1447N/Adiff --git a/configure.ac b/configure.ac
1447N/Aindex 28537ac..09d4d9a 100644
1447N/A--- a/configure.ac
1447N/A+++ b/configure.ac
1447N/A@@ -221,6 +221,8 @@ AC_REPLACE_FUNCS([strcasecmp strcasestr strlcat strlcpy strndup])
1447N/A dnl Find the math libary, then check for cbrt function in it.
1447N/A AC_CHECK_LIB(m, sqrt)
1447N/A AC_CHECK_FUNCS([cbrt])
1447N/A+# But we don't want to link everything with libm
1447N/A+LIBS="${LIBS//-lm}"
1447N/A
1447N/A dnl Check for libtsol for Solaris Trusted Extensions module
1447N/A AC_CHECK_LIB(tsol, bsllow, [BUILD_TSOL_MODULE=yes], [BUILD_TSOL_MODULE=no])
1447N/A@@ -1092,7 +1094,6 @@ AM_CONDITIONAL(AIGLX_DRI_LOADER, { test "x$DRI" = xyes || test "x$DRI2" = xyes;
1447N/A
1447N/A if test "x$GLX_USE_TLS" = xyes ; then
1447N/A GLX_DEFINES="-DGLX_USE_TLS -DPTHREADS"
1447N/A- GLX_SYS_LIBS="$GLX_SYS_LIBS -lpthread"
1447N/A fi
1447N/A AC_SUBST([GLX_DEFINES])
1447N/A AC_SUBST([GLX_SYS_LIBS])
1447N/A@@ -1516,6 +1517,7 @@ XSERVER_CFLAGS="${XSERVER_CFLAGS} ${XSERVERCFLAGS_CFLAGS}"
1447N/A XSERVER_LIBS="$DIX_LIB $MI_LIB $OS_LIB"
1447N/A XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}"
1447N/A XSERVER_SYS_LIBS="${XSERVER_SYS_LIBS} -lproject"
1447N/A+XSERVER_SYS_LIBS="${XSERVER_SYS_LIBS} -lm"
1447N/A AC_SUBST([XSERVER_LIBS])
1447N/A AC_SUBST([XSERVER_SYS_LIBS])
1447N/A
1447N/Adiff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
1447N/Aindex c3899b5..36ca3d6 100644
1447N/A--- a/hw/xfree86/Makefile.am
1447N/A+++ b/hw/xfree86/Makefile.am
1447N/A@@ -25,10 +25,10 @@ if INT10MODULE
1351N/A INT10_SUBDIR = int10
1351N/A endif
1265N/A
1351N/A-SUBDIRS = common ddc x86emu $(INT10_SUBDIR) os-support parser \
1351N/A- ramdac $(VGAHW_SUBDIR) loader modes $(DRI_SUBDIR) \
1351N/A- $(DRI2_SUBDIR) . $(VBE_SUBDIR) i2c dixmods \
1351N/A- fbdevhw shadowfb exa $(XF86UTILS_SUBDIR) doc man
1351N/A+SUBDIRS = common ddc i2c x86emu $(INT10_SUBDIR) fbdevhw os-support parser \
1351N/A+ ramdac shadowfb $(VBE_SUBDIR) $(VGAHW_SUBDIR) loader \
1351N/A+ $(DRI_SUBDIR) $(DRI2_SUBDIR) . dixmods exa modes \
1265N/A+ $(XF86UTILS_SUBDIR) doc man
1265N/A
1265N/A DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \
1351N/A parser ramdac shadowfb vbe vgahw \
1447N/A@@ -38,7 +38,7 @@ DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \
1265N/A bin_PROGRAMS = Xorg
1265N/A nodist_Xorg_SOURCES = sdksyms.c
1265N/A
1265N/A-AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
1265N/A+AM_CFLAGS = $(DIX_CFLAGS) $(PIXMAN_CFLAGS) @XORG_CFLAGS@
1265N/A INCLUDES = $(XORG_INCS) -I$(srcdir)/parser -I$(top_srcdir)/miext/cw \
1351N/A -I$(srcdir)/ddc -I$(srcdir)/i2c -I$(srcdir)/modes -I$(srcdir)/ramdac \
1351N/A -I$(srcdir)/dri -I$(srcdir)/dri2
1447N/A@@ -123,6 +123,9 @@ include $(SDKSYMS_DEP)
1447N/A i2c/libi2c.la:
1447N/A $(AM_V_at)cd i2c && $(MAKE) libi2c.la
1447N/A
1447N/A+modes/libxf86modes.la:
1447N/A+ $(AM_V_at)cd modes && $(MAKE) libxf86modes.la
1447N/A+
1447N/A dixmods/libdixmods.la:
1447N/A $(AM_V_at)cd dixmods && $(MAKE) libdixmods.la
1447N/A
1447N/Adiff --git a/hw/xfree86/dixmods/Makefile.am b/hw/xfree86/dixmods/Makefile.am
1447N/Aindex c02677a..a9557b0 100644
1447N/A--- a/hw/xfree86/dixmods/Makefile.am
1447N/A+++ b/hw/xfree86/dixmods/Makefile.am
1447N/A@@ -18,7 +18,9 @@ INCLUDES = @XORG_INCS@ \
1447N/A -I$(top_srcdir)/glx
1447N/A
1447N/A libfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
1447N/A+libfb_la_LDFLAGS += $(XORG_EXTERNS_FLAG)
1447N/A libfb_la_LIBADD = $(top_builddir)/fb/libfb.la
1447N/A+libfb_la_LIBADD += -lpixman-1
1447N/A libfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c
1447N/A libfb_la_CFLAGS = $(AM_CFLAGS)
1447N/A
1447N/A@@ -28,9 +30,12 @@ libwfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c
1447N/A libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER
1447N/A
1447N/A libglx_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
1447N/A+libglx_la_LDFLAGS += $(XORG_EXTERNS_FLAG)
1447N/A libglx_la_LIBADD = $(top_builddir)/glx/libglx.la $(GLX_SYS_LIBS)
1447N/A if AIGLX_DRI_LOADER
1447N/A libglx_la_LIBADD += $(top_builddir)/glx/libglxdri.la
1447N/A+libglx_la_LDFLAGS += -R$(extsmoduledir)
1447N/A+libglx_la_LDFLAGS += $(LIBDRM_LIBS)
1447N/A if NO_UNDEFINED
1447N/A libglx_la_LIBADD += ../dri/libdri.la ../dri2/libdri2.la
1447N/A endif
1447N/A@@ -39,6 +44,8 @@ libglx_la_SOURCES = glxmodule.c
1447N/A
1447N/A libshadow_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
1447N/A libshadow_la_LIBADD = $(top_builddir)/miext/shadow/libshadow.la
1447N/A+libshadow_la_DEPENDENCIES = libfb.la
1447N/A+libshadow_la_LDFLAGS += $(XORG_EXTERNS_FLAG)
1447N/A if NO_UNDEFINED
1447N/A libshadow_la_LIBADD += libfb.la
1447N/A endif
1447N/Adiff --git a/hw/xfree86/i2c/Makefile.am b/hw/xfree86/i2c/Makefile.am
1447N/Aindex cb18db1..06cd033 100644
1447N/A--- a/hw/xfree86/i2c/Makefile.am
1447N/A+++ b/hw/xfree86/i2c/Makefile.am
1447N/A@@ -22,22 +22,30 @@ sdk_HEADERS = xf86i2c.h bt829.h fi1236.h msp3430.h tda8425.h tda9850.h tda9885.h
1351N/A # i2c drivers
1351N/A #
1351N/A bt829_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
1351N/A+bt829_drv_la_LDFLAGS += $(XORG_EXTERNS_FLAG)
1351N/A bt829_drv_la_SOURCES = bt829.c bt829.h bt829_module.c
1351N/A
1351N/A fi1236_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
1351N/A+fi1236_drv_la_LDFLAGS += $(XORG_EXTERNS_FLAG)
1447N/A+fi1236_drv_la_LIBADD = -lm
1351N/A fi1236_drv_la_SOURCES = fi1236.c fi1236.h fi1236_module.c tda9885.c
1351N/A
1351N/A msp3430_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
1351N/A+msp3430_drv_la_LDFLAGS += $(XORG_EXTERNS_FLAG)
1351N/A msp3430_drv_la_SOURCES = msp3430.c msp3430.h msp3430_module.c
1265N/A
1351N/A tda8425_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
1351N/A+tda8425_drv_la_LDFLAGS += $(XORG_EXTERNS_FLAG)
1351N/A tda8425_drv_la_SOURCES = tda8425.c tda8425.h tda8425_module.c
1351N/A
1351N/A tda9850_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
1351N/A+tda9850_drv_la_LDFLAGS += $(XORG_EXTERNS_FLAG)
1351N/A tda9850_drv_la_SOURCES = tda9850.c tda9850.h tda9850_module.c
606N/A
1351N/A tda9885_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
1351N/A+tda9885_drv_la_LDFLAGS += $(XORG_EXTERNS_FLAG)
1351N/A tda9885_drv_la_SOURCES = tda9885.c tda9885.h tda9885_module.c
1351N/A
1351N/A uda1380_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
1351N/A+uda1380_drv_la_LDFLAGS += $(XORG_EXTERNS_FLAG)
1351N/A uda1380_drv_la_SOURCES = uda1380.c uda1380.h uda1380_module.c
1447N/Adiff --git a/hw/xfree86/shadowfb/Makefile.am b/hw/xfree86/shadowfb/Makefile.am
1447N/Aindex 5756fca..6ec3116 100644
1447N/A--- a/hw/xfree86/shadowfb/Makefile.am
1447N/A+++ b/hw/xfree86/shadowfb/Makefile.am
1447N/A@@ -8,3 +8,7 @@ sdk_HEADERS = shadowfb.h
957N/A INCLUDES = $(XORG_INCS)
957N/A
957N/A AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
957N/A+
1447N/A+libshadowfb_la_LDFLAGS += $(XORG_EXTERNS_FLAG)
1447N/A+libshadowfb_la_LIBADD += -lXfont
1351N/A+
1447N/Adiff --git a/hw/xfree86/utils/gtf/Makefile.am b/hw/xfree86/utils/gtf/Makefile.am
1447N/Aindex f77bf60..64a7362 100644
1447N/A--- a/hw/xfree86/utils/gtf/Makefile.am
1447N/A+++ b/hw/xfree86/utils/gtf/Makefile.am
1447N/A@@ -24,4 +24,6 @@ bin_PROGRAMS = gtf
1447N/A
1447N/A gtf_SOURCES = gtf.c
1447N/A gtf_CFLAGS = $(XORG_CFLAGS)
1447N/A-gtf_LDADD = -lm
1447N/A+# Include -lc as workaround for bug 17815318 so libm can actually go away
1447N/A+# if -xlibmil manages to inline all math functions.
1447N/A+gtf_LDADD = -lc -lm
1447N/Adiff --git a/hw/xfree86/vbe/Makefile.am b/hw/xfree86/vbe/Makefile.am
1447N/Aindex 0b24faf..40ba628 100644
1447N/A--- a/hw/xfree86/vbe/Makefile.am
1447N/A+++ b/hw/xfree86/vbe/Makefile.am
1447N/A@@ -11,3 +11,5 @@ AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
957N/A
957N/A INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \
957N/A -I$(srcdir)/../int10
957N/A+
1196N/A+libvbe_la_LDFLAGS += $(XORG_EXTERNS_FLAG)
1447N/Adiff --git a/hw/xfree86/vgahw/Makefile.am b/hw/xfree86/vgahw/Makefile.am
1447N/Aindex f48e46a..5b69aad 100644
1447N/A--- a/hw/xfree86/vgahw/Makefile.am
1447N/A+++ b/hw/xfree86/vgahw/Makefile.am
1447N/A@@ -1,5 +1,6 @@
1447N/A module_LTLIBRARIES = libvgahw.la
1447N/A libvgahw_la_LDFLAGS = -avoid-version
1447N/A+libvgahw_la_LIBADD = $(PCIACCESS_LIBS)
1447N/A libvgahw_la_SOURCES = vgaHW.c vgaHWmodule.c
1447N/A INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c
1447N/A AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)