[PATCH 1/3] build: clean AM_CFLAGS and AM_CPPFLAGS usage around

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Fabio M. Di Nitto" <fdinitto@xxxxxxxxxx>

also set commont include dirs.

fPIC and DPIC are automatically detected and added
as required by libtool. We don't need to carry it around.

Signed-off-by: Fabio M. Di Nitto <fdinitto@xxxxxxxxxx>
---
 common_lib/Makefile.am |    4 ----
 configure.ac           |    6 +++++-
 cts/agents/Makefile.am |    6 ------
 exec/Makefile.am       |   12 ++++--------
 lib/Makefile.am        |    5 -----
 test/Makefile.am       |    9 ++-------
 tools/Makefile.am      |    8 ++------
 7 files changed, 13 insertions(+), 37 deletions(-)

diff --git a/common_lib/Makefile.am b/common_lib/Makefile.am
index fe325de..7045c3c 100644
--- a/common_lib/Makefile.am
+++ b/common_lib/Makefile.am
@@ -31,10 +31,6 @@
 
 MAINTAINERCLEANFILES    	= Makefile.in
 
-AM_CFLAGS			= -fPIC \
-				  -I$(top_builddir)/include \
-				  -I$(top_srcdir)/include
-
 lib_LTLIBRARIES			= libcorosync_common.la
 
 libcorosync_common_la_SOURCES	= error_conversion.c
diff --git a/configure.ac b/configure.ac
index 702ae8d..30e4d42 100644
--- a/configure.ac
+++ b/configure.ac
@@ -536,12 +536,16 @@ if test "x${enable_user_flags}" = xyes; then
   EXTRA_WARNINGS=""
 fi
 
+# define global include dirs
+INCLUDE_DIRS="$INCLUDE_DIRS -I\$(top_builddir)/include -I\$(top_srcdir)/include"
+INCLUDE_DIRS="$INCLUDE_DIRS -I\$(top_builddir)/include/corosync -I\$(top_srcdir)/include/corosync"
+
 # final build of *FLAGS
 CFLAGS="$ENV_CFLAGS $OPT_CFLAGS $GDB_FLAGS \
 	$COVERAGE_CFLAGS $EXTRA_WARNINGS \
 	$WERROR_CFLAGS $NSS_CFLAGS $LIBQB_CFLAGS \
 	$SNMP_INCLUDES"
-CPPFLAGS="$ENV_CPPFLAGS $ANSI_CPPFLAGS"
+CPPFLAGS="$ENV_CPPFLAGS $ANSI_CPPFLAGS $INCLUDE_DIRS"
 LDFLAGS="$ENV_LDFLAGS $COVERAGE_LDFLAGS"
 
 # substitute what we need:
diff --git a/cts/agents/Makefile.am b/cts/agents/Makefile.am
index 6603890..bbfff8b 100644
--- a/cts/agents/Makefile.am
+++ b/cts/agents/Makefile.am
@@ -62,12 +62,6 @@ shm_leak_audit.sh: shm_leak_audit.sh.in
 	sed -e 's#@''BASHPATH@#${BASHPATH}#g' $< > $@
 	chmod 755 $@
 
-AM_CPPFLAGS			= -I$(top_builddir)/include \
-				  -I$(top_srcdir)/include \
-				  -I$(top_builddir)/include/corosync
-
-AM_CFLAGS			= -fPIC
-
 cpg_test_agent_SOURCES		= cpg_test_agent.c common_test_agent.c
 cpg_test_agent_CFLAGS		= $(nss_CFLAGS)
 cpg_test_agent_LDADD		= $(LIBQB_LIBS) $(nss_LIBS) \
diff --git a/exec/Makefile.am b/exec/Makefile.am
index c69b536..2cc4f47 100644
--- a/exec/Makefile.am
+++ b/exec/Makefile.am
@@ -31,13 +31,6 @@
 
 MAINTAINERCLEANFILES	= Makefile.in
 
-AM_CFLAGS		= -fPIC
-
-AM_CPPFLAGS		= -DLOGCONFIG_USE_ICMAP=1 \
-			  -I$(top_builddir)/include \
-			  -I$(top_srcdir)/include \
-			  $(nss_CFLAGS) $(rdmacm_CFLAGS) $(ibverbs_CFLAGS)
-
 noinst_HEADERS		= apidef.h cs_queue.h logconfig.h main.h \
 			  quorum.h service.h timer.h totemconfig.h \
 			  totemmrp.h totemnet.h totemudp.h totemiba.h \
@@ -55,6 +48,7 @@ endif
 
 lib_LTLIBRARIES		= libtotem_pg.la
 libtotem_pg_la_SOURCES	= $(TOTEM_SRC)
+libtotem_pg_la_CFLAGS	= $(nss_CFLAGS) $(rdmacm_CFLAGS) $(ibverbs_CFLAGS)
 libtotem_pg_la_LDFLAGS	= -version-number $(subst .,:,$(SONAME))
 libtotem_pg_la_LIBADD	= -lpthread $(nss_LIBS) $(rdmacm_LIBS) $(ibverbs_LIBS)
 
@@ -74,9 +68,11 @@ if BUILD_WATCHDOG
 corosync_SOURCES	+= wd.c
 endif
 
+corosync_CPPFLAGS	= -DLOGCONFIG_USE_ICMAP=1
+
 corosync_LDADD		= libtotem_pg.la ../common_lib/libcorosync_common.la \
 			  $(LIBQB_LIBS) $(statgrab_LIBS)
 corosync_DEPENDENCIES	= libtotem_pg.la ../common_lib/libcorosync_common.la
 
 lint:
-	-splint $(AM_CPPFLAGS) $(LINT_FLAGS) $(CFLAGS) *.c
+	-splint $(LINT_FLAGS) $(CPPFLAGS) $(CFLAGS) *.c
diff --git a/lib/Makefile.am b/lib/Makefile.am
index e0c9c54..3bcdb2c 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -47,11 +47,6 @@ EXTRA_DIST		= libcfg.versions	 libcfg.verso		\
 
 noinst_HEADERS		= util.h
 
-AM_CPPFLAGS		= -I$(top_builddir)/include \
-			  -I$(top_srcdir)/include
-
-AM_CFLAGS		= -fPIC
-
 # override global LIBS that pulls in lots of craft we don't need here
 LIBS			= -version-number $(call get_soname,$<) \
 			  -Wl,-version-script=$(srcdir)/lib$(call get_libname,$<).versions \
diff --git a/test/Makefile.am b/test/Makefile.am
index 777a1f0..c19e506 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -41,12 +41,6 @@ noinst_PROGRAMS		= cpgverify testcpg testcpg2 cpgbench \
 
 noinst_SCRIPTS		= ploadstart
 
-AM_CPPFLAGS		= -I$(top_builddir)/include/corosync \
-			  -I$(top_srcdir)/include \
-			  $(nss_CFLAGS)
-
-AM_CFLAGS		= -fPIC
-
 testcpg_LDADD		= $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la
 testcpg2_LDADD		= $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la
 testcpgzc_LDADD		= $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la
@@ -57,6 +51,7 @@ stress_cpgcontext_LDADD	= $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la
 testquorum_LDADD	= $(LIBQB_LIBS) $(top_builddir)/lib/libquorum.la
 testvotequorum1_LDADD	= $(LIBQB_LIBS) $(top_builddir)/lib/libvotequorum.la
 testvotequorum2_LDADD	= $(LIBQB_LIBS) $(top_builddir)/lib/libvotequorum.la
+cpgverify_CPPFLAGS	= $(nss_CFLAGS)
 cpgverify_LDADD		= $(LIBQB_LIBS) $(nss_LIBS) $(top_builddir)/lib/libcpg.la
 cpgbound_LDADD		= $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la
 cpgbench_LDADD		= $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la
@@ -71,7 +66,7 @@ LINT_FILES1:=$(filter-out sa_error.c, $(wildcard *.c))
 LINT_FILES:=$(filter-out testparse.c, $(LINT_FILES1))
 
 lint:
-	-for f in $(LINT_FILES) ; do echo Splint $$f ; splint $(AM_CPPFLAGS) $(LINT_FLAGS) $(CFLAGS) $$f ; done
+	-for f in $(LINT_FILES) ; do echo Splint $$f ; splint $(LINT_FLAGS) $(CPPFLAGS) $(CFLAGS) $$f ; done
 
 clean-local:
 	rm -f ploadstart
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 0269497..8f4064a 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -54,11 +54,6 @@ corosync-xmlproc: corosync-xmlproc.sh
 corosync-blackbox: corosync-blackbox.sh
 	sed -e 's#@''LOCALSTATEDIR@#${localstatedir}#g' $< > $@
 
-AM_CPPFLAGS		= -I$(top_builddir)/include \
-			  -I$(top_srcdir)/include \
-                          -I$(top_builddir)/include/corosync \
-			  $(DBUS_CFLAGS)
-
 corosync_cmapctl_LDADD	= $(LIBQB_LIBS) $(top_builddir)/lib/libcmap.la
 
 corosync_cfgtool_LDADD	= $(LIBQB_LIBS) $(top_builddir)/lib/libcfg.la
@@ -72,13 +67,14 @@ corosync_quorumtool_LDADD = $(LIBQB_LIBS) \
 			    $(top_builddir)/lib/libquorum.la \
 			    $(top_builddir)/lib/libvotequorum.la
 
+corosync_notifyd_CPPFLAGS = $(DBUS_CFLAGS)
 corosync_notifyd_LDADD    = $(LIBQB_LIBS) $(DBUS_LIBS) $(SNMP_LIBS) \
 			    $(top_builddir)/lib/libcmap.la \
 			    $(top_builddir)/lib/libcfg.la \
 			    $(top_builddir)/lib/libquorum.la
 
 lint:
-	-splint $(LINT_FLAGS) $(DBUS_CFLAGS) $(AM_CPPFLAGS) $(CFLAGS) *.c
+	-splint $(LINT_FLAGS) $(DBUS_CFLAGS) $(CPPFLAGS) $(CFLAGS) *.c
 
 clean-local:
 	rm -f corosync-xmlproc corosync-blackbox
-- 
1.7.7.6

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux