From: Jan Engelhardt <jengelh@inai.de>
To: luiz.dentz@gmail.com
Cc: linux-bluetooth@vger.kernel.org
Subject: [PATCH 3/8] build: -l arguments to belong into LDADD/LIBADD not LDFLAGS
Date: Sun, 25 Nov 2018 10:20:07 +0100 [thread overview]
Message-ID: <20181125092012.8001-4-jengelh@inai.de> (raw)
In-Reply-To: <20181125092012.8001-1-jengelh@inai.de>
It is an error to put -l arguments into LDFLAGS, because the linker
command line is order-sensitive and libs must appear in certain
places. For this, automake has the LDADD/LIBADD.
---
Makefile.plugins | 3 ++-
android/Makefile.am | 15 ++++++++-------
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/Makefile.plugins b/Makefile.plugins
index 1c9919d71..d3cf5cab8 100644
--- a/Makefile.plugins
+++ b/Makefile.plugins
@@ -107,6 +107,7 @@ if SIXAXIS
plugin_LTLIBRARIES += plugins/sixaxis.la
plugins_sixaxis_la_SOURCES = plugins/sixaxis.c
plugins_sixaxis_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
- -no-undefined $(UDEV_LIBS)
+ -no-undefined
+plugins_sixaxis_la_LIBADD = $(UDEV_LIBS)
plugins_sixaxis_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden $(UDEV_CFLAGS)
endif
diff --git a/android/Makefile.am b/android/Makefile.am
index d09a52d69..0f04b6a05 100644
--- a/android/Makefile.am
+++ b/android/Makefile.am
@@ -142,7 +142,8 @@ android_haltest_SOURCES = android/client/haltest.c \
android/hal-utils.h android/hal-utils.c
android_haltest_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android \
-DPLUGINDIR=\""$(android_plugindir)"\"
-android_haltest_LDFLAGS = -pthread -ldl -lm
+android_haltest_LDFLAGS = -pthread
+android_haltest_LDADD = -ldl -lm
noinst_PROGRAMS += android/android-tester
@@ -165,8 +166,8 @@ android_android_tester_SOURCES = emulator/hciemu.h emulator/hciemu.c \
android_android_tester_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android \
-DPLUGINDIR=\""$(android_plugindir)"\"
android_android_tester_LDADD = lib/libbluetooth-internal.la \
- src/libshared-glib.la $(GLIB_LIBS)
-android_android_tester_LDFLAGS = -pthread -ldl
+ src/libshared-glib.la $(GLIB_LIBS) -ldl
+android_android_tester_LDFLAGS = -pthread
noinst_PROGRAMS += android/ipc-tester
@@ -194,9 +195,9 @@ android_audio_a2dp_default_la_SOURCES = android/audio-msg.h \
android/system/audio.h
android_audio_a2dp_default_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android \
$(SBC_CFLAGS)
-android_audio_a2dp_default_la_LIBADD = $(SBC_LIBS)
+android_audio_a2dp_default_la_LIBADD = $(SBC_LIBS) -lrt
android_audio_a2dp_default_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
- -no-undefined -pthread -lrt
+ -no-undefined -pthread
plugin_LTLIBRARIES += android/audio.sco.default.la
@@ -210,9 +211,9 @@ android_audio_sco_default_la_SOURCES = android/hal-log.h \
android/audio_utils/resampler.h \
android/system/audio.h
android_audio_sco_default_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android
-android_audio_sco_default_la_LIBADD = $(SPEEXDSP_LIBS)
+android_audio_sco_default_la_LIBADD = $(SPEEXDSP_LIBS) -lrt
android_audio_sco_default_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
- -no-undefined -lrt
+ -no-undefined
unit_tests += android/test-ipc
android_test_ipc_SOURCES = android/test-ipc.c \
--
2.19.1
next prev parent reply other threads:[~2018-11-25 9:20 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-18 16:07 [PATCH bluez] build system refresh Jan Engelhardt
2018-11-18 16:07 ` [PATCH 1/8] build: rename libexecdir to pkglibexecdir Jan Engelhardt
2018-11-21 11:29 ` Luiz Augusto von Dentz
2018-11-21 12:57 ` Jan Engelhardt
2018-11-21 12:57 ` [PATCH 1/7] build: change @foo@ to $(foo) in automake makefiles Jan Engelhardt
2018-11-22 9:47 ` Luiz Augusto von Dentz
2018-11-24 13:27 ` Jan Engelhardt
2018-11-25 9:20 ` [PATCH bluez] build system refresh (take 3) Jan Engelhardt
2018-11-25 9:20 ` [PATCH 1/8] build: rename includedir to pkgincludedir Jan Engelhardt
2018-11-25 9:20 ` [PATCH 2/8] build: change @foo@ to $(foo) in automake makefiles Jan Engelhardt
2018-11-25 9:20 ` Jan Engelhardt [this message]
2018-11-25 9:20 ` [PATCH 4/8] build: -D/-I arguments go into CPPFLAGS Jan Engelhardt
2018-11-25 9:20 ` [PATCH 5/8] build: add missing ELL_CFLAGS Jan Engelhardt
2018-11-25 9:20 ` [PATCH 6/8] build: add missing UDEV_CFLAGS Jan Engelhardt
2018-11-25 9:20 ` [PATCH 7/8] build: add missing ALSA_CFLAGS Jan Engelhardt
2018-11-25 9:20 ` [PATCH 8/8] build: add missing BACKTRACE_CFLAGS Jan Engelhardt
2018-11-26 10:45 ` [PATCH bluez] build system refresh (take 3) Luiz Augusto von Dentz
2018-11-28 14:38 ` Luiz Augusto von Dentz
2018-11-28 15:04 ` Jan Engelhardt
2018-11-28 15:06 ` Luiz Augusto von Dentz
2018-11-28 15:45 ` [PATCH] build: make building with --coverage work again Jan Engelhardt
2018-11-29 11:57 ` Luiz Augusto von Dentz
2018-11-21 12:57 ` [PATCH 2/7] build: -l arguments to belong into LDADD/LIBADD not LDFLAGS Jan Engelhardt
2018-11-21 12:57 ` [PATCH 3/7] build: -D/-I arguments go into CPPFLAGS Jan Engelhardt
2018-11-21 12:57 ` [PATCH 4/7] build: add missing ELL_CFLAGS Jan Engelhardt
2018-11-21 12:57 ` [PATCH 5/7] build: add missing UDEV_CFLAGS Jan Engelhardt
2018-11-21 12:57 ` [PATCH 6/7] build: add missing ALSA_CFLAGS Jan Engelhardt
2018-11-21 12:57 ` [PATCH 7/7] build: add missing BACKTRACE_CFLAGS Jan Engelhardt
2018-11-18 16:07 ` [PATCH 2/8] build: change @foo@ to $(foo) in automake makefiles Jan Engelhardt
2018-11-18 16:07 ` [PATCH 3/8] build: -l arguments to belong into LDADD/LIBADD not LDFLAGS Jan Engelhardt
2018-11-18 16:07 ` [PATCH 4/8] build: -D/-I arguments go into CPPFLAGS Jan Engelhardt
2018-11-18 16:07 ` [PATCH 5/8] build: add missing ELL_CFLAGS Jan Engelhardt
2018-11-18 16:08 ` [PATCH 6/8] build: add missing UDEV_CFLAGS Jan Engelhardt
2018-11-18 16:08 ` [PATCH 7/8] build: add missing ALSA_CFLAGS Jan Engelhardt
2018-11-18 16:08 ` [PATCH 8/8] build: add missing BACKTRACE_CFLAGS Jan Engelhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181125092012.8001-4-jengelh@inai.de \
--to=jengelh@inai.de \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.