Index: xorg/configure.ac =================================================================== RCS file: /cvs/xorg/xserver/xorg/configure.ac,v retrieving revision 1.192 diff -p -u -r1.192 configure.ac --- xorg/configure.ac 6 Apr 2006 18:59:10 -0000 1.192 +++ xorg/configure.ac 26 Apr 2006 08:58:13 -0000 @@ -111,7 +111,8 @@ AC_CHECK_HEADERS([linux/agpgart.h sys/ag AM_CONDITIONAL(AGP, [test "x$AGP" = xyes]) dnl APM header -AC_CHECK_HEADERS([linux/apm_bios.h]) +AC_CHECK_HEADERS([linux/apm_bios.h], LNXAPM=yes) +AM_CONDITIONAL(LNXAPM, [test "x$LNXAPM" = xyes]) dnl fbdev header AC_CHECK_HEADERS([linux/fb.h], FBDEV=yes) @@ -1045,19 +1046,27 @@ if test "x$XORG" = xyes -o "x$XGL" = xye case $host_os in linux*) + if test "x$LNXAPM" = xyes; then + XORG_CFLAGS="$XORG_CFLAGS -DXF86PM" + fi XORG_OS="linux" XORG_OS_SUBDIR="linux" XORG_OS_KBD="Lnx" xorg_bus_linuxpci="yes" + AM_CONDITIONAL(LNXACPI,false) case $host_cpu in ia64*) linux_ia64=yes + AM_CONDITIONAL(LNXACPI,true) ;; alpha*) linux_alpha=yes XORG_OS_PCI="axp" xorg_bus_linuxpci="no" ;; + x86*) + AM_CONDITIONAL(LNXACPI,true) + ;; *) ;; esac Index: xorg/hw/xfree86/.cvsignore =================================================================== RCS file: /cvs/xorg/xserver/xorg/hw/xfree86/.cvsignore,v retrieving revision 1.3 diff -p -u -r1.3 .cvsignore --- xorg/hw/xfree86/.cvsignore 13 Sep 2005 18:29:53 -0000 1.3 +++ xorg/hw/xfree86/.cvsignore 26 Apr 2006 08:58:18 -0000 @@ -6,4 +6,4 @@ Makefile.in .libs Xorg xorg.c -xorgos.c +osandcommon.c Index: xorg/hw/xfree86/Makefile.am =================================================================== RCS file: /cvs/xorg/xserver/xorg/hw/xfree86/Makefile.am,v retrieving revision 1.38 diff -p -u -r1.38 Makefile.am --- xorg/hw/xfree86/Makefile.am 25 Jan 2006 23:05:26 -0000 1.38 +++ xorg/hw/xfree86/Makefile.am 26 Apr 2006 08:58:18 -0000 @@ -21,20 +21,24 @@ INCLUDES = @XORG_INCS@ Xorg_SOURCES = xorg.c -DISTCLEANFILES = xorg.c +# libxorgos and libcommon need symbols from each other +noinst_LTLIBRARIES = libosandcommon.la +libosandcommon_la_SOURCES = osandcommon.c +libosandcommon_la_LIBADD = \ + os-support/libxorgos.la \ + common/libcommon.la -xorg.c: +osandcommon.c xorg.c: touch $@ -OS_LIBS = os-support/libxorgos.la +DISTCLEANFILES = osandcommon.c xorg.c XORG_LIBS = \ @XORG_CORE_LIBS@ \ common/libinit.a \ loader/libloader.a \ - common/libcommon.a \ + libosandcommon.la \ parser/libxf86config.a \ - $(OS_LIBS) \ dummylib/libdummy.a \ dixmods/libdixmods.la \ @XORG_LIBS@ Index: xorg/hw/xfree86/common/Makefile.am =================================================================== RCS file: /cvs/xorg/xserver/xorg/hw/xfree86/common/Makefile.am,v retrieving revision 1.17 diff -p -u -r1.17 Makefile.am --- xorg/hw/xfree86/common/Makefile.am 2 Dec 2005 06:02:40 -0000 1.17 +++ xorg/hw/xfree86/common/Makefile.am 26 Apr 2006 08:58:18 -0000 @@ -1,4 +1,5 @@ -noinst_LIBRARIES = libcommon.a libinit.a +noinst_LIBRARIES = libinit.a +noinst_LTLIBRARIES = libcommon.la if XORG_BUS_SPARC SBUS_SOURCES = xf86sbusBus.c @@ -30,7 +31,7 @@ xf86DefModeSet.c: $(srcdir)/modeline2c.p BUILT_SOURCES = xf86DefModeSet.c AM_LDFLAGS = -r -libcommon_a_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \ +libcommon_la_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \ xf86Cursor.c xf86DGA.c xf86DPMS.c \ xf86DoProbe.c xf86DoScanPci.c xf86Events.c \ xf86Globals.c xf86Io.c xf86AutoConfig.c \ @@ -41,7 +42,7 @@ libcommon_a_SOURCES = xf86Configure.c xf $(XVSOURCES) $(BUSSOURCES) $(XKBSOURCES) \ $(DEBUGSOURCES) $(XISOURCES) $(RANDRSOURCES) \ $(KBDSOURCES) -nodist_libcommon_a_SOURCES = xf86DefModeSet.c +nodist_libcommon_la_SOURCES = xf86DefModeSet.c libinit_a_SOURCES = xf86Build.h xf86Init.c INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \ @@ -98,4 +99,8 @@ EXTRA_DIST = \ modeline2c.pl \ $(DISTKBDSOURCES) +if LNXACPI +XORG_CFLAGS += -DHAVE_ACPI +endif + AM_CFLAGS = $(XORG_CFLAGS) @SERVER_DEFINES@ @LOADER_DEFINES@ Index: xorg/hw/xfree86/common/xf86Globals.c =================================================================== RCS file: /cvs/xorg/xserver/xorg/hw/xfree86/common/xf86Globals.c,v retrieving revision 1.10 diff -p -u -r1.10 xf86Globals.c --- xorg/hw/xfree86/common/xf86Globals.c 25 Mar 2006 19:52:03 -0000 1.10 +++ xorg/hw/xfree86/common/xf86Globals.c 26 Apr 2006 08:58:18 -0000 @@ -216,7 +216,9 @@ Bool xf86sFlag = FALSE; Bool xf86bsEnableFlag = FALSE; Bool xf86bsDisableFlag = FALSE; Bool xf86silkenMouseDisableFlag = FALSE; +#ifdef HAVE_ACPI Bool xf86acpiDisableFlag = FALSE; +#endif char *xf86LayoutName = NULL; char *xf86ScreenName = NULL; char *xf86PointerName = NULL; Index: xorg/hw/xfree86/common/xf86Init.c =================================================================== RCS file: /cvs/xorg/xserver/xorg/hw/xfree86/common/xf86Init.c,v retrieving revision 1.34 diff -p -u -r1.34 xf86Init.c --- xorg/hw/xfree86/common/xf86Init.c 4 Apr 2006 14:17:04 -0000 1.34 +++ xorg/hw/xfree86/common/xf86Init.c 26 Apr 2006 08:58:19 -0000 @@ -1661,11 +1661,13 @@ ddxProcessArgument(int argc, char **argv xf86silkenMouseDisableFlag = TRUE; return 1; } +#ifdef HAVE_ACPI if (!strcmp(argv[i], "-noacpi")) { xf86acpiDisableFlag = TRUE; return 1; } +#endif if (!strcmp(argv[i], "-scanpci")) { DoScanPci(argc, argv, i); Index: xorg/hw/xfree86/os-support/linux/Makefile.am =================================================================== RCS file: /cvs/xorg/xserver/xorg/hw/xfree86/os-support/linux/Makefile.am,v retrieving revision 1.12 diff -p -u -r1.12 Makefile.am --- xorg/hw/xfree86/os-support/linux/Makefile.am 2 Dec 2005 06:02:42 -0000 1.12 +++ xorg/hw/xfree86/os-support/linux/Makefile.am 26 Apr 2006 08:58:20 -0000 @@ -9,6 +9,16 @@ PLATFORM_PCI_SUPPORT = lnx_ev56.c \ $(srcdir)/../shared/xf86Axp.c endif +if LNXACPI +ACPI_SOURCES = lnx_acpi.c lnx_apm.c +XORG_CFLAGS += -DHAVE_ACPI +endif + +if LNXAPM +APM_SOURCES = lnx_apm.c +XORG_CFLAGS += -DHAVE_APM +endif + liblinux_la_SOURCES = lnx_init.c lnx_video.c lnx_io.c lnx_kbd.c lnx_mouse.c \ lnx_pci.c lnx_agp.c lnx_kmod.c lnx_KbdMap.c \ $(srcdir)/../shared/bios_mmap.c \ @@ -20,6 +30,8 @@ liblinux_la_SOURCES = lnx_init.c lnx_vid $(srcdir)/../shared/stdResource.c \ $(srcdir)/../shared/libc_wrapper.c \ $(srcdir)/../shared/at_scancode.c \ + $(ACPI_SOURCES) \ + $(APM_SOURCES) \ $(PLATFORM_PCI_SUPPORT) AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) @SERVER_DEFINES@ @LOADER_DEFINES@ @@ -28,9 +40,6 @@ INCLUDES = $(XORG_INCS) -I/usr/include/d # FIXME: These need to be added to the build LNX_EXTRA_SOURCES = \ - lnx_acpi.c \ - lnx_apm.c \ - lnx_axp.c \ lnx_font.c \ lnx_ia64.c \ lnx_jstk.c \ Index: xorg/hw/xfree86/os-support/linux/lnx_acpi.c =================================================================== RCS file: /cvs/xorg/xserver/xorg/hw/xfree86/os-support/linux/lnx_acpi.c,v retrieving revision 1.2 diff -p -u -r1.2 lnx_acpi.c --- xorg/hw/xfree86/os-support/linux/lnx_acpi.c 31 Oct 2005 05:45:40 -0000 1.2 +++ xorg/hw/xfree86/os-support/linux/lnx_acpi.c 26 Apr 2006 08:58:20 -0000 @@ -1,4 +1,3 @@ -#include "X.h" #include "os.h" #include "xf86.h" #include "xf86Priv.h" Index: xorg/hw/xfree86/os-support/linux/lnx_apm.c =================================================================== RCS file: /cvs/xorg/xserver/xorg/hw/xfree86/os-support/linux/lnx_apm.c,v retrieving revision 1.11 diff -p -u -r1.11 lnx_apm.c --- xorg/hw/xfree86/os-support/linux/lnx_apm.c 14 Dec 2005 20:11:16 -0000 1.11 +++ xorg/hw/xfree86/os-support/linux/lnx_apm.c 26 Apr 2006 08:58:20 -0000 @@ -10,6 +10,13 @@ #include "xf86Priv.h" #define XF86_OS_PRIVS #include "xf86_OSproc.h" + +#ifdef HAVE_ACPI +extern PMClose lnxACPIOpen(void); +#endif + +#ifdef HAVE_APM + #include "lnx.h" #include #include @@ -30,7 +37,6 @@ #endif static PMClose lnxAPMOpen(void); -extern PMClose lnxACPIOpen(void); static void lnxCloseAPM(void); static pointer APMihPtr = NULL; @@ -126,22 +132,30 @@ lnxPMConfirmEventToOs(int fd, pmEvent ev } } +#endif // HAVE_APM + PMClose xf86OSPMOpen(void) { PMClose ret = NULL; +#ifdef HAVE_ACPI /* Favour ACPI over APM, but only when enabled */ if (!xf86acpiDisableFlag) ret = lnxACPIOpen(); if (!ret) +#endif +#ifdef HAVE_APM ret = lnxAPMOpen(); +#endif return ret; } +#ifdef HAVE_APM + static PMClose lnxAPMOpen(void) { @@ -190,3 +204,4 @@ lnxCloseAPM(void) } } +#endif // HAVE_APM