The attached patch updates obsolete Autoconf/Automake syntax, and fixes one spot I overlooked in my recently-merged omnibus patch. All this was inspired by "autoreconf -Wall" :)

The walk-through:

Makefile.am, doc/examples/Makefile.am, example/Makefile.am, python/Makefile.am:

* Use AM_CPPFLAGS instead of INCLUDES, as the latter is an obsolete name

* (Where applicable) Moved $(*_CFLAGS) variables into AM_CFLAGS rather
  than AM_CPPFLAGS, to keep CFLAGS segregated from CPPFLAGS

acinclude.m4:

* autoupdate replaced AC_FD_CC with AS_MESSAGE_LOG_FD

autogen.sh:

* Added -Wall to the autoreconf invocation, which turned up a whole slew
  of warnings that are fixed by this patch

configure.in:

* Most of the changes are due to autoupdate, with subsequent manual
  tidying

* Ensure that #include directives in C fragments always have no whitespace
  to the left of the '#' mark, as some preprocessors need that to be in
  the first column

doc/examples/index.py:

* Use AM_CPPFLAGS instead of INCLUDES, as the latter is an obsolete name

* Moved $(*_CFLAGS) variables into AM_CFLAGS rather than AM_CPPFLAGS, to
  keep CFLAGS segregated from CPPFLAGS

* Missed this ealier: Use $(VAR) instead of @VAR@, $(MKDIR_P) instead of
  $(mkinstalldirs)


--Daniel


--
Daniel Richard G. || [email protected] || Software Developer
Teragram Linguistic Technologies (a division of SAS)
http://www.teragram.com/
diff --git a/Makefile.am b/Makefile.am
index c5e34ea..dcac0f8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,7 +6,9 @@ SUBDIRS = include . doc example xstc $(PYTHON_SUBDIR)
 
 DIST_SUBDIRS = include . doc example python xstc
 
-INCLUDES = -I$(top_builddir)/include -I$(srcdir)/include $(THREAD_CFLAGS) $(Z_CFLAGS) $(LZMA_CFLAGS)
+AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include
+
+AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS) $(LZMA_CFLAGS)
 
 noinst_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \
                 testThreads testC14N testAutomata testRegexp \
diff --git a/acinclude.m4 b/acinclude.m4
index 4ff672e..7ad8630 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -2,8 +2,8 @@ dnl Like AC_TRY_EVAL but also errors out if the compiler generates
 dnl _any_ output. Some compilers might issue warnings which we want
 dnl to catch.
 AC_DEFUN([AC_TRY_EVAL2],
-[{ (eval echo configure:__oline__: \"[$]$1\") 1>&AC_FD_CC; dnl
-(eval [$]$1) 2>&AC_FD_CC; _out=`eval [$]$1 2>&1` && test "x$_out" = x; }])
+[{ (eval echo configure:__oline__: \"[$]$1\") 1>&AS_MESSAGE_LOG_FD; dnl
+(eval [$]$1) 2>&AS_MESSAGE_LOG_FD; _out=`eval [$]$1 2>&1` && test "x$_out" = x; }])
 
 dnl Like AC_TRY_COMPILE but calls AC_TRY_EVAL2 instead of AC_TRY_EVAL
 AC_DEFUN([AC_TRY_COMPILE2],
@@ -19,8 +19,8 @@ if AC_TRY_EVAL2(ac_compile); then
   ifelse([$3], , :, [rm -rf conftest*
   $3])
 else
-  echo "configure: failed program was:" >&AC_FD_CC
-  cat conftest.$ac_ext >&AC_FD_CC
+  echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
+  cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
 ifelse([$4], , , [  rm -rf conftest*
   $4
 ])dnl
diff --git a/autogen.sh b/autogen.sh
index a8c8e0c..8b47ea5 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -65,7 +65,7 @@ if [ ! -d $srcdir/m4 ]; then
 fi
 
 # Replaced by autoreconf below
-autoreconf -if
+autoreconf -if -Wall
 
 cd $THEDIR
 
diff --git a/configure.in b/configure.in
index ccbc330..6df8f60 100644
--- a/configure.in
+++ b/configure.in
@@ -1,7 +1,8 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_PREREQ(2.59)
-AC_INIT(entities.c)
-AM_CONFIG_HEADER(config.h)
+AC_PREREQ([2.68])
+AC_INIT
+AC_CONFIG_SRCDIR([entities.c])
+AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CANONICAL_HOST
 
@@ -116,11 +117,11 @@ AC_ARG_WITH(history,
 AC_ARG_WITH(html,
 [  --with-html             add the HTML support (on)])
 dnl Specific dir for HTML output ?
-AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path],
+AC_ARG_WITH(html-dir, AS_HELP_STRING([--with-html-dir=path],
             [path to base html directory, default $datadir/doc/html]),
             [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
 
-AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path],
+AC_ARG_WITH(html-subdir, AS_HELP_STRING([--with-html-subdir=path],
             [directory used under html-dir, default $PACKAGE-$VERSION/html]),
             [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
             [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
@@ -523,8 +524,8 @@ AH_VERBATIM([HAVE_MUNMAP_AFTER],[/* mmap() is no good without munmap() */
 
 dnl Checking for va_copy availability
 AC_MSG_CHECKING([for va_copy])
-AC_TRY_LINK([#include <stdarg.h>
-va_list ap1,ap2;], [va_copy(ap1,ap2);],
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
+va_list ap1,ap2;]], [[va_copy(ap1,ap2);]])],
 have_va_copy=yes,
 have_va_copy=no)
 AC_MSG_RESULT($have_va_copy)
@@ -532,8 +533,8 @@ if test x"$have_va_copy" = x"yes"; then
     AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
 else
     AC_MSG_CHECKING([for __va_copy])
-    AC_TRY_LINK([#include <stdarg.h>
-    va_list ap1,ap2;], [__va_copy(ap1,ap2);],
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
+    va_list ap1,ap2;]], [[__va_copy(ap1,ap2);]])],
     have___va_copy=yes,
     have___va_copy=no)
     AC_MSG_RESULT($have___va_copy)
@@ -584,13 +585,13 @@ then
 fi
 if test $enable_ipv6 = yes; then
   have_ipv6=no
-  AC_TRY_COMPILE([
-    #include <sys/types.h>
-    #include <sys/socket.h>
-    ], [
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#   include <sys/types.h>
+#   include <sys/socket.h>
+    ]], [[
     struct sockaddr_storage ss;
     socket(AF_INET6, SOCK_STREAM, 0)
-    ],
+    ]])],
     have_ipv6=yes,
     have_ipv6=no
   )
@@ -608,26 +609,26 @@ if test $enable_ipv6 = yes; then
     dnl present.
     dnl ********************************************************************
     AC_MSG_CHECKING([struct sockaddr::ss_family])
-    AC_TRY_COMPILE([
-      #include <sys/types.h>
-      #include <sys/socket.h>
-      ], [
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#     include <sys/types.h>
+#     include <sys/socket.h>
+      ]], [[
       struct sockaddr_storage ss ;
       ss.ss_family = 0 ;
-      ],
+      ]])],
       have_ss_family=yes,
       have_ss_family=no
     )
     AC_MSG_RESULT($have_ss_family)
     if test x$have_ss_family = xno ; then
       AC_MSG_CHECKING([broken struct sockaddr::ss_family])
-      AC_TRY_COMPILE([
-        #include <sys/types.h>
-        #include <sys/socket.h>
-        ], [
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#       include <sys/types.h>
+#       include <sys/socket.h>
+        ]], [[
         struct sockaddr_storage ss ;
         ss.__ss_family = 0 ;
-        ],
+        ]])],
         have_broken_ss_family=yes,
         have_broken_ss_family=no
       )
@@ -1311,10 +1312,10 @@ else
 
     AC_CHECK_HEADER(iconv.h,
 	AC_MSG_CHECKING(for iconv)
-	AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],[
+	AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
+#include <iconv.h>]],[[
 iconv_t cd = iconv_open ("","");
-iconv (cd, NULL, NULL, NULL, NULL);],[
+iconv (cd, NULL, NULL, NULL, NULL);]])],[
 	    AC_MSG_RESULT(yes)
 	    WITH_ICONV=1],[
 	    AC_MSG_RESULT(no)
@@ -1325,10 +1326,10 @@ iconv (cd, NULL, NULL, NULL, NULL);],[
 	    LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
 	    LIBS="${LIBS} -liconv"
 
-	    AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],[
+	    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
+#include <iconv.h>]],[[
 iconv_t cd = iconv_open ("","");
-iconv (cd, NULL, NULL, NULL, NULL);],[
+iconv (cd, NULL, NULL, NULL, NULL);]])],[
 		AC_MSG_RESULT(yes)
 		WITH_ICONV=1
 		ICONV_LIBS="${ICONV_LIBS} -liconv"
@@ -1341,7 +1342,7 @@ iconv (cd, NULL, NULL, NULL, NULL);],[
 	if test "$WITH_ICONV" = "1" ; then
 		AC_MSG_CHECKING([for iconv declaration])
 		AC_CACHE_VAL(xml_cv_iconv_arg2, [
-			AC_TRY_COMPILE([#include <stdlib.h>
+			AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
 #include <iconv.h>
 extern
 #ifdef __cplusplus
@@ -1352,7 +1353,7 @@ size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, si
 #else
 size_t iconv();
 #endif
-], [], xml_cv_iconv_arg2="", xml_cv_iconv_arg2="const")])
+]], [])], xml_cv_iconv_arg2="", xml_cv_iconv_arg2="const")])
 
 		xml_cv_iconv_decl="extern size_t iconv (iconv_t cd, $xml_cv_iconv_arg2 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
 		AC_MSG_RESULT([${xml_xxx:-
@@ -1564,7 +1565,8 @@ rm -f COPYING.LIB COPYING
 ln -s $srcdir/Copyright COPYING
 
 # keep on one line for cygwin c.f. #130896
-AC_OUTPUT(libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc libxml-2.0-uninstalled.pc python/setup.py)
+AC_CONFIG_FILES([libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc libxml-2.0-uninstalled.pc python/setup.py])
+AC_OUTPUT
 
 chmod +x xml2-config python/setup.py
 echo Done configuring
diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am
index d728f49..cab047d 100644
--- a/doc/examples/Makefile.am
+++ b/doc/examples/Makefile.am
@@ -1,5 +1,6 @@
 # Beware this is autogenerated by index.py
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)/include $(THREAD_CFLAGS) $(Z_CFLAGS)
+AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)/include
+AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS)
 DEPS = $(top_builddir)/libxml2.la
 LDADDS = $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(ICONV_LIBS) -lm $(WIN32_EXTRA_LIBADD)
 
diff --git a/doc/examples/index.py b/doc/examples/index.py
index 536d5dc..bd3e4c3 100755
--- a/doc/examples/index.py
+++ b/doc/examples/index.py
@@ -221,9 +221,10 @@ def dump_Makefile():
     for file in glob.glob('*.res'):
         extras.append(file)
     Makefile="""# Beware this is autogenerated by index.py
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I@srcdir@/include @THREAD_CFLAGS@ @Z_CFLAGS@
+AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)/include
+AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS)
 DEPS = $(top_builddir)/libxml2.la
-LDADDS = @STATIC_BINARIES@ $(top_builddir)/libxml2.la @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) -lm @WIN32_EXTRA_LIBADD@
+LDADDS = $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(ICONV_LIBS) -lm $(WIN32_EXTRA_LIBADD)
 
 rebuild: examples.xml index.html
 
@@ -234,8 +235,8 @@ index.html: examples.xml examples.xsl
 	-@(xsltproc examples.xsl examples.xml && echo "Rebuilt web page" && xmllint --valid --noout index.html)
 
 install-data-local: 
-	$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
-	-@INSTALL@ -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR)
+	$(MKDIR_P) $(DESTDIR)$(HTML_DIR)
+	-$(INSTALL) -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR)
 
 """
     EXTRA_DIST=""
@@ -247,7 +248,7 @@ install-data-local:
         noinst_PROGRAMS = noinst_PROGRAMS + example + " "
     Makefile = Makefile + "noinst_PROGRAMS=%s\n\n" % (noinst_PROGRAMS)
     for example in examples:
-        Makefile = Makefile + "%s_SOURCES=%s.c\n%s_LDFLAGS=\n%s_DEPENDENCIES= $(DEPS)\n%s_LDADD= @RDL_LIBS@ $(LDADDS)\n\n" % (example, example, example,
+        Makefile = Makefile + "%s_SOURCES=%s.c\n%s_LDFLAGS=\n%s_DEPENDENCIES= $(DEPS)\n%s_LDADD= $(RDL_LIBS) $(LDADDS)\n\n" % (example, example, example,
 	       example, example)
     Makefile = Makefile + "valgrind: \n\t$(MAKE) CHECKER='valgrind' tests\n\n"
     Makefile = Makefile + "tests: $(noinst_PROGRAMS)\n"
diff --git a/example/Makefile.am b/example/Makefile.am
index f8a137b..1b5b12d 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -1,6 +1,7 @@
 noinst_PROGRAMS	= gjobread
 
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)/include $(THREAD_CFLAGS) $(Z_CFLAGS)
+AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)/include
+AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS)
 DEPS = $(top_builddir)/libxml2.la
 LDADDS = $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(ICONV_LIBS) -lm $(WIN32_EXTRA_LIBADD)
 
diff --git a/python/Makefile.am b/python/Makefile.am
index f34aa98..885d29d 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS = 1.4 foreign
 
 SUBDIRS= . tests
 
-INCLUDES = \
+AM_CPPFLAGS = \
 	-I$(PYTHON_INCLUDES) \
 	-I$(top_srcdir)/include	\
 	-I$(top_builddir)/include \
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
https://mail.gnome.org/mailman/listinfo/xml

Reply via email to