From da081215481aaed435bbeed1927afef8738b40ef Mon Sep 17 00:00:00 2001 From: Diego 'Flameeyes' Pettenò Date: Thu, 7 Aug 2008 11:47:31 +0200 Subject: Bump autoconf requirement to 2.62 (latest released version). --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 1ae4bc9..1e1b244 100644 --- a/configure.ac +++ b/configure.ac @@ -19,7 +19,7 @@ # License along with libasyncns. If not, see # . -AC_PREREQ(2.59) +AC_PREREQ(2.62) AC_INIT([libasyncns],[0.5],[mznflapaf (at) 0pointer (dot) de]) AC_CONFIG_SRCDIR([libasyncns/asyncns.c]) AC_CONFIG_HEADERS([config.h]) -- cgit From ded3a48ca801da56d893a11a5999110c297f1906 Mon Sep 17 00:00:00 2001 From: Diego 'Flameeyes' Pettenò Date: Thu, 7 Aug 2008 11:49:08 +0200 Subject: Execute autoupdate. Replaces AC_GNU_SOURCE with AC_USE_SYSTEM_EXTENSIONS and AC_HELP_STRING with AS_HELP_STRING (and quotes its parameters). --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 1e1b244..05a22e7 100644 --- a/configure.ac +++ b/configure.ac @@ -38,7 +38,7 @@ fi AC_PROG_CC AC_PROG_CPP -AC_GNU_SOURCE +AC_USE_SYSTEM_EXTENSIONS AC_PROG_INSTALL AC_PROG_LN_S @@ -112,7 +112,7 @@ ACX_PTHREAD # LYNX documentation generation AC_ARG_ENABLE(lynx, - AC_HELP_STRING(--disable-lynx,Turn off lynx usage for documentation generation), + AS_HELP_STRING([--disable-lynx],[Turn off lynx usage for documentation generation]), [case "${enableval}" in yes) lynx=yes ;; no) lynx=no ;; -- cgit From db09dab2dbdf5c2ac620aed8d671992e9d25d3bb Mon Sep 17 00:00:00 2001 From: Diego 'Flameeyes' Pettenò Date: Thu, 7 Aug 2008 12:06:52 +0200 Subject: Check for assert.h header and allow to disable assertions. In recent versions of autoconf, the AC_HEADER_ASSERT check not only makes sure that the assert.h header is found but it also allows the user to decide whether to enable or disable assertions at ./configure (rather than having to pass -DNDEBUG manually). --- configure.ac | 1 + 1 file changed, 1 insertion(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 05a22e7..54c12ac 100644 --- a/configure.ac +++ b/configure.ac @@ -70,6 +70,7 @@ if test "x$GCC" = "xyes" ; then fi # Checks for header files. +AC_HEADER_ASSERT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h stdlib.h string.h sys/socket.h unistd.h sys/prctl.h netinet/in.h]) -- cgit From f4772fd28aebb280d07fe8b49bfbb2aa9d6a5527 Mon Sep 17 00:00:00 2001 From: Diego 'Flameeyes' Pettenò Date: Thu, 7 Aug 2008 12:12:02 +0200 Subject: Move ACX_PTHREAD macro from acinclude.m4 to m4/ directory. Make this change because recent versions of libtool (2.2 series) copy over their m4 macro files if an m4/ directory is present, and because futher m4/ macro files might be added too. Also make sure the macro directory is announced to autoconf and is picked up by aclocal. --- configure.ac | 1 + 1 file changed, 1 insertion(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 54c12ac..00a3910 100644 --- a/configure.ac +++ b/configure.ac @@ -23,6 +23,7 @@ AC_PREREQ(2.62) AC_INIT([libasyncns],[0.5],[mznflapaf (at) 0pointer (dot) de]) AC_CONFIG_SRCDIR([libasyncns/asyncns.c]) AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign 1.9 -Wall]) AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/libasyncns/]) -- cgit From 28db0b43c2bd6f6605373733a164a372315d61a7 Mon Sep 17 00:00:00 2001 From: Diego 'Flameeyes' Pettenò Date: Thu, 7 Aug 2008 12:20:37 +0200 Subject: Use AC_PROG_CC_C99 to discover C99-compliant compiler. Instead of just checking if the compiler supports -std=c99 option, make use of the autoconf macro for discovering C99. This way other non-GCC compiler could be used in C99 mode too. --- configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 00a3910..b76b6d5 100644 --- a/configure.ac +++ b/configure.ac @@ -37,6 +37,7 @@ fi # Checks for programs. AC_PROG_CC +AC_PROG_CC_C99 AC_PROG_CPP AC_USE_SYSTEM_EXTENSIONS @@ -57,7 +58,7 @@ test_gcc_flag() { # If using GCC specify some additional parameters if test "x$GCC" = "xyes" ; then - DESIRED_FLAGS="-std=c99 -Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter" + DESIRED_FLAGS="-Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter" for flag in $DESIRED_FLAGS ; do AC_MSG_CHECKING([whether $CC accepts $flag]) -- cgit From c29dadcbfd8b0b0b3e5d0307e718148ea632ec0d Mon Sep 17 00:00:00 2001 From: Diego 'Flameeyes' Pettenò Date: Thu, 7 Aug 2008 12:26:49 +0200 Subject: Replace the CFLAGS-checking code with a common macro from xine-lib. Instead of writing custom code to check for cflags checking, import a copy of attributes.m4 from xine-lib's repository and use the CC_CHECK_CFLAGS macro. The advantage lies not only in being able to reduce the custom code in configure.ac, but also in the fact that the CC_CHECK_CFLAGS macro caches the results, making ./configure -C quite faster on second run. Check for the CFLAGS for any compiler and not just GCC, if the compiler does support the flag it is better to u se it anyway, otherwise it will be skipped. --- configure.ac | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index b76b6d5..86df833 100644 --- a/configure.ac +++ b/configure.ac @@ -47,29 +47,11 @@ AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_LIBTOOL -test_gcc_flag() { - AC_LANG_CONFTEST([int main() {}]) - $CC -c conftest.c $CFLAGS "$1" -o conftest.o > /dev/null 2> /dev/null - ret=$? - rm -f conftest.o - return $ret -} - -# If using GCC specify some additional parameters -if test "x$GCC" = "xyes" ; then - - DESIRED_FLAGS="-Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter" - - for flag in $DESIRED_FLAGS ; do - AC_MSG_CHECKING([whether $CC accepts $flag]) - if test_gcc_flag $flag ; then - CFLAGS="$CFLAGS $flag" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - done -fi +DESIRED_FLAGS="-Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter" + +for flag in $DESIRED_FLAGS ; do + CC_CHECK_CFLAGS([$flag], [CFLAGS="$CFLAGS $flag"]) +done # Checks for header files. AC_HEADER_ASSERT -- cgit From c813eefb86359c1fa58fbeaa77b53267c405d60e Mon Sep 17 00:00:00 2001 From: Diego 'Flameeyes' Pettenò Date: Thu, 7 Aug 2008 14:14:31 +0200 Subject: Split out the lynx documentation generation autoconf code to an m4 macro. As many 0pointer projects use the same code, move it out on its own macro, and use that. The macro can then be shared across projects. --- configure.ac | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 86df833..2172791 100644 --- a/configure.ac +++ b/configure.ac @@ -95,24 +95,7 @@ AC_CHECK_FUNC(res_query, , ACX_PTHREAD -# LYNX documentation generation -AC_ARG_ENABLE(lynx, - AS_HELP_STRING([--disable-lynx],[Turn off lynx usage for documentation generation]), -[case "${enableval}" in - yes) lynx=yes ;; - no) lynx=no ;; - *) AC_MSG_ERROR(bad value ${enableval} for --disable-lynx) ;; -esac],[lynx=yes]) - -if test x$lynx = xyes ; then - AC_CHECK_PROG(have_lynx, lynx, yes, no) - - if test x$have_lynx = xno ; then - AC_MSG_WARN([*** lynx not found, plain text README will not be built ***]) - fi -fi - -AM_CONDITIONAL([USE_LYNX], [test "x$lynx" = xyes]) +ZP_LYNX_DOC AC_CONFIG_FILES([Makefile libasyncns/Makefile doc/Makefile doc/README.html doxygen/Makefile doxygen/doxygen.conf libasyncns.pc]) AC_OUTPUT -- cgit