Index: allegro/include/allegro/platform/aintlnx.h diff -u allegro/include/allegro/platform/aintlnx.h:1.3 allegro/include/allegro/platform/aintlnx.h:1.3.2.1 --- allegro/include/allegro/platform/aintlnx.h:1.3 Tue Nov 13 14:52:13 2001 +++ allegro/include/allegro/platform/aintlnx.h Thu Oct 9 08:02:07 2003 @@ -259,8 +259,11 @@ /* VGA register access helpers */ -#include "allegro/internal/aintern.h" -#include "allegro/internal/aintvga.h" +/* This is conditional because configure may have disabled VGA support */ +#ifdef ALLEGRO_LINUX_VGA + #include "allegro/internal/aintern.h" + #include "allegro/internal/aintvga.h" +#endif Index: allegro/include/allegro/platform/alunix.h diff -u allegro/include/allegro/platform/alunix.h:1.2.2.2 allegro/include/allegro/platform/alunix.h:1.2.2.3 --- allegro/include/allegro/platform/alunix.h:1.2.2.2 Fri Jan 31 08:12:50 2003 +++ allegro/include/allegro/platform/alunix.h Thu Oct 9 08:02:08 2003 @@ -251,6 +251,8 @@ /* Port I/O functions -- maybe these should be internal */ +#ifdef ALLEGRO_LINUX_VGA + static INLINE void outportb(unsigned short port, unsigned char value) { __asm__ volatile ("outb %0, %1" : : "a" (value), "d" (port)); @@ -287,6 +289,8 @@ return value; } +#endif /* ALLEGRO_LINUX_VGA */ + #endif /* ALLEGRO_LINUX */ Index: allegro/src/linux/lsystem.c diff -u allegro/src/linux/lsystem.c:1.17.2.1 allegro/src/linux/lsystem.c:1.17.2.4 --- allegro/src/linux/lsystem.c:1.17.2.1 Fri Feb 7 04:41:09 2003 +++ allegro/src/linux/lsystem.c Thu Oct 9 08:02:09 2003 @@ -26,13 +26,16 @@ #include "allegro.h" #include "allegro/internal/aintern.h" #include "allegro/platform/aintunix.h" -#include "allegro/internal/aintvga.h" -#include "linalleg.h" +#include "allegro/platform/aintlnx.h" +#ifdef ALLEGRO_LINUX_VGA #ifdef HAVE_SYS_IO_H /* iopl() exists in here instead of unistd.h in glibc */ #include #endif +#endif + +#include "linalleg.h" #ifndef ALLEGRO_LINUX #error Something is wrong with the makefile @@ -171,7 +174,9 @@ * we attempt to set our euid to 0, in case this is the * second time we've been called. */ __al_linux_have_ioperms = !seteuid (0); +#ifdef ALLEGRO_LINUX_VGA __al_linux_have_ioperms &= !iopl (3); +#endif __al_linux_have_ioperms &= !__al_linux_init_memory(); /* At this stage we can drop the root privileges. */ @@ -189,8 +194,10 @@ if (__al_linux_init_console()) return -1; /* Initialise VGA helpers */ +#ifdef ALLEGRO_LINUX_VGA if (__al_linux_have_ioperms) if (__al_linux_init_vga_helpers()) return -1; +#endif /* Install emergency-exit signal handlers */ old_sig_abrt = signal(SIGABRT, signal_handler); @@ -242,7 +249,10 @@ #endif /* shut down VGA helpers */ - __al_linux_shutdown_vga_helpers(); +#ifdef ALLEGRO_LINUX_VGA + if (__al_linux_have_ioperms) + __al_linux_shutdown_vga_helpers(); +#endif /* shut down the console subsystem */ __al_linux_done_console(); @@ -254,7 +264,9 @@ _unix_driver_lists_shutdown(); __al_linux_shutdown_memory(); +#ifdef ALLEGRO_LINUX_VGA iopl (0); +#endif } Index: allegro/src/linux/lvga.c diff -u allegro/src/linux/lvga.c:1.7 allegro/src/linux/lvga.c:1.7.2.1 --- allegro/src/linux/lvga.c:1.7 Mon Dec 3 05:34:27 2001 +++ allegro/src/linux/lvga.c Thu Oct 9 08:02:09 2003 @@ -24,12 +24,13 @@ #include #include "allegro.h" + +#if ((defined ALLEGRO_LINUX_VGA) && ((!defined ALLEGRO_WITH_MODULES) || (defined ALLEGRO_MODULE))) + #include "allegro/internal/aintern.h" #include "allegro/platform/aintunix.h" #include "allegro/internal/aintvga.h" -#if ((defined ALLEGRO_LINUX_VGA) && ((!defined ALLEGRO_WITH_MODULES) || (defined ALLEGRO_MODULE))) - static MODE_REGISTERS mode13h = /* 320x200x8bpp NI */ Index: allegro/src/linux/lvgahelp.c diff -u allegro/src/linux/lvgahelp.c:1.4 allegro/src/linux/lvgahelp.c:1.4.2.1 --- allegro/src/linux/lvgahelp.c:1.4 Tue Nov 13 14:52:13 2001 +++ allegro/src/linux/lvgahelp.c Thu Oct 9 08:02:09 2003 @@ -20,6 +20,9 @@ #endif #include "allegro.h" + +#ifdef ALLEGRO_LINUX_VGA + #include "allegro/internal/aintern.h" #include "allegro/platform/aintunix.h" #include "allegro/internal/aintvga.h" @@ -263,3 +266,4 @@ __al_linux_set_vga_regs (&txt_regs); } +#endif /* ALLEGRO_LINUX_VGA */ Index: allegro/src/linux/vtswitch.c diff -u allegro/src/linux/vtswitch.c:1.8.2.2 allegro/src/linux/vtswitch.c:1.8.2.3 --- allegro/src/linux/vtswitch.c:1.8.2.2 Fri Feb 7 05:35:56 2003 +++ allegro/src/linux/vtswitch.c Thu Oct 9 08:02:10 2003 @@ -26,5 +26,4 @@ #include "allegro.h" #include "allegro/internal/aintern.h" #include "allegro/platform/aintunix.h" -#include "allegro/internal/aintvga.h" #include "linalleg.h" #ifdef HAVE_MMAP Index: allegro/src/misc/modex.c diff -u allegro/src/misc/modex.c:1.23.2.3 allegro/src/misc/modex.c:1.23.2.4 --- allegro/src/misc/modex.c:1.23.2.3 Fri Feb 14 05:25:33 2003 +++ allegro/src/misc/modex.c Thu Oct 9 08:02:10 2003 @@ -23,6 +23,9 @@ #include #include "allegro.h" + +#ifdef GFX_MODEX + #include "allegro/internal/aintern.h" #include "allegro/internal/aintvga.h" @@ -30,7 +33,6 @@ #include ALLEGRO_INTERNAL_HEADER #endif -#ifdef GFX_MODEX #if (!defined ALLEGRO_LINUX) || ((defined ALLEGRO_LINUX_VGA) && ((!defined ALLEGRO_WITH_MODULES) || (defined ALLEGRO_MODULE))) Index: allegro/src/misc/vga.c diff -u allegro/src/misc/vga.c:1.17.2.1 allegro/src/misc/vga.c:1.17.2.2 --- allegro/src/misc/vga.c:1.17.2.1 Fri Feb 7 05:36:02 2003 +++ allegro/src/misc/vga.c Thu Oct 9 08:02:10 2003 @@ -23,6 +23,9 @@ #include #include "allegro.h" + +#ifdef GFX_VGA + #include "allegro/internal/aintern.h" #include "allegro/internal/aintvga.h" @@ -30,7 +33,6 @@ #include ALLEGRO_INTERNAL_HEADER #endif -#ifdef GFX_VGA #if (!defined ALLEGRO_LINUX) || ((defined ALLEGRO_LINUX_VGA) && ((!defined ALLEGRO_WITH_MODULES) || (defined ALLEGRO_MODULE))) Index: allegro/src/misc/vgaregs.c diff -u allegro/src/misc/vgaregs.c:1.5 allegro/src/misc/vgaregs.c:1.5.2.1 --- allegro/src/misc/vgaregs.c:1.5 Tue Nov 13 14:52:13 2001 +++ allegro/src/misc/vgaregs.c Thu Oct 9 08:02:10 2003 @@ -17,6 +17,9 @@ #include "allegro.h" + +#ifdef GFX_VGA + #include "allegro/internal/aintern.h" #include "allegro/internal/aintvga.h" @@ -88,3 +91,4 @@ } +#endif /* GFX_VGA */ Index: allegro/src/unix/uptimer.c diff -u allegro/src/unix/uptimer.c:1.6 allegro/src/unix/uptimer.c:1.6.2.1 --- allegro/src/unix/uptimer.c:1.6 Wed Jan 23 14:25:34 2002 +++ allegro/src/unix/uptimer.c Sat Oct 4 13:04:27 2003 @@ -19,16 +19,6 @@ #include "allegro.h" #include "allegro/internal/aintern.h" -/* See hack later. */ -#ifdef ALLEGRO_LINUX -#include -#ifdef HAVE_SYS_IO_H -#include -#endif -#include "allegro/platform/aintlnx.h" -#endif - - #ifdef HAVE_LIBPTHREAD @@ -38,6 +28,16 @@ #include +/* See hack later. */ +#ifdef ALLEGRO_LINUX_VGA +#ifdef HAVE_SYS_IO_H +/* iopl() exists in here instead of unistd.h in glibc */ +#include +#endif +#include "allegro/platform/aintlnx.h" +#endif + + #define TIMER_TO_USEC(x) ((long)((x) / 1.193181)) #define USEC_TO_TIMER(x) ((long)((x) * (TIMERS_PER_SECOND / 1000000.))) @@ -89,7 +89,7 @@ block_all_signals(); -#ifdef ALLEGRO_LINUX +#ifdef ALLEGRO_LINUX_VGA /* privileges hack for Linux: * One of the jobs of the timer thread is to update the mouse pointer * on screen. When using the Mode-X driver under Linux console, this