## (and hence PIE off) and hope bug 16 remains fixed
SXE_CHECK_COMPILER_FLAGS([-nopie],
[featflags="$featflags -nopie"])
+
+ ## icc and gcc related
+ ## check if some stuff can be staticalised
+ ## actually requires SXE_WARNFLAGS so warnings would be disabled
+ ## that affect the outcome of the following tests
+ SXE_CHECK_COMPILER_FLAGS([-static-intel], [
+ featflags="${featflags} -static-intel"], [:], [${SXE_CFLAGS}])
+ SXE_CHECK_COMPILER_FLAGS([-static-libgcc], [
+ featflags="${featflags} -static-libgcc"], [:], [${SXE_CFLAGS}])
])dnl SXE_FEATFLAGS
##### http://autoconf-archive.cryp.to/ax_check_compiler_flags.html
## renamed the prefix to SXE_
AC_DEFUN([SXE_CHECK_COMPILER_FLAGS], [dnl
+dnl SXE_CHECK_COMPILER_FLAGS(<FLAG>, <ACTION-IF-FOUND>, <ACTION-IF-NOT-FOUND>,
+dnl <ADDITIONAL-FLAGS>)
AC_MSG_CHECKING([whether _AC_LANG compiler accepts $1])
dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
AS_LITERAL_IF([$1], [
AC_CACHE_VAL(AS_TR_SH(sxe_cv_[]_AC_LANG_ABBREV[]_flags_$1), [
sxe_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
- _AC_LANG_PREFIX[]FLAGS="$1"
+ _AC_LANG_PREFIX[]FLAGS="$4 $1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
AS_TR_SH(sxe_cv_[]_AC_LANG_ABBREV[]_flags_$1)="yes",
AS_TR_SH(sxe_cv_[]_AC_LANG_ABBREV[]_flags_$1)="no")
_AC_LANG_PREFIX[]FLAGS=$sxe_save_FLAGS])], [
sxe_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
- _AC_LANG_PREFIX[]FLAGS="$1"
+ _AC_LANG_PREFIX[]FLAGS="$4 $1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
eval AS_TR_SH(sxe_cv_[]_AC_LANG_ABBREV[]_flags_$1)="yes",
eval AS_TR_SH(sxe_cv_[]_AC_LANG_ABBREV[]_flags_$1)="no")
SXE_DEBUGFLAGS
SXE_WARNFLAGS
SXE_OPTIFLAGS
+ SXE_CFLAGS="$debugflags $optiflags $warnflags"
+
SXE_FEATFLAGS
SXE_CFLAGS="$debugflags $featflags $optiflags $warnflags"
+
elif test "$CFLAGS_uspecified_p" = "no" -o \
"$ac_test_CFLAGS" != "set"; then
SXE_DEBUGFLAGS
SXE_WARNFLAGS
- SXE_FEATFLAGS
## the old settings
## Following values of CFLAGS are known to work well.
optiflags="-O"])
fi
+ SXE_CFLAGS="$debugflags $optiflags $warnflags"
+
+ SXE_FEATFLAGS
SXE_CFLAGS="$debugflags $featflags $optiflags $warnflags"
else
SXE_CFLAGS=${USER_CFLAGS}
SXE_CHECK_LD_ZFLAG([lazy])
SXE_CHECK_LD_ZFLAG([now])
- ## icc related
- ## default flags for needed features
- SXE_CHECK_LINKER_FLAGS([-static-intel], [
- ldflags="${ldflags} ${XFLAG} -static-intel"])
- SXE_CHECK_LINKER_FLAGS([-static-libgcc], [
- ldflags="${ldflags} ${XFLAG} -static-libgcc"])
-
LDFLAGS="${ldflags} ${ac_cv_env_LDFLAGS_value}"
AC_MSG_CHECKING([for preferred LDFLAGS])
AC_MSG_RESULT([${LDFLAGS}])