From: Jarkko Hietaniemi Date: Wed, 13 Sep 2006 20:19:04 +0000 (+0300) Subject: (1) g++ 4.x (or Mac OS X) (2) Solaris g++ or CC X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7e827271d645402804a156e9a8b9edddac65bd6a;p=p5sagit%2Fp5-mst-13.2.git (1) g++ 4.x (or Mac OS X) (2) Solaris g++ or CC Message-ID: <45083D88.7050207@iki.fi> Plus a tweak to the name of CC. p4raw-id: //depot/perl@28842 --- diff --git a/cflags.SH b/cflags.SH index cc369d9..966901a 100755 --- a/cflags.SH +++ b/cflags.SH @@ -225,7 +225,26 @@ for file do esac case "$cc" in -*g++*) ccflags="`echo $ccflags|sed 's/-Wdeclaration-after-statement/ /'`" ;; +*g++*) + # We need to remove this also in here (removed early earlier). + ccflags="`echo $ccflags|sed 's/-Wdeclaration-after-statement/ /'`" + ;; +esac + +case "$cc" in +*g++*) + # Without -Wno-unused-variable g++ 4.x compiles are rather unwatchable + # because of all the warnings about Perl___notused, and g++ doesn't + # do __attribute__((unused)) (and even if at some stage it will), people + # do have older gcc installations. Yes, we lose some valid warnings. + for o in -Wno-unused-variable + do + case "$warn" in + *$o*) ;; + *) warn="$warn $o" ;; + esac + done + ;; esac if test -f .patch; then diff --git a/hints/solaris_2.sh b/hints/solaris_2.sh index d4549e3..fcb7233 100644 --- a/hints/solaris_2.sh +++ b/hints/solaris_2.sh @@ -645,19 +645,6 @@ rm -f try.c try.o try a.out # a delicate spot in Configure, so easier just to force our guess here # for Solaris. case "$cc" in -*g++*|/opt/SUNWspro/bin/CC) d_dlopen='define' ;; -esac - -# The Sun C++ doesn't define the global environ array. -case "$cc" in -/opt/SUNWspro/bin/CC) - for o in NO_ENVIRON_ARRAY PERL_USE_SAFE_PUTENV - do - case "$ccflags" in - *$o*) ;; - *) ccflags="$ccflags $o" ;; - esac - done - ;; +*g++*|*CC*) d_dlopen='define' ;; esac diff --git a/perl.h b/perl.h index 5dab0f8..0f71630 100644 --- a/perl.h +++ b/perl.h @@ -1150,15 +1150,16 @@ int sockatmark(int); # endif #endif -#if defined(__osf__) && defined(__cplusplus) && !defined(_XOPEN_SOURCE_EXTENDED) +#if defined(__osf__) && defined(__cplusplus) && !defined(_XOPEN_SOURCE_EXTENDED) /* Tru64 "cxx" (C++), see hints/dec_osf.sh for why the _XOPEN_SOURCE_EXTENDED cannot be defined. */ EXTERN_C int fchdir(int); EXTERN_C int flock(int, int); EXTERN_C int fseeko(FILE *, off_t, int); EXTERN_C off_t ftello(FILE *); #endif -#if defined(__SUNPRO_CC) +#if defined(__SUNPRO_CC) /* SUNWspro CC (C++) */ EXTERN_C char *crypt(const char *, const char *); +EXTERN_C char **environ; #endif #ifdef SETERRNO