From d35dad46c2466789d05625636e3a47d9b8aa1cba Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 29 Nov 2018 12:39:33 -0800 Subject: [PATCH] configure: Add EXTRA_LIBS rather than modifying LIBS here. --- configure.ac | 9 +++++++-- construct/Makefile.am | 6 ++++++ include/ircd/Makefile.am | 2 ++ ircd/Makefile.am | 4 ++++ modules/Makefile.am | 18 ++++++++++++------ 5 files changed, 31 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 610851fa6..ef7490362 100644 --- a/configure.ac +++ b/configure.ac @@ -1307,12 +1307,17 @@ dnl Additional linkages dnl dnl +AC_SUBST(EXTRA_CPPFLAGS) +AC_SUBST(EXTRA_CXXFLAGS) +AC_SUBST(EXTRA_LDFLAGS) +AC_SUBST(EXTRA_LIBS) + AM_COND_IF([MINGW], [ ], [ - CXXFLAGS+=" -pthread" - LIBS+="-lpthread -latomic" + EXTRA_CXXFLAGS+=" -pthread" + EXTRA_LIBS+="-lpthread -latomic" ]) dnl *************************************************************************** diff --git a/construct/Makefile.am b/construct/Makefile.am index 9df5d1386..c95c780b0 100644 --- a/construct/Makefile.am +++ b/construct/Makefile.am @@ -1,6 +1,7 @@ prefix = @prefix@ AM_CXXFLAGS = \ + @EXTRA_CXXFLAGS@ \ ### AM_CPPFLAGS = \ @@ -11,8 +12,11 @@ AM_CPPFLAGS = \ @SSL_CPPFLAGS@ \ @CRYPTO_CPPFLAGS@ \ @SODIUM_CPPFLAGS@ \ + @MAGIC_CPPFLAGS@ \ + @SNAPPY_CPPFLAGS@ \ @LZ4_CPPFLAGS@ \ @Z_CPPFLAGS@ \ + @EXTRA_CPPFLAGS@ \ ### AM_LDFLAGS = \ @@ -35,6 +39,7 @@ AM_LDFLAGS = \ -L$(top_srcdir)/ircd \ -L$(top_srcdir)/modules \ $(PLATFORM_LDFLAGS) \ + @EXTRA_LDFLAGS@ \ ### bin_PROGRAMS = construct @@ -65,6 +70,7 @@ construct_LDADD = \ @SNAPPY_LIBS@ \ @LZ4_LIBS@ \ @Z_LIBS@ \ + @EXTRA_LIBS@ \ ### construct_SOURCES = \ diff --git a/include/ircd/Makefile.am b/include/ircd/Makefile.am index 7c7264686..2b2ca299e 100644 --- a/include/ircd/Makefile.am +++ b/include/ircd/Makefile.am @@ -12,9 +12,11 @@ AM_CPPFLAGS = \ @SNAPPY_CPPFLAGS@ \ @LZ4_CPPFLAGS@ \ @Z_CPPFLAGS@ \ + @EXTRA_CPPFLAGS@ \ ### AM_CXXFLAGS = \ + @EXTRA_CXXFLAGS@ \ ### if GCC diff --git a/ircd/Makefile.am b/ircd/Makefile.am index c369a0183..700b58595 100644 --- a/ircd/Makefile.am +++ b/ircd/Makefile.am @@ -3,6 +3,7 @@ AUTOMAKE_OPTIONS = foreign libircddir = @libdir@ AM_CXXFLAGS = \ + @EXTRA_CXXFLAGS@ \ ### AM_CPPFLAGS = \ @@ -18,6 +19,7 @@ AM_CPPFLAGS = \ @LZ4_CPPFLAGS@ \ @Z_CPPFLAGS@ \ -include ircd/ircd.pic.h \ + @EXTRA_CPPFLAGS@ \ ### if MINGW @@ -45,6 +47,7 @@ AM_LDFLAGS = \ -Wl,-z -Wl,nodlopen \ -Wl,-z -Wl,now \ $(PLATFORM_LDFLAGS) \ + @EXTRA_LDFLAGS@ \ ### libircd_LTLIBRARIES = libircd.la @@ -74,6 +77,7 @@ libircd_la_LIBADD = \ @SNAPPY_LIBS@ \ @LZ4_LIBS@ \ @Z_LIBS@ \ + @EXTRA_LIBS@ \ ### # Since this is a GNU C++ project we assume the non-standard respect for diff --git a/modules/Makefile.am b/modules/Makefile.am index 20df8fa38..fed6334be 100644 --- a/modules/Makefile.am +++ b/modules/Makefile.am @@ -4,23 +4,27 @@ # AM_CXXFLAGS = \ + @EXTRA_CXXFLAGS@ \ ### AM_CPPFLAGS = \ -I$(top_srcdir)/include \ + @ROCKSDB_CPPFLAGS@ \ @JS_CPPFLAGS@ \ @BOOST_CPPFLAGS@ \ + @SSL_CPPFLAGS@ \ + @CRYPTO_CPPFLAGS@ \ + @SODIUM_CPPFLAGS@ \ + @MAGIC_CPPFLAGS@ \ + @SNAPPY_CPPFLAGS@ \ + @LZ4_CPPFLAGS@ \ + @Z_CPPFLAGS@ \ -include $(top_srcdir)/include/ircd/ircd.pic.h \ -include $(top_srcdir)/include/ircd/mods/mapi.h \ + @EXTRA_CPPFLAGS@ \ ### AM_LDFLAGS = \ - -L$(top_srcdir)/ircd \ - @JS_LDFLAGS@ \ - @BOOST_LDFLAGS@ \ - ### - -AM_LDFLAGS += \ -avoid-version \ -module \ -Wl,-fuse-ld=gold \ @@ -31,7 +35,9 @@ AM_LDFLAGS += \ -Wl,--gc-sections \ -Wl,--icf=all \ -Wl,--rosegment \ + -L$(top_srcdir)/ircd \ $(PLATFORM_LDFLAGS) \ + @EXTRA_LDFLAGS@ \ # -Wl,--no-undefined \ # -export-symbols-regex IRCD_MODULE* \ # -export-symbols-regex * \