Fix automake library goo.
authorTaylor R Campbell <campbell@mumble.net>
Sun, 21 Oct 2018 17:14:34 +0000 (17:14 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Sun, 21 Oct 2018 17:18:08 +0000 (17:18 +0000)
- Respect LDFLAGS in configure.
- Let automake figure out the .lo files.
- Specify -lX11 only if no pkg-config.

src/x11/Makefile.am
src/x11/configure.ac

index 7b74e2e2c9d57b05e9969a2d32376a114ffdc6e5..cff56dd3127206b712d513aad15476d304fd70d2 100644 (file)
@@ -47,12 +47,9 @@ scmlib_sub_DATA += make.scm @MIT_SCHEME_PKD@
 AM_CPPFLAGS = -I@MIT_SCHEME_INCLUDEDIR@
 AM_CFLAGS = @MIT_CFLAGS@
 
-LIBS = @MIT_LIBS@
-LDFLAGS = @MIT_LIBS@
-
-x11_shim_la_LIBADD = x11base.lo x11color.lo x11graph.lo x11term.lo
-c_sources = x11-shim.h x11.h x11base.c x11color.c x11graph.c x11term.c
-x11_shim_la_LDFLAGS = -module -avoid-version -shared -lX11
+x11_shim_la_LIBADD = @MIT_LIBS@
+x11_shim_la_SOURCES = x11base.c x11color.c x11graph.c x11term.c x11-shim.c
+x11_shim_la_LDFLAGS = -module -avoid-version -shared
 
 noinst_PROGRAMS = x11-const
 x11_const_SOURCES = x11-const.c x11-shim.h
index 6260f43efcb17a4b6a10a9365c5fe78577adc31e..c53faaef38e3270bcee34f2b629e4fee84edbd39 100644 (file)
@@ -91,9 +91,11 @@ if test "${no_x}" != yes; then
     fi
     if test "x${x_libraries}" != x; then
         FOO=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"`
-        MIT_LIBS="${MIT_LIBS} ${FOO}"
+        MIT_LIBS="${MIT_LIBS} ${FOO} -lX11"
     elif pkg-config --exists x11 2>/dev/null; then
         MIT_LIBS="${MIT_LIBS} `pkg-config --libs x11`"
+    else
+        MIT_LIBS="${MIT_LIBS} -lX11"
     fi
 fi