From a2b4516f93f4d99e5ddae4c1eed78f2014f0875b Mon Sep 17 00:00:00 2001 From: "Luke A. Guest" Date: Fri, 14 Feb 2014 13:54:29 +0000 Subject: [PATCH 2/2] Added --enable-cross-gnattools flag for bare metal environment. --- configure | 25 ++++++++++++++++++++++-- configure.ac | 63 ++++++++++++++++++++++++++++++++++++------------------------ 2 files changed, 61 insertions(+), 27 deletions(-) diff --git a/configure b/configure index 749a35e..c0d706d 100755 --- a/configure +++ b/configure @@ -749,6 +749,7 @@ enable_ld enable_libquadmath enable_libquadmath_support enable_libada +enable_cross_gnattools enable_libssp enable_libstdcxx enable_static_libjava @@ -1466,6 +1467,10 @@ Optional Features: --disable-libquadmath-support disable libquadmath support for Fortran --enable-libada build libada directory + --enable-cross-gnattools + Enable cross gnattools for cross-compiler for + freestanding environment, --disable-libada is set + automatically --enable-libssp build libssp directory --disable-libstdcxx do not build libstdc++-v3 directory --enable-static-libjava[=ARG] @@ -3068,8 +3073,24 @@ else ENABLE_LIBADA=yes fi -if test "${ENABLE_LIBADA}" != "yes" ; then - noconfigdirs="$noconfigdirs gnattools" + +# Check whether --enable-cross-gnattools was given. +if test "${enable_cross_gnattools+set}" = set; then : + enableval=$enable_cross_gnattools; ENABLE_CROSS_GNATTOOLS=$enableval +else + ENABLE_CROSS_GNATTOOLS=yes +fi + + +if test "${is_cross_compiler}" = "yes" && test "${ENABLE_CROSS_GNATTOOLS}" = "yes" ; then + if test "${target_vendor}" = "none" || test "${target_vendor}" = "unknown" ; then + enable_libada=no + ENABLE_LIBADA=$enable_libada + fi +else + if test "${ENABLE_LIBADA}" != "yes" ; then + noconfigdirs="$noconfigdirs gnattools" + fi fi # Check whether --enable-libssp was given. diff --git a/configure.ac b/configure.ac index b24b33d..4fcac1a 100644 --- a/configure.ac +++ b/configure.ac @@ -113,11 +113,11 @@ extra_host_args= ### or a host dependent tool. Then put it into the appropriate list ### (library or tools, host or target), doing a dependency sort. -# Subdirs will be configured in the order listed in build_configdirs, +# Subdirs will be configured in the order listed in build_configdirs, # configdirs, or target_configdirs; see the serialization section below. -# Dependency sorting is only needed when *configuration* must be done in -# a particular order. In all cases a dependency should be specified in +# Dependency sorting is only needed when *configuration* must be done in +# a particular order. In all cases a dependency should be specified in # the Makefile, whether or not it's implicitly specified here. # Double entries in build_configdirs, configdirs, or target_configdirs may @@ -214,7 +214,7 @@ if test x"${host}" = x"${target}" ; then is_cross_compiler=no else is_cross_compiler=yes -fi +fi # Find the build and target subdir names. GCC_TOPLEV_SUBDIRS @@ -250,7 +250,7 @@ if test x$with_system_zlib = xyes ; then noconfigdirs="$noconfigdirs zlib" fi -# some tools are so dependent upon X11 that if we're not building with X, +# some tools are so dependent upon X11 that if we're not building with X, # it's not even worth trying to configure, much less build, that tool. case ${with_x} in @@ -258,7 +258,7 @@ case ${with_x} in no) skipdirs="${skipdirs} tk itcl libgui" # We won't be able to build gdbtk without X. - enable_gdbtk=no + enable_gdbtk=no ;; *) echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 ;; esac @@ -384,7 +384,7 @@ esac # Only spaces may be used in this macro; not newlines or tabs. unsupported_languages= -# Remove more programs from consideration, based on the host or +# Remove more programs from consideration, based on the host or # target this usually means that a port of the program doesn't # exist yet. @@ -420,8 +420,21 @@ AC_ARG_ENABLE(libada, [AS_HELP_STRING([--enable-libada], [build libada directory])], ENABLE_LIBADA=$enableval, ENABLE_LIBADA=yes) -if test "${ENABLE_LIBADA}" != "yes" ; then - noconfigdirs="$noconfigdirs gnattools" + +AC_ARG_ENABLE(cross-gnattools, +[AS_HELP_STRING([--enable-cross-gnattools], [Enable cross gnattools for cross-compiler for freestanding environment, --disable-libada is set automatically])], +ENABLE_CROSS_GNATTOOLS=$enableval, +ENABLE_CROSS_GNATTOOLS=yes) + +if test "${is_cross_compiler}" = "yes" && test "${ENABLE_CROSS_GNATTOOLS}" = "yes" ; then + if test "${target_vendor}" = "none" || test "${target_vendor}" = "unknown" ; then + enable_libada=no + ENABLE_LIBADA=$enable_libada + fi +else + if test "${ENABLE_LIBADA}" != "yes" ; then + noconfigdirs="$noconfigdirs gnattools" + fi fi AC_ARG_ENABLE(libssp, @@ -768,7 +781,7 @@ case "${target}" in ;; *-*-lynxos*) noconfigdirs="$noconfigdirs ${libgcj}" - ;; + ;; esac # Disable libgo for some systems where it is known to not work. @@ -873,7 +886,7 @@ case "${target}" in ;; *-*-lynxos*) noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; + ;; *-*-mingw*) noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; @@ -1183,7 +1196,7 @@ case "${host}" in hppa*-hp-hpux*) host_makefile_frag="config/mh-pa" ;; - hppa*-*) + hppa*-*) host_makefile_frag="config/mh-pa" ;; *-*-darwin*) @@ -1857,7 +1870,7 @@ if test -d ${srcdir}/gcc; then # an apparent bug in bash 1.12 on linux. ${srcdir}/gcc/[[*]]/config-lang.in) ;; *) - # From the config-lang.in, get $language, $target_libs, + # From the config-lang.in, get $language, $target_libs, # $lang_dirs, $boot_language, and $build_by_default language= target_libs= @@ -2110,7 +2123,7 @@ done build_configdirs_all="$build_configdirs" build_configdirs= for i in ${build_configdirs_all} ; do - j=`echo $i | sed -e s/build-//g` + j=`echo $i | sed -e s/build-//g` if test -f ${srcdir}/$j/configure ; then build_configdirs="${build_configdirs} $i" fi @@ -2127,7 +2140,7 @@ done target_configdirs_all="$target_configdirs" target_configdirs= for i in ${target_configdirs_all} ; do - j=`echo $i | sed -e s/target-//g` + j=`echo $i | sed -e s/target-//g` if test -f ${srcdir}/$j/configure ; then target_configdirs="${target_configdirs} $i" fi @@ -2178,7 +2191,7 @@ ACX_TOOL_DIRS copy_dirs= -AC_ARG_WITH([build-sysroot], +AC_ARG_WITH([build-sysroot], [AS_HELP_STRING([--with-build-sysroot=SYSROOT], [use sysroot as the system root during the build])], [if test x"$withval" != x ; then @@ -2269,11 +2282,11 @@ fi # This is done by determining whether or not the appropriate directory # is available, and by checking whether or not specific configurations # have requested that this magic not happen. -# -# The command line options always override the explicit settings in +# +# The command line options always override the explicit settings in # configure.in, and the settings in configure.in override this magic. # -# If the default for a toolchain is to use GNU as and ld, and you don't +# If the default for a toolchain is to use GNU as and ld, and you don't # want to do that, then you should use the --without-gnu-as and # --without-gnu-ld options for the configure script. Similarly, if # the default is to use the included zlib and you don't want to do that, @@ -2374,7 +2387,7 @@ case "${target}" in target_makefile_frag="config/mt-gnu" ;; *-*-aix4.[[3456789]]* | *-*-aix[[56789]].*) - # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm + # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm # commands to handle both 32-bit and 64-bit objects. These flags are # harmless if we're using GNU nm or ar. extra_arflags_for_target=" -X32_64" @@ -2444,7 +2457,7 @@ if test $? = 0 ; then if test -s conftest || test -s conftest.exe ; then we_are_ok=yes fi -fi +fi case $we_are_ok in no) echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed." @@ -2824,7 +2837,7 @@ baseargs=`echo "x$baseargs" | sed -e 's/^x *//' -e 's,\\$,$$,g'` # --program-suffix have been applied to it. Autoconf has already # doubled dollar signs and backslashes in program_transform_name; we want # the backslashes un-doubled, and then the entire thing wrapped in single -# quotes, because this will be expanded first by make and then by the shell. +# quotes, because this will be expanded first by make and then by the shell. # Also, because we want to override the logic in subdir configure scripts to # choose program_transform_name, replace any s,x,x, with s,y,y,. sed -e "s,\\\\\\\\,\\\\,g; s,','\\\\'',g; s/s,x,x,/s,y,y,/" < conftestsed.out @@ -2891,7 +2904,7 @@ case "$target:$have_compiler:$host:$target:$enable_multilib" in if test -s conftest || test -s conftest.exe ; then dev64=yes fi - 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.]) @@ -3169,7 +3182,7 @@ AC_SUBST(CFLAGS) AC_SUBST(CXXFLAGS) # Target tools. -AC_ARG_WITH([build-time-tools], +AC_ARG_WITH([build-time-tools], [AS_HELP_STRING([--with-build-time-tools=PATH], [use given path to find target tools during the build])], [case x"$withval" in @@ -3274,7 +3287,7 @@ if test "$USE_MAINTAINER_MODE" = yes; then else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= -fi +fi MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl -- 1.8.5.3