From 0820bcb640e9030a99a4c47119df6b9305e632da Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Sun, 4 Jan 2015 16:21:02 +0100 Subject: Fix build-system: use xxx_LDADD instead of xxx_LDFLAGS xxx_LDFLAGS place the libraries like '-lX11' or '-lXft' at the beginning of the linker command. Some systems were not able to handle the situation and this lead to a lot of unresolved symbols. Reading the documentation of automake: ... you can use LDADD to do so. This variable is used to specify additional objects or libraries to link with; it is inappropriate for specifying specific linker flags, you should use AM_LDFLAGS for this purpose. In addition we link against -lm in order to satisfy symbols refering to 'cos' and 'sin'. --- configure.ac | 4 ++++ src/Makemodule.am | 10 ++++++---- util/Makemodule.am | 19 +++++++++---------- util/fbrun/Makemodule.am | 11 +++++------ 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/configure.ac b/configure.ac index 65ee23e..33217ad 100644 --- a/configure.ac +++ b/configure.ac @@ -129,6 +129,10 @@ AC_CHECK_FUNCS([ \ vsnprintf \ ]) +AC_CHECK_LIBM +AC_SUBST(LIBM) +LIBS="$LIBS $LIBM" + dnl Windows requires the mingw-catgets library for the catgets function. AC_SEARCH_LIBS([catgets], [catgets], [], []) diff --git a/src/Makemodule.am b/src/Makemodule.am index c9e41ec..2fd5891 100644 --- a/src/Makemodule.am +++ b/src/Makemodule.am @@ -25,6 +25,8 @@ BUILT_SOURCES = src/defaults.hh src/defaults.cc CONFIG_CLEAN_FILES = src/defaults.hh src/defaults.cc +LDADD = libFbTk.a src/defaults.$(OBJEXT) + bin_PROGRAMS += fluxbox src/defaults.hh: @@ -138,13 +140,13 @@ fluxbox_CPPFLAGS = \ -I$(fbtk_incdir) \ -I$(nls_incdir) -fluxbox_LDFLAGS = \ +fluxbox_LDADD = \ + $(LDADD) \ $(FONTCONFIG_LIBS) \ $(FREETYPE2_LIBS) \ $(FRIBIDI_LIBS) \ $(IMLIB2_LIBS) \ $(RANDR_LIBS) \ - $(X11_LIBS) \ $(XEXT_LIBS) \ $(XFT_LIBS) \ $(XINERAMA_LIBS) \ @@ -152,7 +154,8 @@ fluxbox_LDFLAGS = \ $(XRENDER_LIBS) \ $(X_EXTRA_LIBS) \ $(X_LIBS) \ - $(X_PRE_LIBS) + $(X_PRE_LIBS) \ + $(X11_LIBS) fluxbox_SOURCES = \ src/AlphaMenu.cc \ @@ -272,4 +275,3 @@ fluxbox_SOURCES = \ ${SLIT_SOURCE} \ ${TOOLBAR_SOURCE} -LDADD = libFbTk.a src/defaults.$(OBJEXT) diff --git a/util/Makemodule.am b/util/Makemodule.am index 44f3002..b022f10 100644 --- a/util/Makemodule.am +++ b/util/Makemodule.am @@ -21,19 +21,19 @@ fbsetroot_SOURCES = \ util/fbsetroot.cc \ util/fbsetroot.hh fbsetroot_LDADD = \ - libFbTk.a -fbsetroot_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - -I$(fbtk_incdir) \ - -I$(src_incdir) \ - -I$(nls_incdir) -fbsetroot_LDFLAGS = \ + libFbTk.a \ $(FONTCONFIG_LIBS) \ $(FRIBIDI_LIBS) \ $(X11_LIBS) \ $(XFT_LIBS) \ $(XRENDER_LIBS) +fbsetroot_CPPFLAGS = \ + $(AM_CPPFLAGS) \ + -I$(fbtk_incdir) \ + -I$(src_incdir) \ + -I$(nls_incdir) + fluxbox_update_configs_SOURCES = \ src/defaults.cc \ src/Resources.cc \ @@ -44,8 +44,7 @@ fluxbox_update_configs_CPPFLAGS = \ -I$(src_incdir) \ -I$(nls_incdir) fluxbox_update_configs_LDADD = \ - libFbTk.a -fluxbox_update_configs_LDFLAGS = \ + libFbTk.a \ $(FRIBIDI_LIBS) \ $(X11_LIBS) @@ -54,5 +53,5 @@ fluxbox_remote_SOURCES = \ fluxbox_remote_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(fbtk_incdir) -fluxbox_remote_LDFLAGS = \ +fluxbox_remote_LDADD = \ $(X11_LIBS) diff --git a/util/fbrun/Makemodule.am b/util/fbrun/Makemodule.am index f730ac8..ddeeafb 100644 --- a/util/fbrun/Makemodule.am +++ b/util/fbrun/Makemodule.am @@ -10,13 +10,12 @@ fbrun_SOURCES = \ util/fbrun/main.cc \ util/fbrun/fbrun.xpm -fbrun_LDADD = libFbTk.a - -fbrun_LDFLAGS = \ - $(FONTCONFIG_LIBS) \ +fbrun_LDADD = libFbTk.a \ $(FRIBIDI_LIBS) \ - $(X11_LIBS) \ + $(FONTCONFIG_LIBS) \ + $(FREETYEP_LIBS) \ $(XFT_LIBS) \ $(XINERAMA_LIBS) \ $(XPM_LIBS) \ - $(XRENDER_LIBS) + $(XRENDER_LIBS) \ + $(X11_LIBS) -- cgit v0.11.2