[PATCH 8/8] xfree86: link modules against Xorg symbols on Cygwin

Yaakov (Cygwin/X) yselkowitz at users.sourceforge.net
Thu Mar 29 01:22:41 PDT 2012


From: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>

As a PE platform, all symbols in both EXEs and DLLs must be resolved
at link time.  As Xorg modules depend on symbols in the Xorg
executable, we must build Xorg before its modules, creating an implib
from the former which is used to link the latter.  This implib must
then be installed in order to build the drivers.

Currently only two drivers are supported on Cygwin: xf86-video-dummy
(to replace Xvfb/Xfake) and xf86-video-nested (to replace Xnest/Xephyr).

Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
---
 configure.ac           |   11 +++++++++++
 hw/xfree86/Makefile.am |   18 +++++++++++++++---
 xorg-server.pc.in      |    2 +-
 3 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8de2563..8895b68 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1473,8 +1473,19 @@ AC_SUBST([UTILS_SYS_LIBS])
 # necessary flags for each platform when -export-dynamic is passed to it.
 LD_EXPORT_SYMBOLS_FLAG="-export-dynamic"
 LD_NO_UNDEFINED_FLAG=
+XORG_DRIVER_LIBS=
+case "$host_os" in
+    cygwin*)
+	LD_EXPORT_SYMBOLS_FLAG="-Wl,--export-all,--out-implib,lib\$@.a"
+	LD_NO_UNDEFINED_FLAG="-no-undefined -Wl,\$(top_builddir)/hw/xfree86/libXorg.exe.a"
+	XORG_DRIVER_LIBS="-lXorg.exe -L\${moduledir} -lshadow -lfb -no-undefined"
+	CYGWIN=yes
+	;;
+esac
 AC_SUBST([LD_EXPORT_SYMBOLS_FLAG])
 AC_SUBST([LD_NO_UNDEFINED_FLAG])
+AC_SUBST([XORG_DRIVER_LIBS])
+AM_CONDITIONAL([CYGWIN], [test x"$CYGWIN" = xyes])
 AM_CONDITIONAL([NO_UNDEFINED], [test x"$LD_NO_UNDEFINED_FLAG" != x])
 
 dnl Imake defines SVR4 on SVR4 systems, and many files check for it, so
diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index 72be889..d61c640 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -25,9 +25,9 @@ if INT10MODULE
 INT10_SUBDIR = int10
 endif
 
-SUBDIRS = common ddc i2c x86emu $(INT10_SUBDIR) fbdevhw os-support parser \
-	  ramdac shadowfb $(VBE_SUBDIR) $(VGAHW_SUBDIR) $(XAA_SUBDIR) \
-	  loader dixmods exa modes \
+SUBDIRS = common ddc x86emu $(INT10_SUBDIR) os-support parser \
+	  ramdac $(VBE_SUBDIR) $(VGAHW_SUBDIR) $(XAA_SUBDIR) \
+	  loader modes . i2c dixmods fbdevhw shadowfb exa \
 	  $(DRI_SUBDIR) $(DRI2_SUBDIR) $(XF86UTILS_SUBDIR) doc man
 
 DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \
@@ -92,6 +92,9 @@ if INSTALL_SETUID
 	chown root $(DESTDIR)$(bindir)/Xorg
 	chmod u+s $(DESTDIR)$(bindir)/Xorg
 endif
+if CYGWIN
+	$(INSTALL_DATA) libXorg.exe.a $(DESTDIR)$(libdir)/libXorg.exe.a
+endif
 
 # Use variables from XORG_MANPAGE_SECTIONS and X Server configuration
 # Do not include manpages.am as values are not appropriate for rc files
@@ -113,3 +116,12 @@ sdksyms.dep sdksyms.c: sdksyms.sh
 
 SDKSYMS_DEP = sdksyms.dep
 include $(SDKSYMS_DEP)
+
+i2c/libi2c.la:
+	$(AM_V_at)cd i2c && $(MAKE) libi2c.la
+
+dixmods/libdixmods.la:
+	$(AM_V_at)cd dixmods && $(MAKE) libdixmods.la
+
+dixmods/libxorgxkb.la:
+	$(AM_V_at)cd dixmods && $(MAKE) libxorgxkb.la
diff --git a/xorg-server.pc.in b/xorg-server.pc.in
index a98eca8..1de1c6c 100644
--- a/xorg-server.pc.in
+++ b/xorg-server.pc.in
@@ -17,4 +17,4 @@ Description: Modular X.Org X Server
 Version: @PACKAGE_VERSION@
 Requires.private: @SDK_REQUIRED_MODULES@
 Cflags: -I${sdkdir} @symbol_visibility@
-Libs: -L${libdir}
+Libs: -L${libdir} @XORG_DRIVER_LIBS@
-- 
1.7.9



More information about the xorg-devel mailing list