]> granicus.if.org Git - libexpat/commitdiff
Be more careful about deciding which filemap implementation to use for
authorFred L. Drake, Jr. <fdrake@users.sourceforge.net>
Fri, 9 Nov 2001 04:19:01 +0000 (04:19 +0000)
committerFred L. Drake, Jr. <fdrake@users.sourceforge.net>
Fri, 9 Nov 2001 04:19:01 +0000 (04:19 +0000)
xmlwf.  Part of SF patch #465018.

Only add the -fexceptions option when the version of GCC we're using
actually supports it.  This relates to & partially solves SF bug #445893;
see also SF bug #419585 for why the option was originally added.

expat/configure.in

index 12b7472f0fd87275608eae1d690ff46b24fec49c..436e3a351b3df65274c0911ae5c887eba7451329 100644 (file)
@@ -46,11 +46,19 @@ AC_PROG_CC
 AC_PROG_INSTALL
 
 if test "$GCC" = yes ; then
-    CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions"
+    dnl
+    dnl Be careful about adding the -fexceptions option; some versions of
+    dnl don't support it and it causes extra warnings that are only
+    dnl distracting; avoid.
+    dnl
+    OLDCFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes"
+    CFLAGS="$OLDCFLAGS -fexceptions"
+    AC_MSG_CHECKING(whether gcc accepts -fexceptions)
+    AC_TRY_COMPILE(,(void)1,
+                   AC_MSG_RESULT(yes),
+                   AC_MSG_RESULT(no); CFLAGS="$OLDCFLAGS")
 fi
 
-dnl Checks for libraries.
-
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS(fcntl.h unistd.h)
@@ -70,7 +78,7 @@ dnl Checks for library functions.
 AC_FUNC_MEMCMP
 AC_FUNC_MMAP
 
-if test -z "$HAVE_MMAP"; then
+if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then
     FILEMAP_OBJ=unixfilemap.o
 else
     FILEMAP_OBJ=readfilemap.o