configure: fix --disable-mac64 mode as cross-compile mode

This commit is contained in:
Matthew Flatt 2020-01-09 06:56:20 -07:00
parent 8c5d580d5a
commit d5930a18c6
7 changed files with 128 additions and 137 deletions

36
racket/src/ac/iconv.m4 Normal file
View File

@ -0,0 +1,36 @@
iconv_lib_flag=""
if test "${skip_iconv_check}" = "no" ; then
if test "${enable_iconv}" = "yes" ; then
AC_CHECK_HEADER(iconv.h, enable_iconv=yes, enable_iconv=no)
if test "${enable_iconv}" = "yes" ; then
# Does it all work, now?
AC_TRY_LINK(
[#include <iconv.h>]
[#include <langinfo.h>],
[ iconv_open("UTF-8", "UTF-8");]
return 0;
, enable_iconv=yes, enable_iconv=no)
if test "${enable_iconv}" = "no" ; then
# Try adding -liconv ?
# We did not use AC_CHECK_LIB because iconv is sometimes macro-renamed
ORIG_LIBS="$LIBS"
LIBS="$LIBS -liconv"
AC_TRY_LINK(
[#include <iconv.h>]
[#include <langinfo.h>],
[ iconv_open("UTF-8", "UTF-8");]
return 0;
, enable_iconv=yes, enable_iconv=no)
if test "${enable_iconv}" = "no" ; then
LIBS="$ORIG_LIBS"
else
iconv_lib_flag=" -liconv"
fi
fi
fi
fi
[ msg="iconv is usable" ]
AC_MSG_CHECKING($msg)
iconv_usage_result="$enable_iconv$iconv_lib_flag"
AC_MSG_RESULT($iconv_usage_result)
fi

View File

@ -66,7 +66,12 @@
SUB_CONFIGURE_EXTRAS="${SUB_CONFIGURE_EXTRAS} CC="'"'"${CC}"' -m32"'
fi
need_cc_in_extras=no
if test "$build_cpu" = "x86_64" ; then
# AG_PROC_CC has already decided that we weren't
# cross compiling, so change that decision
cross_compiling=yes
echo may be cross compiling after all
fi
fi
fi
fi

View File

@ -0,0 +1,6 @@
if test "${ac_cv_sizeof_void_p}" != "4" ; then
if test "${ac_cv_sizeof_void_p}" != "8" ; then
echo "Something has gone wrong getting the pointer size; see config.log"
exit 1
fi
fi

View File

@ -5025,12 +5025,17 @@ $as_echo "#define HAVE_STDINT_H 1" >>confdefs.h
SUB_CONFIGURE_EXTRAS="${SUB_CONFIGURE_EXTRAS} CC="'"'"${CC}"' -m32"'
fi
need_cc_in_extras=no
if test "$build_cpu" = "x86_64" ; then
# AG_PROC_CC has already decided that we weren't
# cross compiling, so change that decision
cross_compiling=yes
echo may be cross compiling after all
fi
fi
fi
fi
case "$host_cpu" in
i386|x86_64)
enable_parallel_by_default=yes
@ -5673,53 +5678,53 @@ fi
if test "${enable_iconv}" = "yes" ; then
# Does it all work, now?
if test "$cross_compiling" = yes; then :
enable_iconv=yes
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <iconv.h>
#include <langinfo.h>
int main() {
#include <iconv.h>
#include <langinfo.h>
int
main ()
{
iconv_open("UTF-8", "UTF-8");
return 0;
}
;
return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
if ac_fn_c_try_link "$LINENO"; then :
enable_iconv=yes
else
enable_iconv=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test "${enable_iconv}" = "no" ; then
# Try adding -liconv ?
# We did not use AC_CHECK_LIB because iconv is sometimes macro-renamed
ORIG_LIBS="$LIBS"
LIBS="$LIBS -liconv"
if test "$cross_compiling" = yes; then :
enable_iconv=yes
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <iconv.h>
#include <langinfo.h>
int main() {
#include <iconv.h>
#include <langinfo.h>
int
main ()
{
iconv_open("UTF-8", "UTF-8");
return 0;
}
;
return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
if ac_fn_c_try_link "$LINENO"; then :
enable_iconv=yes
else
enable_iconv=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test "${enable_iconv}" = "no" ; then
LIBS="$ORIG_LIBS"
else
@ -5736,6 +5741,7 @@ $as_echo_n "checking $msg... " >&6; }
$as_echo "$iconv_usage_result" >&6; }
fi
if test "${check_for_mprotect}" = "yes" ; then
msg="for mmap and mprotect"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $msg" >&5
@ -6180,6 +6186,14 @@ _ACEOF
if test "${ac_cv_sizeof_void_p}" != "4" ; then
if test "${ac_cv_sizeof_void_p}" != "8" ; then
echo "Something has gone wrong getting the pointer size; see config.log"
exit 1
fi
fi
ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default"
if test "x$ac_cv_type_intptr_t" = xyes; then :

View File

@ -4690,12 +4690,17 @@ fi
SUB_CONFIGURE_EXTRAS="${SUB_CONFIGURE_EXTRAS} CC="'"'"${CC}"' -m32"'
fi
need_cc_in_extras=no
if test "$build_cpu" = "x86_64" ; then
# AG_PROC_CC has already decided that we weren't
# cross compiling, so change that decision
cross_compiling=yes
echo may be cross compiling after all
fi
fi
fi
fi
if test "${enable_libfw}" = "yes" ; then
FRAMEWORK_INSTALL_DIR=/Library/Frameworks
FRAMEWORK_REL_INSTALL=no
@ -5073,53 +5078,53 @@ fi
if test "${enable_iconv}" = "yes" ; then
# Does it all work, now?
if test "$cross_compiling" = yes; then :
enable_iconv=yes
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <iconv.h>
#include <langinfo.h>
int main() {
#include <iconv.h>
#include <langinfo.h>
int
main ()
{
iconv_open("UTF-8", "UTF-8");
return 0;
}
;
return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
if ac_fn_c_try_link "$LINENO"; then :
enable_iconv=yes
else
enable_iconv=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test "${enable_iconv}" = "no" ; then
# Try adding -liconv ?
# We did not use AC_CHECK_LIB because iconv is sometimes macro-renamed
ORIG_LIBS="$LIBS"
LIBS="$LIBS -liconv"
if test "$cross_compiling" = yes; then :
enable_iconv=yes
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <iconv.h>
#include <langinfo.h>
int main() {
#include <iconv.h>
#include <langinfo.h>
int
main ()
{
iconv_open("UTF-8", "UTF-8");
return 0;
}
;
return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
if ac_fn_c_try_link "$LINENO"; then :
enable_iconv=yes
else
enable_iconv=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test "${enable_iconv}" = "no" ; then
LIBS="$ORIG_LIBS"
else
@ -5135,6 +5140,7 @@ $as_echo_n "checking $msg... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $iconv_usage_result" >&5
$as_echo "$iconv_usage_result" >&6; }
fi
if test "${enable_iconv}" = "no" ; then
$as_echo "#define RKTIO_NO_ICONV 1" >>confdefs.h
@ -5317,6 +5323,7 @@ if test "${ac_cv_sizeof_void_p}" != "4" ; then
fi
fi
############## subconfigure ################
# Before libtool setup

View File

@ -481,44 +481,7 @@ fi
AC_LANG_C
iconv_lib_flag=""
if test "${skip_iconv_check}" = "no" ; then
if test "${enable_iconv}" = "yes" ; then
AC_CHECK_HEADER(iconv.h, enable_iconv=yes, enable_iconv=no)
if test "${enable_iconv}" = "yes" ; then
# Does it all work, now?
AC_TRY_RUN(
[ #include <iconv.h>]
[ #include <langinfo.h>]
int main() {
[ iconv_open("UTF-8", "UTF-8");]
return 0;
}, enable_iconv=yes, enable_iconv=no, enable_iconv=yes)
if test "${enable_iconv}" = "no" ; then
# Try adding -liconv ?
# We did not use AC_CHECK_LIB because iconv is sometimes macro-renamed
ORIG_LIBS="$LIBS"
LIBS="$LIBS -liconv"
AC_TRY_RUN(
[ #include <iconv.h>]
[ #include <langinfo.h>]
int main() {
[ iconv_open("UTF-8", "UTF-8");]
return 0;
}, enable_iconv=yes, enable_iconv=no, enable_iconv=yes)
if test "${enable_iconv}" = "no" ; then
LIBS="$ORIG_LIBS"
else
iconv_lib_flag=" -liconv"
fi
fi
fi
fi
[ msg="iconv is usable" ]
AC_MSG_CHECKING($msg)
iconv_usage_result="$enable_iconv$iconv_lib_flag"
AC_MSG_RESULT($iconv_usage_result)
fi
m4_include(../ac/iconv.m4)
if test "${enable_iconv}" = "no" ; then
AC_DEFINE(RKTIO_NO_ICONV,1,[Do not use iconv])
fi
@ -608,12 +571,7 @@ fi
AC_CHECK_SIZEOF([void *])
if test "${ac_cv_sizeof_void_p}" != "4" ; then
if test "${ac_cv_sizeof_void_p}" != "8" ; then
echo "Something has gone wrong getting the pointer size; see config.log"
exit 1
fi
fi
m4_include(../ac/valid_sizeof.m4)
############## subconfigure ################

View File

@ -883,44 +883,7 @@ AC_MSG_RESULT($using_gnu_cpp)
# Although rktio takes care of iconv, we need to know whether
# to link to it
iconv_lib_flag=""
if test "${skip_iconv_check}" = "no" ; then
if test "${enable_iconv}" = "yes" ; then
AC_CHECK_HEADER(iconv.h, enable_iconv=yes, enable_iconv=no)
if test "${enable_iconv}" = "yes" ; then
# Does it all work, now?
AC_TRY_RUN(
[ #include <iconv.h>]
[ #include <langinfo.h>]
int main() {
[ iconv_open("UTF-8", "UTF-8");]
return 0;
}, enable_iconv=yes, enable_iconv=no, enable_iconv=yes)
if test "${enable_iconv}" = "no" ; then
# Try adding -liconv ?
# We did not use AC_CHECK_LIB because iconv is sometimes macro-renamed
ORIG_LIBS="$LIBS"
LIBS="$LIBS -liconv"
AC_TRY_RUN(
[ #include <iconv.h>]
[ #include <langinfo.h>]
int main() {
[ iconv_open("UTF-8", "UTF-8");]
return 0;
}, enable_iconv=yes, enable_iconv=no, enable_iconv=yes)
if test "${enable_iconv}" = "no" ; then
LIBS="$ORIG_LIBS"
else
iconv_lib_flag=" -liconv"
fi
fi
fi
fi
[ msg="iconv is usable" ]
AC_MSG_CHECKING($msg)
iconv_usage_result="$enable_iconv$iconv_lib_flag"
AC_MSG_RESULT($iconv_usage_result)
fi
m4_include(../ac/iconv.m4)
if test "${check_for_mprotect}" = "yes" ; then
[ msg="for mmap and mprotect" ]
@ -1045,6 +1008,8 @@ AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF([void *])
AC_CHECK_SIZEOF(bool, unused, [#include <stdbool.h>])
m4_include(../ac/valid_sizeof.m4)
AC_TYPE_INTPTR_T
AC_TYPE_UINTPTR_T