diff options
author | Erlang/OTP <[email protected]> | 2010-02-10 09:20:00 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-02-10 09:20:00 +0000 |
commit | 7c0ca6e0bd1025c06358a154c26dd59629e94162 (patch) | |
tree | 54e5ff7a43a06a1baa0832c3733121f2ea994b09 /erts | |
parent | 29262ef2477ac656bf19073f90a742c23a7bb789 (diff) | |
parent | cad901a54fa7d0eb3ad17270a08d4824d50cfd51 (diff) | |
download | otp-7c0ca6e0bd1025c06358a154c26dd59629e94162.tar.gz otp-7c0ca6e0bd1025c06358a154c26dd59629e94162.tar.bz2 otp-7c0ca6e0bd1025c06358a154c26dd59629e94162.zip |
Merge branch 'pan/enable_m32_build' into ccase/r13b04_dev
* pan/enable_m32_build:
Teach configure --enable-m32-build for forcing a 32-bit build
OTP-8415 configure learned the option --enable-m32-build to force the
building of a 32-bit run-time on systems where the default C
compiler generates 64-bit executables by default.
Diffstat (limited to 'erts')
-rw-r--r-- | erts/configure.in | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/erts/configure.in b/erts/configure.in index a3b6fe319f..f4ee1fe935 100644 --- a/erts/configure.in +++ b/erts/configure.in @@ -226,6 +226,19 @@ AC_ARG_ENABLE(m64-build, esac ],enable_m64_build=no) +AC_ARG_ENABLE(m32-build, +[ --enable-m32-build build 32bit binaries using the -m32 flag to (g)cc], +[ case "$enableval" in + no) enable_m32_build=no ;; + *) + if test X${enable_darwin_64bit} = Xyes -o X${enable_m64_build} = Xyes; + then + AC_MSG_ERROR([(--enable-darwin-64bit or --enable-m64-build) and --enable-m32-build are mutually exclusive]) ; + fi ; + enable_m32_build=yes ;; + esac +],enable_m32_build=no) + AC_ARG_ENABLE(fixalloc, [ --disable-fixalloc disable the use of fix_alloc]) if test x${enable_fixalloc} = xno ; then @@ -335,6 +348,17 @@ else esac ;; *) + if test X${enable_m32_build} = Xyes; + then + enable_hipe=no; + case $CFLAGS in + *-m32*) + ;; + *) + CFLAGS="-m32 $CFLAGS" + ;; + esac ; + fi ;; esac fi @@ -432,6 +456,35 @@ CFLAGS="$CFLAGS $extra_flags" DEBUG_CFLAGS="-g $CPPFLAGS $extra_flags" DEBUG_FLAGS=-g +dnl +dnl Adjust DEBUG_CFLAGS to match CFLAGS in terms of -m +dnl + +case $CFLAGS in + *-m64*) + case $DEBUG_CFLAGS in + *-m64*) + ;; + *) + DEBUG_CFLAGS="-m64 $DEBUG_CFLAGS" + ;; + esac + ;; + *-m32*) + case $DEBUG_CFLAGS in + *-m32*) + ;; + *) + DEBUG_CFLAGS="-m32 $DEBUG_CFLAGS" + ;; + esac + ;; + *) + ;; +esac + + + CFLAG_RUNTIME_LIBRARY_PATH="-Wl,-R" case $host_os in darwin*) @@ -664,6 +717,16 @@ case $ARCH-$OPSYS in LDFLAGS="-m64 $LDFLAGS" ;; esac + fi; + if test X${enable_m32_build} = Xyes; then + AC_MSG_NOTICE([Adjusting LDFLAGS to use -m32]) ; + case $LDFLAGS in + *-m32*) + ;; + *) + LDFLAGS="-m32 $LDFLAGS" + ;; + esac ; fi ;; esac @@ -3220,6 +3283,9 @@ case $host_os in DED_LDFLAGS="-shared -Wl,-Bsymbolic" if test X${enable_m64_build} = Xyes; then DED_LDFLAGS="-m64 $DED_LDFLAGS" + fi; + if test X${enable_m32_build} = Xyes; then + DED_LDFLAGS="-m32 $DED_LDFLAGS" fi ;; freebsd*) @@ -3228,6 +3294,9 @@ case $host_os in DED_LDFLAGS="-shared" if test X${enable_m64_build} = Xyes; then DED_LDFLAGS="-m64 $DED_LDFLAGS" + fi; + if test X${enable_m32_build} = Xyes; then + DED_LDFLAGS="-m32 $DED_LDFLAGS" fi ;; osf*) |