summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@nwnk.net>2006-05-09 18:04:19 +0000
committerAdam Jackson <ajax@nwnk.net>2006-05-09 18:04:19 +0000
commit421576f413b40ee58220e7d57fa0033f2cbee259 (patch)
tree0ba13fd4e65ff33b695b8a8cccecf1a598d7e362
parenta9fc172112a3eb0f6be5141756540cdd253e7831 (diff)
Bug #5209: Re-enable building APM and ACPI support. (Michel Dänzer)
-rw-r--r--ChangeLog13
-rw-r--r--configure.ac11
-rw-r--r--hw/xfree86/Makefile.am16
-rw-r--r--hw/xfree86/common/Makefile.am11
-rw-r--r--hw/xfree86/common/xf86Globals.c2
-rw-r--r--hw/xfree86/common/xf86Init.c4
-rw-r--r--hw/xfree86/os-support/linux/Makefile.am15
-rw-r--r--hw/xfree86/os-support/linux/lnx_acpi.c1
-rw-r--r--hw/xfree86/os-support/linux/lnx_apm.c17
9 files changed, 74 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 8c6af18ff..6cfcb1399 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2006-05-09 Adam Jackson <ajax@freedesktop.org>
+
+ * configure.ac:
+ * hw/xfree86/Makefile.am:
+ * hw/xfree86/common/Makefile.am:
+ * hw/xfree86/common/xf86Globals.c:
+ * hw/xfree86/common/xf86Init.c:
+ * hw/xfree86/os-support/linux/Makefile.am:
+ * hw/xfree86/os-support/linux/lnx_acpi.c:
+ * hw/xfree86/os-support/linux/lnx_apm.c:
+ Bug #5209: Re-enable building APM and ACPI support. (Michel
+ Dänzer)
+
2006-05-03 Alan Coopersmith <alan.coopersmith@sun.com>
* configure.ac:
diff --git a/configure.ac b/configure.ac
index 3aa5355e7..c18fd3a3c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -111,7 +111,8 @@ AC_CHECK_HEADERS([linux/agpgart.h sys/agpio.h], AGP=yes)
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" = xyes; then
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
diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index 1bec7193e..8665926f6 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -21,20 +21,24 @@ INCLUDES = @XORG_INCS@
Xorg_SOURCES = xorg.c
-DISTCLEANFILES = xorg.c
-
-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
+
+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@
diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am
index 8dfcf3696..0fe8aff27 100644
--- a/hw/xfree86/common/Makefile.am
+++ b/hw/xfree86/common/Makefile.am
@@ -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.pl $(MODEDEFSOURCES)
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 xf86Bus.c xf86Config.c \
$(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@
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index 2066a2b89..49321b1b6 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -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;
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index d5741aa94..e04bec867 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -1,5 +1,5 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v 3.212 2004/01/27 01:31:45 dawes Exp $ */
-/* $XdotOrg: xserver/xorg/hw/xfree86/common/xf86Init.c,v 1.33 2006/03/25 19:52:03 ajax Exp $ */
+/* $XdotOrg: xserver/xorg/hw/xfree86/common/xf86Init.c,v 1.33.2.1 2006/04/04 14:16:56 ajax Exp $ */
/*
* Loosely based on code bearing the following copyright:
@@ -1661,11 +1661,13 @@ ddxProcessArgument(int argc, char **argv, int i)
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);
diff --git a/hw/xfree86/os-support/linux/Makefile.am b/hw/xfree86/os-support/linux/Makefile.am
index 3815b283e..d492f962e 100644
--- a/hw/xfree86/os-support/linux/Makefile.am
+++ b/hw/xfree86/os-support/linux/Makefile.am
@@ -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_video.c lnx_io.c lnx_kbd.c lnx_mouse.c \
$(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/drm # FIXME this last part is crack
# 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 \
diff --git a/hw/xfree86/os-support/linux/lnx_acpi.c b/hw/xfree86/os-support/linux/lnx_acpi.c
index 9d1dea77d..3d048c750 100644
--- a/hw/xfree86/os-support/linux/lnx_acpi.c
+++ b/hw/xfree86/os-support/linux/lnx_acpi.c
@@ -1,4 +1,3 @@
-#include "X.h"
#include "os.h"
#include "xf86.h"
#include "xf86Priv.h"
diff --git a/hw/xfree86/os-support/linux/lnx_apm.c b/hw/xfree86/os-support/linux/lnx_apm.c
index bd78d877f..a0722edd7 100644
--- a/hw/xfree86/os-support/linux/lnx_apm.c
+++ b/hw/xfree86/os-support/linux/lnx_apm.c
@@ -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 <linux/apm_bios.h>
#include <unistd.h>
@@ -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 event)
}
}
+#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