The following commit has been merged in the master branch:
commit fcd428d0b05f84ee1dbc4910a011d75bf6d02171
Author: Guillem Jover <[email protected]>
Date: Sun Oct 31 03:27:29 2010 +0100
build: Unify and fix AC_ARG_ENABLE usage
The current code was executing code in the action arguments, instead
of just setting boolean flags and processing them afterwards. This
poses several problems, it implies jugling code around in case the the
default changes, it might also duplicate code, and it might leave the
ACTION-IF-NOT-GIVEN argument empty which could turn into an empty
“then fi” shell block which is a syntax error on POSIX shell. Leaving
the ACTION-IF-GIVEN argument empty is fine as it's always used by
autoconf to set $enableval to the specific enable variable, and setting
that variable from $enableval is redundant and might be wrong depending
on the order they are set, which could empty it.
Reported-by: Michael Schmidt <[email protected]>
diff --git a/m4/dpkg-compiler.m4 b/m4/dpkg-compiler.m4
index e885af4..3a38601 100644
--- a/m4/dpkg-compiler.m4
+++ b/m4/dpkg-compiler.m4
@@ -8,7 +8,7 @@ AC_DEFUN([DPKG_COMPILER_WARNINGS],
[AC_ARG_ENABLE(compiler-warnings,
AS_HELP_STRING([--disable-compiler-warnings],
[Disable additional compiler warnings]),
- [enable_compiler_warnings=$enableval],
+ [],
[enable_compiler_warnings=yes])
WFLAGS="-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers \
@@ -35,9 +35,12 @@ AC_DEFUN([DPKG_COMPILER_OPTIMISATIONS],
[AC_ARG_ENABLE(compiler-optimisations,
AS_HELP_STRING([--disable-compiler-optimisations],
[Disable compiler optimisations]),
-[if test "x$enable_compiler_optimisations" = "xno"; then
- [CFLAGS=$(echo "$CFLAGS" | sed -e "s/ -O[[1-9]]*\b/ -O0/g")]
-fi])dnl
+ [],
+ [enable_compiler_optimisations=yes])
+
+ AS_IF([test "x$enable_compiler_optimisations" = "xno"], [
+ CFLAGS=$(echo "$CFLAGS" | sed -e "s/ -O[[1-9]]*\b/ -O0/g")
+ ])
])
# DPKG_TRY_C99([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
diff --git a/m4/dpkg-funcs.m4 b/m4/dpkg-funcs.m4
index d374986..45c0e3c 100644
--- a/m4/dpkg-funcs.m4
+++ b/m4/dpkg-funcs.m4
@@ -76,12 +76,13 @@ AC_DEFUN([DPKG_MMAP],
AC_ARG_ENABLE([mmap],
AS_HELP_STRING([--enable-mmap],
[enable usage of unrealiable mmap if available]),
- [
- AC_CHECK_FUNCS([mmap])
- AC_DEFINE(USE_MMAP, 1, [Use unreliable mmap support])
- ],
- []
- )
+ [],
+ [enable_mmap=no])
+
+ AS_IF([test "x$enable_mmap" = "xyes"], [
+ AC_CHECK_FUNCS([mmap])
+ AC_DEFINE(USE_MMAP, 1, [Use unreliable mmap support])
+ ])
])
# DPKG_FUNC_ASYNC_SYNC
diff --git a/m4/dpkg-linker.m4 b/m4/dpkg-linker.m4
index bff4d22..2fdaae5 100644
--- a/m4/dpkg-linker.m4
+++ b/m4/dpkg-linker.m4
@@ -7,9 +7,12 @@ AC_DEFUN([DPKG_LINKER_OPTIMISATIONS],
[AC_ARG_ENABLE(linker-optimisations,
AS_HELP_STRING([--disable-linker-optimisations],
[Disable linker optimisations]),
-[if test "x$enable_linker_optimisations" = "xno"; then
- [LDFLAGS=$(echo "$LDFLAGS" | sed -e "s/ -Wl,-O[[0-9]]*\b//g")]
-else
- [LDFLAGS="$LDFLAGS -Wl,-O1"]
-fi], [LDFLAGS="$LDFLAGS -Wl,-O1"])dnl
+ [],
+ [enable_linker_optimisations=yes])
+
+ AS_IF([test "x$enable_linker_optimisations" = "xno"], [
+ LDFLAGS=$(echo "$LDFLAGS" | sed -e "s/ -Wl,-O[[0-9]]*\b//g")
+ ], [
+ LDFLAGS="$LDFLAGS -Wl,-O1"
+ ])
])
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]