diff --git a/icu4c/source/aclocal.m4 b/icu4c/source/aclocal.m4 index 71a76f5c2c4..fa0ab6433a5 100644 --- a/icu4c/source/aclocal.m4 +++ b/icu4c/source/aclocal.m4 @@ -275,6 +275,19 @@ AC_DEFUN(AC_CHECK_64BIT_LIBS, ENABLE_64BIT_LIBS=no ;; esac + else + if test "$GCC" = yes; then + OLD_CFLAGS="${CFLAGS}" + OLD_CXXFLAGS="${CXXFLAGS}" + CFLAGS="${CFLAGS} -m32" + CXXFLAGS="${CXXFLAGS} -m32" + AC_TRY_RUN(int main(void) {return 0;}, + ENABLE_64BIT_LIBS=no, ENABLE_64BIT_LIBS=yes, ENABLE_64BIT_LIBS=yes) + if test "$ENABLE_64BIT_LIBS" = yes; then + CFLAGS="${OLD_CFLAGS}" + CXXFLAGS="${OLD_CXXFLAGS}" + fi + fi fi dnl Individual tests that fail should reset their own flags. AC_MSG_RESULT($ENABLE_64BIT_LIBS) diff --git a/icu4c/source/configure b/icu4c/source/configure index c1a6897b8dd..e687cbf24b8 100755 --- a/icu4c/source/configure +++ b/icu4c/source/configure @@ -3327,6 +3327,50 @@ fi ENABLE_64BIT_LIBS=no ;; esac + else + if test "$GCC" = yes; then + OLD_CFLAGS="${CFLAGS}" + OLD_CXXFLAGS="${CXXFLAGS}" + CFLAGS="${CFLAGS} -m32" + CXXFLAGS="${CXXFLAGS} -m32" + if test "$cross_compiling" = yes; then + ENABLE_64BIT_LIBS=yes +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int main(void) {return 0;} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ENABLE_64BIT_LIBS=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ENABLE_64BIT_LIBS=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + if test "$ENABLE_64BIT_LIBS" = yes; then + CFLAGS="${OLD_CFLAGS}" + CXXFLAGS="${OLD_CXXFLAGS}" + fi + fi fi echo "$as_me:$LINENO: result: $ENABLE_64BIT_LIBS" >&5 echo "${ECHO_T}$ENABLE_64BIT_LIBS" >&6