From 9eb1502d96b1bc6febee972c1374b40038bedf88 Mon Sep 17 00:00:00 2001 From: Steve Youngs Date: Wed, 1 Jun 2016 13:18:10 +1000 Subject: [PATCH] Automake/Libtool warning fix/suppression This changeset cleans up all of the warnings that our autogen.sh spits out. At least on my system with automake 1.15, and libtool 2.4.6. A possibly controversial change here (read: ugly as hell) is that I've symlinked a couple of files from `src' into `lib-src'. The lib-src/Makefile.am referenced regex.c, regex.h, and alloca.c in 'src'. That caused automake to freak out and warn that we were using source files in subdirectories which would become incompatible in the future. Automake does have a "subdir-objects" option for this type of thing, but it causes problems elsewhere in our build chain. The symlink "fix" is quick, dirty, and easy, however I'm happy to have it reverted if a neater solution can be found. * m4/sxe-libtool.m4 (_SXE_CHECK_LT2): Pull in `_LT_COMPILER_PIC' to fix a swag of warnings about macros being expanded before being required. * lib-src/Makefile.am (REGEX_C, ALLOCA_C): Point to files in the current directory which are symlinks to the originals in `src'. This prevents a scary warning from automake about files in subdirectories and future incompatibities. Automake does have a "subdir-objects" option, but because we have a specialised build that causes more problems than it fixes. * configure.ac (AM_INIT_AUTOMAKE): Use `-Wno-override' and `-Wno-portability' to suppress harmless and irrelevant, at least to us, warnings. Signed-off-by: Steve Youngs --- .gitignore | 1 + configure.ac | 4 ++-- lib-src/Makefile.am | 4 ++-- lib-src/alloca.c | 1 + lib-src/regex.c | 1 + lib-src/regex.h | 1 + m4/sxe-libtool.m4 | 1 + 7 files changed, 9 insertions(+), 4 deletions(-) create mode 120000 lib-src/alloca.c create mode 120000 lib-src/regex.c create mode 120000 lib-src/regex.h diff --git a/.gitignore b/.gitignore index 94ed0cd..c2679fc 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ libltdl ltmain.sh m4/argz.m4 m4/libtool.m4 +m4/ltargz.m4 m4/ltdl.m4 m4/ltoptions.m4 m4/ltsugar.m4 diff --git a/configure.ac b/configure.ac index cba46b1..d6b2c8e 100644 --- a/configure.ac +++ b/configure.ac @@ -823,9 +823,9 @@ AM_INIT_AUTOMAKE(m4_esyscmd([ automake_minor=`echo "$automake_ver" | sed -e 's/^.* [0-9]*\.\([0-9]*\).*/\1/'` if test "$automake_major" = "1" -a "$automake_minor" -lt "14" then - echo "foreign -Wall" + echo "foreign -Wall -Wno-override -Wno-portability" else - echo "info-in-builddir foreign -Wall" + echo "info-in-builddir foreign -Wall -Wno-override -Wno-portability" fi])) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) diff --git a/lib-src/Makefile.am b/lib-src/Makefile.am index 1bdf0cc..ac4224f 100644 --- a/lib-src/Makefile.am +++ b/lib-src/Makefile.am @@ -50,9 +50,9 @@ AM_CFLAGS = AM_CPPFLAGS = -I$(sxesrcdir) $(c_switch_all) AM_LDFLAGS = $(ld_switch_general) $(ld_libs_general) -REGEX_C = $(sxesrcdir)/regex.c $(sxesrcdir)/regex.h +REGEX_C = regex.c regex.h REGEX_CF = -DINHIBIT_STRING_HEADER -ALLOCA_C = $(sxesrcdir)/alloca.c +ALLOCA_C = alloca.c ## stuff we create here bin_PROGRAMS = gnuclient etags ctags2 ootags diff --git a/lib-src/alloca.c b/lib-src/alloca.c new file mode 120000 index 0000000..8fd11e8 --- /dev/null +++ b/lib-src/alloca.c @@ -0,0 +1 @@ +../src/alloca.c \ No newline at end of file diff --git a/lib-src/regex.c b/lib-src/regex.c new file mode 120000 index 0000000..07a7f09 --- /dev/null +++ b/lib-src/regex.c @@ -0,0 +1 @@ +../src/regex.c \ No newline at end of file diff --git a/lib-src/regex.h b/lib-src/regex.h new file mode 120000 index 0000000..51d1ae9 --- /dev/null +++ b/lib-src/regex.h @@ -0,0 +1 @@ +../src/regex.h \ No newline at end of file diff --git a/m4/sxe-libtool.m4 b/m4/sxe-libtool.m4 index bc027a2..afa1c69 100644 --- a/m4/sxe-libtool.m4 +++ b/m4/sxe-libtool.m4 @@ -48,6 +48,7 @@ AC_DEFUN([_SXE_CHECK_LT2], [dnl LT_CONFIG_LTDL_DIR([libltdl], [recursive]) LT_PREREQ([2.1]) AC_REQUIRE([_LT_SYS_DYNAMIC_LINKER]) + AC_REQUIRE([_LT_COMPILER_PIC]) LT_INIT([dlopen]) LTDL_INSTALLABLE LTDL_INIT -- 2.25.1