diff --git a/configure.ac b/configure.ac index d6f27a4ea..5707a477b 100644 --- a/configure.ac +++ b/configure.ac @@ -146,11 +146,13 @@ dnl AC_MSG_CHECKING(whether to enable debugging) AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging suite for development.]), [ + debug="yes" AC_MSG_RESULT([yes]) AC_SUBST(DEBUG, 1) RB_DEFINE_UNQUOTED([DEBUG], [1], [Not configured for release when lit.]) RB_DEFINE_UNQUOTED([DEBUG_LEVEL], [1], [Defined to 0 for release; or > 0 otherwise]) ], [ + debug="no" AC_MSG_RESULT([no]) RB_DEFINE_UNQUOTED([DEBUG_LEVEL], [0], [Defined to 0 for release]) ]) @@ -417,8 +419,10 @@ AM_CONDITIONAL([GENERIC], [[[[ "$enable_generic" = "yes" ]]]]) AM_COND_IF([GENERIC], [ + machine_tuning="generic instruction set" CXXFLAGS+=" -mtune=generic" ], [ + machine_tuning="native instruction set" CXXFLAGS+=" -march=native" ]) @@ -441,6 +445,7 @@ AM_CONDITIONAL([UNTUNED], [[[[ "$enable_untuned" = "yes" ]]]]) AM_COND_IF([UNTUNED], [ + machine_tuning="fully generic and untuned" CXXFLAGS+=" -mno-default" ], [ CXXFLAGS+="" @@ -505,11 +510,12 @@ dnl dnl Gold linker dnl -AC_ARG_ENABLE(gold, AC_HELP_STRING([--enable-ld-gold], [Use the gold linker.]), +AC_ARG_ENABLE(gold, AC_HELP_STRING([--disable-ld-gold], [Disable defaulting to the gold linker.]), [ - ld_gold="yes" + ld_gold="no" ], [ ld_gold="yes" + LD="ld.gold" ]) AM_CONDITIONAL([LD_GOLD], [[[[ $ld_gold = "yes" ]]]]) @@ -1841,6 +1847,7 @@ AM_COND_IF([MINGW], ]) ]) + dnl *************************************************************************** dnl dnl Application settings @@ -1933,10 +1940,50 @@ AC_ARG_WITH(custom-version, AC_HELP_STRING([--with-custom-version=NAME], [Custom AC_MSG_RESULT([no]) ]) + dnl *************************************************************************** dnl -dnl Misc +dnl Unit configuration macros dnl +dnl These are used in various Makefiles on certain units which require them. +dnl They are defined here to deduplicate between Makefile. + +dnl Units which require boost::asio use these flags. This includes the +dnl ircd/asio.h PCH, which includes ircd.h upstream in the precompile. +AC_SUBST(ASIO_UNIT_CPPFLAGS) +ASIO_UNIT_CPPFLAGS+=" $BOOST_CPPFLAGS" +ASIO_UNIT_CPPFLAGS+=" $SSL_CPPFLAGS" +ASIO_UNIT_CPPFLAGS+=" $CRYPTO_CPPFLAGS" +ASIO_UNIT_CPPFLAGS+=" -include ircd/asio.h" + +dnl Units which include rocksdb headers use these flags. +AC_SUBST(ROCKSDB_UNIT_CPPFLAGS) +ROCKSDB_UNIT_CPPFLAGS+=" $ROCKSDB_CPPFLAGS" +ROCKSDB_UNIT_CPPFLAGS+=" $SNAPPY_CPPFLAGS" +ROCKSDB_UNIT_CPPFLAGS+=" $LZ4_CPPFLAGS" +ROCKSDB_UNIT_CPPFLAGS+=" $Z_CPPFLAGS" + +dnl Units defining spirit grammars may benefit from special compiler flags due +dnl to their various complexities. The ./configure may have generated flags +dnl in $GRAMMAR_UNIT_CXXFLAGS to improve compile time and reduce debug symbol. +AC_SUBST(SPIRIT_UNIT_CPPFLAGS) +SPIRIT_UNIT_CPPFLAGS+=" $BOOST_CPPFLAGS" +SPIRIT_UNIT_CPPFLAGS+=" -include ircd/spirit.h" + +AC_SUBST(SPIRIT_UNIT_CXXFLAGS) +SPIRIT_UNIT_CXXFLAGS+=" -fno-var-tracking" + +AM_COND_IF([GCC], +[ + SPIRIT_UNIT_CXXFLAGS+=" -fno-var-tracking-assignments" + SPIRIT_UNIT_CXXFLAGS+=" -femit-struct-debug-baseonly" + + AM_COND_IF([LOWMEM_COMPILE], + [ + SPIRIT_UNIT_CXXFLAGS+=" --param ggc-min-expand=1" + ]) +]) + dnl *************************************************************************** dnl @@ -1945,13 +1992,6 @@ dnl AC_OUTPUT -if [[ $DEBUG ]]; then - debug="yes" -else - debug="no" -fi - - dnl Make it look sexay! echo echo "Configured ........................ $PACKAGE_NAME $PACKAGE_VERSION" @@ -1960,9 +2000,21 @@ echo "Configuration time ................ $RB_DATESTR" echo "Host OS ........................... $host_os" echo "Compiler .......................... $CXX" echo "Compiler flags (CXXFLAGS) ......... $CXXFLAGS" +echo "Linker ............................ $LD" +echo "Linker flags (LDFLAGS) ............ $LDFLAGS" +echo "Developer debug ................... $debug" +echo "Developer assert .................. $assert ($assert_type)" +echo "Low-memory compile ................ $lowmem_compile" +echo "Precompiled headers ............... $build_pch" +echo "Optimized compile ................. $optimize" +echo "Optimized linking ................. $lto" +echo "Optimization level ................ $optimize_level" +echo "Machine tuned ..................... $machine_tuning" +echo "Memory allocator .................. $alloc_lib" echo "Building boost .................... $with_included_boost" echo "Building RocksDB .................. $with_included_rocksdb" echo "Building JS (SpiderMonkey) ........ $with_included_js" +echo "IPv6 support ...................... $ipv6" echo "Ziplinks (libz) support ........... $have_zlib" echo "LZ4 support ....................... $have_lz4" echo "Snappy support .................... $have_snappy" @@ -1974,16 +2026,6 @@ echo "Magic support ..................... $have_magic" echo "ImageMagick support ............... $have_imagemagick" echo "Linux AIO support ................. $aio" echo "Linux io_uring support ............ $io_uring" -echo "IPv6 support ...................... $ipv6" -echo "Precompiled headers ............... $build_pch" -echo "Developer debug ................... $debug" -echo "Developer assert .................. $assert ($assert_type)" -echo "Optimized build ................... $optimize" -echo "Link-time optimized ............... $lto" -echo "Optimization level ................ $optimize_level" -echo "Generic binary .................... $enable_generic" -echo "Untuned binary .................... $enable_untuned" -echo "Memory allocator .................. $alloc_lib" echo "Logging level ..................... $LOG_LEVEL" echo "Installing into ................... $prefix" echo diff --git a/include/ircd/Makefile.am b/include/ircd/Makefile.am index 432d34b6a..4fe2bcd14 100644 --- a/include/ircd/Makefile.am +++ b/include/ircd/Makefile.am @@ -2,17 +2,6 @@ AUTOMAKE_OPTIONS = foreign 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@ \ - @MALLOC_CPPFLAGS@ \ @EXTRA_CPPFLAGS@ \ ### @@ -40,6 +29,7 @@ BUILT_SOURCES = \ ircd.h.gch \ ircd.pic.h.gch \ spirit.h.gch \ + asio.h.gch \ ### endif @@ -66,14 +56,21 @@ ircd.pic.h.gch: $(DEPS) spirit.h.gch: $(DEPS) $(CXX) $(CXXFLAGS) $(LOWMEM_FLAGS) $(AM_CXXFLAGS) -fPIC -o spirit.h.gch $(DEFS) $(CPPFLAGS) $(AM_CPPFLAGS) -DPIC -include ircd.pic.h spirit.h +asio.h.gch: $(DEPS) + $(CXX) $(CXXFLAGS) $(AM_CXXFLAGS) -fPIC -o asio.h.gch $(DEFS) $(CPPFLAGS) $(AM_CPPFLAGS) -DPIC -include ircd.h asio.h + +asio.h.gch: \ + AM_CPPFLAGS += @BOOST_CPPFLAGS@ @SSL_CPPFLAGS@ @CRYPTO_CPPFLAGS@ + clean-local: rm -f ircd.h.gch rm -f ircd.pic.h rm -f ircd.pic.h.gch + rm -f asio.h.gch rm -f spirit.h.gch rm -f *.gch.tmp -install-mkdirs: $(DEPS) ircd.h.gch ircd.pic.h.gch spirit.h.gch +install-mkdirs: $(DEPS) ircd.h.gch ircd.pic.h.gch asio.h.gch spirit.h.gch -@if test ! -d $(DESTDIR)$(includedir); then \ echo "mkdir -p $(DESTDIR)$(includedir)"; \ mkdir -p $(DESTDIR)$(includedir); \ diff --git a/include/ircd/asio.h b/include/ircd/asio.h index 820f80d91..13f75e49f 100644 --- a/include/ircd/asio.h +++ b/include/ircd/asio.h @@ -8,7 +8,7 @@ // copyright notice and this permission notice is present in all copies. The // full license for this software is available in the LICENSE file. -#pragma once +#ifndef HAVE_IRCD_ASIO_H #define HAVE_IRCD_ASIO_H /// @@ -24,6 +24,10 @@ /// boost headers for the time being... /// +// ircd.h is included here so that it can be compiled into this header. Then +// this becomes the single leading precompiled header. +#include + #define BOOST_COROUTINES_NO_DEPRECATION_WARNING #pragma GCC visibility push(default) @@ -45,3 +49,5 @@ #include #include + +#endif HAVE_IRCD_ASIO_H diff --git a/ircd/Makefile.am b/ircd/Makefile.am index 30cae2dfb..24a7a5b64 100644 --- a/ircd/Makefile.am +++ b/ircd/Makefile.am @@ -9,49 +9,39 @@ AM_CXXFLAGS = \ @EXTRA_CXXFLAGS@ \ ### +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -include ircd/ircd.pic.h \ + @EXTRA_CPPFLAGS@ \ + ### + +AM_LDFLAGS = \ + -version-info 3:1:0 \ + -Wl,--no-undefined-version \ + -Wl,--unresolved-symbols=report-all \ + -Wl,--weak-unresolved-symbols \ + -Wl,-z,nodelete \ + -Wl,-z,nodlopen \ + -Wl,-z,now \ + $(PLATFORM_LDFLAGS) \ + @EXTRA_LDFLAGS@ \ + ### + if DEBUG if GCC AM_CXXFLAGS += -fmax-errors=2 endif endif -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@ \ - @MALLOC_CPPFLAGS@ \ - -include ircd/ircd.pic.h \ - @EXTRA_CPPFLAGS@ \ - ### - -#TODO: split options for if LD_GOLD -AM_LDFLAGS = \ - -version-info 3:1:0 \ - -Wl,--no-undefined-version \ - -Wl,--unresolved-symbols=report-all \ - -Wl,--weak-unresolved-symbols \ - -Wl,-z,now \ - -Wl,-z,nodelete \ - -Wl,-z,nodlopen \ - $(PLATFORM_LDFLAGS) \ - @EXTRA_LDFLAGS@ \ - ### - if MINGW -AM_LDFLAGS += \ - -Wl,--enable-runtime-pseudo-reloc \ - -export-symbols-regex '*' \ - ### +AM_LDFLAGS += -Wl,--enable-runtime-pseudo-reloc +AM_LDFLAGS += -export-symbols-regex '*' endif +# +# libircd +# + libircddir = @libdir@ libircd_LTLIBRARIES = libircd.la @@ -85,13 +75,16 @@ libircd_la_LIBADD = \ @EXTRA_LIBS@ \ ### +# +# Unit list +# # Since this is a GNU C++ project we assume the non-standard respect for # the order of this sources list. Static initialization will occur in # the same order as this list, and destruction in the reverse order. -# # Add the most dependent units at the end and the least dependent units # at the beginning. # + libircd_la_SOURCES =# libircd_la_SOURCES += assert.cc libircd_la_SOURCES += info.cc @@ -118,8 +111,12 @@ libircd_la_SOURCES += json.cc libircd_la_SOURCES += conf.cc libircd_la_SOURCES += stats.cc libircd_la_SOURCES += logger.cc +if MAGIC libircd_la_SOURCES += magic.cc +endif +if SODIUM libircd_la_SOURCES += sodium.cc +endif libircd_la_SOURCES += openssl.cc libircd_la_SOURCES += rfc1459.cc libircd_la_SOURCES += rfc3986.cc @@ -158,45 +155,52 @@ libircd_la_SOURCES += js.cc endif libircd_la_SOURCES += ircd.cc -db_write_thread.lo: AM_CPPFLAGS += -I$(top_srcdir)/deps/rocksdb/include -db_write_thread.lo: AM_CPPFLAGS += -I$(top_srcdir)/deps/rocksdb +# +# Specific unit configurations +# -# Units containing a spirit grammar have some special needs to mitigate -# larger-than-normal compile time, compile memory, and output objects. -# A composite of CXXFLAGS is used specifically on units with grammars. -GUNIT_CXXFLAGS = ### - -# Grammar templates can generate a huge number of individual debug symbols -# for each template instantiation deep within spirit; we try to reduce... -GUNIT_CXXFLAGS += -fno-var-tracking -if GCC -GUNIT_CXXFLAGS += -fno-var-tracking-assignments -GUNIT_CXXFLAGS += -femit-struct-debug-baseonly +base.lo: AM_CPPFLAGS := @BOOST_CPPFLAGS@ ${AM_CPPFLAGS} +client.lo: AM_CPPFLAGS := ${ASIO_UNIT_CPPFLAGS} ${AM_CPPFLAGS} +ctx.lo: AM_CPPFLAGS := ${ASIO_UNIT_CPPFLAGS} ${AM_CPPFLAGS} +ctx_ole.lo: AM_CPPFLAGS := ${ASIO_UNIT_CPPFLAGS} ${AM_CPPFLAGS} +ctx_eh.lo: AM_CPPFLAGS := ${ASIO_UNIT_CPPFLAGS} ${AM_CPPFLAGS} +db.lo: AM_CPPFLAGS := ${ROCKSDB_UNIT_CPPFLAGS} ${AM_CPPFLAGS} +db_env.lo: AM_CPPFLAGS := ${ROCKSDB_UNIT_CPPFLAGS} ${AM_CPPFLAGS} +db_port.lo: AM_CPPFLAGS := ${ROCKSDB_UNIT_CPPFLAGS} ${AM_CPPFLAGS} +db_write_thread.lo: AM_CPPFLAGS := ${ROCKSDB_UNIT_CPPFLAGS} ${AM_CPPFLAGS} +db_write_thread.lo: AM_CPPFLAGS += -I$(top_srcdir)/deps/rocksdb/include +db_write_thread.lo: AM_CPPFLAGS += -I$(top_srcdir)/deps/rocksdb +fmt.lo: AM_CPPFLAGS := ${SPIRIT_UNIT_CPPFLAGS} ${AM_CPPFLAGS} +fmt.lo: AM_CXXFLAGS := ${SPIRIT_UNIT_CXXFLAGS} ${AM_CXXFLAGS} +fs.lo: AM_CPPFLAGS := ${ASIO_UNIT_CPPFLAGS} ${AM_CPPFLAGS} +if AIO +fs_aio.lo: AM_CPPFLAGS := ${ASIO_UNIT_CPPFLAGS} ${AM_CPPFLAGS} endif - -# The recursive grammars can consume a large amount of RAM when compiling -# (>= 2 GiB) which can thrash small systems and even sometimes crash GCC. -# This option reduces memory consumption at the cost of compilation speed. -if GCC -if LOWMEM_COMPILE -GUNIT_CXXFLAGS += --param ggc-min-expand=1 +if IOU +fs_iou.lo: AM_CPPFLAGS := ${ASIO_UNIT_CPPFLAGS} ${AM_CPPFLAGS} endif +http.lo: AM_CPPFLAGS := ${SPIRIT_UNIT_CPPFLAGS} ${AM_CPPFLAGS} +http.lo: AM_CXXFLAGS := ${SPIRIT_UNIT_CXXFLAGS} ${AM_CXXFLAGS} +ios.lo: AM_CPPFLAGS := ${ASIO_UNIT_CPPFLAGS} ${AM_CPPFLAGS} +if JS +js.lo: AM_CPPFLAGS := @JS_CPPFLAGS@ ${AM_CPPFLAGS} +endif +json.lo: AM_CPPFLAGS := ${SPIRIT_UNIT_CPPFLAGS} ${AM_CPPFLAGS} +json.lo: AM_CXXFLAGS := ${SPIRIT_UNIT_CXXFLAGS} ${AM_CXXFLAGS} +lex_cast.lo: AM_CPPFLAGS := @BOOST_CPPFLAGS@ ${AM_CPPFLAGS} +if MAGIC +magic.lo: AM_CPPFLAGS := @MAGIC_CPPFLAGS@ ${AM_CPPFLAGS} +endif +mods.lo: AM_CPPFLAGS := ${ASIO_UNIT_CPPFLAGS} ${AM_CPPFLAGS} +net.lo: AM_CPPFLAGS := ${ASIO_UNIT_CPPFLAGS} ${AM_CPPFLAGS} +openssl.lo: AM_CPPFLAGS := @SSL_CPPFLAGS@ @CRYPTO_CPPFLAGS@ ${AM_CPPFLAGS} +parse.lo: AM_CPPFLAGS := ${SPIRIT_UNIT_CPPFLAGS} ${AM_CPPFLAGS} +parse.lo: AM_CXXFLAGS := ${SPIRIT_UNIT_CXXFLAGS} ${AM_CXXFLAGS} +rfc1459.lo: AM_CPPFLAGS := ${SPIRIT_UNIT_CPPFLAGS} ${AM_CPPFLAGS} +rfc1459.lo: AM_CXXFLAGS := ${SPIRIT_UNIT_CXXFLAGS} ${AM_CXXFLAGS} +rfc3986.lo: AM_CPPFLAGS := ${SPIRIT_UNIT_CPPFLAGS} ${AM_CPPFLAGS} +rfc3986.lo: AM_CXXFLAGS := ${SPIRIT_UNIT_CXXFLAGS} ${AM_CXXFLAGS} +server.lo: AM_CPPFLAGS := ${ASIO_UNIT_CPPFLAGS} ${AM_CPPFLAGS} +if SODIUM +sodium.lo: AM_CPPFLAGS := @SODIUM_CPPFLAGS@ ${AM_CPPFLAGS} endif - -parse.lo: AM_CPPFLAGS := -include ircd/spirit.h ${AM_CPPFLAGS} -parse.lo: CXXFLAGS += ${GUNIT_CXXFLAGS} - -json.lo: AM_CPPFLAGS := -include ircd/spirit.h ${AM_CPPFLAGS} -json.lo: CXXFLAGS += ${GUNIT_CXXFLAGS} - -http.lo: AM_CPPFLAGS := -include ircd/spirit.h ${AM_CPPFLAGS} -http.lo: CXXFLAGS += ${GUNIT_CXXFLAGS} - -fmt.lo: AM_CPPFLAGS := -include ircd/spirit.h ${AM_CPPFLAGS} -fmt.lo: CXXFLAGS += ${GUNIT_CXXFLAGS} - -rfc3986.lo: AM_CPPFLAGS := -include ircd/spirit.h ${AM_CPPFLAGS} -rfc3986.lo: CXXFLAGS += ${GUNIT_CXXFLAGS} - -rfc1459.lo: AM_CPPFLAGS := -include ircd/spirit.h ${AM_CPPFLAGS} -rfc1459.lo: CXXFLAGS += ${GUNIT_CXXFLAGS} diff --git a/ircd/client.cc b/ircd/client.cc index 1e79a4b84..8c7d431ce 100644 --- a/ircd/client.cc +++ b/ircd/client.cc @@ -8,8 +8,6 @@ // copyright notice and this permission notice is present in all copies. The // full license for this software is available in the LICENSE file. -#include - // // client::settings conf::item's // diff --git a/ircd/ctx.cc b/ircd/ctx.cc index e7282a07e..82e4a0783 100644 --- a/ircd/ctx.cc +++ b/ircd/ctx.cc @@ -8,7 +8,6 @@ // copyright notice and this permission notice is present in all copies. The // full license for this software is available in the LICENSE file. -#include #include "ctx.h" /// Dedicated log facility for the ircd::ctx subsystem. diff --git a/ircd/ctx_eh.cc b/ircd/ctx_eh.cc index d57f5a549..4e47332a4 100644 --- a/ircd/ctx_eh.cc +++ b/ircd/ctx_eh.cc @@ -9,7 +9,6 @@ // full license for this software is available in the LICENSE file. #include #include "ctx.h" #ifdef HAVE_CXXABI_H diff --git a/ircd/ctx_ole.cc b/ircd/ctx_ole.cc index 90bbeddd3..90ee4a38a 100644 --- a/ircd/ctx_ole.cc +++ b/ircd/ctx_ole.cc @@ -8,7 +8,6 @@ // copyright notice and this permission notice is present in all copies. The // full license for this software is available in the LICENSE file. -#include #include "ctx.h" namespace ircd::ctx::ole diff --git a/ircd/fs.cc b/ircd/fs.cc index 6d062962d..38db26d3a 100644 --- a/ircd/fs.cc +++ b/ircd/fs.cc @@ -14,7 +14,6 @@ #include #include #ifdef IRCD_USE_AIO #include "fs_aio.h" diff --git a/ircd/fs_aio.cc b/ircd/fs_aio.cc index 228e904d0..19747d3b5 100644 --- a/ircd/fs_aio.cc +++ b/ircd/fs_aio.cc @@ -10,7 +10,6 @@ #include #include -#include #include "fs_aio.h" /////////////////////////////////////////////////////////////////////////////// diff --git a/ircd/fs_iou.cc b/ircd/fs_iou.cc index adf5ac0ee..003a6c071 100644 --- a/ircd/fs_iou.cc +++ b/ircd/fs_iou.cc @@ -10,7 +10,6 @@ #include #include -#include #include "fs_iou.h" decltype(ircd::fs::iou::MAX_EVENTS) diff --git a/ircd/ios.cc b/ircd/ios.cc index 6637f2e37..deede5163 100644 --- a/ircd/ios.cc +++ b/ircd/ios.cc @@ -8,8 +8,6 @@ // copyright notice and this permission notice is present in all copies. The // full license for this software is available in the LICENSE file. -#include - /// "main" thread for IRCd; the one the main context landed on. decltype(ircd::ios::main_thread_id) ircd::ios::main_thread_id; diff --git a/ircd/mods.cc b/ircd/mods.cc index cefb1c3d4..933659f62 100644 --- a/ircd/mods.cc +++ b/ircd/mods.cc @@ -14,7 +14,6 @@ namespace filesystem = boost::filesystem; namespace load_mode = boost::dll::load_mode; -#include #include // Module's internal API #include "mods.h" diff --git a/ircd/net.cc b/ircd/net.cc index 6e02e500c..b37c45671 100644 --- a/ircd/net.cc +++ b/ircd/net.cc @@ -8,7 +8,6 @@ // copyright notice and this permission notice is present in all copies. The // full license for this software is available in the LICENSE file. -#include #include - namespace ircd::server { // Internal state diff --git a/matrix/Makefile.am b/matrix/Makefile.am index 9d4ac8878..ad6596b3a 100644 --- a/matrix/Makefile.am +++ b/matrix/Makefile.am @@ -23,7 +23,6 @@ AM_CPPFLAGS = \ @EXTRA_CPPFLAGS@ \ ### -#TODO: split options for if LD_GOLD AM_LDFLAGS = \ -version-info 0:1:0 \ -Wl,--no-undefined-version \ @@ -43,10 +42,17 @@ AM_LDFLAGS += \ endif libircd_matrixdir = @libdir@ -libircd_matrix_LTLIBRARIES = libircd_matrix.la +libircd_matrix_LTLIBRARIES = \ + libircd_matrix.la \ + ### -libircd_matrix_LIBADD =# -libircd_matrix_LIBADD += -lircd +libircd_matrix_la_LIBADD = \ + -lircd \ + ### + +# +# Unit list +# libircd_matrix_la_SOURCES =# libircd_matrix_la_SOURCES += name.cc @@ -58,29 +64,9 @@ libircd_matrix_la_SOURCES += init_bootstrap.cc libircd_matrix_la_SOURCES += matrix.cc libircd_matrix_la_SOURCES += event.cc -### TODO: dedup with ircd/Makefile.am +# +# Unit configurations +# -# Units containing a spirit grammar have some special needs to mitigate -# larger-than-normal compile time, compile memory, and output objects. -# A composite of CXXFLAGS is used specifically on units with grammars. -GUNIT_CXXFLAGS = ### - -# Grammar templates can generate a huge number of individual debug symbols -# for each template instantiation deep within spirit; we try to reduce... -GUNIT_CXXFLAGS += -fno-var-tracking -if GCC -GUNIT_CXXFLAGS += -fno-var-tracking-assignments -GUNIT_CXXFLAGS += -femit-struct-debug-baseonly -endif - -# The recursive grammars can consume a large amount of RAM when compiling -# (>= 2 GiB) which can thrash small systems and even sometimes crash GCC. -# This option reduces memory consumption at the cost of compilation speed. -if GCC -if LOWMEM_COMPILE -GUNIT_CXXFLAGS += --param ggc-min-expand=1 -endif -endif - -id.lo: AM_CPPFLAGS := -include ircd/spirit.h ${AM_CPPFLAGS} -id.lo: CXXFLAGS += ${GUNIT_CXXFLAGS} +id.lo: AM_CPPFLAGS := ${SPIRIT_UNIT_CPPFLAGS} ${AM_CPPFLAGS} +id.lo: CXXFLAGS += ${SPIRIT_UNIT_CXXFLAGS} ${AM_CXXFLAGS} diff --git a/modules/Makefile.am b/modules/Makefile.am index 1beeadc67..3f50296b1 100644 --- a/modules/Makefile.am +++ b/modules/Makefile.am @@ -41,8 +41,9 @@ moduledir = @moduledir@ conf_la_SOURCES = conf.cc stats_la_SOURCES = stats.cc -net_dns_la_SOURCES = net_dns.cc net_dns_cache.cc net_dns_resolver.cc -net_dns_la_CPPFLAGS = $(AM_CPPFLAGS) @BOOST_CPPFLAGS@ +net_dns_la_SOURCES = net_dns.cc net_dns_cache.cc net_dns_resolver.cc +net_dns_la_CPPFLAGS = -include $(top_srcdir)/include/ircd/asio.h +net_dns_la_CPPFLAGS += $(AM_CPPFLAGS) @BOOST_CPPFLAGS@ net_dns_la_LDFLAGS = $(AM_LDFLAGS) @BOOST_LDFLAGS@ net_dns_la_LIBADD = $(AM_LIBS) @BOOST_LIBS@ console_la_SOURCES = console.cc