diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 1997-03-11 09:25:23 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 1997-03-11 09:25:23 +0000 |
commit | f13ce4a3df625f62b80517cd8d075b419b5083b4 (patch) | |
tree | 268a3caf5ee249a25ab7bb6b3dc7012e278fba9f | |
parent | 2cdc5ac5eb1f8ac792eb4c0d0efd13602fc570bf (diff) |
Nettoyage choix du compilo C
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1368 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | config/auto-aux/gcctest.c | 8 | ||||
-rwxr-xr-x | configure | 69 |
2 files changed, 34 insertions, 43 deletions
diff --git a/config/auto-aux/gcctest.c b/config/auto-aux/gcctest.c deleted file mode 100644 index 19905a413..000000000 --- a/config/auto-aux/gcctest.c +++ /dev/null @@ -1,8 +0,0 @@ -int main() -{ -#ifdef __GNUC__ - exit(0); -#else - exit(1); -#endif -} @@ -82,16 +82,41 @@ if test -z "$cc"; then fi fi -export cc cclibs +# Configure the bytecode compiler -# Is cc/gcc the GNU C compiler? +bytecc="$cc" +bytecccompopts="" +bytecclinkopts="" -if sh runtest gcctest.c; then - echo "We're using the GNU C compiler" - gcc=yes -else - gcc=no -fi +case "$bytecc,$host" in + gcc,*-*-nextstep*) + # GNU C extensions disabled, but __GNUC__ still defined! + bytecccompopts="-fno-defer-pop -Wall -U__GNUC__ -posix" + bytecclinkopts="-posix";; + gcc,alpha-*-osf*) + bytecccompopts="-fno-defer-pop -Wall" + # -taso puts code in lower 4GB + bytecclinkopts="-Xlinker -taso";; + gcc*) + bytecccompopts="-fno-defer-pop -Wall";; + cc,mips-*-irix*) + # Add -32 flag to ensure compatibility with native-code compiler + bytecccompopts="-32" + # Turn off warning "unused library" + bytecclinkopts="-32 -Wl,-woff,84";; + cc*,mips-*-irix*) + # Turn off warning "unused library" + bytecclinkopts="-Wl,-woff,84";; +esac + +echo "BYTECC=$bytecc" >> Makefile +echo "BYTECCCOMPOPTS=$bytecccompopts" >> Makefile +echo "BYTECCLINKOPTS=$bytecclinkopts" >> Makefile + +# Configure compiler to use in further tests + +cc="$bytecc $bytecclinkopts" +export cc cclibs # Check the sizes of data types @@ -151,32 +176,6 @@ case $? in echo "#define ARCH_ALIGN_DOUBLE" >> m.h;; esac -# Configure the bytecode compiler - -bytecc="$cc" -bytecccompopts="" -bytecclinkopts="" - -case "$bytecc,$host" in - gcc,*-*-nextstep*) - bytecccompopts="-fno-defer-pop -Wall -U__GNUC__ -posix" - bytecclinkopts="-posix";; - gcc,alpha-*-osf*) - bytecccompopts="-fno-defer-pop -Wall" - bytecclinkopts="-Xlinker -taso";; - gcc*) - bytecccompopts="-fno-defer-pop -Wall";; - cc,mips-*-irix*) - bytecccompopts="-32" - bytecclinkopts="-Wl,-woff,84";; - cc*,mips-*-irix*) - bytecclinkopts="-Wl,-woff,84";; -esac - -echo "BYTECC=$bytecc" >> Makefile -echo "BYTECCCOMPOPTS=$bytecccompopts" >> Makefile -echo "BYTECCLINKOPTS=$bytecclinkopts" >> Makefile - # Configure the native-code compiler arch=none @@ -217,7 +216,7 @@ case "$arch,$nativecc,$system" in mips,cc,irix) nativecccompopts=-32 nativecclinkopts="-32 -Wl,-woff,84";; mips,cc,ultrix) nativecccompopts=-std;; - *,*,nextstep) nativecccompopts="-Wall -posix" + *,*,nextstep) nativecccompopts="-Wall -U__GNUC__ -posix" nativecclinkopts="-posix";; *,gcc,*) nativecccompopts=-Wall;; esac |