mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2024-12-30 09:38:52 +00:00
98bc4decde
Signed-off-by: Alexey Neyman <stilor@att.net>
108 lines
2.7 KiB
Diff
108 lines
2.7 KiB
Diff
---
|
|
gcc/configure | 22 +++++++++++++++-------
|
|
gcc/configure.ac | 18 +++++++++++++-----
|
|
2 files changed, 28 insertions(+), 12 deletions(-)
|
|
|
|
--- a/gcc/configure
|
|
+++ b/gcc/configure
|
|
@@ -28058,6 +28058,9 @@
|
|
|
|
|
|
pluginlibs=
|
|
+PICFLAG="-fPIC"
|
|
+UNDEFINEDPREAMBLE="extern int X;"
|
|
+UNDEFINEDCODE="return X == 0;"
|
|
|
|
case "${host}" in
|
|
*-*-darwin*)
|
|
@@ -28069,6 +28072,11 @@
|
|
export_sym_check=
|
|
fi
|
|
;;
|
|
+ *-*-mingw*|*-*-cygwin*|*-*-msys*)
|
|
+ PICFLAG=""
|
|
+ UNDEFINEDPREAMBLE=""
|
|
+ UNDEFINEDCODE=""
|
|
+ ;;
|
|
*)
|
|
if test x$build = x$host; then
|
|
export_sym_check="objdump${exeext} -T"
|
|
@@ -28181,23 +28189,23 @@
|
|
case "${host}" in
|
|
*-*-darwin*)
|
|
CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
|
|
- CFLAGS="$CFLAGS -fPIC"
|
|
+ CFLAGS="$CFLAGS ${PICFLAG}"
|
|
LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
|
|
;;
|
|
*)
|
|
- CFLAGS="$CFLAGS -fPIC"
|
|
- LDFLAGS="$LDFLAGS -fPIC -shared"
|
|
+ CFLAGS="$CFLAGS ${PICFLAG}"
|
|
+ LDFLAGS="$LDFLAGS ${PICFLAG} -shared"
|
|
;;
|
|
esac
|
|
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fPIC -shared" >&5
|
|
-$as_echo_n "checking for -fPIC -shared... " >&6; }
|
|
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${PICFLAG} -shared" >&5
|
|
+$as_echo_n "checking for ${PICFLAG} -shared... " >&6; }
|
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
|
/* end confdefs.h. */
|
|
-extern int X;
|
|
+${UNDEFINEDPREAMBLE}
|
|
int
|
|
main ()
|
|
{
|
|
-return X == 0;
|
|
+${UNDEFINEDCODE}
|
|
;
|
|
return 0;
|
|
}
|
|
--- a/gcc/configure.ac
|
|
+++ b/gcc/configure.ac
|
|
@@ -5583,6 +5583,9 @@
|
|
enable_plugin=yes; default_plugin=yes)
|
|
|
|
pluginlibs=
|
|
+PICFLAG="-fPIC"
|
|
+UNDEFINEDPREAMBLE="extern int X;"
|
|
+UNDEFINEDCODE="return X == 0;"
|
|
|
|
case "${host}" in
|
|
*-*-darwin*)
|
|
@@ -5594,6 +5597,11 @@
|
|
export_sym_check=
|
|
fi
|
|
;;
|
|
+ *-*-mingw*|*-*-cygwin*|*-*-msys*)
|
|
+ PICFLAG=""
|
|
+ UNDEFINEDPREAMBLE=""
|
|
+ UNDEFINEDCODE=""
|
|
+ ;;
|
|
*)
|
|
if test x$build = x$host; then
|
|
export_sym_check="objdump${exeext} -T"
|
|
@@ -5645,17 +5653,17 @@
|
|
case "${host}" in
|
|
*-*-darwin*)
|
|
CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
|
|
- CFLAGS="$CFLAGS -fPIC"
|
|
+ CFLAGS="$CFLAGS ${PICFLAG}"
|
|
LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
|
|
;;
|
|
*)
|
|
- CFLAGS="$CFLAGS -fPIC"
|
|
- LDFLAGS="$LDFLAGS -fPIC -shared"
|
|
+ CFLAGS="$CFLAGS ${PICFLAG}"
|
|
+ LDFLAGS="$LDFLAGS ${PICFLAG} -shared"
|
|
;;
|
|
esac
|
|
- AC_MSG_CHECKING([for -fPIC -shared])
|
|
+ AC_MSG_CHECKING([for ${PICFLAG} -shared])
|
|
AC_TRY_LINK(
|
|
- [extern int X;],[return X == 0;],
|
|
+ [${UNDEFINEDPREAMBLE}],[${UNDEFINEDCODE}],
|
|
[AC_MSG_RESULT([yes]); have_pic_shared=yes],
|
|
[AC_MSG_RESULT([no]); have_pic_shared=no])
|
|
if test x"$have_pic_shared" != x"yes" -o x"$ac_cv_search_dlopen" = x"no"; then
|