Well, after some fixing I was able to compile and install svgalib-1.4.3 (shipped in slackware 11).
Also I was lucky enough to find (and fix) bug in it. (Couldn't believe it at first)
Al problems were caused by line 1956 in vga.c where
had to be replaced with
That small "misprint" was causing false "mmap error rrr" alerts all the time. It's said in documentation that in case of failure mmap() returns -1, not "something less than zero" (which could be valid address)
The other compilation issues were fixed by disabling et6000 driver which tried to include
<pci.h> that (in turn) was leading to an "parse error" due to __u16 and __u32 types...
I'll make and post a patch later (there were some other small fixes to make this thing work)...
I must say that some programs using svgalib were not working with version 1.9.25. (wich compile easily).
--added--
here is the patch (for the original svgalib-1.4.3 shipped with slackware 11 in /source/l/svgalib/svgalib-1.4.3.tar.gz) to make it compile (and work). Hope it will help someone...:
Code:
diff -Nuar svgalib-1.4.3/Makefile.cfg svgalib-1.4.3a/Makefile.cfg
--- svgalib-1.4.3/Makefile.cfg 2001-05-29 18:39:13.000000000 +0400
+++ svgalib-1.4.3a/Makefile.cfg 2007-03-21 22:50:56.000000000 +0300
@@ -25,7 +25,7 @@
# Common prefix for installation directories.
# NOTE: This directory must exist when you start the install.
TOPDIR=
-prefix = $(TOPDIR)/usr/local
+prefix = $(TOPDIR)/usr
exec_prefix = $(prefix)
# Directory where the shared stubs and static library will be installed.
@@ -38,7 +38,7 @@
bindir = $(exec_prefix)/bin
# Directory where the run-time configuration files will be installed.
-datadir = $(TOPDIR)/etc/vga
+datadir = /etc/vga
# Directory where the header files will be installed.
includedir = $(prefix)/include
@@ -82,7 +82,7 @@
# BACKGROUND = y
# Uncomment this if you want to compile and install the static libs.
-# INSTALLSTATICLIB = installstaticlib
+INSTALLSTATICLIB = installstaticlib
# Comment this out if you don't want to install the shared libs.
# If you do not install the shared nor the static libs, 'make static'
@@ -94,7 +94,7 @@
# a.out image is available install it in the first directory named something
# like *aout/ in /etc/ld.so.conf.
# If you want this, do not comment out the next line:
-INSTALLAOUTLIB = installaoutcompat
+# INSTALLAOUTLIB = installaoutcompat
# Comment this out if you want to keep old shared images. Old header files,
# library stubs and static libraries CANNOT be kept in public locations
@@ -112,7 +112,7 @@
# the Makefiles will try to figure out if your system supports gzipped man
# pages and install them when possible.
-# MANFORMAT = compressed
+MANFORMAT = compressed
# MANFORMAT = uncompressed
# This is the command to update the man pages whatis database.
@@ -138,7 +138,7 @@
INCLUDE_CHIPS_DRIVER = y
INCLUDE_APM_DRIVER = y
INCLUDE_NV3_DRIVER = y
-INCLUDE_ET6000_DRIVER = y
+#INCLUDE_ET6000_DRIVER = y
INCLUDE_VESA_DRIVER = y
INCLUDE_MX_DRIVER = y
INCLUDE_PARADISE_DRIVER = y
@@ -257,7 +257,7 @@
ifndef CFLAGS
- OPTIMIZE = -fomit-frame-pointer -O2 -fno-strength-reduce -pipe -g
+ OPTIMIZE = -fomit-frame-pointer -O2 -fno-strength-reduce -pipe
else
OPTIMIZE := $(CFLAGS)
endif
diff -Nuar svgalib-1.4.3/demos/lineart.c svgalib-1.4.3a/demos/lineart.c
--- svgalib-1.4.3/demos/lineart.c 2000-02-19 12:12:52.000000000 +0300
+++ svgalib-1.4.3a/demos/lineart.c 2007-03-21 22:47:49.000000000 +0300
@@ -19,8 +19,8 @@
if(mode == 0)
{
- printf("Usage:linp [mode mode ...]\n
- where mode is an integer.\n");
+ printf("Usage:linp [mode mode ...]\n"
+ "where mode is an integer.\n");
return;
}
if(! vga_hasmode(mode)) {
diff -Nuar svgalib-1.4.3/src/mach32.c svgalib-1.4.3a/src/mach32.c
--- svgalib-1.4.3/src/mach32.c 1999-09-29 20:52:14.000000000 +0400
+++ svgalib-1.4.3a/src/mach32.c 2007-03-21 21:40:14.000000000 +0300
@@ -1544,7 +1544,7 @@
goto writerr;
printf("mach32: Notice: new EEPROM file >%s< succesful created.\n",
eeprom_fname);
- finish_w_eeprom:
+ finish_w_eeprom:;
}
/* Change eeprom contents if requested: */
if (!(eeprom_option & EEPROM_USE_MEMCFG))
diff -Nuar svgalib-1.4.3/src/s3.c svgalib-1.4.3a/src/s3.c
--- svgalib-1.4.3/src/s3.c 2000-05-03 16:23:57.000000000 +0400
+++ svgalib-1.4.3a/src/s3.c 2007-03-21 21:41:12.000000000 +0300
@@ -475,8 +475,8 @@
return old_values;
}
default:
+ return 0;
}
- return 0;
}
/* Return non-zero if mode is available */
diff -Nuar svgalib-1.4.3/src/vga.c svgalib-1.4.3a/src/vga.c
--- svgalib-1.4.3/src/vga.c 2001-05-29 18:37:55.000000000 +0400
+++ svgalib-1.4.3a/src/vga.c 2007-03-21 22:59:40.000000000 +0300
@@ -1953,7 +1953,7 @@
};
__vga_mmap();
- if ((long) GM < 0) {
+ if ((long) GM == -1) {
printf("svgalib: mmap error rrr\n");
exit(1);
}
@@ -3914,7 +3914,7 @@
#define ML_GETINT(x) \
ptr = strtok(NULL, " "); if(!ptr) break; \
- mmt.##x = atoi(ptr);
+ mmt.x = atoi(ptr);
ML_GETINT(HDisplay);
ML_GETINT(HSyncStart);