Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2012-10-22 11:32:04 +0400
committerEric Botcazou <ebotcazou@adacore.com>2012-10-22 11:32:04 +0400
commite885309220343161f3b1286da1b6f2e62311eebd (patch)
treeaa1e1551330855f0d4f21cce00bf1bffc53d7a7c /configure.ac
parent3f30575344d5af8d2cd9f52f2282c80833c7bf1c (diff)
PR bootstrap/54820
* Makefile.tpl (STAGE1_FLAGS_TO_PASS): New variable. (all-[+prefix+][+module+]): Pass stage1_args to sub-makes. (all-stage[+id+]-[+prefix+][+module+]): Likewise, if prev is false. (clean-stage[+id+]-[+prefix+][+module+]): Likewise, if prev is false. (host_modules): Set stage1_args to STAGE1_FLAGS_TO_PASS. * Makefile.in: Regenerate. * configure.ac (have_static_libs): New variable and associated check. (stage1-ldflags): Move to after stage1_libs and set to -static-libstdc++ -static-libgcc if stage1_libs is empty and have_static_libs is yes. * configure: Regenerate.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac44
1 files changed, 33 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac
index f0d86d906..958eadd5e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1182,6 +1182,22 @@ if test -z "$LD"; then
fi
fi
+# Check whether -static-libstdc++ -static-libgcc is supported.
+have_static_libs=no
+if test "$GCC" = yes; then
+ saved_LDFLAGS="$LDFLAGS"
+
+ LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc"
+ AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc])
+ AC_LANG_PUSH(C++)
+ AC_LINK_IFELSE([int main() {}],
+ [AC_MSG_RESULT([yes]); have_static_libs=yes],
+ [AC_MSG_RESULT([no])])
+ AC_LANG_POP(C++)
+
+ LDFLAGS="$saved_LDFLAGS"
+fi
+
ACX_PROG_GNAT
ACX_PROG_CMP_IGNORE_INITIAL
@@ -1478,17 +1494,6 @@ case $with_host_libstdcxx in
;;
esac
-# Linker flags to use for stage1 or when not boostrapping.
-AC_ARG_WITH(stage1-ldflags,
-[AS_HELP_STRING([--with-stage1-ldflags=FLAGS], [linker flags for stage1])],
-[if test "$withval" = "no" -o "$withval" = "yes"; then
- stage1_ldflags=
- else
- stage1_ldflags=$withval
- fi],
-[stage1_ldflags=])
-AC_SUBST(stage1_ldflags)
-
# Libraries to use for stage1 or when not bootstrapping.
AC_ARG_WITH(stage1-libs,
[AS_HELP_STRING([--with-stage1-libs=LIBS], [libraries for stage1])],
@@ -1500,6 +1505,23 @@ AC_ARG_WITH(stage1-libs,
[stage1_libs=$with_host_libstdcxx])
AC_SUBST(stage1_libs)
+# Linker flags to use for stage1 or when not bootstrapping.
+AC_ARG_WITH(stage1-ldflags,
+[AS_HELP_STRING([--with-stage1-ldflags=FLAGS], [linker flags for stage1])],
+[if test "$withval" = "no" -o "$withval" = "yes"; then
+ stage1_ldflags=
+ else
+ stage1_ldflags=$withval
+ fi],
+[stage1_ldflags=
+ # In stage 1, default to linking libstdc++ and libgcc statically with GCC
+ # if supported. But if the user explicitly specified the libraries to use,
+ # trust that they are doing what they want.
+ if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then
+ stage1_ldflags="-static-libstdc++ -static-libgcc"
+ fi])
+AC_SUBST(stage1_ldflags)
+
# Libraries to use for stage2 and later builds. This defaults to the
# argument passed to --with-host-libstdcxx.
AC_ARG_WITH(boot-libs,