Here are 3 patches (all relative to the src directory) to help with

the configuration of v6.3.1.  I have replaced the queries for
include/lib directories with --with configuration options.  I have
also included a list of potential tcl/tk include directories directly
in the CPPFLAGS variable.  As new versions are needed, these should
be added to the list in reverse numerical order (libraries are in
a separate list near the end).  This greatly simplifies the later
checks if --with-tcl is set.  I hope this solution works for
everyone.

I also added a check to disable the perl support if postgres was
not already installed (as per the instructions in the directory).
By the way, why must there be an installed pgsql to compile perl
support? This seems odd, at best.

Finally, I changed the Makefile in the libpgtcl interface to place
the shared libraries at the end of the list of files, not at the
beginning.  With NetBSD at least, libraries are linked in order,
so the original sequence does not work.

Brook Milligan
This commit is contained in:
Bruce Momjian 1998-04-05 20:28:23 +00:00
parent 7a9385e9d3
commit 05102c7551
4 changed files with 485 additions and 415 deletions

13
INSTALL
View File

@ -276,15 +276,22 @@ PostgreSQL:
listens for incoming connections on. The
default for this is port 5432.
--with-defaults Use default responses to several queries during
configuration.
--with-tcl Enables programs requiring Tcl/Tk and X11,
including pgtclsh and libpgtcl.
--with-perl Enables the perl interface. Note that this
requires an installed version of postgreSQL.
--with-includes=DIRS
Include DIRS in list of directories searched
for header files. (Typical use will need
--with-includes=/usr/local/include)
--with-libraries=DIRS
Include DIRS in list of directories searched
for archive libraries. (Typical use will need
--with-libraries=/usr/local/lib)
As an example, here is the configure script I use on a Sparc
Solaris 2.5 system with /opt/postgres being the install base.

725
src/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -141,62 +141,47 @@ CC=`grep '^CC:' $TEMPLATE | awk -F: '{print $2}'`
LIBS=`grep '^LIBS:' $TEMPLATE | awk -F: '{print $2}'`
dnl We now need to check for additional directories (include
dnl and library directories.
echo "**************************************************************"
echo "We now need to know if your compiler needs to search any
echo "additional directories for include or library files. If
echo "you don't know the answers to these questions, then just
echo "hit enter and we will try and figure it out. If things
echo "don't compile because of missing libraries or include
echo "files, then you probably need to enter something here.
echo "enter 'none' or new directories to override default"
echo ""
$ECHO_N "Additional directories to search for include files { $SRCH_INC }: $ECHO_C"
if test "X$with_defaults" = "Xyes"
then
a=$SRCH_INC
echo ""
else
read a
fi
if test "$a." = "none."
then
SRCH_INC=
CPPFLAGS=
else
if test "$a." = "."
then
a=$SRCH_INC
fi
CPPFLAGS=`echo "$a" | sed 's@ *@ @g; s@^\([[^ ]]\)@-I\1@; s@ \([[^ ]]\)@ -I\1@g'`
AC_ARG_WITH(includes,
[ --with-includes=DIR site header files for tk/tcl, etc in DIR],
[
case "$withval" in
"" | y | ye | yes | n | no)
AC_MSG_ERROR([*** You must supply an argument to the --with-includes option.])
;;
esac
INCLUDE_DIRS="$withval"
])
if test "$INCLUDE_DIRS"; then
for dir in $INCLUDE_DIRS; do
if test -d "$dir"; then
PGSQL_CPPFLAGS="$PGSQL_CPPFLAGS -I$dir"
else
AC_MSG_WARN([*** Include directory $dir does not exist.])
fi
done
fi
export CPPFLAGS
echo "- setting CPPFLAGS=$CPPFLAGS"
$ECHO_N "Additional directories to search for library files { $SRCH_LIB }: $ECHO_C"
if test "X$with_defaults" = "Xyes"
then
a=$SRCH_LIB
echo ""
else
read a
fi
if test "$a." = "none."
then
SRCH_LIB=
LDFLAGS=
else
if test "$a." = "."
then
a=$SRCH_LIB
fi
LDFLAGS=`echo "$a" | sed 's@ *@ @g; s@^\([[^ ]]\)@-L\1@; s@ \([[^ ]]\)@ -L\1@g'`
AC_ARG_WITH(libraries,
[ --with-libraries=DIR site library directories for tk/tcl, etc in DIR],
[
case "$withval" in
"" | y | ye | yes | n | no)
AC_MSG_ERROR([*** You must supply an argument to the --with-libraries option.])
;;
esac
LIBRARY_DIRS="$withval"
])
if test "$LIBRARY_DIRS"; then
for dir in $withval; do
if test -d "$dir"; then
PGSQL_LDFLAGS="$PGSQL_LDFLAGS -L$dir"
else
AC_MSG_WARN([*** Library directory $dir does not exist.])
fi
done
fi
export LDFLAGS
echo "- setting LDFLAGS=$LDFLAGS"
dnl We have read the default value of USE_LOCALE from the template
dnl file. We have a further option of using
@ -242,6 +227,27 @@ AC_ARG_WITH(
USE_TCL=true; AC_MSG_RESULT(enabled),
USE_TCL=false; AC_MSG_RESULT(disabled)
)
dnl Add tcl/tk candidate directories to CPPFLAGS
if test "$USE_TCL"; then
header_dirs="/usr/include $INCLUDE_DIRS"
tcl_dirs="tcl8.0 tcl80 tcl7.6 tcl76"
tk_dirs="tk8.0 tk4.2"
for dir in $header_dirs; do
for tcl_dir in $tcl_dirs; do
if test -d "$dir/$tcl_dir"; then
PGSQL_CPPFLAGS="$PGSQL_CPPFLAGS -I$dir/$tcl_dir"
fi
done
done
for dir in $header_dirs; do
for tk_dir in $tk_dirs; do
if test -d "$dir/$tk_dir"; then
PGSQL_CPPFLAGS="$PGSQL_CPPFLAGS -I$dir/$tk_dir"
fi
done
done
fi
export USE_TCL
USE_X=$USE_TCL
@ -253,6 +259,15 @@ AC_ARG_WITH(
USE_PERL=true; AC_MSG_RESULT(enabled),
USE_PERL=false; AC_MSG_RESULT(disabled)
)
dnl Verify that postgres is already installed
dnl per instructions for perl interface installation
if test "$USE_PERL" = "true"; then
if test ! -x $prefix/bin/postgres; then
AC_MSG_WARN(perl support disabled; postgres not previously installed)
USE_PERL=
fi
fi
export USE_PERL
dnl Unless we specify the command line options
@ -276,6 +291,13 @@ else
AC_PROG_CC
fi
CPPFLAGS="$CPPFLAGS $PGSQL_CPPFLAGS"
export CPPFLAGS
echo "- setting CPPFLAGS=$CPPFLAGS"
LDFLAGS="$LDFLAGS $PGSQL_LDFLAGS"
export LDFLAGS
echo "- setting LDFLAGS=$LDFLAGS"
AC_CONFIG_HEADER(include/config.h)
@ -577,17 +599,21 @@ fi
fi
dnl Check for Tcl archive
if test "$USE_TCL" = "true"
then
TCL_LIB=
AC_CHECK_LIB(tcl, main, TCL_LIB=tcl)
if test -z "$TCL_LIB"; then
AC_MSG_WARN(tcl support disabled; Tcl library missing)
USE_TCL=
else
TCL_LIB=-l$TCL_LIB
fi
AC_SUBST(TCL_LIB)
if test "$USE_TCL" = "true"; then
TCL_LIB=
tcl_libs="tcl8.0 tcl80 tcl7.6 tcl76 tcl"
for tcl_lib in $tcl_libs; do
if test -z "$TCL_LIB"; then
AC_CHECK_LIB($tcl_lib, main, TCL_LIB=$tcl_lib)
fi
done
if test -z "$TCL_LIB"; then
AC_MSG_WARN(tcl support disabled; Tcl library missing)
USE_TCL=
else
TCL_LIB=-l$TCL_LIB
fi
AC_SUBST(TCL_LIB)
fi
dnl Check for location of Tk support (only if Tcl used)

View File

@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile.in,v 1.5 1998/03/23 06:03:04 momjian Exp $
# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile.in,v 1.6 1998/04/05 20:28:23 momjian Exp $
#
#-------------------------------------------------------------------------
@ -31,12 +31,14 @@ endif
install-shlib-dep :=
shlib :=
LIBPQ = -L $(SRCDIR)/interfaces/libpq -lpq
ifeq ($(PORTNAME), linux)
ifdef LINUX_ELF
install-shlib-dep := install-shlib
shlib := libpgtcl.so.1
CFLAGS += $(CFLAGS_SL)
LDFLAGS_SL = -shared -L$(SRCDIR)/interfaces/libpq -lpq
LDFLAGS_SL = -shared
endif
endif
@ -52,14 +54,14 @@ endif
ifeq ($(PORTNAME), i386_solaris)
install-shlib-dep := install-shlib
shlib := libpgtcl.so.1
LDFLAGS_SL = -G -z text -L$(SRCDIR)/interfaces/libpq -lpq
LDFLAGS_SL = -G -z text
CFLAGS += $(CFLAGS_SL)
endif
ifeq ($(PORTNAME), univel)
install-shlib-dep := install-shlib
shlib := libpgtcl.so.1
LDFLAGS_SL = -G -z text -L$(SRCDIR)/interfaces/libpq -lpq
LDFLAGS_SL = -G -z text
CFLAGS += $(CFLAGS_SL)
endif
@ -77,7 +79,7 @@ endif
$(RANLIB) libpgtcl.a
$(shlib): $(OBJS)
$(LD) $(LDFLAGS_SL) -o $@ $(OBJS)
$(LD) $(LDFLAGS_SL) -o $@ $(OBJS) $(LIBPQ)
ln -sf $@ libpgtcl.so
.PHONY: beforeinstall-headers install-headers