Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Getting SVGAlib to compile
diff -ru packages.orig/svgalib-1.4.3/Makefile packages/svgalib-1.4.3/Makefile
--- packages.orig/svgalib-1.4.3/Makefile 2001-04-18 18:35:51.000000000 +0100
+++ packages/svgalib-1.4.3/Makefile 2010-04-30 22:01:09.000000000 +0100
@@ -86,22 +86,7 @@
BACKUP = ../svgalib-$(VERSION).tar.gz
-default:
- @echo "To install SVGAlib, do one of the following:"
- @echo ""
- @echo " make clean - clean every thing. Do this after every change"
- @echo " of Makefile.cfg! Esp. when changing from a.out"
- @echo " to ELF and vice versa"
- @echo " make install - compile & install components specified in Makefile.cfg"
- @echo " make demoprogs - make demo programs in demo/ and threeDKit/"
- @echo ""
- @echo " make uninstall - remove an existing installation from various"
- @echo " common places. (old traces often confuse the"
- @echo " compiler even when svgalib is not installed anew)"
- @echo " (make install includes an uninstall first)"
- @echo ""
- @echo " Be sure to read the file 0-INSTALL!"
- @echo ""
+default: staticlib/libvga.a staticlib/libvgagl.a
.PHONY: default all install installheaders installconfig
.PHONY: clean distclean indent uninstall
diff -ru packages.orig/svgalib-1.4.3/Makefile.cfg packages/svgalib-1.4.3/Makefile.cfg
--- packages.orig/svgalib-1.4.3/Makefile.cfg 2001-05-29 15:39:13.000000000 +0100
+++ packages/svgalib-1.4.3/Makefile.cfg 2010-04-30 16:28:46.000000000 +0100
@@ -52,7 +52,7 @@
#uncomment this if your compiler fails on compiling the assembler in
#src/vgaconvplanar.c, gl/inlstring.h, gl/line.c or gl/scale.c
-# NO_ASM = y
+NO_ASM = y
# Uncomment this if you want root processes to be able to always get a new
# VC. Alas, some games misuse suid root privs and become root, svgalib cannot
diff -ru packages.orig/svgalib-1.4.3/src/apm.c packages/svgalib-1.4.3/src/apm.c
--- packages.orig/svgalib-1.4.3/src/apm.c 2000-10-11 17:35:18.000000000 +0100
+++ packages/svgalib-1.4.3/src/apm.c 2010-04-30 16:17:11.000000000 +0100
@@ -151,12 +151,12 @@
regs[APMREG_SAVE(15)] = (k >> 8)&0xff;
regs[APMREG_SAVE(16)] = (k >> 16) & 0xff ;
regs[APMREG_SAVE(17)] = ( k >> 24 ) & 0xff ;
- (unsigned long)regs[APMREG_SAVE(18)] = inlXR(0xf0) ;
- (unsigned long)regs[APMREG_SAVE(22)] = inlXR(0xf4) ;
- (unsigned long)regs[APMREG_SAVE(26)] = inlXR(0x140) ;
- (unsigned short)regs[APMREG_SAVE(30)] = inlXR(0x144) ;
- (unsigned long)regs[APMREG_SAVE(32)] = inXR(0x148) ;
- (unsigned short)regs[APMREG_SAVE(36)] = inXR(0x14c) ;
+ *(unsigned long*)&regs[APMREG_SAVE(18)] = inlXR(0xf0) ;
+ *(unsigned long*)&regs[APMREG_SAVE(22)] = inlXR(0xf4) ;
+ *(unsigned long*)&regs[APMREG_SAVE(26)] = inlXR(0x140) ;
+ *(unsigned short*)&regs[APMREG_SAVE(30)] = inlXR(0x144) ;
+ *(unsigned long*)&regs[APMREG_SAVE(32)] = inXR(0x148) ;
+ *(unsigned short*)&regs[APMREG_SAVE(36)] = inXR(0x14c) ;
return APM_TOTAL_REGS - VGA_TOTAL_REGS;
}
diff -ru packages.orig/svgalib-1.4.3/src/lrmi.c packages/svgalib-1.4.3/src/lrmi.c
--- packages.orig/svgalib-1.4.3/src/lrmi.c 2000-08-07 08:17:23.000000000 +0100
+++ packages/svgalib-1.4.3/src/lrmi.c 2010-04-30 16:19:34.000000000 +0100
@@ -14,6 +14,19 @@
#include <string.h>
#include <asm/vm86.h>
+#ifndef TF_MASK
+#define TF_MASK X86_EFLAGS_TF
+#endif
+#ifndef IF_MASK
+#define IF_MASK X86_EFLAGS_IF
+#endif
+#ifndef IOPL_MASK
+#define IOPL_MASK X86_EFLAGS_IOPL
+#endif
+#ifndef VIF_MASK
+#define VIF_MASK X86_EFLAGS_VIF
+#endif
+
#ifdef USE_LIBC_VM86
#include <sys/vm86.h>
#endif
diff -ru packages.orig/svgalib-1.4.3/src/mach32.c packages/svgalib-1.4.3/src/mach32.c
--- packages.orig/svgalib-1.4.3/src/mach32.c 1999-09-29 17:52:14.000000000 +0100
+++ packages/svgalib-1.4.3/src/mach32.c 2010-04-30 16:05:08.000000000 +0100
@@ -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 -ru packages.orig/svgalib-1.4.3/src/s3.c packages/svgalib-1.4.3/src/s3.c
--- packages.orig/svgalib-1.4.3/src/s3.c 2000-05-03 13:23:57.000000000 +0100
+++ packages/svgalib-1.4.3/src/s3.c 2010-04-30 16:05:39.000000000 +0100
@@ -474,7 +474,7 @@
dac_used->restoreState(regs);
return old_values;
}
- default:
+ default:;
}
return 0;
}
diff -ru packages.orig/svgalib-1.4.3/src/vgabg.h packages/svgalib-1.4.3/src/vgabg.h
--- packages.orig/svgalib-1.4.3/src/vgabg.h 1999-07-27 17:36:19.000000000 +0100
+++ packages/svgalib-1.4.3/src/vgabg.h 2010-04-30 15:59:28.000000000 +0100
@@ -27,7 +27,6 @@
/* Linear video memory things */
-extern void *__svgalib_linearframebuffer;
extern void *__svgalib_physaddr;
extern unsigned char *__svgalib_graph_mem_linear_orginal;
extern unsigned char *__svgalib_graph_mem_linear_check;
diff -ru packages.orig/svgalib-1.4.3/src/vga.c packages/svgalib-1.4.3/src/vga.c
--- packages.orig/svgalib-1.4.3/src/vga.c 2001-05-29 15:37:55.000000000 +0100
+++ packages/svgalib-1.4.3/src/vga.c 2010-05-01 07:23:05.000000000 +0100
@@ -1953,8 +1953,8 @@
};
__vga_mmap();
- if ((long) GM < 0) {
- printf("svgalib: mmap error rrr\n");
+ if (GM == MAP_FAILED) {
+ printf("svgalib: mmap error: %s\n", strerror(errno));
exit(1);
}
/* disable video */
@@ -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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment