;;
esac
+# If we have g++, we cannot have the -Wdeclaration-after-statement.
+# Some g++s accept it but then whine about it with every file.
+case "$cc" in
+*g++*) warn="`echo $warn|sed 's/-Wdeclaration-after-statement/ /'`" ;;
+esac
+
+extra=''
+
+# C and C++ have different rules for const strings;
+# without the -fno-const-strings g++ cannot handle our habit
+# of mixing char literals and char pointers.
+case "$cc" in
+*g++*) extra="$extra -fno-const-strings" ;;
+esac
stdflags=''
warn="$warn"
# Extra standardness.
stdflags="$stdflags"
+# Extra extra.
+extra="$extra"
!GROK!THIS!
fi
: Can we perhaps use $ansi2knr here
- echo "$cc -c -DPERL_CORE $ccflags $stdflags $optimize $warn"
- eval "$also "'"$cc -DPERL_CORE -c $ccflags $stdflags $optimize $warn"'
+ echo "$cc -c -DPERL_CORE $ccflags $stdflags $optimize $warn $extra"
+ eval "$also "'"$cc -DPERL_CORE -c $ccflags $stdflags $optimize $warn $extra"'
. $TOP/config.sh
/* Test for whether ELF binaries are produced */
#include <fcntl.h>
#include <stdlib.h>
+#include <unistd.h>
main() {
char buffer[4];
int i=open("a.out",O_RDONLY);
libswanted="$*"
;;
esac
+
+# If we are using g++ we must use nm and force ourselves to use
+# the /usr/lib/libc.a (resetting the libc below to an empty string
+# makes Configure to look for the right one) because the symbol
+# scanning tricks of Configure will crash and burn horribly.
+case "$cc" in
+*g++*) usenm=true
+ libc=''
+ ;;
+esac
+
# endif
#endif
-#if defined(PERL_GCC_PEDANTIC)
+/* gcc (-ansi) -pedantic doesn't allow gcc brace groups,
+ * g++ allows them but seems to have problems with them
+ * (insane errors ensue). */
+#if defined(PERL_GCC_PEDANTIC) || (defined(__GNUC__) && defined(__cplusplus))
# ifndef PERL_GCC_BRACE_GROUPS_FORBIDDEN
# define PERL_GCC_BRACE_GROUPS_FORBIDDEN
# endif