aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>2013-12-13 21:42:02 +0000
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2013-12-13 21:42:02 +0000
commit79e0604dcf5a920054ad48a4c7a1835064dc4265 (patch)
treef3dc8a59dcb1995ea5e15a624963fd3e39e038fe
parent4c2b2d7916bef81ed7d2e7ebe8a657635306fa15 (diff)
downloadgcc-79e0604dcf5a920054ad48a4c7a1835064dc4265.zip
gcc-79e0604dcf5a920054ad48a4c7a1835064dc4265.tar.gz
gcc-79e0604dcf5a920054ad48a4c7a1835064dc4265.tar.bz2
configure.ac: Add user-friendly check for native x86_64-linux multilibs.
* configure.ac: Add user-friendly check for native x86_64-linux multilibs. * configure: Regenerate. From-SVN: r205975
-rw-r--r--ChangeLog6
-rwxr-xr-xconfigure20
-rw-r--r--configure.ac20
3 files changed, 46 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 83f8eb5..a58296f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-12-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ * configure.ac: Add user-friendly check for native x86_64-linux
+ multilibs.
+ * configure: Regenerate.
+
2013-12-06 Oleg Endo <olegendo@gcc.gnu.org>
* MAINTAINERS: Add myself as sh maintainer.
diff --git a/configure b/configure
index d4a8213..749a35e 100755
--- a/configure
+++ b/configure
@@ -7500,6 +7500,26 @@ if test x${is_cross_compiler} = xyes ; then
target_configargs="--with-cross-host=${host_noncanonical} ${target_configargs}"
fi
+# Special user-friendly check for native x86_64-linux build, if
+# multilib is not explicitly enabled.
+case "$target:$have_compiler:$host:$target:$enable_multilib" in
+ x86_64-*linux*:yes:$build:$build:)
+ # Make sure we have a developement environment that handles 32-bit
+ dev64=no
+ echo "int main () { return 0; }" > conftest.c
+ ${CC} -m32 -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
+ if test $? = 0 ; then
+ if test -s conftest || test -s conftest.exe ; then
+ dev64=yes
+ fi
+ fi
+ rm -f conftest*
+ if test x${dev64} != xyes ; then
+ as_fn_error "I suspect your system does not have 32-bit developement libraries (libc and headers). If you have them, rerun configure with --enable-multilib. If you do not have them, and want to build a 64-bit-only compiler, rerun configure with --disable-multilib." "$LINENO" 5
+ fi
+ ;;
+esac
+
# Default to --enable-multilib.
if test x${enable_multilib} = x ; then
target_configargs="--enable-multilib ${target_configargs}"
diff --git a/configure.ac b/configure.ac
index 30190d6..b24b33d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2879,6 +2879,26 @@ if test x${is_cross_compiler} = xyes ; then
target_configargs="--with-cross-host=${host_noncanonical} ${target_configargs}"
fi
+# Special user-friendly check for native x86_64-linux build, if
+# multilib is not explicitly enabled.
+case "$target:$have_compiler:$host:$target:$enable_multilib" in
+ x86_64-*linux*:yes:$build:$build:)
+ # Make sure we have a developement environment that handles 32-bit
+ dev64=no
+ echo "int main () { return 0; }" > conftest.c
+ ${CC} -m32 -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
+ if test $? = 0 ; then
+ if test -s conftest || test -s conftest.exe ; then
+ dev64=yes
+ fi
+ fi
+ rm -f conftest*
+ if test x${dev64} != xyes ; then
+ AC_MSG_ERROR([I suspect your system does not have 32-bit developement libraries (libc and headers). If you have them, rerun configure with --enable-multilib. If you do not have them, and want to build a 64-bit-only compiler, rerun configure with --disable-multilib.])
+ fi
+ ;;
+esac
+
# Default to --enable-multilib.
if test x${enable_multilib} = x ; then
target_configargs="--enable-multilib ${target_configargs}"