summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-10-04 05:18:05 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-10-04 05:18:05 +0000
commit5c57848093d4bc4ffc6140365707a879c7a7838c (patch)
tree287195e29184ce252439de17d083d85aadb0eaa7 /configure.in
parente6bb432c83584f174d9ccc24f6433a781aa9364d (diff)
* configure.in (RUBY_PROG_GNU_LD): check whether the linker is GNU ld.
* ext/extmk.rb (create_makefile): add -Wl,-no-undefined to $DLDFLAGS on Linux if GNU ld is used and --enable-shared is specified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in14
1 files changed, 13 insertions, 1 deletions
diff --git a/configure.in b/configure.in
index 90d2230f6b..b3425ceffd 100644
--- a/configure.in
+++ b/configure.in
@@ -32,6 +32,17 @@ AC_SUBST(CPPOUTFILE)
rm -f conftest*])
])
+AC_DEFUN(RUBY_PROG_GNU_LD,
+[AC_CACHE_CHECK(whether the linker is GNU ld, rb_cv_prog_gnu_ld,
+[if `$CC --print-prog-name=ld` -v 2>&1 | grep "GNU ld" > /dev/null; then
+ rb_cv_prog_gnu_ld=yes
+else
+ rb_cv_prog_gnu_ld=no
+fi
+])
+GNU_LD=$rb_cv_prog_gnu_ld
+AC_SUBST(GNU_LD)])
+
rb_version=`grep RUBY_VERSION $srcdir/version.h`
MAJOR=`expr "$rb_version" : '#define RUBY_VERSION "\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*"'`
MINOR=`expr "$rb_version" : '#define RUBY_VERSION "[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*"'`
@@ -127,6 +138,7 @@ fi
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
+RUBY_PROG_GNU_LD
RUBY_CPPOUTFILE
OUTFLAG='-o '
@@ -729,7 +741,7 @@ if test "$with_dln_a_out" != yes; then
rb_cv_dlopen=yes;;
solaris*) if test "$GCC" = yes; then
LDSHARED='$(CC) -Wl,-G'
- if `$CC --print-prog-name=ld` -v 2>&1 | grep "GNU ld" > /dev/null; then
+ if test $rb_cv_prog_gnu_ld = yes; then
LDFLAGS="-Wl,-E"
LDSHARED="$LDSHARED -shared"
fi