[PATCH] Install fbdevhw.so in the correct os-specific path

Alan Coopersmith alan.coopersmith at oracle.com
Fri May 28 12:39:25 PDT 2010


Stop hardcoding "linux" for the os module path.   In order for the
Makefile.am to get the correct path, the mapping to the names used
for OS'es by the module loader was moved from #ifdef's in loader/os.c
to $host_os matches in configure.ac.

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 configure.ac                   |   16 ++++++++++++++++
 hw/xfree86/fbdevhw/Makefile.am |    4 ++--
 hw/xfree86/loader/os.c         |   35 ++++-------------------------------
 include/xorg-config.h.in       |    3 +++
 xorg-server.pc.in              |    1 +
 5 files changed, 26 insertions(+), 33 deletions(-)

diff --git a/configure.ac b/configure.ac
index b5b638a..c57b7b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1721,6 +1721,22 @@ if test "x$XORG" = xyes; then
 		;;
 	esac
 
+	# name used for OS-specific directories in module loader path
+	case $host_os in
+	  *linux*)	LOADER_OSNAME="linux" ;;
+	  *freebsd*)	LOADER_OSNAME="freebsd" ;;
+	  dragonfly*)	LOADER_OSNAME="dragonfly" ;;
+	  *netbsd*)	LOADER_OSNAME="netbsd" ;;
+	  openbsd*)	LOADER_OSNAME="openbsd" ;;
+	  gnu*)		LOADER_OSNAME="hurd" ;;
+	  *sco*)	LOADER_OSNAME="sco" ;;
+	  *solaris*)	LOADER_OSNAME="solaris" ;;
+	  *)		LOADER_OSNAME="unknown" ;;
+	esac
+	AC_SUBST([LOADER_OSNAME])
+	AC_DEFINE_UNQUOTED(LOADER_OSNAME, "$LOADER_OSNAME",
+		[name used for OS-specific directories in module loader path])
+
 	if test "x$SUPPORT_PC98" = xauto; then
 		SUPPORT_PC98="no"
 	fi
diff --git a/hw/xfree86/fbdevhw/Makefile.am b/hw/xfree86/fbdevhw/Makefile.am
index 0663525..5f88fcc 100644
--- a/hw/xfree86/fbdevhw/Makefile.am
+++ b/hw/xfree86/fbdevhw/Makefile.am
@@ -1,5 +1,5 @@
-linuxmoduledir = $(moduledir)/linux
-linuxmodule_LTLIBRARIES = libfbdevhw.la
+osmoduledir = $(moduledir)/$(LOADER_OSNAME)
+osmodule_LTLIBRARIES = libfbdevhw.la
 
 libfbdevhw_la_LDFLAGS = -avoid-version
 
diff --git a/hw/xfree86/loader/os.c b/hw/xfree86/loader/os.c
index 5acce00..8a0db96 100644
--- a/hw/xfree86/loader/os.c
+++ b/hw/xfree86/loader/os.c
@@ -32,43 +32,16 @@
 #include "loaderProcs.h"
 
 /*
- * OSNAME is a standard form of the OS name that may be used by the
- * loader and by OS-specific modules.  OSNAME here is different from what's in
- * dix-config.h
+ * Return the OS name, and run-time OS version
+ * The name returned is a standard form of the OS name that may be used
+ * by the loader for the path for OS-specific modules.
  */
 
-#undef OSNAME
-#if defined(__linux__)
-#define OSNAME "linux"
-#elif defined(__FreeBSD__)
-#define OSNAME "freebsd"
-#elif defined(__DragonFly__)
-#define OSNAME "dragonfly"
-#elif defined(__NetBSD__)
-#define OSNAME "netbsd"
-#elif defined(__OpenBSD__)
-#define OSNAME "openbsd"
-#elif defined(__GNU__)
-#define OSNAME "hurd"
-#elif defined(__SCO__)
-#define OSNAME "sco"
-#elif defined(SVR4) && defined(sun)
-#define OSNAME "solaris"
-#elif defined(SVR5)
-#define OSNAME "svr5"
-#elif defined(SVR4)
-#define OSNAME "svr4"
-#else
-#define OSNAME "unknown"
-#endif
-
-/* Return the OS name, and run-time OS version */
-
 void
 LoaderGetOS(const char **name, int *major, int *minor, int *teeny)
 {
     if (name)
-	*name = OSNAME;
+	*name = LOADER_OSNAME;
 
     /* reporting runtime versions isn't supported yet */
 }
diff --git a/include/xorg-config.h.in b/include/xorg-config.h.in
index 8946a65..aeb558e 100644
--- a/include/xorg-config.h.in
+++ b/include/xorg-config.h.in
@@ -42,6 +42,9 @@
 /* Path to loadable modules. */
 #undef DEFAULT_MODULE_PATH
 
+/* name used for OS-specific directories in module loader path */
+#undef LOADER_OSNAME
+
 /* Path to installed libraries. */
 #undef DEFAULT_LIBRARY_PATH
 
diff --git a/xorg-server.pc.in b/xorg-server.pc.in
index 44f886a..ef8610b 100644
--- a/xorg-server.pc.in
+++ b/xorg-server.pc.in
@@ -4,6 +4,7 @@ libdir=@libdir@
 includedir=@includedir@
 datarootdir=@datarootdir@
 moduledir=@moduledir@
+moduleos=@LOADER_OSNAME@
 sdkdir=@sdkdir@
 sysconfigdir=@sysconfigdir@
 
-- 
1.5.6.5



More information about the xorg-devel mailing list