Skip to content
Snippets Groups Projects
configure.in 35.4 KiB
Newer Older
Bruce Momjian's avatar
Bruce Momjian committed
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`)

AC_CANONICAL_HOST
Bruce Momjian's avatar
Bruce Momjian committed
	case "$host_cpu" in
Bruce Momjian's avatar
Bruce Momjian committed
	  sparc) os=solaris_sparc need_tas=yes tas_file=solaris_sparc.s ;;
Bruce Momjian's avatar
Bruce Momjian committed
	   i386) os=solaris_i386 need_tas=yes tas_file=solaris_i386.s ;;
Bruce Momjian's avatar
Bruce Momjian committed
	esac ;;
   sunos*) os=sunos4 need_tas=no ;;
Marc G. Fournier's avatar
 
Marc G. Fournier committed
     beos) os=beos need_tas=no ;;
     aux*) os=aux need_tas=no ;;
   linux*) os=linux need_tas=no ;;
    bsdi*) os=bsdi need_tas=no ;;
Marc G. Fournier's avatar
 
Marc G. Fournier committed
 freebsd1*|freebsd2*) os=freebsd need_tas=no ;;
Marc G. Fournier's avatar
 
Marc G. Fournier committed
 freebsd*) os=freebsd need_tas=no elf=yes ;;
  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 ;;
    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 ;;
Bruce Momjian's avatar
Bruce Momjian committed
 sysv4.2*)
Bruce Momjian's avatar
Bruce Momjian committed
	       univel) os=univel need_tas=no ;;
		    *) os=unknown need_tas=no ;;
   sysv4*) os=svr4 need_tas=no ;;
   unixware*) os=unixware need_tas=no ;;
*) echo ""
   echo "*************************************************************"
   echo "configure does not currently recognize your operating system,"
   echo "therefore you must do a manual configuration of:"
   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)
Marc G. Fournier's avatar
 
Marc G. Fournier committed

if test "X$need_tas" = "Xyes"
	AC_LINK_FILES(backend/port/tas/${tas_file}, backend/port/tas.s)
Bruce Momjian's avatar
Bruce Momjian committed
	AC_SUBST(TAS)
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],
Bruce Momjian's avatar
Bruce Momjian committed

# lowercase $host
host="`echo $host | tr '[[A-Z]]' '[[a-z]]'`"
# 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]]'` 
if test ! -f "template/$TEMPLATE"; then
	echo ""
	echo "$TEMPLATE does not exist"
	echo ""
	echo "Available Templates (set using --with-template):"
	echo ""
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
Bruce Momjian's avatar
Bruce Momjian committed
    [  --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"
    ])

Marc G. Fournier's avatar
 
Marc G. Fournier committed
if test "$INCLUDE_DIRS" -o "$SRCH_INC"; then
	for dir in $INCLUDE_DIRS $SRCH_INC; do
Bruce Momjian's avatar
Bruce Momjian committed
		if test -d "$dir"; then
			PGSQL_CPPFLAGS="$PGSQL_CPPFLAGS -I$dir"
		else
			AC_MSG_WARN([*** Include directory $dir does not exist.])
		fi
AC_ARG_WITH(libs,
    [  --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"
    ])

    [  --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...