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'.
This commit is contained in:
Mathias Gumz 2015-01-04 16:21:02 +01:00
parent ad968e32b3
commit 0820bcb640
4 changed files with 24 additions and 20 deletions

View file

@ -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], [], [])

View file

@ -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)

View file

@ -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)

View file

@ -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)