dnl Process this file with autoconf to produce a configure script. AC_INIT(bind.c) AC_PREFIX_DEFAULT(/usr/local) if test -d ../../interfaces then TEMPLATEDIR=../../template if test "$prefix" = "NONE" then ac_default_prefix=/usr/local/pgsql ODBCINSTDIR=$ac_default_prefix else ODBCINSTDIR=$prefix fi else TEMPLATEDIR=./template if test "$prefix" = "NONE" then ODBCINSTDIR=$ac_default_prefix/share else ODBCINSTDIR=$prefix fi fi echo "*** configuring psqlodbc ***" AC_CANONICAL_HOST case "$host_os" in solaris*) case "$host_cpu" in sparc) os=sparc_solaris ;; i386) os=i386_solaris ;; esac ;; sunos*) os=sunos4 ;; aux*) os=aux ;; linux*) os=linux ;; bsdi*) os=bsdi ;; freebsd*|netbsd*|openbsd*) os=bsd ;; dgux*) os=dgux ;; aix*) os=aix ;; nextstep*) os=nextstep ;; ultrix*) os=ultrix4 ;; irix*) os=irix5 ;; hpux*) os=hpux ;; osf*) os=alpha ;; sco*) os=sco ;; machten*) os=machten ;; cygwin*) os=win ;; sysv4.2*) case "$host_vendor" in univel) os=univel ;; *) os=unknown ;; esac ;; sysv4*) os=svr4 ;; *) echo "" echo "*************************************************************" echo "configure does not currently recognize your operating system," echo "therefore you must do a manual configuration of:" 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} AC_SUBST(PORTNAME) 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 cat </dev/null` fi if test "$GUESS" then TEMPLATE=`echo $GUESS | sed 's/.*=//'` fi export TEMPLATE ls $TEMPLATEDIR echo "**************************************************************" $ECHO_N "Appropriate template file { $TEMPLATE }: $ECHO_C" read a if test "$a." != "." then TEMPLATE=$a fi if test ! -f $TEMPLATEDIR/$TEMPLATE then echo "You must choose an appropriate template file." exit fi fi fi TEMPLATE=$TEMPLATEDIR/$TEMPLATE export TEMPLATE echo "" AROPT=`grep '^AROPT:' $TEMPLATE | awk -F: '{print $2}'` SHARED_LIB=`grep '^SHARED_LIB:' $TEMPLATE | awk -F: '{print $2}'` CFLAGS=`grep '^CFLAGS:' $TEMPLATE | awk -F: '{print $2}'` SRCH_INC=`grep '^SRCH_INC:' $TEMPLATE | awk -F: '{print $2}'` SRCH_LIB=`grep '^SRCH_LIB:' $TEMPLATE | awk -F: '{print $2}'` DLSUFFIX=`grep '^DLSUFFIX:' $TEMPLATE | awk -F: '{print $2}'` DL_LIB=`grep '^DL_LIB:' $TEMPLATE | awk -F: '{print $2}'` CC=`grep '^CC:' $TEMPLATE | awk -F: '{print $2}'` LIBS=`grep '^LIBS:' $TEMPLATE | awk -F: '{print $2}'` a=$SRCH_INC CPPFLAGS=`echo "$a" | sed 's@ *@ @g; s@^\([[^ ]]\)@-I\1@; s@ \([[^ ]]\)@ -I\1@g'` export CPPFLAGS echo "- setting CPPFLAGS=$CPPFLAGS" a=$SRCH_LIB LDFLAGS=`echo "$a" | sed 's@ *@ @g; s@^\([[^ ]]\)@-L\1@; s@ \([[^ ]]\)@ -L\1@g'` export LDFLAGS echo "- setting LDFLAGS=$LDFLAGS" dnl Allow for overriding the default location of the odbcinst.ini dnl file which is normally ${prefix}/share or ${prefix} if this is dnl being compiled inside the postgres distribution. AC_MSG_CHECKING(setting ODBCINST) AC_ARG_WITH( odbcinst, [ --with-odbcinst= change default directory for odbcinst.ini], AC_DEFINE_UNQUOTED(ODBCINST, ${with_odbcinst}) AC_MSG_RESULT($with_odbcinst), AC_DEFINE_UNQUOTED(ODBCINST, ${ODBCINSTDIR}) AC_MSG_RESULT(${ODBCINSTDIR}) ) if test "X$with_odbcinst" != "X" then ODBCINSTDIR=$with_odbcinst fi AC_SUBST(ODBCINSTDIR) if test "X$with_compiler" != "X" then CC=$with_compiler else AC_PROG_CC fi AC_CONFIG_HEADER(config.h) dnl Checks for programs. AC_PROG_CPP AC_SUBST(PORTNAME) AC_SUBST(LDFLAGS) AC_SUBST(CPPFLAGS) AC_SUBST(AROPT) AC_SUBST(SHARED_LIB) AC_SUBST(CFLAGS) AC_SUBST(DLSUFFIX) AC_SUBST(DL_LIB) INSTALLPATH="/usr/ucb:$PATH" AC_PATH_PROGS(INSTALL, ginstall installbsd bsdinst scoinst install, NONE, $INSTALLPATH) if test $INSTALL = "NONE" then echo "- No Install Script found - aborting." exit 0; fi INSTLOPTS="-m 444" INSTL_EXE_OPTS="-m 555" INSTL_LIB_OPTS="-m 644" case "`basename $INSTALL`" in install|installbsd|scoinst) INSTLOPTS="-c $INSTLOPTS" INSTL_EXE_OPTS="-c $INSTL_EXE_OPTS" INSTL_LIB_OPTS="-c $INSTL_LIB_OPTS";; esac echo "- Using $INSTALL" AC_SUBST(INSTALL) AC_SUBST(INSTLOPTS) AC_SUBST(INSTL_LIB_OPTS) AC_SUBST(INSTL_EXE_OPTS) dnl Check the option to echo to inhibit newlines. ECHO_N_OUT=`echo -n "" | wc -c` ECHO_C_OUT=`echo "\c" | wc -c` if test "$ECHO_N_OUT" -eq 0; then DASH_N='-n' BACKSLASH_C= else if test "ECHO_C_OUT" -eq 0; then DASH_N= BACKSLASH_C='\\\\c' else AC_MSG_ERROR("echo behaviour undetermined") fi fi AC_SUBST(DASH_N) AC_SUBST(BACKSLASH_C) AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_RANLIB AC_PATH_PROG(find, find) AC_PATH_PROG(tar, tar) AC_PATH_PROG(split,split) AC_CHECK_LIB(c, main) AC_CHECK_LIB(m, main) AC_CHECK_LIB(dl, main) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(sys/param.h pwd.h) dnl Checks for typedefs, structures, and compiler characteristics. dnl Check for any "odd" conditions dnl Checks for library functions. AC_CHECK_FUNCS(stricmp) dnl Check for X libraries dnl Check for X library AC_OUTPUT(GNUmakefile Makefile.global)