configure: disable static linking on Darwin
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Jun 27 21:03:40 2011 +0200 (2011-06-27)
changeset 2526e5fb003a354c
parent 2525 00054087dab2
child 2527 a65f56df62de
configure: disable static linking on Darwin

Static liunking is not supported on Darwin, so hide the corresponding
options when the build machine is Darwin.

Reported-by: Andrea Franceschini <therealmorpheu5@gmail.com>
Reported-by: Bryan Hundven <bryanhundven@gmail.com>
Reported-by: "Titus von Boxberg" <titus@v9g.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
config/cc/gcc.in.2
config/debug/gdb.in.cross
config/toolchain.in
configure
     1.1 --- a/config/cc/gcc.in.2	Tue Jun 28 17:25:02 2011 +0200
     1.2 +++ b/config/cc/gcc.in.2	Mon Jun 27 21:03:40 2011 +0200
     1.3 @@ -44,6 +44,7 @@
     1.4      bool
     1.5      prompt "Link libstdc++ statically into the gcc binary"
     1.6      default y
     1.7 +    depends on CONFIGURE_static_link_ok
     1.8      depends on CONFIGURE_has_static_libstdcxx
     1.9      depends on CC_GCC_4_4_or_later
    1.10      help
     2.1 --- a/config/debug/gdb.in.cross	Tue Jun 28 17:25:02 2011 +0200
     2.2 +++ b/config/debug/gdb.in.cross	Mon Jun 27 21:03:40 2011 +0200
     2.3 @@ -24,6 +24,7 @@
     2.4  config GDB_CROSS_STATIC
     2.5      bool
     2.6      prompt "Build a static cross gdb"
     2.7 +    depends on CONFIGURE_static_link_ok
     2.8      depends on CONFIGURE_has_static_expat
     2.9      help
    2.10        A static cross gdb can be usefull if you debug on a machine that is
     3.1 --- a/config/toolchain.in	Tue Jun 28 17:25:02 2011 +0200
     3.2 +++ b/config/toolchain.in	Mon Jun 27 21:03:40 2011 +0200
     3.3 @@ -51,6 +51,7 @@
     3.4  config STATIC_TOOLCHAIN_POSSIBLE
     3.5      bool
     3.6      default y
     3.7 +    depends on CONFIGURE_static_link_ok
     3.8      depends on CONFIGURE_has_static_libstdcxx
     3.9      # Add new deps here! :-)
    3.10  
     4.1 --- a/configure	Tue Jun 28 17:25:02 2011 +0200
     4.2 +++ b/configure	Mon Jun 27 21:03:40 2011 +0200
     4.3 @@ -449,6 +449,30 @@
     4.4          ;;
     4.5  esac
     4.6  
     4.7 +printf "Checking if static linking is possible... "
     4.8 +static_link_ok=""
     4.9 +case "${host}" in
    4.10 +    Darwin) ;;
    4.11 +    *)  tmp=.static.tmp
    4.12 +        if gcc -xc - -static -o "${tmp}" >/dev/null 2>&1<<-_EOF_
    4.13 +				int main() { return 0; }
    4.14 +			_EOF_
    4.15 +        then
    4.16 +            static_link_ok="y"
    4.17 +        fi
    4.18 +        rm -f "${tmp}"
    4.19 +        ;;
    4.20 +esac
    4.21 +if [ "${static_link_ok}" = "y" ]; then
    4.22 +    printf "yes\n"
    4.23 +else
    4.24 +    printf "no\n"
    4.25 +    printf " * An optional host feature is missing, some features will be disabled:\n"
    4.26 +    printf " * - It will not be possible to statically link toolchain's binaries\n"
    4.27 +fi
    4.28 +add_to_kconfig_list static_link_ok
    4.29 +
    4.30 +# Library checks
    4.31  ncurses_hdrs="ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h"
    4.32  ncurses_libs="$( for l in ncursesw ncurses curses; do   \
    4.33                       for x in so a dylib; do            \