head	1.11;
access;
symbols;
locks; strict;
comment	@# @;


1.11
date	97.04.09.08.55.06;	author scrappy;	state dead;
branches;
next	1.10;

1.10
date	97.04.06.04.43.22;	author scrappy;	state Exp;
branches;
next	1.9;

1.9
date	97.04.04.11.21.42;	author scrappy;	state Exp;
branches;
next	1.8;

1.8
date	97.04.04.10.38.27;	author scrappy;	state Exp;
branches;
next	1.7;

1.7
date	97.04.04.07.58.02;	author scrappy;	state Exp;
branches;
next	1.6;

1.6
date	97.04.03.22.15.44;	author scrappy;	state Exp;
branches;
next	1.5;

1.5
date	97.04.03.21.26.03;	author scrappy;	state Exp;
branches;
next	1.4;

1.4
date	97.03.26.06.54.01;	author scrappy;	state Exp;
branches;
next	1.3;

1.3
date	97.02.05.21.28.22;	author scrappy;	state Exp;
branches;
next	1.2;

1.2
date	97.02.05.04.47.20;	author momjian;	state Exp;
branches;
next	1.1;

1.1
date	97.02.04.22.14.08;	author scrappy;	state Exp;
branches;
next	;


desc
@@


1.11
log
@Much improved configure that integrates the build script right into it

Submitted by: adrian@@waltham.harvard.net
@
text
@#!/bin/sh
#
# PostgreSQL Build Script
#
BUILDRUN=true

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

ls template
TEMPLATE=generic
#
#     Use the file template/.similar to find an appropriate file
#     We get the architecture from the config.guess script.
#
CONFIG=`./config.guess`
GUESS=`grep $CONFIG template/.similar 2>/dev/null`
if [ $GUESS ]; then
      TEMPLATE=`echo $GUESS | sed 's/.*=//'`
fi

$ECHO_N "Appropriate template file [$TEMPLATE]: $ECHO_C"
read a
if [ "$a." = " ." ]
then
	echo "You must choose an appropriate template file"
	exit
else
	if [ "$a." = "." ]; then 
		TEMPLATE=template/$TEMPLATE
	else
		TEMPLATE=template/$a
	fi
	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}'`
	USE_LOCALE=`grep USE_LOCALE $TEMPLATE | awk -F: '{print $2}'`
	DLSUFFIX=`grep DLSUFFIX $TEMPLATE | awk -F: '{print $2}'`
	DL_LIB=`grep DL_LIB $TEMPLATE | awk -F: '{print $2}'`
	YACC=`grep YACC $TEMPLATE | awk -F: '{print $2}'`
	YFLAGS=`grep YFLAGS $TEMPLATE | awk -F: '{print $2}'`
fi

$ECHO_N "Additional directories to search for .h files [$SRCH_INC]: $ECHO_C"
read a
if [ "$a." = " ." ]
then
        CPPFLAGS=
else
	if [ "$a." != "." ]; then
		SRCH_INC = $a
	fi
        CPPFLAGS=`echo "$SRCH_INC" | sed 's@@  *@@ @@g; s@@^\([^ ]\)@@-I\1@@; s@@ \([^ ]\)@@ -I\1@@g'`
fi


$ECHO_N "Additional directories to search for library files [$SRCH_LIB]: $ECHO_C"
read a
if [ "$a." = " ." ]
then
	LDFLAGS=
else
        if [ "$a." != "." ]; then
                SRCH_LIB = $a
        fi
        LDFLAGS=`echo "$SRCH_LIB" | sed 's@@  *@@ @@g; s@@^\([^ ]\)@@-L\1@@; s@@ \([^ ]\)@@ -L\1@@g'`
fi

IDIR=/usr/local/pgsql
$ECHO_N "Installation directory [/usr/local/pgsql]: $ECHO_C"
read a
if [ "$a." != "." ]
then
        IDIR=${a}
fi

echo ""
echo "Define USE_LOCALE to get Postgres work (sort, search)"
$ECHO_N "with national alphabet. [$USE_LOCALE]: $ECHO_C"
read a
if [ "$a." != " ." ]
then
	USE_LOCALE=no
else
        if [ "$a." != "." ]; then
                USE_LOCALE=$a
        fi
fi

DEF_PGPORT=5432
echo ""
echo "DEF_PGPORT is the TCP port number on which the Postmaster listens by"
echo "default.  This can be overriden by command options, environment "
echo "variables, and the postconfig hook."
echo ""

$ECHO_N "Define DEF_PGPORT to [$DEF_PGPORT]: $ECHO_C"
read a
if [ "$a." != "." ]
then
        DEF_PGPORT=${a}
fi

NOHBA=no
echo ""
$ECHO_N "Do you wish to disable Host Based Authentication(HBA) [no]: $ECHO_C"
read a
if [ "$a." != "." ]
then
        NOHBA=${a}
fi

export BUILDRUN USE_LOCALE DEF_PGPORT NOHBA AROPT DLSUFFIX DL_LIB YACC
export SHARED_LIB CFLAGS CPPFLAGS LDFLAGS YFLAGS

./configure --prefix=${IDIR}

@


1.10
log
@Add in support so that build will at least guess which template file
should be used :)
@
text
@@


1.9
log
@Move YACC and YFLAGS into the template files

Clean up the .sample files...comment out all sample entries except for
the localhost one
@
text
@d18 10
@


1.8
log
@This commit represents a clean compile with the new templates under
FreeBSD

The Makefile(s) have all been cleaned up such that there is a single
LDFLAGS vs LD_ADD or LDADD or LDFLAGS or LDFLAGS_BE.  The Makefile(s)
should be alot more straightforward then they were before...and
consistent
@
text
@d38 2
d75 1
d111 2
a112 2
export BUILDRUN USE_LOCALE DEF_PGPORT NOHBA AROPT DLSUFFIX DL_LIB
export SHARED_LIB CFLAGS CPPFLAGS LDFLAGS
@


1.7
log
@One helluva mess.

	Further extended Makefile.global/build/configure so that we can
have a 'template' file for each OS (and each version of OS, as in BSDi)
which is used as much as possible to generate Makefile.global

	Any future ports should look at using the template file as a basis,
before moving over to Makefile.global.

	This will most probably break alot of the ports, atho I've tried to
be very neat about it...
@
text
@d31 2
a32 3
	SHARED_LIBS=`grep SHARED_LIBS $TEMPLATE | awk -F: '{print $2}'`
	ALL=`grep ALL $TEMPLATE | awk -F: '{print $2}'`
	BACKEND=`grep BACKEND $TEMPLATE | awk -F: '{print $2}'`
d36 2
a48 1
	echo $a
d52 1
a52 1
echo ""
d55 1
a55 1
if [ "$a." != " ." ]
d108 2
a109 2
export BUILDRUN USE_LOCALE DEF_PGPORT NOHBA AROPT 
export SHARED_LIBS CFLAGS CPPFLAGS LDFLAGS
@


1.6
log
@More modifications to make building more interactive:

	Allow installer to change DEF_PGPORT
	Allow installer to disable HBA
@
text
@d16 3
a18 1
$ECHO_N "Additional directories to search for .h files []: $ECHO_C"
d20 1
a20 1
if [ "$a." = "." ]
d22 2
a23 1
        ADD_INC_DIRS=
d25 12
a36 3
        ADD_INC_DIRS=`echo "$a" | sed 's@@  *@@ @@g; s@@^\([^ ]\)@@-I\1@@; s@@ \([^ ]\)@@ -I\1@@g'`
        INC_CFLAGS="$ADD_INC_DIRS"
        CPPFLAGS="$ADD_INC_DIRS" ; export CPPFLAGS
d39 1
a39 1
$ECHO_N "Additional directories to search for library files []: $ECHO_C"
d41 15
a55 1
if [ "$a." != "." ]
d57 6
a62 2
        ADD_LIB_DIRS=`echo "$a" | sed 's@@  *@@ @@g; s@@^\([^ ]\)@@-L\1@@; s@@ \([^ ]\)@@ -L\1@@g'`
        LDFLAGS="$ADD_LIB_DIRS" ; export LDFLAGS
a72 1
USE_LOCALE=no
d76 1
a76 1
if [ "$a." != "." ]
d78 5
a82 1
	USE_LOCALE=${a}
d108 2
a109 1
export BUILDRUN USE_LOCALE DEF_PGPORT NOHBA
@


1.5
log
@Various improvements to reduce questions :)

Remove USE_LOCALE from Makefile.global.in
Add USE_LOCALE to build/configure/config.h

Add check for BUILDRUN in configure to make sure that build is run before
configure
@
text
@d45 1
a45 1
$ECHO_N "with national alphabet. [no]: $ECHO_C"
d52 24
a75 1
export BUILDRUN USE_LOCALE
@


1.4
log
@Add ability to change installation directory in build, prior to configure
@
text
@d5 2
d35 1
a40 2
else
	IDIR=/usr/local/pgsql
d42 11
@


1.3
log
@Oops, just about forgot to commit this one too :(
@
text
@d33 10
a42 1
./configure
@


1.2
log
@Update to handle include search paths.
@
text
@d14 1
a14 1
$ECHO_N "Additional directories to search for include and library files []: $ECHO_C"
d16 1
a16 1
if [ "$a." != "." ]
d18 2
d21 1
d23 6
a28 1
        CFLAGS="$ADD_INC_DIRS" ; export CFLAGS
@


1.1
log
@Add a 'build' script.  All it currently does is prompts the user for additional 'lib'
directories to search to find libraries, and then runs ./configure directly
@
text
@d14 1
a14 1
$ECHO_N "Additional directories to search for library files []: $ECHO_C"
d16 1
a16 1
if [ "$a." = "." ]
d18 3
a20 2
        ADD_LIB_DIRS=
else
d22 1
a22 2
        LDFLAGS=$ADD_LIB_DIRS
        export LDFLAGS
@
