[PATCH 1 of 4] configure: disable static linking on Darwin
Yann E. MORIN
yann.morin.1998@anciens.enib.fr
Mon Jun 27 21:40:00 GMT 2011
# HG changeset patch
# User "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
# Date 1309201420 -7200
# Node ID 28ea242a652e197abf84c549ee275059a425d72a
# Parent 364b06df9e3a11637489a8f3f6a0010a555a5597
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>
diff --git a/config/cc/gcc.in.2 b/config/cc/gcc.in.2
--- a/config/cc/gcc.in.2
+++ b/config/cc/gcc.in.2
@@ -44,6 +44,7 @@
bool
prompt "Link libstdc++ statically into the gcc binary"
default y
+ depends on CONFIGURE_static_link_ok
depends on CONFIGURE_has_static_libstdcxx
depends on CC_GCC_4_4_or_later
help
diff --git a/config/debug/gdb.in.cross b/config/debug/gdb.in.cross
--- a/config/debug/gdb.in.cross
+++ b/config/debug/gdb.in.cross
@@ -24,6 +24,7 @@
config GDB_CROSS_STATIC
bool
prompt "Build a static cross gdb"
+ depends on CONFIGURE_static_link_ok
depends on CONFIGURE_has_static_expat
help
A static cross gdb can be usefull if you debug on a machine that is
diff --git a/config/toolchain.in b/config/toolchain.in
--- a/config/toolchain.in
+++ b/config/toolchain.in
@@ -51,6 +51,7 @@
config STATIC_TOOLCHAIN_POSSIBLE
bool
default y
+ depends on CONFIGURE_static_link_ok
depends on CONFIGURE_has_static_libstdcxx
# Add new deps here! :-)
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -435,6 +435,29 @@
has_or_abort prog=readelf var=readelf
has_or_abort prog=patch var=patch
+# System specific checks
+printf "Checking if static linking is possible... "
+static_link_ok=""
+case $(uname -s) in
+ Darwin) ;;
+ *) if gcc -xc - -static -o - >/dev/null 2>&1<<-_EOF_
+ int main() { return 0; }
+ _EOF_
+ then
+ static_link_ok="y"
+ fi
+ ;;
+esac
+if [ "${static_link_ok}" = "y" ]; then
+ printf "yes\n"
+else
+ printf "no\n"
+ printf " * An optional dependency is missing, some features will be disabled\n"
+ printf " * It wil not be possible to link binaries statically\n"
+fi
+add_to_kconfig_list static_link_ok
+
+# Library checks
ncurses_hdrs="ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h"
ncurses_libs="$( for l in ncursesw ncurses curses; do \
for x in so a dylib; do \
--
For unsubscribe information see http://sourceware.org/lists.html#faq
More information about the crossgcc
mailing list