Newer
Older
dnl Process this file with autoconf to produce a configure script.
AC_INIT(backend/access/common/heaptuple.c)
AC_PREFIX_DEFAULT(/usr/local/pgsql)
AC_CONFIG_HEADER(include/config.h)
dnl Autoconf 2.12, at least, generates a useless relative path to install-sh
dnl unless we do this.
AC_CONFIG_AUX_DIR(`pwd`)
Marc G. Fournier
committed
tas_file=dummy.s
case "$host_os" in
solaris*)
sparc) os=solaris_sparc need_tas=yes tas_file=solaris_sparc.s ;;
i386) os=solaris_i386 need_tas=yes tas_file=solaris_i386.s ;;
aux*) os=aux need_tas=no ;;
linux*) os=linux need_tas=no ;;
bsdi*) os=bsdi need_tas=no ;;
netbsd*)
os=bsd need_tas=no
case "$host_cpu" in
powerpc) elf=yes ;;
esac ;;
openbsd*) os=bsd need_tas=no ;;
dgux*) os=dgux need_tas=no ;;
aix*) os=aix need_tas=no ;;
nextstep*) os=nextstep need_tas=no ;;
ultrix*) os=ultrix4 need_tas=no ;;
irix*) os=irix5 need_tas=no ;;
Marc G. Fournier
committed
hpux*) os=hpux need_tas=yes tas_file=hpux.s ;;
osf*) os=alpha need_tas=no ;;
sco*) os=sco need_tas=no ;;
machten*) os=machten need_tas=no ;;
cygwin*) os=win need_tas=no ;;
Marc G. Fournier
committed
case "$host_vendor" in
univel) os=univel need_tas=no ;;
*) os=unknown need_tas=no ;;
Marc G. Fournier
committed
esac ;;
unixware*) os=unixware need_tas=no ;;
qnx4*) os=qnx4 need_tas=no ;;
*) echo ""
echo "*************************************************************"
echo "configure does not currently recognize your operating system,"
echo "therefore you must do a manual configuration of:"
Marc G. Fournier
committed
echo "$host_os"
echo "Please contact scrappy@hub.org to see about rectifying this, "
echo "including the above 'checking host system type...' line "
echo "*************************************************************"
echo ""
exit;;
esac
PORTNAME=${os}
CPU=${host_cpu}
AC_LINK_FILES(backend/port/dynloader/${os}.c, backend/port/dynloader.c)
AC_LINK_FILES(backend/port/dynloader/${os}.h, include/dynloader.h)
AC_LINK_FILES(include/port/${os}.h, include/os.h)
AC_LINK_FILES(makefiles/Makefile.${os}, Makefile.port)
if test "X$need_tas" = "Xyes"
Marc G. Fournier
committed
AC_LINK_FILES(backend/port/tas/${tas_file}, backend/port/tas.s)
echo "checking echo setting..."
if echo '\c' | grep -s c >/dev/null 2>&1
then
ECHO_N="echo -n"
ECHO_C=""
else
ECHO_N="echo"
ECHO_C='\c'
fi
dnl this part selects the template from the ones in the template directory.
AC_MSG_CHECKING(setting template to)
AC_ARG_WITH(template,
[ --with-template=TEMPLATE
use operating system template file
see template directory],
[ TEMPLATE=$withval ],
host="`echo $host | tr '[[A-Z]]' '[[a-z]]'`"
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# First, try for a template exactly matching $host
if test -f "template/$host"
then TEMPLATE="$host"
else
# Next try for an exact match to a .similar entry.
# There shouldn't be multiple matches, but take the last if there are.
GUESS=`grep "^$host=" template/.similar | sed 's/^.*=//' | tail -1`
if test "$GUESS"
then TEMPLATE="$GUESS"
else
# Next look for a .similar entry that is a prefix of $host.
# If there are multiple matches, take the last one.
exec 4<template/.similar
while read LINE <&4
do
SIMHOST=`expr "$LINE" : '\(.*\)='`
MATCH=`expr "$host" : "$SIMHOST"`
if test "$MATCH" != 0
then GUESS=`echo "$LINE" | sed 's/^.*=//'`
fi
done
exec 4<&-
if test "$GUESS"
then TEMPLATE="$GUESS"
else
# Last chance ... maybe uname -s will match an entry.
TEMPLATE=`uname -s | tr '[[A-Z]]' '[[a-z]]'`
])
AC_MSG_RESULT($TEMPLATE)
export TEMPLATE
if test ! -f "template/$TEMPLATE"; then
echo ""
echo "$TEMPLATE does not exist"
echo ""
echo "Available Templates (set using --with-template):"
echo ""
ls template
echo ""
exit
fi
dnl Read the selected template file.
dnl For reasons of backwards compatibility, lines of the form
dnl IDENTIFIER: something
dnl should be treated as variable assignments. However, we also want to
dnl allow other shell commands in the template file (in case the file
dnl needs to make conditional tests, etc). So, generate a temp file with
dnl the IDENTIFIER: lines translated, then source it.
[
rm -f conftest.sh
sed 's/^\([A-Za-z_]*\):\(.*\)$/\1="\2"/' "template/$TEMPLATE" >conftest.sh
rm -f conftest.sh
]
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"
])
for dir in $INCLUDE_DIRS $SRCH_INC; 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
[ --with-libs=DIR also search for libraries in DIR],
[
case "$withval" in
"" | y | ye | yes | n | no)
AC_MSG_ERROR([*** You must supply an argument to the --with-libs option.])
;;
esac
LIBRARY_DIRS="$withval"
])
AC_ARG_WITH(libraries,
[ --with-libraries=DIR also search for libraries 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"
Loading
Loading full blame...