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