[libdvbpsi-devel] [PATCH 4/6] Modernize autotools

Timothy Gu timothygu99 at gmail.com
Fri Jun 27 01:15:18 CEST 2014


Signed-off-by: Timothy Gu <timothygu99 at gmail.com>
---
 configure.ac | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/configure.ac b/configure.ac
index f95c186..e5adab6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,22 +1,20 @@
-AC_INIT(libdvbpsi, 1.2.0)
+AC_INIT([libdvbpsi],[1.2.0])
 
-AC_PREREQ(2.50)
+AC_PREREQ([2.65])
 AC_CONFIG_AUX_DIR(.auto)
-AC_CANONICAL_SYSTEM
+AC_CANONICAL_HOST
 
 AM_INIT_AUTOMAKE
 AC_CONFIG_HEADERS(config.h)
 AC_CONFIG_MACRO_DIR([m4])
 
-dnl AC_CANONICAL_HOST
 AC_PROG_CC
-AC_STDC_HEADERS
+AC_HEADER_STDC
 AC_C_INLINE
 
 AM_PROG_CC_C_O
 
-AC_LIBTOOL_WIN32_DLL
-AM_PROG_LIBTOOL
+LT_INIT([win32-dll])
 
 dnl store CFLAGS from user
 CFLAGS_save="${CFLAGS}"
@@ -90,12 +88,17 @@ AC_CHECK_HEADERS([net/if.h], [], [],
 dnl Check for variadic macros
 AC_CACHE_CHECK([for variadic cpp macros],
     [ac_cv_cpp_variadic_macros],
-    [AC_TRY_COMPILE(
-         [#include <stdio.h>
-          #define a(b,c...) printf(b,##c)],
-         [a("foo");a("%s","bar");a("%s%s","baz","quux");],
-         ac_cv_cpp_variadic_macros=yes,
-         ac_cv_cpp_variadic_macros=no)])
+    [AC_COMPILE_IFELSE([
+        AC_LANG_SOURCE([[
+            #include <stdio.h>
+            #define a(b,c...) printf(b,##c)
+            int main(void) {
+                a("foo"); a("%s","bar"); a("%s%s","baz","quux");
+                return 0;
+            }
+        ]])],
+        ac_cv_cpp_variadic_macros=yes,
+        ac_cv_cpp_variadic_macros=no)])
 if test "${ac_cv_cpp_variadic_macros}" != "no"; then
     AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
 fi
@@ -124,7 +127,7 @@ fi
 dnl
 dnl Generate Makefiles and other output files
 dnl
-AC_OUTPUT([Makefile
+AC_CONFIG_FILES([Makefile
            src/Makefile
            examples/Makefile
            examples/dvbinfo/Makefile
@@ -133,6 +136,7 @@ AC_OUTPUT([Makefile
            wince/Makefile
            libdvbpsi.pc
            libdvbpsi.spec])
+AC_OUTPUT
 
 echo "
 libdvbpsi configuration
-- 
1.9.1



More information about the libdvbpsi-devel mailing list