[PATCH 3/8] xfree86: allow modules to be built without undefined symbols

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


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

This will be necessary to port Xorg to Cygwin, but other platforms may
find this useful as well.

Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
---
 configure.ac                          |    4 ++++
 hw/xfree86/dixmods/Makefile.am        |   24 ++++++++++++++----------
 hw/xfree86/dixmods/extmod/Makefile.am |    2 +-
 hw/xfree86/dri/Makefile.am            |    3 ++-
 hw/xfree86/dri2/Makefile.am           |    3 ++-
 hw/xfree86/exa/Makefile.am            |    4 ++--
 hw/xfree86/fbdevhw/Makefile.am        |    2 +-
 hw/xfree86/i2c/Makefile.am            |   17 ++++++++++-------
 hw/xfree86/shadowfb/Makefile.am       |    3 ++-
 hw/xfree86/vbe/Makefile.am            |    5 ++++-
 hw/xfree86/xaa/Makefile.am            |    2 +-
 11 files changed, 43 insertions(+), 26 deletions(-)

diff --git a/configure.ac b/configure.ac
index 44fe8e2..8de2563 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1070,6 +1070,7 @@ if test "x$GLX_USE_TLS" = xyes ; then
 	GLX_SYS_LIBS="$GLX_SYS_LIBS -lpthread"
 fi
 AC_SUBST([GLX_DEFINES])
+AC_SUBST([GLX_SYS_LIBS])
 
 AM_CONDITIONAL(DRI, test "x$DRI" = xyes)
 if test "x$DRI" = xyes; then
@@ -1471,7 +1472,10 @@ AC_SUBST([UTILS_SYS_LIBS])
 # Some platforms require extra flags to do this.   libtool should set the
 # necessary flags for each platform when -export-dynamic is passed to it.
 LD_EXPORT_SYMBOLS_FLAG="-export-dynamic"
+LD_NO_UNDEFINED_FLAG=
 AC_SUBST([LD_EXPORT_SYMBOLS_FLAG])
+AC_SUBST([LD_NO_UNDEFINED_FLAG])
+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
 dnl we need to replicate that here until those can all be fixed
diff --git a/hw/xfree86/dixmods/Makefile.am b/hw/xfree86/dixmods/Makefile.am
index a5be3ae..6f4af6c 100644
--- a/hw/xfree86/dixmods/Makefile.am
+++ b/hw/xfree86/dixmods/Makefile.am
@@ -30,35 +30,39 @@ INCLUDES = @XORG_INCS@ \
            -I$(top_srcdir)/miext/shadow \
            -I$(top_srcdir)/glx
 
-libdbe_la_LDFLAGS = -module -avoid-version
+libdbe_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 libdbe_la_LIBADD = $(top_builddir)/dbe/libdbe.la
 libdbe_la_SOURCES = dbemodule.c
 
-libfb_la_LDFLAGS = -module -avoid-version
+libfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 libfb_la_LIBADD = $(top_builddir)/fb/libfb.la
 libfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c
 libfb_la_CFLAGS = $(AM_CFLAGS)
 
-libwfb_la_LDFLAGS = -module -avoid-version
+libwfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 libwfb_la_LIBADD = $(top_builddir)/fb/libwfb.la
 libwfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c
 libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER
 
-libglx_la_LDFLAGS = -module -avoid-version
+libglx_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
+libglx_la_LIBADD = $(top_builddir)/glx/libglx.la $(GLX_SYS_LIBS)
 if AIGLX_DRI_LOADER
-GLXDRI_LIBRARY = $(top_builddir)/glx/libglxdri.la
+libglx_la_LIBADD += $(top_builddir)/glx/libglxdri.la
+if NO_UNDEFINED
+libglx_la_LIBADD += ../dri/libdri.la ../dri2/libdri2.la
+endif
 endif
-libglx_la_LIBADD = \
-	$(top_builddir)/glx/libglx.la \
-	$(GLXDRI_LIBRARY)
 libglx_la_SOURCES = glxmodule.c
 
-librecord_la_LDFLAGS = -module -avoid-version
+librecord_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 librecord_la_LIBADD = $(top_builddir)/record/librecord.la
 librecord_la_SOURCES = recordmod.c
 
-libshadow_la_LDFLAGS = -module -avoid-version
+libshadow_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 libshadow_la_LIBADD = $(top_builddir)/miext/shadow/libshadow.la
+if NO_UNDEFINED
+libshadow_la_LIBADD += libfb.la
+endif
 libshadow_la_SOURCES = shmodule.c
 
 libdixmods_la_SOURCES = $(top_srcdir)/mi/miinitext.c
diff --git a/hw/xfree86/dixmods/extmod/Makefile.am b/hw/xfree86/dixmods/extmod/Makefile.am
index 87c28a4..d08e9ad 100644
--- a/hw/xfree86/dixmods/extmod/Makefile.am
+++ b/hw/xfree86/dixmods/extmod/Makefile.am
@@ -21,7 +21,7 @@ INCLUDES = @XORG_INCS@ \
            -I$(top_srcdir)/hw/xfree86/loader \
            -I$(top_srcdir)/miext/shadow
 
-libextmod_la_LDFLAGS = -module -avoid-version
+libextmod_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 libextmod_la_SOURCES = modinit.c \
                        modinit.h \
                        $(DGA_SRCS) \
diff --git a/hw/xfree86/dri/Makefile.am b/hw/xfree86/dri/Makefile.am
index a7b491c..194cf8e 100644
--- a/hw/xfree86/dri/Makefile.am
+++ b/hw/xfree86/dri/Makefile.am
@@ -12,7 +12,8 @@ libdri_la_CFLAGS = -I$(top_srcdir)/hw/xfree86/common \
                    @DIX_CFLAGS@ @XORG_CFLAGS@ @DRIPROTO_CFLAGS@ \
                    @LIBDRM_CFLAGS@ \
                    @DRI_CFLAGS@
-libdri_la_LDFLAGS = -module -avoid-version @LIBDRM_LIBS@
+libdri_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
+libdri_la_LIBADD = @LIBDRM_LIBS@
 libdri_ladir = $(moduledir)/extensions
 libdri_la_SOURCES = \
 	dri.c \
diff --git a/hw/xfree86/dri2/Makefile.am b/hw/xfree86/dri2/Makefile.am
index c9fdde2..0e40fbc 100644
--- a/hw/xfree86/dri2/Makefile.am
+++ b/hw/xfree86/dri2/Makefile.am
@@ -6,7 +6,8 @@ libdri2_la_CFLAGS = \
 	-I$(top_srcdir)/hw/xfree86/common \
 	-I$(top_srcdir)/hw/xfree86/os-support/bus
 
-libdri2_la_LDFLAGS = -module -avoid-version @LIBDRM_LIBS@
+libdri2_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
+libdri2_la_LIBADD = @LIBDRM_LIBS@
 libdri2_ladir = $(moduledir)/extensions
 libdri2_la_SOURCES = \
 	dri2.c \
diff --git a/hw/xfree86/exa/Makefile.am b/hw/xfree86/exa/Makefile.am
index 3ced531..4339084 100644
--- a/hw/xfree86/exa/Makefile.am
+++ b/hw/xfree86/exa/Makefile.am
@@ -2,7 +2,7 @@ SUBDIRS = man
 
 module_LTLIBRARIES = libexa.la
 
-libexa_la_LDFLAGS = -module -avoid-version
+libexa_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 
 INCLUDES = \
 	$(XORG_INCS) \
@@ -15,4 +15,4 @@ libexa_la_SOURCES = \
 	examodule.c
 
 libexa_la_LIBADD = \
-	../../../exa/libexa.la
+	../../../exa/libexa.la $(PIXMAN_LIBS)
diff --git a/hw/xfree86/fbdevhw/Makefile.am b/hw/xfree86/fbdevhw/Makefile.am
index 4472acd..1fa9321 100644
--- a/hw/xfree86/fbdevhw/Makefile.am
+++ b/hw/xfree86/fbdevhw/Makefile.am
@@ -2,7 +2,7 @@ SUBDIRS = man
 
 module_LTLIBRARIES = libfbdevhw.la
 
-libfbdevhw_la_LDFLAGS = -module -avoid-version
+libfbdevhw_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 
 if FBDEVHW
 libfbdevhw_la_SOURCES = fbdevhw.c
diff --git a/hw/xfree86/i2c/Makefile.am b/hw/xfree86/i2c/Makefile.am
index 0b80cc8..f08541c 100644
--- a/hw/xfree86/i2c/Makefile.am
+++ b/hw/xfree86/i2c/Makefile.am
@@ -21,23 +21,26 @@ sdk_HEADERS = xf86i2c.h bt829.h fi1236.h msp3430.h tda8425.h tda9850.h tda9885.h
 #
 # i2c drivers
 #
-bt829_drv_la_LDFLAGS = -module -avoid-version
+bt829_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 bt829_drv_la_SOURCES = bt829.c bt829.h bt829_module.c
 
-fi1236_drv_la_LDFLAGS = -module -avoid-version
+fi1236_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 fi1236_drv_la_SOURCES = fi1236.c fi1236.h fi1236_module.c
+if NO_UNDEFINED
+fi1236_drv_la_LIBADD = tda9885_drv.la
+endif
 
-msp3430_drv_la_LDFLAGS = -module -avoid-version
+msp3430_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 msp3430_drv_la_SOURCES = msp3430.c msp3430.h msp3430_module.c
 
-tda8425_drv_la_LDFLAGS = -module -avoid-version
+tda8425_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 tda8425_drv_la_SOURCES = tda8425.c tda8425.h tda8425_module.c
 
-tda9850_drv_la_LDFLAGS = -module -avoid-version
+tda9850_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 tda9850_drv_la_SOURCES = tda9850.c tda9850.h tda9850_module.c
 
-tda9885_drv_la_LDFLAGS = -module -avoid-version
+tda9885_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 tda9885_drv_la_SOURCES = tda9885.c tda9885.h tda9885_module.c
 
-uda1380_drv_la_LDFLAGS = -module -avoid-version
+uda1380_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 uda1380_drv_la_SOURCES = uda1380.c uda1380.h uda1380_module.c
diff --git a/hw/xfree86/shadowfb/Makefile.am b/hw/xfree86/shadowfb/Makefile.am
index 39c6610..5756fca 100644
--- a/hw/xfree86/shadowfb/Makefile.am
+++ b/hw/xfree86/shadowfb/Makefile.am
@@ -1,6 +1,7 @@
 module_LTLIBRARIES = libshadowfb.la
-libshadowfb_la_LDFLAGS = -module -avoid-version
+libshadowfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 libshadowfb_la_SOURCES = sfbmodule.c shadow.c
+libshadowfb_la_LIBADD = $(PIXMAN_LIBS)
 
 sdk_HEADERS = shadowfb.h
 
diff --git a/hw/xfree86/vbe/Makefile.am b/hw/xfree86/vbe/Makefile.am
index 4b794e6..0b24faf 100644
--- a/hw/xfree86/vbe/Makefile.am
+++ b/hw/xfree86/vbe/Makefile.am
@@ -1,6 +1,9 @@
 module_LTLIBRARIES = libvbe.la
-libvbe_la_LDFLAGS = -module -avoid-version
+libvbe_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 libvbe_la_SOURCES = vbe.c vbeModes.c vbe_module.c
+if NO_UNDEFINED
+libvbe_la_LIBADD = ../int10/libint10.la
+endif
 
 sdk_HEADERS = vbe.h vbeModes.h
 
diff --git a/hw/xfree86/xaa/Makefile.am b/hw/xfree86/xaa/Makefile.am
index 78d9348..f6480a7 100644
--- a/hw/xfree86/xaa/Makefile.am
+++ b/hw/xfree86/xaa/Makefile.am
@@ -10,7 +10,7 @@ POLYSEG = s-xaaLine.c s-xaaDashLine.c
 
 if XAA
 
-libxaa_la_LDFLAGS = -module -avoid-version
+libxaa_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
 if COMPOSITE
 libxaa_la_LIBADD = $(top_builddir)/miext/cw/libcw.la
 endif
-- 
1.7.9



More information about the xorg-devel mailing list