summaryrefslogtreecommitdiff
path: root/gcc/configure.ac
diff options
context:
space:
mode:
authordoko <doko@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-09 18:22:48 +0000
committerdoko <doko@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-09 18:22:48 +0000
commit22dcc08a91f6f5edb85951a79d826f34988f1875 (patch)
treeb8fb449695248198a678ee918230c6583deb529f /gcc/configure.ac
parent5ed26d6427fccb1a575eef8478b2ca39b5c54ba1 (diff)
downloadgcc-22dcc08a91f6f5edb85951a79d826f34988f1875.tar.gz
2010-09-09 Matthias Klose <doko@ubuntu.com>
PR bootstrap/43847 * configure.ac (--enable-plugin): Enhance for cross builds. * configure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164113 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/configure.ac')
-rw-r--r--gcc/configure.ac58
1 files changed, 39 insertions, 19 deletions
diff --git a/gcc/configure.ac b/gcc/configure.ac
index e39ab87542c..e02dac98d42 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -4639,32 +4639,52 @@ enable_plugin=$enableval,
enable_plugin=yes; default_plugin=yes)
pluginlibs=
-if test x"$enable_plugin" = x"yes"; then
- case "${host}" in
- *-*-darwin*)
+case "${host}" in
+ *-*-darwin*)
+ if test x$build = x$host; then
+ export_sym_check="nm${exeext} -g"
+ elif x$host = x$target; then
export_sym_check="$gcc_cv_nm -g"
- ;;
- *)
+ else
+ export_sym_check=
+ fi
+ ;;
+ *)
+ if test x$build = x$host; then
+ export_sym_check="objdump${exeext} -T"
+ elif x$host = x$target; then
export_sym_check="$gcc_cv_objdump -T"
- ;;
- esac
+ else
+ export_sym_check=
+ fi
+ ;;
+esac
+
+if test x"$enable_plugin" = x"yes"; then
+
AC_MSG_CHECKING([for exported symbols])
- echo "int main() {return 0;} int foobar() {return 0;}" > conftest.c
- ${CC} ${CFLAGS} ${LDFLAGS} conftest.c -o conftest > /dev/null 2>&1
- if $export_sym_check conftest | grep foobar > /dev/null; then
- : # No need to use a flag
- else
- AC_MSG_CHECKING([for -rdynamic])
- ${CC} ${CFLAGS} ${LDFLAGS} -rdynamic conftest.c -o conftest > /dev/null 2>&1
+ if test "x$export_sym_check" != x; then
+ echo "int main() {return 0;} int foobar() {return 0;}" > conftest.c
+ ${CC} ${CFLAGS} ${LDFLAGS} conftest.c -o conftest > /dev/null 2>&1
if $export_sym_check conftest | grep foobar > /dev/null; then
- plugin_rdynamic=yes
- pluginlibs="-rdynamic"
+ : # No need to use a flag
+ AC_MSG_RESULT([yes])
else
- plugin_rdynamic=no
- enable_plugin=no
+ AC_MSG_RESULT([yes])
+ AC_MSG_CHECKING([for -rdynamic])
+ ${CC} ${CFLAGS} ${LDFLAGS} -rdynamic conftest.c -o conftest > /dev/null 2>&1
+ if $export_sym_check conftest | grep foobar > /dev/null; then
+ plugin_rdynamic=yes
+ pluginlibs="-rdynamic"
+ else
+ plugin_rdynamic=no
+ enable_plugin=no
+ fi
+ AC_MSG_RESULT([$plugin_rdynamic])
fi
- AC_MSG_RESULT([$plugin_rdynamic])
+ else
+ AC_MSG_RESULT([unable to check])
fi
# Check -ldl