Skip to content

Commit c7b1625

Browse files
committed
xfree86: link modules against Xorg symbols on Cygwin
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 <[email protected]> Reviewed-by: Jon TURNEY <[email protected]> Reviewed-by: Jeremy Huddleston <[email protected]>
1 parent 2dffdcd commit c7b1625

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

configure.ac

+11
Original file line numberDiff line numberDiff line change
@@ -1473,8 +1473,19 @@ AC_SUBST([UTILS_SYS_LIBS])
14731473
# necessary flags for each platform when -export-dynamic is passed to it.
14741474
LD_EXPORT_SYMBOLS_FLAG="-export-dynamic"
14751475
LD_NO_UNDEFINED_FLAG=
1476+
XORG_DRIVER_LIBS=
1477+
case "$host_os" in
1478+
cygwin*)
1479+
LD_EXPORT_SYMBOLS_FLAG="-Wl,--export-all,--out-implib,lib\[email protected]"
1480+
LD_NO_UNDEFINED_FLAG="-no-undefined -Wl,\$(top_builddir)/hw/xfree86/libXorg.exe.a"
1481+
XORG_DRIVER_LIBS="-lXorg.exe -L\${moduledir} -lshadow -lfb -no-undefined"
1482+
CYGWIN=yes
1483+
;;
1484+
esac
14761485
AC_SUBST([LD_EXPORT_SYMBOLS_FLAG])
14771486
AC_SUBST([LD_NO_UNDEFINED_FLAG])
1487+
AC_SUBST([XORG_DRIVER_LIBS])
1488+
AM_CONDITIONAL([CYGWIN], [test x"$CYGWIN" = xyes])
14781489
AM_CONDITIONAL([NO_UNDEFINED], [test x"$LD_NO_UNDEFINED_FLAG" != x])
14791490

14801491
dnl Imake defines SVR4 on SVR4 systems, and many files check for it, so

hw/xfree86/Makefile.am

+15-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ if INT10MODULE
2525
INT10_SUBDIR = int10
2626
endif
2727

28-
SUBDIRS = common ddc i2c x86emu $(INT10_SUBDIR) fbdevhw os-support parser \
29-
ramdac shadowfb $(VBE_SUBDIR) $(VGAHW_SUBDIR) $(XAA_SUBDIR) \
30-
loader dixmods exa modes \
28+
SUBDIRS = common ddc x86emu $(INT10_SUBDIR) os-support parser \
29+
ramdac $(VBE_SUBDIR) $(VGAHW_SUBDIR) $(XAA_SUBDIR) \
30+
loader modes . i2c dixmods fbdevhw shadowfb exa \
3131
$(DRI_SUBDIR) $(DRI2_SUBDIR) $(XF86UTILS_SUBDIR) doc man
3232

3333
DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \
@@ -92,6 +92,9 @@ if INSTALL_SETUID
9292
chown root $(DESTDIR)$(bindir)/Xorg
9393
chmod u+s $(DESTDIR)$(bindir)/Xorg
9494
endif
95+
if CYGWIN
96+
$(INSTALL_DATA) libXorg.exe.a $(DESTDIR)$(libdir)/libXorg.exe.a
97+
endif
9598

9699
# Use variables from XORG_MANPAGE_SECTIONS and X Server configuration
97100
# Do not include manpages.am as values are not appropriate for rc files
@@ -113,3 +116,12 @@ sdksyms.dep sdksyms.c: sdksyms.sh
113116

114117
SDKSYMS_DEP = sdksyms.dep
115118
include $(SDKSYMS_DEP)
119+
120+
i2c/libi2c.la:
121+
$(AM_V_at)cd i2c && $(MAKE) libi2c.la
122+
123+
dixmods/libdixmods.la:
124+
$(AM_V_at)cd dixmods && $(MAKE) libdixmods.la
125+
126+
dixmods/libxorgxkb.la:
127+
$(AM_V_at)cd dixmods && $(MAKE) libxorgxkb.la

xorg-server.pc.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ Description: Modular X.Org X Server
1717
Version: @PACKAGE_VERSION@
1818
Requires.private: @SDK_REQUIRED_MODULES@
1919
Cflags: -I${sdkdir} @symbol_visibility@
20-
Libs: -L${libdir}
20+
Libs: -L${libdir} @XORG_DRIVER_LIBS@

0 commit comments

Comments
 (0)