diff options
author | Björn-Egil Dahlberg <[email protected]> | 2013-01-18 13:00:22 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2013-01-18 13:00:22 +0100 |
commit | 40e7a6da2054b9c430360bd5dd656b1d43f6c6ef (patch) | |
tree | f98510f7594540beb2c63bc696d221131eac3bf4 | |
parent | 2bd44c7f5462bbfaaf38eed6f708bf01b0c97469 (diff) | |
parent | dc60870eb02edb6b0163a77cc9ca523d692bc385 (diff) | |
download | otp-40e7a6da2054b9c430360bd5dd656b1d43f6c6ef.tar.gz otp-40e7a6da2054b9c430360bd5dd656b1d43f6c6ef.tar.bz2 otp-40e7a6da2054b9c430360bd5dd656b1d43f6c6ef.zip |
Merge branch 'egil/fix-LM_TRY_ENABLE_CFLAG'
* egil/fix-LM_TRY_ENABLE_CFLAG:
Fix LM_TRY_ENABLE_CFLAG to use correct environment
-rw-r--r-- | aclocal.m4 | 7 | ||||
-rw-r--r-- | erts/aclocal.m4 | 7 | ||||
-rw-r--r-- | lib/erl_interface/aclocal.m4 | 7 | ||||
-rw-r--r-- | lib/megaco/aclocal.m4 | 7 | ||||
-rw-r--r-- | lib/megaco/configure.in | 10 | ||||
-rw-r--r-- | lib/odbc/aclocal.m4 | 7 | ||||
-rw-r--r-- | lib/wx/aclocal.m4 | 7 |
7 files changed, 23 insertions, 29 deletions
diff --git a/aclocal.m4 b/aclocal.m4 index 5d555a5123..918e30a886 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1861,17 +1861,16 @@ dnl Usage example LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CFLAGS]) dnl dnl AC_DEFUN([LM_TRY_ENABLE_CFLAG], [ - AC_MSG_CHECKING([if we can add $1 to CFLAGS]) + AC_MSG_CHECKING([if we can add $1 to $2 (via CFLAGS)]) saved_CFLAGS=$CFLAGS; - CFLAGS="$1 $CFLAGS"; + CFLAGS="$1 $$2"; AC_TRY_COMPILE([],[return 0;],can_enable_flag=true,can_enable_flag=false) CFLAGS=$saved_CFLAGS; if test "X$can_enable_flag" = "Xtrue"; then AC_MSG_RESULT([yes]) - AS_VAR_SET($2, "$1 $CFLAGS") + AS_VAR_SET($2, "$1 $$2") else AC_MSG_RESULT([no]) - AS_VAR_SET($2, "$CFLAGS") fi ]) diff --git a/erts/aclocal.m4 b/erts/aclocal.m4 index 5d555a5123..918e30a886 100644 --- a/erts/aclocal.m4 +++ b/erts/aclocal.m4 @@ -1861,17 +1861,16 @@ dnl Usage example LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CFLAGS]) dnl dnl AC_DEFUN([LM_TRY_ENABLE_CFLAG], [ - AC_MSG_CHECKING([if we can add $1 to CFLAGS]) + AC_MSG_CHECKING([if we can add $1 to $2 (via CFLAGS)]) saved_CFLAGS=$CFLAGS; - CFLAGS="$1 $CFLAGS"; + CFLAGS="$1 $$2"; AC_TRY_COMPILE([],[return 0;],can_enable_flag=true,can_enable_flag=false) CFLAGS=$saved_CFLAGS; if test "X$can_enable_flag" = "Xtrue"; then AC_MSG_RESULT([yes]) - AS_VAR_SET($2, "$1 $CFLAGS") + AS_VAR_SET($2, "$1 $$2") else AC_MSG_RESULT([no]) - AS_VAR_SET($2, "$CFLAGS") fi ]) diff --git a/lib/erl_interface/aclocal.m4 b/lib/erl_interface/aclocal.m4 index 5d555a5123..918e30a886 100644 --- a/lib/erl_interface/aclocal.m4 +++ b/lib/erl_interface/aclocal.m4 @@ -1861,17 +1861,16 @@ dnl Usage example LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CFLAGS]) dnl dnl AC_DEFUN([LM_TRY_ENABLE_CFLAG], [ - AC_MSG_CHECKING([if we can add $1 to CFLAGS]) + AC_MSG_CHECKING([if we can add $1 to $2 (via CFLAGS)]) saved_CFLAGS=$CFLAGS; - CFLAGS="$1 $CFLAGS"; + CFLAGS="$1 $$2"; AC_TRY_COMPILE([],[return 0;],can_enable_flag=true,can_enable_flag=false) CFLAGS=$saved_CFLAGS; if test "X$can_enable_flag" = "Xtrue"; then AC_MSG_RESULT([yes]) - AS_VAR_SET($2, "$1 $CFLAGS") + AS_VAR_SET($2, "$1 $$2") else AC_MSG_RESULT([no]) - AS_VAR_SET($2, "$CFLAGS") fi ]) diff --git a/lib/megaco/aclocal.m4 b/lib/megaco/aclocal.m4 index 5d555a5123..918e30a886 100644 --- a/lib/megaco/aclocal.m4 +++ b/lib/megaco/aclocal.m4 @@ -1861,17 +1861,16 @@ dnl Usage example LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CFLAGS]) dnl dnl AC_DEFUN([LM_TRY_ENABLE_CFLAG], [ - AC_MSG_CHECKING([if we can add $1 to CFLAGS]) + AC_MSG_CHECKING([if we can add $1 to $2 (via CFLAGS)]) saved_CFLAGS=$CFLAGS; - CFLAGS="$1 $CFLAGS"; + CFLAGS="$1 $$2"; AC_TRY_COMPILE([],[return 0;],can_enable_flag=true,can_enable_flag=false) CFLAGS=$saved_CFLAGS; if test "X$can_enable_flag" = "Xtrue"; then AC_MSG_RESULT([yes]) - AS_VAR_SET($2, "$1 $CFLAGS") + AS_VAR_SET($2, "$1 $$2") else AC_MSG_RESULT([no]) - AS_VAR_SET($2, "$CFLAGS") fi ]) diff --git a/lib/megaco/configure.in b/lib/megaco/configure.in index 9c3858f562..643267a154 100644 --- a/lib/megaco/configure.in +++ b/lib/megaco/configure.in @@ -162,6 +162,11 @@ else fi AC_SUBST(OTP_EXTRA_FLAGS) +if test "x$GCC" = xyes; then + # Treat certain GCC warnings as errors + LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CFLAGS]) +fi + dnl dnl If ${ERL_TOP}/make/otp_ded.mk.in exists and contains DED_MK_VSN > 0, dnl every thing releted to compiling Dynamic Erlang Drivers can be found @@ -273,11 +278,6 @@ if test "$PERL" = no_perl; then AC_MSG_ERROR([Perl is required to build the flex scanner!]) fi -if test "x$GCC" = xyes; then - # Treat certain GCC warnings as errors - LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CFLAGS]) -fi - AC_OUTPUT(examples/meas/Makefile:examples/meas/Makefile.in) AC_OUTPUT(src/flex/$host/Makefile:src/flex/Makefile.in) diff --git a/lib/odbc/aclocal.m4 b/lib/odbc/aclocal.m4 index 5d555a5123..918e30a886 100644 --- a/lib/odbc/aclocal.m4 +++ b/lib/odbc/aclocal.m4 @@ -1861,17 +1861,16 @@ dnl Usage example LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CFLAGS]) dnl dnl AC_DEFUN([LM_TRY_ENABLE_CFLAG], [ - AC_MSG_CHECKING([if we can add $1 to CFLAGS]) + AC_MSG_CHECKING([if we can add $1 to $2 (via CFLAGS)]) saved_CFLAGS=$CFLAGS; - CFLAGS="$1 $CFLAGS"; + CFLAGS="$1 $$2"; AC_TRY_COMPILE([],[return 0;],can_enable_flag=true,can_enable_flag=false) CFLAGS=$saved_CFLAGS; if test "X$can_enable_flag" = "Xtrue"; then AC_MSG_RESULT([yes]) - AS_VAR_SET($2, "$1 $CFLAGS") + AS_VAR_SET($2, "$1 $$2") else AC_MSG_RESULT([no]) - AS_VAR_SET($2, "$CFLAGS") fi ]) diff --git a/lib/wx/aclocal.m4 b/lib/wx/aclocal.m4 index 5d555a5123..918e30a886 100644 --- a/lib/wx/aclocal.m4 +++ b/lib/wx/aclocal.m4 @@ -1861,17 +1861,16 @@ dnl Usage example LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CFLAGS]) dnl dnl AC_DEFUN([LM_TRY_ENABLE_CFLAG], [ - AC_MSG_CHECKING([if we can add $1 to CFLAGS]) + AC_MSG_CHECKING([if we can add $1 to $2 (via CFLAGS)]) saved_CFLAGS=$CFLAGS; - CFLAGS="$1 $CFLAGS"; + CFLAGS="$1 $$2"; AC_TRY_COMPILE([],[return 0;],can_enable_flag=true,can_enable_flag=false) CFLAGS=$saved_CFLAGS; if test "X$can_enable_flag" = "Xtrue"; then AC_MSG_RESULT([yes]) - AS_VAR_SET($2, "$1 $CFLAGS") + AS_VAR_SET($2, "$1 $$2") else AC_MSG_RESULT([no]) - AS_VAR_SET($2, "$CFLAGS") fi ]) |