Hello,

David Reiser <[EMAIL PROTECTED]> writes:

> cc1: error: unrecognized command line option "-fgnu89-inline"

Damn it, I just noticed that this option appeared in GCC 4.1.3 [0].  The
attached patch (applied to `master') fixes it (Simon: can you apply it
to other branches as well, if needed?).

What version of GCC are you using?  Can you list all the compilation
options that are actually used when compiling things under `guile/src'?

BTW, is there any reason why GnuTLS is now compiled in C99 mode?  It
doesn't seem to be explicitly set in `configure.in', so maybe some
Gnulib module requires it somehow?

Thanks for your help,
Ludovic.

[0] http://gcc.gnu.org/ml/gcc-patches/2007-03/msg00793.html
    The documentation also states that the actual "inline" semantic
    change occurs starting with GCC 4.3.

>From d5b3b9c5b4cd118cb3229f3b64d8bda146bf7b1b Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Ludovic=20Court=C3=A8s?= <[EMAIL PROTECTED]>
Date: Thu, 20 Mar 2008 09:25:33 +0100
Subject: [PATCH] Check whether `-fgnu89-inline' is supported before using it.

* configure.in: Check for `-fgnu89-inline', define Automake conditional
  `HAVE_GCC_GNU89_INLINE_OPTION'.

* guile/src/Makefile.am (AM_CFLAGS): Only use `-fgnu89-inline' when
  `HAVE_GCC_GNU89_INLINE_OPTION' is true.
---
 configure.in          |   14 ++++++++++++--
 guile/src/Makefile.am |    8 +++++++-
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/configure.in b/configure.in
index de5860e..4d0d3a9 100644
--- a/configure.in
+++ b/configure.in
@@ -151,7 +151,7 @@ if test $ac_cv_c_compiler_gnu != no; then
 #	  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])
+	AC_MSG_CHECKING([whether gcc supports -Wno-pointer-sign])
 	_gcc_cflags_save=$CFLAGS
 	CFLAGS="${CFLAGS} -Wno-pointer-sign"
 	AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_psign=yes,_gcc_psign=no)
@@ -160,7 +160,17 @@ if test $ac_cv_c_compiler_gnu != no; then
 	  CFLAGS=$_gcc_cflags_save;
 	fi
 
-	AC_MSG_CHECKING([if gcc/ld supports -Wl,--output-def])
+	AC_MSG_CHECKING([whether gcc supports -fgnu89-inline])
+	_gcc_cflags_save="$CFLAGS"
+	CFLAGS="${CFLAGS} -fgnu89-inline"
+	AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),
+	  _gcc_gnu89_inline=yes, _gcc_gnu89_inline=no)
+	AC_MSG_RESULT($_gcc_gnu89_inline)
+	AM_CONDITIONAL([HAVE_GCC_GNU89_INLINE_OPTION],
+	  [test "x$_gcc_gnu89_inline" = "xyes"])
+	CFLAGS=$_gcc_cflags_save;
+
+	AC_MSG_CHECKING([whether gcc/ld supports -Wl,--output-def])
 	_gcc_ldflags_save=$LDFLAGS
 	LDFLAGS="-Wl,--output-def,foo.def"
 	AC_LINK_IFELSE(AC_LANG_PROGRAM([]),output_def=yes,output_def=no)
diff --git a/guile/src/Makefile.am b/guile/src/Makefile.am
index f50b5c2..9bcaf63 100644
--- a/guile/src/Makefile.am
+++ b/guile/src/Makefile.am
@@ -68,10 +68,16 @@ if HAVE_GCC
 # after `-Ws-p'.
 AM_CFLAGS += -Wno-strict-prototypes
 
+# The `-fgnu89-inline' option appeared in GCC 4.1.3.
+if HAVE_GCC_GNU89_INLINE_OPTION
+
 # Guile and GMP currently rely on GNU inline semantics, not C99 inline.
 AM_CFLAGS += -fgnu89-inline
 
-endif
+endif HAVE_GCC_GNU89_INLINE_OPTION
+
+endif HAVE_GCC
+
 
 enums.h: $(srcdir)/make-enum-header.scm
 	$(GUILE_FOR_BUILD) $^ > $@
-- 
1.5.4.4

_______________________________________________
Help-gnutls mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gnutls

Reply via email to