# Copyright 1994-1996 America Online, Inc. 

#
# Makefile for postgres.so module.
#
# -DFOR_ACS_USE required for OpenACS use!

# To have the AOLserver load the postgres.so module at runtime, you will need 
# to add the following entry in the [ns\server\godzilla\modules] section of your 
# nsd.ini file (where 'godzilla' is the name of a virtual server):
#
#	postgres=postgres.so
#
# 12/13/1999 Lamar Owen <lamar.owen@wgcr.org>
#  - Cleaned up assumptions about NSHOME, PGLIB, and PGINC locations.
#  - Added a commented-out block showing settings for RedHat Linux with
#    the PostgreSQL RPM's installed.
#
# 2000-02-12 John Beimler <john@radiomind.com>
#  - Added a commented-out block showing settings for Debian/GNU Linux with
#    package installed AOLserver and PostgreSQL
#
# 2001-08-21 Roberto Mello (rmello@fslc.usu.edu)
#  - Cleaned up the Makefile to conform to AOLserver module makefiles.
#  - Added PGLOC section. But this should really be done with autoconf/automake

ifdef INST
	NSHOME ?= $(INST)
else
	NSHOME ?= ../aolserver
endif

PGLOC=$(shell if [ -d "/usr/local/pgsql" ]; then echo "source" else echo "standard"; fi)
ifeq ($(PGLOC),source)
	# Location of the PostgreSQL libraries 
	PGLIB=/usr/local/pgsql/lib 
	# Location of the PostgreSQL includes 
	PGINC=/usr/local/pgsql/include
else 
	# Locations on a LSB-compliant distribution 
	PGLIB=/usr/lib 
	PGINC=/usr/include/postgresql 
endif

#
# Module name
#
MOD      =  postgres.so

#
# Objects to build
#
OBJS     =  postgres.o

#
# Header files in THIS directory (included with your module)
#
HDRS     =

#
# Extra libraries required by your module (-L and -l go here)
#
MODLIBS  = -lpq

#
# Compiler flags required by your module (-I for external headers goes here)
#
CFLAGS   =  -DFOR_ACS_USE -DBIND_EMULATION -I$(NSHOME)/include -I$(PGINC) 

include  $(NSHOME)/include/Makefile.module