summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtes <ludo@chbouib.org>2007-06-06 17:00:00 +0200
committerLudovic Courtes <ludo@chbouib.org>2007-06-06 17:00:00 +0200
commitbefacfea1d24f2b6b43ecdf12a22f47b160f39b6 (patch)
treea2c1344b043ec991e9d016f7b6f2674f608c2f36
parent83de5ed4aa6a91b1223d4117e7cfef691b87d97e (diff)
downloadgnutls-befacfea1d24f2b6b43ecdf12a22f47b160f39b6.tar.gz
Fixed the `-Wno-strict-prototypes' issue in Guile code.
* configure.in: Add all custom CFLAGS to `AM_CFLAGS' rather than `CFLAGS', except for `-D_REENTRANT -D_THREAD_SAFE' which must be present during feature tests. Substitute `AM_CFLAGS'. * src/Makefile.am (libguile_gnutls_v_0_la_CFLAGS): Added `$(AM_CFLAGS)'. (libguile_gnutls_extra_v_0_la_CFLAGS): Likewise. (AM_CFLAGS): When GCC is used, add `-Wno-strict-prototypes'.
-rw-r--r--configure.in19
-rw-r--r--guile/src/Makefile.am8
2 files changed, 16 insertions, 11 deletions
diff --git a/configure.in b/configure.in
index b5fccfe240..e753a06e67 100644
--- a/configure.in
+++ b/configure.in
@@ -58,6 +58,7 @@ AC_SUBST(NUMBER_VERSION, `printf "0x%02x%02x%02x" $MAJOR_VERSION $MINOR_VERSION
dnl In order to use the reentrant libc functions.
dnl I hope it is portable enough.
CFLAGS="${CFLAGS} -D_REENTRANT -D_THREAD_SAFE"
+AM_CFLAGS="${CFLAGS}"
opt_dmalloc_mode=no
AC_MSG_CHECKING([whether in dmalloc mode])
@@ -194,17 +195,17 @@ return 0;
if test $ac_cv_c_compiler_gnu != no; then
if test x$opt_developer_mode = xyes; then
- CFLAGS="${CFLAGS} -g -Wall -Wcast-align -W -Wpointer-arith -Wchar-subscripts -Wformat-security -Wno-format-y2k -Wmissing-braces -Winline -Wstrict-prototypes -Wno-unused-parameter"
-# CFLAGS="${CFLAGS} -g -W -Wall -Wcast-align -Wpointer-arith -Wchar-subscripts -Wformat-security -Wno-format-y2k -Wmissing-braces -Winline -Wstrict-prototypes -Wshadow -Wno-unused-parameter -Wimplicit -fno-common -Wno-sign-compare -Wbad-function-cast -Wendif-labels -Wmissing-declarations -Wno-missing-format-attribute -Wmissing-prototypes -Wnested-externs -Wpointer-arith -pedantic -Wlong-long -Wcast-qual -Wcast-align -Winline -Wredundant-decls -Wstrict-prototypes -Wwrite-strings -Wparentheses -Wsequence-point -Wpacked -Waggregate-return -Wfloat-equal -Wmultichar -Wunknown-pragmas -Wtrigraphs -Wswitch -Wreturn-type -Wmain -Wchar-subscripts -Wcomment -Wno-missing-noreturn"
+ AM_CFLAGS="${AM_CFLAGS} -g -Wall -Wcast-align -W -Wpointer-arith -Wchar-subscripts -Wformat-security -Wno-format-y2k -Wmissing-braces -Winline -Wstrict-prototypes -Wno-unused-parameter"
+# AM_CFLAGS="${AM_CFLAGS} -g -W -Wall -Wcast-align -Wpointer-arith -Wchar-subscripts -Wformat-security -Wno-format-y2k -Wmissing-braces -Winline -Wstrict-prototypes -Wshadow -Wno-unused-parameter -Wimplicit -fno-common -Wno-sign-compare -Wbad-function-cast -Wendif-labels -Wmissing-declarations -Wno-missing-format-attribute -Wmissing-prototypes -Wnested-externs -Wpointer-arith -pedantic -Wlong-long -Wcast-qual -Wcast-align -Winline -Wredundant-decls -Wstrict-prototypes -Wwrite-strings -Wparentheses -Wsequence-point -Wpacked -Waggregate-return -Wfloat-equal -Wmultichar -Wunknown-pragmas -Wtrigraphs -Wswitch -Wreturn-type -Wmain -Wchar-subscripts -Wcomment -Wno-missing-noreturn"
fi
AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
- _gcc_cflags_save=$CFLAGS
- CFLAGS="${CFLAGS} -Wno-pointer-sign"
+ _gcc_cflags_save=$AM_CFLAGS
+ AM_CFLAGS="${AM_CFLAGS} -Wno-pointer-sign"
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_psign=yes,_gcc_psign=no)
AC_MSG_RESULT($_gcc_psign)
if test x"$_gcc_psign" != xyes ; then
- CFLAGS=$_gcc_cflags_save;
+ AM_CFLAGS=$_gcc_cflags_save;
fi
AC_MSG_CHECKING([if gcc/ld supports -Wl,--output-def])
@@ -227,7 +228,7 @@ if test $ac_cv_c_compiler_gnu != no; then
AC_MSG_CHECKING([whether we have GNU assembler])
GAS=`as --version < /dev/null 2>/dev/null | grep GNU`
if test "$GAS"; then
- CFLAGS="${CFLAGS} -pipe"
+ AM_CFLAGS="${AM_CFLAGS} -pipe"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
@@ -650,13 +651,13 @@ AC_SUBST(LIBGNUTLS_EXTRA_LIBS)
AC_SUBST(LIBGNUTLS_EXTRA_CFLAGS)
export ac_full
-CFLAGS="${CFLAGS} ${LIBGCRYPT_CFLAGS}"
+AM_CFLAGS="${AM_CFLAGS} ${LIBGCRYPT_CFLAGS}"
if test $ac_cv_c_compiler_gnu != no; then
if test x$opt_profiler_mode = xyes; then
AC_CHECK_PROG(FC_OK, fc-config, yes, no)
if test x$FC_OK = xyes; then
- CFLAGS="${CFLAGS} `fc-config --cflags`"
+ AM_CFLAGS="${AM_CFLAGS} `fc-config --cflags`"
LIBS="$LIBS `fc-config --libs`"
else
AC_MSG_WARN(***
@@ -673,6 +674,8 @@ if test $ac_full -eq 0; then
#endif /* __GNUC__ */]])
fi
+AC_SUBST(AM_CFLAGS)
+
AC_CONFIG_COMMANDS([chmod-config],[[
chmod +x lib/libgnutls-config
chmod +x libextra/libgnutls-extra-config
diff --git a/guile/src/Makefile.am b/guile/src/Makefile.am
index 0550652413..c86e3f8cd8 100644
--- a/guile/src/Makefile.am
+++ b/guile/src/Makefile.am
@@ -39,12 +39,14 @@ GNULIB_CFLAGS = -I$(top_builddir)/lgl -I$(top_srcdir)/lgl
libguile_gnutls_v_0_la_SOURCES = core.c errors.c utils.c
libguile_gnutls_v_0_la_CFLAGS = \
+ $(AM_CFLAGS) \
$(GNULIB_CFLAGS) $(GUILE_CFLAGS) $(LIBGNUTLS_CFLAGS)
libguile_gnutls_v_0_la_LDFLAGS = \
$(GNULIB_LDFLAGS) $(GUILE_LDFLAGS) $(LIBGNUTLS_LIBS)
libguile_gnutls_extra_v_0_la_SOURCES = extra.c
libguile_gnutls_extra_v_0_la_CFLAGS = \
+ $(AM_CFLAGS) \
$(GNULIB_CFLAGS) $(GUILE_CFLAGS) \
$(LIBGNUTLS_CFLAGS) $(LIBGNUTLS_EXTRA_CFLAGS)
libguile_gnutls_extra_v_0_la_LDFLAGS = \
@@ -57,9 +59,9 @@ AM_CPPFLAGS = -I$(top_builddir) -I$(builddir)
if HAVE_GCC
# Generated `.x' files and Guile's `scm_c_define_gsubr ()' require
-# `-Wno-strict-prototypes'.
-libguile_gnutls_v_0_la_CFLAGS += -Wno-strict-prototypes
-libguile_gnutls_extra_v_0_la_CFLAGS += -Wno-strict-prototypes
+# `-Wno-strict-prototypes'. This trick makes sure `-Wno-s-p' appears
+# after `-Ws-p'.
+AM_CFLAGS += -Wno-strict-prototypes
endif