Skip to content

Commit

Permalink
Fix CPPFLAGS for GCC 5 (add -P flag)
Browse files Browse the repository at this point in the history
  • Loading branch information
paumard committed Jun 22, 2015
1 parent f0282ed commit 06d6c42
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 57 deletions.
179 changes: 122 additions & 57 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -15581,6 +15581,128 @@ ac_config_headers="$ac_config_headers config.h include/GyotoConfig.h"
VERSINFO=4:0:0


# Needed for gcc-5, should be harmless for other compilers:
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts " >&5
$as_echo_n "checking whether C++ compiler accepts ... " >&6; }
if ${ax_cv_check_cxxflags__+:} false; then :
$as_echo_n "(cached) " >&6
else

ax_check_save_flags=$CXXFLAGS
CXXFLAGS="$CXXFLAGS "
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

int
main ()
{

;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
ax_cv_check_cxxflags__=yes
else
ax_cv_check_cxxflags__=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CXXFLAGS=$ax_check_save_flags
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags__" >&5
$as_echo "$ax_cv_check_cxxflags__" >&6; }
if test x"$ax_cv_check_cxxflags__" = xyes; then :
:
else
:
fi

if ${CXXFLAGS+:} false; then :
case " $CXXFLAGS " in
*" "*)
{ { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS already contains "; } >&5
(: CXXFLAGS already contains ) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
;;
*)
{ { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS=\"\$CXXFLAGS \""; } >&5
(: CXXFLAGS="$CXXFLAGS ") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
CXXFLAGS="$CXXFLAGS "
;;
esac
else
CXXFLAGS=""
fi



for flag in -P; do
as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags__$flag" | $as_tr_sh`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5
$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; }
if eval \${$as_CACHEVAR+:} false; then :
$as_echo_n "(cached) " >&6
else

ax_check_save_flags=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $flag"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

int
main ()
{

;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
eval "$as_CACHEVAR=yes"
else
eval "$as_CACHEVAR=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CXXFLAGS=$ax_check_save_flags
fi
eval ac_res=\$$as_CACHEVAR
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then :
if ${CPPFLAGS+:} false; then :
case " $CPPFLAGS " in
*" $flag "*)
{ { $as_echo "$as_me:${as_lineno-$LINENO}: : CPPFLAGS already contains \$flag"; } >&5
(: CPPFLAGS already contains $flag) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
;;
*)
{ { $as_echo "$as_me:${as_lineno-$LINENO}: : CPPFLAGS=\"\$CPPFLAGS \$flag\""; } >&5
(: CPPFLAGS="$CPPFLAGS $flag") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
CPPFLAGS="$CPPFLAGS $flag"
;;
esac
else
CPPFLAGS="$flag"
fi

else
:
fi

done


FEATURES=""
# Check whether --enable-release was given.
if test "${enable_release+set}" = set; then :
Expand Down Expand Up @@ -17752,63 +17874,6 @@ done

# Provide additional defaults for user variables

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts " >&5
$as_echo_n "checking whether C++ compiler accepts ... " >&6; }
if ${ax_cv_check_cxxflags__+:} false; then :
$as_echo_n "(cached) " >&6
else

ax_check_save_flags=$CXXFLAGS
CXXFLAGS="$CXXFLAGS "
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

int
main ()
{

;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
ax_cv_check_cxxflags__=yes
else
ax_cv_check_cxxflags__=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CXXFLAGS=$ax_check_save_flags
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags__" >&5
$as_echo "$ax_cv_check_cxxflags__" >&6; }
if test x"$ax_cv_check_cxxflags__" = xyes; then :
:
else
:
fi

if ${CXXFLAGS+:} false; then :
case " $CXXFLAGS " in
*" "*)
{ { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS already contains "; } >&5
(: CXXFLAGS already contains ) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
;;
*)
{ { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS=\"\$CXXFLAGS \""; } >&5
(: CXXFLAGS="$CXXFLAGS ") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
CXXFLAGS="$CXXFLAGS "
;;
esac
else
CXXFLAGS=""
fi



for flag in -rdynamic; do
Expand Down
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ AC_CONFIG_HEADERS([config.h include/GyotoConfig.h])
VERSINFO=4:0:0
AC_SUBST([VERSINFO])

# Needed for gcc-5, should be harmless for other compilers:
AX_APPEND_COMPILE_FLAGS([-P], [CPPFLAGS])

FEATURES=""
AC_ARG_ENABLE([release],
[AS_HELP_STRING([--enable-release],
Expand Down

0 comments on commit 06d6c42

Please sign in to comment.