Use built-in autoconf cross-compile support.

Change-Id: If3f1de5a7b94bce799dc044be602a14d03dff357
Reviewed-on: https://gerrit.libreoffice.org/21555
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
This commit is contained in:
Peter Foley 2016-01-17 16:06:14 -05:00 committed by jan iversen
parent 20a4b3a081
commit b09b496b9f

View File

@ -6337,15 +6337,11 @@ if test "$cxx11_ref_qualifier" = yes; then
fi fi
AC_MSG_CHECKING([whether $CXX supports C++14 sized deallocation]) AC_MSG_CHECKING([whether $CXX supports C++14 sized deallocation])
if test "$CROSS_COMPILING" = TRUE; then dnl At least Clang -fsanitize=address causes "multiple definition of
cxx14_sized_deallocation=no dnl `operator delete(void*, unsigned long)'" also defined in
AC_MSG_RESULT([$cxx14_sized_deallocation (assumed; cross compiling)]) dnl projects/compiler-rt/lib/asan/asan_new_delete.cc:
else save_CXX=$CXX
dnl At least Clang -fsanitize=address causes "multiple definition of if test "$COM_IS_CLANG" = TRUE; then
dnl `operator delete(void*, unsigned long)'" also defined in
dnl projects/compiler-rt/lib/asan/asan_new_delete.cc:
save_CXX=$CXX
if test "$COM_IS_CLANG" = TRUE; then
my_CXX= my_CXX=
for i in $CXX; do for i in $CXX; do
case $i in case $i in
@ -6357,11 +6353,11 @@ else
esac esac
done done
CXX=$my_CXX CXX=$my_CXX
fi fi
save_CXXFLAGS=$CXXFLAGS save_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11" CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
AC_LANG_PUSH([C++]) AC_LANG_PUSH([C++])
AC_RUN_IFELSE([AC_LANG_PROGRAM([[ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include <cstddef> #include <cstddef>
#include <cstdlib> #include <cstdlib>
void operator delete(void *) throw () { std::exit(1); } void operator delete(void *) throw () { std::exit(1); }
@ -6370,12 +6366,11 @@ else
]],[[ ]],[[
try { new S; } catch (...) {} try { new S; } catch (...) {}
return 1; return 1;
]])], [cxx14_sized_deallocation=yes], [cxx14_sized_deallocation=no]) ]])], [cxx14_sized_deallocation=yes], [cxx14_sized_deallocation=no], [cxx14_sized_deallocation=no])
AC_LANG_POP([C++]) AC_LANG_POP([C++])
CXX=$save_CXX CXX=$save_CXX
CXXFLAGS=$save_CXXFLAGS CXXFLAGS=$save_CXXFLAGS
AC_MSG_RESULT([$cxx14_sized_deallocation]) AC_MSG_RESULT([$cxx14_sized_deallocation])
fi
if test "$cxx14_sized_deallocation" = yes; then if test "$cxx14_sized_deallocation" = yes; then
AC_DEFINE([HAVE_CXX14_SIZED_DEALLOCATION]) AC_DEFINE([HAVE_CXX14_SIZED_DEALLOCATION])
fi fi
@ -8126,7 +8121,6 @@ case $enable_python in
system) system)
SYSTEM_PYTHON=TRUE SYSTEM_PYTHON=TRUE
if test "$CROSS_COMPILING" != TRUE; then
dnl Check if the headers really work dnl Check if the headers really work
save_CPPFLAGS="$CPPFLAGS" save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS" CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
@ -8146,12 +8140,11 @@ int main(int argc, char **argv) {
(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0; (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0;
else return 1; else return 1;
} }
]])],[AC_MSG_RESULT([ok])],[AC_MSG_ERROR([Python >= 3.3 is needed when building with Python 3, or Python >= 2.6 when building with Python 2])],[]) ]])],[AC_MSG_RESULT([ok])],[AC_MSG_ERROR([Python >= 3.3 is needed when building with Python 3, or Python >= 2.6 when building with Python 2])],[AC_MSG_RESULT([skipped; cross-compiling])])
CFLAGS=$save_CFLAGS CFLAGS=$save_CFLAGS
AC_LANG_POP(C) AC_LANG_POP(C)
dnl FIXME Check if the Python library can be linked with, too? dnl FIXME Check if the Python library can be linked with, too?
fi
;; ;;
internal) internal)
@ -8333,7 +8326,7 @@ int main(int argc, char **argv) {
else else
return 1; return 1;
} }
]])],[AC_MSG_RESULT(OK)],[AC_MSG_ERROR([not suitable, we need >= 1.0.6])],[]) ]])],[AC_MSG_RESULT(OK)],[AC_MSG_ERROR([not suitable, we need >= 1.0.6])],[AC_MSG_ERROR([MySQL C++ Connecter not tested with cross-compilation])])
AC_LANG_POP([C++]) AC_LANG_POP([C++])
LIBS=$save_LIBS LIBS=$save_LIBS
@ -11148,7 +11141,7 @@ int main(int argc, char **argv) {
if (KDE_VERSION_MAJOR == 4 && KDE_VERSION_MINOR >= 2) return 0; if (KDE_VERSION_MAJOR == 4 && KDE_VERSION_MINOR >= 2) return 0;
else return 1; else return 1;
} }
]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[]) ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[AC_MSG_ERROR([KDE support not tested with cross-compilation])])
CXXFLAGS=$save_CXXFLAGS CXXFLAGS=$save_CXXFLAGS
AC_LANG_POP([C++]) AC_LANG_POP([C++])
@ -11205,7 +11198,7 @@ int main(int argc, char *argv[])
fi fi
qt4_fix_warning=1 qt4_fix_warning=1
add_warning " https://bugreports.qt-project.org/browse/QTBUG-37380 (needed)" add_warning " https://bugreports.qt-project.org/browse/QTBUG-37380 (needed)"
]) ],[AC_MSG_ERROR([KDE4 file pickers not tested with cross-compilation])])
# Remove meta object data # Remove meta object data
rm -f "${TSTBASE}."* rm -f "${TSTBASE}."*
@ -11238,7 +11231,7 @@ int main(int argc, char *argv[])
fi fi
qt4_fix_warning=1 qt4_fix_warning=1
add_warning " https://bugreports.qt-project.org/browse/QTBUG-34614 (needed)" add_warning " https://bugreports.qt-project.org/browse/QTBUG-34614 (needed)"
]) ],[AC_MSG_ERROR([KDE4 file pickers not tested with cross-compilation])])
# Remove meta object data # Remove meta object data
rm -f "${TSTBASE}."* rm -f "${TSTBASE}."*
@ -11297,7 +11290,8 @@ int main(int argc, char **argv) {
if (TDE_VERSION_MAJOR >= 14) return 0; if (TDE_VERSION_MAJOR >= 14) return 0;
else return 1; else return 1;
} }
]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([TDE version too old or too recent, please use another version of TDE or disable TDE address book support])],[]) ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([TDE version too old or too recent, please use another version of TDE or disable TDE address book support])],
[AC_MSG_ERROR([TDE support not tested with cross compilation])])
CXXFLAGS=$save_CXXFLAGS CXXFLAGS=$save_CXXFLAGS
AC_LANG_POP([C++]) AC_LANG_POP([C++])
ENABLE_TDEAB=TRUE ENABLE_TDEAB=TRUE
@ -12601,17 +12595,14 @@ fi
AC_MSG_CHECKING([whether $CXX has broken static initializer_list support]) AC_MSG_CHECKING([whether $CXX has broken static initializer_list support])
if test "$CROSS_COMPILING" = "TRUE"; then save_CXXFLAGS=$CXXFLAGS
broken='assuming not (cross-compiling)' CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
else save_LIBS=$LIBS
save_CXXFLAGS=$CXXFLAGS if test -n "$ILIB1"; then
CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
save_LIBS=$LIBS
if test -n "$ILIB1"; then
LIBS="$LIBS $ILIB1" LIBS="$LIBS $ILIB1"
fi fi
AC_LANG_PUSH([C++]) AC_LANG_PUSH([C++])
AC_RUN_IFELSE([AC_LANG_PROGRAM([[ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
// Exit with failure if the static initializer_list is stored on the // Exit with failure if the static initializer_list is stored on the
// stack (as done by Clang < 3.4): // stack (as done by Clang < 3.4):
#include <initializer_list> #include <initializer_list>
@ -12627,11 +12618,10 @@ else
]],[[ ]],[[
int n; int n;
return f(&n) ? 0 : 1; return f(&n) ? 0 : 1;
]])], [broken=no], [broken=yes]) ]])], [broken=no], [broken=yes],[broken='assuming not (cross-compiling)'])
AC_LANG_POP([C++]) AC_LANG_POP([C++])
LIBS=$save_LIBS LIBS=$save_LIBS
CXXFLAGS=$save_CXXFLAGS CXXFLAGS=$save_CXXFLAGS
fi
AC_MSG_RESULT([$broken]) AC_MSG_RESULT([$broken])
if test "$broken" = yes; then if test "$broken" = yes; then
AC_DEFINE([HAVE_BROKEN_STATIC_INITILIZER_LIST]) AC_DEFINE([HAVE_BROKEN_STATIC_INITILIZER_LIST])