]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Fixed the `-Wno-strict-prototypes' issue in Guile code.
authorLudovic Courtes <ludo@chbouib.org>
Wed, 6 Jun 2007 15:00:00 +0000 (17:00 +0200)
committerLudovic Courtes <ludo@chbouib.org>
Wed, 6 Jun 2007 15:00:00 +0000 (17:00 +0200)
* 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'.

configure.in
guile/src/Makefile.am

index b5fccfe240f72984e2eb7f385606f0acdfd67a98..e753a06e6765228da5b1c724c99a583ffb532080 100644 (file)
@@ -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
index 05506524134ed7f726b4f9713ed7e488f946e79f..c86e3f8cd899e94232ffeac8af450eb33a000d01 100644 (file)
@@ -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