mirror of https://github.com/postgres/postgres
Rearrange handling of -L linker options so that they are always before all
the -l options. (This was not the case when using the OpenSSL or Kerberos options.) Also make sure that shared library links get to see all the -L options. Get Kerberos 5 support to compile on Redhat 7.0. Add OpenSSL and -lsocket (if used/found) to libpq link.
This commit is contained in:
parent
c404d91c0b
commit
53f300d49e
62
configure.in
62
configure.in
|
@ -231,7 +231,7 @@ AC_DEFINE_UNQUOTED([DEF_MAXBACKENDS], [$with_maxbackends],
|
|||
# Option to disable shared libraries
|
||||
#
|
||||
PGAC_ARG_BOOL(enable, shared, yes,
|
||||
[ --disable-shared do not build shared libraries])
|
||||
[ --disable-shared do not build shared libraries])
|
||||
AC_SUBST(enable_shared)
|
||||
|
||||
|
||||
|
@ -315,7 +315,7 @@ IFS=':'
|
|||
# LIBRARY_DIRS comes from command line, SRCH_LIB from template file.
|
||||
for dir in $LIBRARY_DIRS $SRCH_LIB; do
|
||||
if test -d "$dir"; then
|
||||
PGSQL_LDFLAGS="$PGSQL_LDFLAGS -L$dir"
|
||||
LIBDIRS="$LIBDIRS -L$dir"
|
||||
else
|
||||
AC_MSG_WARN([*** Library directory $dir does not exist.])
|
||||
fi
|
||||
|
@ -394,17 +394,12 @@ PGAC_ARG_OPTARG(with, krb4, [ --with-krb4[=DIR] build with Kerberos 4 sup
|
|||
AC_MSG_RESULT([building with Kerberos 4 support])
|
||||
AC_DEFINE(KRB4, 1, [Define if you are building with Kerberos 4 support.])
|
||||
|
||||
if test -d "$krb4_prefix"; then
|
||||
if test -d "$krb4_prefix/include"; then
|
||||
INCLUDES="$INCLUDES -I$krb4_prefix/include"
|
||||
fi
|
||||
if test -d "$krb4_prefix/lib"; then
|
||||
krb_libdir="-L$krb4_prefix/lib"
|
||||
LIBS="$krb_libdir $LIBS"
|
||||
fi
|
||||
if test -d "$krb4_prefix/include"; then
|
||||
INCLUDES="$INCLUDES -I$krb4_prefix/include"
|
||||
fi
|
||||
if test -d "$krb4_prefix/lib"; then
|
||||
LIBDIRS="$LIBDIRS -L$krb4_prefix/lib"
|
||||
fi
|
||||
# Test for these libraries is below
|
||||
KRB_LIBS="$krb_libdir -lkrb -ldes"
|
||||
|
||||
krb_srvtab="/etc/srvtab"
|
||||
])
|
||||
|
@ -422,18 +417,12 @@ PGAC_ARG_OPTARG(with, krb5, [ --with-krb5[=DIR] build with Kerberos 5 sup
|
|||
AC_MSG_RESULT([building with Kerberos 5 support])
|
||||
AC_DEFINE(KRB5, 1, [Define if you are building with Kerberos 5 support.])
|
||||
|
||||
if test -d "$krb5_prefix"; then
|
||||
if test -d "$krb5_prefix/include"; then
|
||||
INCLUDES="$INCLUDES -I$krb5_prefix/include"
|
||||
fi
|
||||
if test -d "$krb5_prefix/lib"; then
|
||||
krb_libdir="-L$krb5_prefix/lib"
|
||||
LIBS="$krb_libdir $LIBS"
|
||||
fi
|
||||
if test -d "$krb5_prefix/include"; then
|
||||
INCLUDES="$INCLUDES -I$krb5_prefix/include"
|
||||
fi
|
||||
if test -d "$krb5_prefix/lib"; then
|
||||
LIBDIRS="$LIBDIRS -L$krb5_prefix/lib"
|
||||
fi
|
||||
|
||||
# Test for these libraries is below
|
||||
KRB_LIBS="$krb_libdir -lkrb5 -lcrypto -lcom_err"
|
||||
|
||||
krb_srvtab="FILE:\$(sysconfdir)/krb5.keytab"
|
||||
])
|
||||
|
@ -447,15 +436,13 @@ if test "$with_krb4" = yes && test "$with_krb5" = yes ; then
|
|||
fi
|
||||
|
||||
AC_SUBST(krb_srvtab)
|
||||
dnl Necessary for special libpq link
|
||||
AC_SUBST(KRB_LIBS)
|
||||
|
||||
|
||||
#
|
||||
# Kerberos configuration parameters
|
||||
#
|
||||
PGAC_ARG_REQ(with, krb-srvnam,
|
||||
[ --with-krb-srvnam=NAME name of the PostgreSQL service principal in Kerberos [postgres]],
|
||||
[ --with-krb-srvnam=NAME name of the service principal in Kerberos [postgres]],
|
||||
[],
|
||||
[with_krb_srvnam="postgres"])
|
||||
AC_DEFINE_UNQUOTED([PG_KRB_SRVNAM], ["$with_krb_srvnam"],
|
||||
|
@ -478,23 +465,13 @@ PGAC_ARG_OPTARG(with, openssl,
|
|||
INCLUDES="$INCLUDES -I${openssl_prefix}/include"
|
||||
fi
|
||||
if test -d "${openssl_prefix}/lib" ; then
|
||||
openssl_libdir="${openssl_prefix}/lib"
|
||||
LIBS="$LIBS -L${openssl_prefix}/lib"
|
||||
else
|
||||
openssl_libdir="${openssl_prefix}"
|
||||
LIBS="$LIBS -L${openssl_prefix}"
|
||||
LIBDIRS="$LIBDIRS -L${openssl_prefix}/lib"
|
||||
fi
|
||||
])
|
||||
|
||||
AC_SUBST(with_openssl)
|
||||
|
||||
|
||||
# OpenSSL and Kerberos 5 both have a `crypto' library, so if you want to
|
||||
# use both of them you'll have to figure it out yourself.
|
||||
if test "$with_openssl" = yes && test "$with_krb5" = yes ; then
|
||||
AC_MSG_ERROR([OpenSSL and Kerberos 5 support cannot be combined])
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Optionally enable the building of the ODBC driver
|
||||
|
@ -561,7 +538,7 @@ PGAC_ARG_OPTARG(with, CXX, [ --with-CXX build C++ modules (libpq++
|
|||
AC_SUBST(with_CXX)
|
||||
|
||||
CPPFLAGS="$CPPFLAGS $INCLUDES"
|
||||
LDFLAGS="$LDFLAGS $PGSQL_LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS $LIBDIRS"
|
||||
|
||||
echo "using CPPFLAGS=$CPPFLAGS"
|
||||
echo "using LDFLAGS=$LDFLAGS"
|
||||
|
@ -640,7 +617,7 @@ AC_CHECK_LIB(gen, main)
|
|||
AC_CHECK_LIB(PW, main)
|
||||
AC_SEARCH_LIBS(crypt, crypt)
|
||||
AC_CHECK_LIB(z, inflate)
|
||||
AC_SEARCH_LIBS(__inet_ntoa, bind)
|
||||
AC_CHECK_LIB(bind, __inet_ntoa)
|
||||
|
||||
|
||||
if test "$with_krb4" = yes ; then
|
||||
|
@ -649,9 +626,10 @@ if test "$with_krb4" = yes ; then
|
|||
fi
|
||||
|
||||
if test "$with_krb5" = yes ; then
|
||||
AC_CHECK_LIB(com_err, main, [], [AC_MSG_ERROR([library \`com_err' is required for Kerberos 5])])
|
||||
AC_CHECK_LIB(crypto, main, [], [AC_MSG_ERROR([library \`crypto' is required for Kerberos 5])])
|
||||
AC_CHECK_LIB(krb5, main, [], [AC_MSG_ERROR([library \`krb5' is required for Kerberos 5])])
|
||||
AC_CHECK_LIB(com_err, [com_err], [], [AC_MSG_ERROR([library \`com_err' is required for Kerberos 5])])
|
||||
AC_CHECK_LIB(crypto, [krb5_encrypt], [],
|
||||
[AC_CHECK_LIB(k5crypto, [krb5_encrypt], [], [AC_MSG_ERROR([library \`crypto' is required for Kerberos 5])])])
|
||||
AC_CHECK_LIB(krb5, [krb5_sendauth], [], [AC_MSG_ERROR([library \`krb5' is required for Kerberos 5])])
|
||||
fi
|
||||
|
||||
if test "$with_openssl" = yes ; then
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*-makefile-*-
|
||||
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.104 2000/10/23 21:43:56 petere Exp $
|
||||
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.105 2000/10/25 16:13:52 petere Exp $
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# All PostgreSQL makefiles include this file and use the variables it sets,
|
||||
|
@ -162,7 +162,6 @@ LIBS = @LIBS@
|
|||
LD = @LD@
|
||||
with_gnu_ld = @with_gnu_ld@
|
||||
LDFLAGS = @LDFLAGS@ $(LIBS)
|
||||
KRB_LIBS = @KRB_LIBS@
|
||||
LDREL = -r
|
||||
LDOUT = -o
|
||||
RANLIB = @RANLIB@
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
# Copyright (c) 1998, Regents of the University of California
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.27 2000/10/23 21:43:56 petere Exp $
|
||||
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.28 2000/10/25 16:13:52 petere Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
|
@ -200,6 +200,9 @@ ifeq ($(PORTNAME), beos)
|
|||
SHLIB_LINK += -ltermcap -lstdc++.r4 -lbind -lsocket -L/boot/develop/lib/x86
|
||||
endif
|
||||
|
||||
# Pull in any extra -L options that the user might have specified.
|
||||
SHLIB_LINK := $(filter -L%, $(LDFLAGS)) $(SHLIB_LINK)
|
||||
|
||||
endif # enable_shared
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
# Copyright (c) 1994, Regents of the University of California
|
||||
#
|
||||
# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.45 2000/10/20 21:04:11 petere Exp $
|
||||
# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.46 2000/10/25 16:13:52 petere Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
|
@ -26,12 +26,11 @@ ifdef MULTIBYTE
|
|||
OBJS+= common.o wchar.o conv.o big5.o mbutils.o
|
||||
endif
|
||||
|
||||
# If crypt is a separate library, rather than part of libc,
|
||||
# make sure it gets included in shared libpq.
|
||||
SHLIB_LINK+= $(findstring -lcrypt, $(LIBS))
|
||||
# Add libraries that libpq depends (or might depend) on into the
|
||||
# shared library link. (The order in which you list them here doesn't
|
||||
# matter.)
|
||||
SHLIB_LINK += $(filter -lcrypt -ldes -lkrb -lcom_err -lcrypto -lk5crypto -lkrb5 -lssl -lsocket -lnsl, $(LIBS))
|
||||
|
||||
# Include kerberos libraries into libpq
|
||||
SHLIB_LINK += $(KRB_LIBS)
|
||||
|
||||
all: all-lib
|
||||
|
||||
|
|
Loading…
Reference in New Issue