#
# $Header: /usr/local/devel/postgres/src/RCS/Makefile.global,v 1.15 1993/03/11 08:04:02 mao Exp $
#
# A Makefile.global is seen by the Makefile in the current
# directory and any Makefiles in any subdirectories (assuming
# they .include <postgres.global.mk>).  Also, if there is
# a Makefile.global in the "obj" directory it is included after.
# This allows machines to tailor Makefiles and override default
# setting when sharing a source tree between a number of
# machines.  Note that since the "obj" directories themselves
# are actually symbolic links which are stored on the serving
# machine and visible to all sharing sites, it is not possible to
# change where the "obj" directories point (without changing
# it for everyone).  You can, however, change any of the values
# below simply by altering your private copy of this Makefile
# in the "obj" directory.
#
# Note: if you change any of these defines you probably have to 
#
#	bmake clean; bmake
#
# since no dependecies are created for these. (of course you can 
# be crafty and check what files really depend on them and just remake
# those).
#

#
# == CONFIGURATION SECTION ==
#

# Following is where the tools necessary to build postgres
# get installed.
# It is necessary to have the TOOLSBINDIR, whatever that may be,
# in your PATH before attempting to bootstrap the build.  To
# bootstrap (that is, if bmake(1) is not installed on your system)
# you should cd(1) to the src/tools/bmake directory and type
#
#       make -f Makefile.boot
#
# This will install bmake(1) in the TOOLSBINDIR and supporting
# postgres configuration files in TOOLSLIBDIR.  Then you can
# go back up to the src/ directory and run "bmake".
#
TOOLSBINDIR= /usr/local/bin
TOOLSLIBDIR= /usr/local/lib

# Following are settings pertaining to the postgres build
# and installation.  The most important one is obviously
# the name of the port.

#  The name of the port.  Valid choices are:
#	ultrix4	-	ultrix 4.?
#	sparc	-	SUN sparc
#  or add your own - :)
#
#PORTNAME=	ultrix4
PORTNAME=	sparc

#
# For convenience, POSTGRESDIR is where DATADIR, BINDIR, and LIBDIR 
# and other target destinations are rooted.  Of course, each of these is 
# changable separately.  This is usually "/usr/local/postgres" but may be 
# different for the postgres development team and sequoia users.
#
#POSTGRESDIR=	/usr/local/devel/postgres-4.1
POSTGRESDIR=	/usr/local/postgres

#
# Where the database lives (changeable at run time by setting PGDATA
# in your environment)
#
DATADIR=	${POSTGRESDIR}/data

#
# Where the postgres executables live (changeable by just putting them
# somewhere else and putting that directory in your shell PATH)
#
BINDIR=		${POSTGRESDIR}/bin

#
# Where libpq.a gets installed.  You must put it where your loader will
# look for it if you wish to use the -lpq.a convention.  Otherwise you
# can just put the absolute pathname to the libraray at the end of your
# compile line.
LIBDIR=		${POSTGRESDIR}/lib

#
# Where the man pages get installed.
#
POSTMANDIR=	${POSTGRESDIR}/man

#
# Where the formatted documents get installed.
#
POSTDOCDIR=	${POSTGRESDIR}/doc

#
# Where the header files necessary to build frontend
# programs get installed.
#
HEADERDIR=	${POSTGRESDIR}/include

#
# If you plan to use Kerberos for authentication.
#
# Comment out KRBVERS if you do not use Kerberos.
# 	Set KRBVERS to "4" for Kerberos v4, "5" for Kerberos v5.
#	XXX Edit the default Kerberos variables below!
#KRBVERS=	5

# Comment out USE_DLD if you do not use the GNU DLD package for
# dynamic loading.
#USE_DLD=

#
# == END OF NORMAL CONFIGURATION SECTION ==
#

.if (${PORTNAME} != "sparc")
MACHINE!=	machine
.else
MACHINE=	sun
.endif
STRIP=

#
# FEATURES: 
# To disable a feature, comment out the definition
# (that is, prepend '#', don't set it to "0" or "no").
#

#
# Man pages don't live with sources this release (coming soon)
#
NOMAN=

#
# If this is set, then target "install" depends on "all", which
# makes "make install" clutzy since it makes two passes over the
# hierarchy, once to check "all", twice to do the install - but
# some people like this.
#
ALLINSTALL=

# comment out CDEBUG to turn off debugging and sanity-checking
#	XXX on MIPS, use -g3 if you want to compile with -O
#CDEBUG=		-g

# comment out PROFILE to disable profiling
#	XXX define on MIPS if you want to be able to use pixie.
#	    note that this disables dynamic loading!
#PROFILE=

#
# Globally pass debugging flags
#
.ifdef CDEBUG
CFLAGS= ${CDEBUG}
LDFLAGS= ${CDEBUG}
.else
CFLAGS= -O -DNO_ASSERT_CHECKING
.endif

#
# Globally pass profiling flags
#
.ifdef PROFILE
CFLAGS+= ${PROFILE}
LDFLAGS+= ${PROFILE}
.endif

#
# Globally pass authentication system file locations
#	these are used in the postmaster and all libpq applications.
#
#	XXX they are also included in the backend due to modularization 
#	    weirdness in libpq...sigh.
#
#	Adjust KRBINCS and KRBLIBS to reflect where you have Kerberos
#		include files and libraries installed.
#	PG_KRB_SRVNAM is the name under which POSTGRES is registered in
#		the Kerberos database (KDC).
#	PG_KRB_SRVTAB is the location of the server's keytab file.
#
.ifdef KRBVERS
KRBINCS= -I/usr/athena/include
KRBLIBS= -L/usr/athena/lib
KRBFLAGS+= ${KRBINCS} '-DPG_KRB_SRVNAM="postgres_dbms"'
.   if ${KRBVERS} == "4"
KRBFLAGS+= -DKRB4
KRBFLAGS+= '-DPG_KRB_SRVTAB="/etc/srvtab"'
KRBLIBS+= -lkrb -ldes
.   elif ${KRBVERS} == "5"
KRBFLAGS+= -DKRB5
KRBFLAGS+= '-DPG_KRB_SRVTAB="FILE:/krb5/srvtab.postgres"'
KRBLIBS+= -lkrb5 -lcrypto -lcom_err -lisode
.   endif
.endif

#
# POSTGRESLOGIN is the login name of the user who gets special
# privilige over the databases.  For now it must be "postgres",
#
POSTGRESLOGIN= postgres

#
# Globally pass PORTNAME
#
CFLAGS+= -DPORTNAME=${PORTNAME} -DPORTNAME_${PORTNAME}

#
# Globally define SEQUOIA for development at Berkeley and other
# Sequoia 2000 Project sites.
#
CFLAGS+= -DSEQUOIA
