Add check for GNU or not GNU ld, needed to pick the right export_dynamic

flags for Solaris.  The test itself is straight from libtool.
This commit is contained in:
Peter Eisentraut 2000-10-20 23:57:34 +00:00
parent 805e431a38
commit 12e7558c76
6 changed files with 641 additions and 357 deletions

3
aclocal.m4 vendored
View File

@ -1,9 +1,10 @@
dnl $Header: /cvsroot/pgsql/aclocal.m4,v 1.9 2000/09/25 22:22:52 petere Exp $
dnl $Header: /cvsroot/pgsql/aclocal.m4,v 1.10 2000/10/20 23:57:32 petere Exp $
builtin([include], [config/ac_func_accept_argtypes.m4])
builtin([include], [config/c-compiler.m4])
builtin([include], [config/c-library.m4])
builtin([include], [config/cxx.m4])
builtin([include], [config/general.m4])
builtin([include], [config/libtool.m4])
builtin([include], [config/programs.m4])
builtin([include], [config/python.m4])
builtin([include], [config/tcl.m4])

123
config/libtool.m4 vendored Normal file
View File

@ -0,0 +1,123 @@
## libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
## Copyright (C) 1996-1999,2000 Free Software Foundation, Inc.
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
##
## As a special exception to the GNU General Public License, if you
## distribute this file as part of a program that contains a
## configuration script generated by Autoconf, you may include it under
## the same distribution terms that you use for the rest of that program.
# No, PostgreSQL doesn't use libtool (yet), we just borrow stuff from it.
# This file was taken on 2000-10-20 from the multi-language branch (since
# that is the branch that PostgreSQL would most likely adopt anyway).
# --petere
# ... bunch of stuff removed here ...
# AC_PROG_LD - find the path to the GNU or non-GNU linker
AC_DEFUN(AC_PROG_LD,
[AC_ARG_WITH(gnu-ld,
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
dnl ###not for PostgreSQL### AC_REQUIRE([AC_CANONICAL_BUILD])dnl
ac_prog=ld
if test "$ac_cv_prog_gcc" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by GCC])
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
esac
case "$ac_prog" in
# Accept absolute paths.
changequote(,)dnl
[\\/]* | [A-Za-z]:[\\/]*)
re_direlt='/[^/][^/]*/\.\./'
changequote([,])dnl
# Canonicalize the path of ld
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
elif test "$with_gnu_ld" = yes; then
AC_MSG_CHECKING([for GNU ld])
else
AC_MSG_CHECKING([for non-GNU ld])
fi
AC_CACHE_VAL(ac_cv_path_LD,
[if test -z "$LD"; then
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
ac_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
test "$with_gnu_ld" != yes && break
fi
fi
done
IFS="$ac_save_ifs"
else
ac_cv_path_LD="$LD" # Let the user override the test with a path.
fi])
LD="$ac_cv_path_LD"
if test -n "$LD"; then
AC_MSG_RESULT($LD)
else
AC_MSG_RESULT(no)
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_PROG_LD_GNU
])
AC_DEFUN(AC_PROG_LD_GNU,
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
ac_cv_prog_gnu_ld=yes
else
ac_cv_prog_gnu_ld=no
fi])
with_gnu_ld=$ac_cv_prog_gnu_ld
])
# ... more stuff removed ...
# ... added:
AC_SUBST(LD)
AC_SUBST(with_gnu_ld)

861
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -592,6 +592,7 @@ AC_SUBST(INSTALL_SHLIB)
AC_PROG_AWK
PGAC_PATH_FLEX
AC_PROG_LN_S
AC_PROG_LD
AC_PROG_RANLIB
AC_CHECK_PROGS(LORDER, lorder)
AC_PATH_PROG(TAR, tar)

View File

@ -1,5 +1,5 @@
# -*-makefile-*-
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.101 2000/10/20 21:03:38 petere Exp $
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.102 2000/10/20 23:57:33 petere Exp $
#------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets,
@ -160,6 +160,8 @@ FLEXFLAGS = @FLEXFLAGS@ $(LFLAGS)
AROPT = @AROPT@
LIBS = @LIBS@
LD = @LD@
with_gnu_ld = @with_gnu_ld@
LDFLAGS = @LDFLAGS@ $(LIBS)
KRB_LIBS = @KRB_LIBS@
LDREL = -r

View File

@ -1,4 +1,8 @@
# $Header: /cvsroot/pgsql/src/makefiles/Makefile.solaris,v 1.1 2000/10/10 21:22:28 petere Exp $
# $Header: /cvsroot/pgsql/src/makefiles/Makefile.solaris,v 1.2 2000/10/20 23:57:34 petere Exp $
ifeq ($(with_gnu_ld), yes)
export_dynamic = -Wl,-E
endif
%.so: %.o
$(LD) -G -Bdynamic -o $@ $<