Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overwriting of CFLAGS #4

Merged
merged 1 commit into from
Apr 20, 2011
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 23 additions & 19 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -101,26 +101,30 @@ AC_SUBST(ESPRESSO_MPIEXEC)
##################################
#### COMPILER CHARACTERISTICS ####
##################################
# test for -O5
AC_MSG_CHECKING([whether the compiler accepts -O5])
saved_CFLAGS=$CFLAGS
CFLAGS="-O5 $CFLAGS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[
AC_MSG_RESULT(yes);try_add_flag_res=yes
],[
AC_MSG_RESULT(no); CFLAGS=$saved_CFLAGS; try_add_flag_res=no
])

##################################
# test for -Wall
AC_MSG_CHECKING([whether the compiler accepts -Wall])
saved_CFLAGS=$CFLAGS
CFLAGS="-Wall $CFLAGS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[
AC_MSG_RESULT(yes);try_add_flag_res=yes
],[
AC_MSG_RESULT(no); CFLAGS=$saved_CFLAGS; try_add_flag_res=no
])
#never overwrite users CFLAGS
if test ${CFLAGS+set} != set; then
# test for -O5
AC_MSG_CHECKING([whether the compiler accepts -O5])
saved_CFLAGS=$CFLAGS
CFLAGS="-O5 $CFLAGS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[
AC_MSG_RESULT(yes);try_add_flag_res=yes
],[
AC_MSG_RESULT(no); CFLAGS=$saved_CFLAGS; try_add_flag_res=no
])

##################################
# test for -Wall
AC_MSG_CHECKING([whether the compiler accepts -Wall])
saved_CFLAGS=$CFLAGS
CFLAGS="-Wall $CFLAGS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[
AC_MSG_RESULT(yes);try_add_flag_res=yes
],[
AC_MSG_RESULT(no); CFLAGS=$saved_CFLAGS; try_add_flag_res=no
])
fi

##################################
# test inlining
Expand Down