Automake/Libtool warning fix/suppression
authorSteve Youngs <steve@sxemacs.org>
Wed, 1 Jun 2016 03:18:10 +0000 (13:18 +1000)
committerSteve Youngs <steve@sxemacs.org>
Wed, 1 Jun 2016 03:18:10 +0000 (13:18 +1000)
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 <steve@sxemacs.org>
.gitignore
configure.ac
lib-src/Makefile.am
lib-src/alloca.c [new symlink]
lib-src/regex.c [new symlink]
lib-src/regex.h [new symlink]
m4/sxe-libtool.m4

index 94ed0cd..c2679fc 100644 (file)
@@ -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
index cba46b1..d6b2c8e 100644 (file)
@@ -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])
index 1bdf0cc..ac4224f 100644 (file)
@@ -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 (symlink)
index 0000000..8fd11e8
--- /dev/null
@@ -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 (symlink)
index 0000000..07a7f09
--- /dev/null
@@ -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 (symlink)
index 0000000..51d1ae9
--- /dev/null
@@ -0,0 +1 @@
+../src/regex.h
\ No newline at end of file
index bc027a2..afa1c69 100644 (file)
@@ -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