linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Engelhardt <jengelh@inai.de>
To: luiz.dentz@gmail.com
Cc: linux-bluetooth@vger.kernel.org
Subject: [PATCH 4/8] build: -D/-I arguments go into CPPFLAGS
Date: Sun, 25 Nov 2018 10:20:08 +0100	[thread overview]
Message-ID: <20181125092012.8001-5-jengelh@inai.de> (raw)
In-Reply-To: <20181125092012.8001-1-jengelh@inai.de>

-D and -I are preprocessor directives, they are therefore to appear
in CPPFLAGS, not CFLAGS. (It is unfortunate that pkg-config does not
make the distinction / or it was misnamed, because only -D/-I make
sense to be emitted by pkg-config in the first place — anything else
(-f/-m) has the potential to mess up someone's compilation. So
pkg-config's Cflags is actually used to convery Cppflags.)
---
 Makefile.am         |  9 ++++-----
 Makefile.obexd      |  7 ++++---
 Makefile.plugins    |  3 ++-
 Makefile.tools      |  2 +-
 android/Makefile.am | 14 +++++++-------
 5 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index dec0dc516..00490d1c3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,6 @@
 
 AM_MAKEFLAGS = --no-print-directory
+AM_CPPFLAGS =
 
 lib_LTLIBRARIES =
 
@@ -214,7 +215,7 @@ src_bluetoothd_DEPENDENCIES = lib/libbluetooth-internal.la \
 				src/libshared-glib.la \
 				src/bluetooth.service
 
-src_bluetoothd_CFLAGS = $(AM_CFLAGS) -DBLUETOOTH_PLUGIN_BUILTIN \
+src_bluetoothd_CPPFLAGS = $(AM_CPPFLAGS) -DBLUETOOTH_PLUGIN_BUILTIN \
 					-DPLUGINDIR=\""$(build_plugindir)"\"
 src_bluetoothd_SHORTNAME = bluetoothd
 
@@ -278,9 +279,7 @@ EXTRA_DIST += doc/btsnoop.txt
 
 EXTRA_DIST += tools/magic.btsnoop
 
-AM_CFLAGS += $(DBUS_CFLAGS) $(GLIB_CFLAGS)
-
-AM_CPPFLAGS = -I$(builddir)/lib
+AM_CPPFLAGS += $(DBUS_CFLAGS) $(GLIB_CFLAGS) -I$(builddir)/lib
 
 
 unit_tests += unit/test-eir
@@ -436,7 +435,7 @@ unit_test_gattrib_LDADD = lib/libbluetooth-internal.la \
 
 if MIDI
 unit_tests += unit/test-midi
-unit_test_midi_CFLAGS = $(AM_CFLAGS) $(ALSA_CFLAGS) -DMIDI_TEST
+unit_test_midi_CPPFLAGS = $(AM_CPPFLAGS) $(ALSA_CFLAGS) -DMIDI_TEST
 unit_test_midi_SOURCES = unit/test-midi.c \
 			profiles/midi/libmidi.h \
 			profiles/midi/libmidi.c
diff --git a/Makefile.obexd b/Makefile.obexd
index 9180d7eea..22a4977ef 100644
--- a/Makefile.obexd
+++ b/Makefile.obexd
@@ -83,12 +83,13 @@ obexd_src_obexd_LDADD = lib/libbluetooth-internal.la \
 
 obexd_src_obexd_LDFLAGS = -Wl,--export-dynamic
 
-obexd_src_obexd_CFLAGS = $(AM_CFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) \
+obexd_src_obexd_CPPFLAGS = $(AM_CFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) \
 				$(ICAL_CFLAGS) -DOBEX_PLUGIN_BUILTIN \
 				-DPLUGINDIR=\""$(obex_plugindir)"\" \
-				-fPIC -D_FILE_OFFSET_BITS=64
+				-D_FILE_OFFSET_BITS=64 \
+				-I$(builddir)/lib -I$(builddir)/obexd/src
 
-obexd_src_obexd_CPPFLAGS = -I$(builddir)/lib -I$(builddir)/obexd/src
+obexd_src_obexd_CFLAGS = -fPIC
 
 endif
 
diff --git a/Makefile.plugins b/Makefile.plugins
index d3cf5cab8..2aaeb7450 100644
--- a/Makefile.plugins
+++ b/Makefile.plugins
@@ -109,5 +109,6 @@ plugins_sixaxis_la_SOURCES = plugins/sixaxis.c
 plugins_sixaxis_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
 						-no-undefined
 plugins_sixaxis_la_LIBADD = $(UDEV_LIBS)
-plugins_sixaxis_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden $(UDEV_CFLAGS)
+plugins_sixaxis_la_CPPFLAGS = $(AM_CPPFLAGS) $(UDEV_CFLAGS)
+plugins_sixaxis_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden
 endif
diff --git a/Makefile.tools b/Makefile.tools
index cdfaaf906..55e769d8c 100644
--- a/Makefile.tools
+++ b/Makefile.tools
@@ -469,6 +469,6 @@ if BTPCLIENT
 noinst_PROGRAMS += tools/btpclient
 
 tools_btpclient_SOURCES = tools/btpclient.c src/shared/btp.c src/shared/btp.h
-tools_btpclient_CFLAGS = $(AM_CFLAGS) $(ELL_CFLAGS)
+tools_btpclient_CPPFLAGS = $(AM_CPPFLAGS) $(ELL_CFLAGS)
 tools_btpclient_LDADD = $(ELL_LIBS) lib/libbluetooth-internal.la
 endif
diff --git a/android/Makefile.am b/android/Makefile.am
index 0f04b6a05..5dd1adf9d 100644
--- a/android/Makefile.am
+++ b/android/Makefile.am
@@ -1,6 +1,6 @@
 if ANDROID
 
-AM_CFLAGS += -DANDROID_VERSION=0x050100
+AM_CPPFLAGS += -DANDROID_VERSION=0x050100
 
 android_plugindir = $(abs_top_srcdir)/android/.libs
 
@@ -96,7 +96,7 @@ android_bluetooth_default_la_SOURCES = android/hal.h android/hal-bluetooth.c \
 					android/hal-log.h \
 					android/hal-ipc.h android/hal-ipc.c \
 					android/hal-utils.h android/hal-utils.c
-android_bluetooth_default_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android
+android_bluetooth_default_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/android
 android_bluetooth_default_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
 					-no-undefined
 
@@ -140,7 +140,7 @@ android_haltest_SOURCES = android/client/haltest.c \
 				android/client/if-mce.c \
 				android/hardware/hardware.c \
 				android/hal-utils.h android/hal-utils.c
-android_haltest_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android \
+android_haltest_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/android \
 				-DPLUGINDIR=\""$(android_plugindir)"\"
 android_haltest_LDFLAGS = -pthread
 android_haltest_LDADD = -ldl -lm
@@ -163,7 +163,7 @@ android_android_tester_SOURCES = emulator/hciemu.h emulator/hciemu.c \
 				android/tester-gatt.c \
 				android/tester-map-client.c \
 				android/tester-main.h android/tester-main.c
-android_android_tester_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android \
+android_android_tester_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/android \
 				-DPLUGINDIR=\""$(android_plugindir)"\"
 android_android_tester_LDADD = lib/libbluetooth-internal.la \
 				src/libshared-glib.la $(GLIB_LIBS) -ldl
@@ -177,7 +177,7 @@ android_ipc_tester_SOURCES = emulator/hciemu.h emulator/hciemu.c \
 				emulator/smp.c \
 				android/hal-utils.h android/hal-utils.c \
 				android/ipc-common.h android/ipc-tester.c
-android_ipc_tester_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android
+android_ipc_tester_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/android
 android_ipc_tester_LDADD = lib/libbluetooth-internal.la \
 				src/libshared-glib.la $(GLIB_LIBS)
 
@@ -193,7 +193,7 @@ android_audio_a2dp_default_la_SOURCES = android/audio-msg.h \
 					android/hardware/audio_effect.h \
 					android/hardware/hardware.h \
 					android/system/audio.h
-android_audio_a2dp_default_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android \
+android_audio_a2dp_default_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/android \
 					$(SBC_CFLAGS)
 android_audio_a2dp_default_la_LIBADD = $(SBC_LIBS) -lrt
 android_audio_a2dp_default_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
@@ -210,7 +210,7 @@ android_audio_sco_default_la_SOURCES = android/hal-log.h \
 					android/audio_utils/resampler.c \
 					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_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/android
 android_audio_sco_default_la_LIBADD = $(SPEEXDSP_LIBS) -lrt
 android_audio_sco_default_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
 					-no-undefined
-- 
2.19.1


  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             ` [PATCH 3/8] build: -l arguments to belong into LDADD/LIBADD not LDFLAGS Jan Engelhardt
2018-11-25  9:20             ` Jan Engelhardt [this message]
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-5-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).