|
|
|
@ -23,6 +23,26 @@ AM_INIT_AUTOMAKE([-Wall -Wno-portability -Wno-override foreign dist-bzip2 tar-us
|
|
|
|
|
dnl enable with --enable-silent-rules or make V=0 (needs automake >= 1.11)
|
|
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl @synopsis TRY_CFLAGS [compiler flags]
|
|
|
|
|
dnl @summary check whether compiler supports given C flags and adds them to CFLAGS
|
|
|
|
|
AC_DEFUN([TRY_CFLAGS],
|
|
|
|
|
[dnl
|
|
|
|
|
AC_MSG_CHECKING([if $CC supports $1])
|
|
|
|
|
AC_LANG_PUSH([C])
|
|
|
|
|
ac_try_cflags_saved_cflags="${CFLAGS}"
|
|
|
|
|
CFLAGS="${CFLAGS} $1"
|
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
|
|
|
|
|
[AC_MSG_RESULT([yes])],
|
|
|
|
|
[
|
|
|
|
|
AC_MSG_ERROR([no])
|
|
|
|
|
CFLAGS="${ac_try_cflags_saved_cflags}"
|
|
|
|
|
]
|
|
|
|
|
)
|
|
|
|
|
AC_LANG_POP([C])
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl Checks for programs.
|
|
|
|
|
AC_PROG_CC
|
|
|
|
|
AM_PROG_CC_C_O
|
|
|
|
@ -394,7 +414,7 @@ if test "$WITH_FAM" != "no"; then
|
|
|
|
|
LIBS=$FAM_LIBS
|
|
|
|
|
AC_CHECK_FUNCS([FAMNoExists])
|
|
|
|
|
LIBS=$OLD_LIBS
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if test x$FAM_LIBS = x; then
|
|
|
|
|
AC_MSG_ERROR([fam/gamin-headers and/or libs where not found, install them or build with --without-fam])
|
|
|
|
|
fi
|
|
|
|
@ -622,7 +642,8 @@ AM_CONDITIONAL(CHECK_WITH_FASTCGI, test "x$fastcgi_found" = xyes)
|
|
|
|
|
|
|
|
|
|
dnl check for extra compiler options (warning options)
|
|
|
|
|
if test "${GCC}" = "yes"; then
|
|
|
|
|
CFLAGS="${CFLAGS} -Wall -W -Wshadow -pedantic -std=gnu99"
|
|
|
|
|
TRY_CFLAGS([-Wall -W -Wshadow -pedantic])
|
|
|
|
|
TRY_CFLAGS([-std=gnu99])
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(extra-warnings,
|
|
|
|
@ -634,7 +655,7 @@ AC_ARG_ENABLE(extra-warnings,
|
|
|
|
|
esac],[extrawarnings=false])
|
|
|
|
|
|
|
|
|
|
if test x$extrawarnings = xtrue; then
|
|
|
|
|
CFLAGS="${CFLAGS} -g -O2 -g2 -Wall -Wmissing-declarations -Wdeclaration-after-statement -Wno-pointer-sign -Wcast-align -Winline -Wsign-compare -Wnested-externs -Wpointer-arith -Wl,--as-needed -Wformat-security"
|
|
|
|
|
TRY_CFLAGS([-g -O2 -g2 -Wall -Wmissing-declarations -Wdeclaration-after-statement -Wcast-align -Winline -Wsign-compare -Wnested-externs -Wpointer-arith -Wl,--as-needed -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security])
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
dnl build version-id
|
|
|
|
|