From 40f4a330b7dc3becf1289d30b1c73ed03f663bde Mon Sep 17 00:00:00 2001 From: "Marc G. Fournier" Date: Mon, 13 Jan 1997 18:54:30 +0000 Subject: [PATCH] Andrew's Makefile.custom generation program...hopefully should reduce *some* confusion, eh? :) From: Andrew Martin --- src/customize | 264 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 264 insertions(+) create mode 100644 src/customize diff --git a/src/customize b/src/customize new file mode 100644 index 0000000000..ef8cff0cd0 --- /dev/null +++ b/src/customize @@ -0,0 +1,264 @@ +#!/bin/sh +#************************************************************************* +# +# Program: PostgreSQL customisation utility +# File: customise +# +# Version: 6.0 +# Date: 08.01.97 +# Function: Write Makefile.custom for PostgreSQL +# +# Copyright: (c) Dr. Andrew C. R. Martin 1997 +# Author: Dr. Andrew C. R. Martin +# Address: Biomolecular Structure & Modelling Unit, +# Department of Biochemistry & Molecular Biology, +# University College, +# Gower Street, +# London. +# WC1E 6BT. +# EMail: martin@biochem.ucl.ac.uk +# andrew@stagleys.demon.co.uk +# +#************************************************************************* +# +# This program is distributed under the copyright for PostgreSQL +# +#************************************************************************* +# +# Function: +# ========= +# This program prompts the user to enter basic customisation options +# for a local installation of PostgreSQL. From these answers it writes +# a Makefile.custom +# +# It is intended as a stop-gap measure until autoconf is implemeted. +# +#************************************************************************* +# +# Revision History: +# ================= +# V6.0 08.01.96 Original version for PostgreSQL V6.0 +# +#************************************************************************* +# Customise the customisation! Set variables for default directories +# ------------------------------------------------------------------ +libdir="/usr/local/lib" +incdir="/usr/local/include" + +#************************************************************************* +# readln "prompt" "default" +# ------------------------- +# Reads a line into $ans. +# Based on code from the Linux Configure utility +# +# 08.01.96 Original By: ACRM +readln () { + echo -n "$1 " + IFS='@' read ans Makefile.custom "PORTNAME= $portname" + +if [ "$portname" = "linux" ] ; then + bool "Is this an ELF system?" "y" + if [ "$ans" = "n" ] ; then + echo >>Makefile.custom "LINUX_ELF= " + fi +fi + +def="/usr/local/pgsql" +readln "Where do you wish to install Postgres [$def]?" "$def" +if [ "$ans" != "$def" ] ; then + echo >>Makefile.custom "POSTGRESDIR= $ans" +fi + +if [ "$portname" = "irix5" ] ; then + echo >>Makefile.custom "IPCSDIR= /usr/sbin" +else + def="/usr/bin" + readln "Where are the IPCS utilities stored [$def]?" "$def" + if [ "$ans" != "$def" ] ; then + echo >>Makefile.custom "IPCSDIR= $ans" + fi +fi + +bool "Compile C++ library?" "n" +if [ "$ans" = "y" ] ; then + echo >>Makefile.custom "HAVE_Cplusplus= true" +fi + +bool "Compile Tcl utilities?" "n" +if [ "$ans" = "y" ] ; then + echo >>Makefile.custom "USE_TCL= true" + + def=$incdir + readln "Tcl include directory [$def]?" "$def" + echo >>Makefile.custom "TCL_INCDIR= $ans" + + def=$libdir + readln "Tcl library directory [$def]?" "$def" + echo >>Makefile.custom "TCL_LIBDIR= $ans" + + def="7.5" + readln "Tcl version [$def]?" "$def" + echo >>Makefile.custom "TCL_LIB= -ltcl$ans" + + def=$incdir + readln "Tk include directory [$def]?" "$def" + echo >>Makefile.custom "TK_INCDIR= $ans" + + def=$libdir + readln "Tk library directory [$def]?" "$def" + echo >>Makefile.custom "TK_LIBDIR= $ans" + + def="4.1" + readln "Tk version [$def]?" "$def" + echo >>Makefile.custom "TK_LIB= -ltk$ans" + + def="/usr/include" + readln "X11 include directory [$def]?" "$def" + echo >>Makefile.custom "X11_INCDIR= $ans" + + def="/usr/lib" + readln "X11 library directory [$def]?" "$def" + echo >>Makefile.custom "X11_LIBDIR= $ans" + + echo " " + echo "If you need to enter more than one library, the second" + echo "and subsequent ones should be preceeded by -l" + def="X11" + readln "X11 library [$def]?" "$def" + echo >>Makefile.custom "X11_LIB= $ans" +fi + + +echo " " +echo "Which BSD-compatible Install utility do you wish to use?" +echo "Under Irix the default will chown all your installed files" +echo "to root, so you are recommended to obtain ginstall" +readln "Enter program name: [system default]" "DEFAULT" +if [ "$ans" != "DEFAULT" ] ; then + echo >>Makefile.custom "CUSTOM_INSTALL= $ans" +fi +echo " " + +bool "Do you wish the psql program to use the GNU readline library?" "n" +if [ "$ans" = "y" ] ; then + echo >>Makefile.custom "USE_READLINE= true" + + echo " " + echo "If the include files for any of the following libraries are" + echo "split across multiple directories, you should put a -I before" + echo "the second and subsequent directories. For example:" + echo "/usr/local/include -I/usr/local/include/readline" + echo " " + +### Readline library ### + def=$incdir + readln "Readline include directory [$def]" "$def" + echo >>Makefile.custom "READLINE_INC= -I$ans" + + rldirdef=$libdir + readln "Readline library directory [$rldirdef]" "$rldirdef" + rldir=$ans + + rllibdef="readline" + readln "Name of the readline library [$rllibdef]" "$rllibdef" + rllib=$ans + + echo >>Makefile.custom "READLINE_LIB= -L$rldir -l$rllib" + +### Curses library ### + crdirdef=$libdir + readln "Curses library directory [$crdirdef]" "$crdirdef" + crdir=$ans + + crlibdef="curses" + readln "Name of the curses library [$crlibdef]" "$crlibdef" + crlib=$ans + + echo >>Makefile.custom "CURSES_LIB= -L$crdir -l$crlib" + +### Separate history library ### + bool "Does your readline have a separate history library?" "n" + if [ "$ans" != "n" ] ; then + def="$incdir -I$incdir/readline" + readln "History include directory [$def]" "$def" + echo >>Makefile.custom "HISTORY_INC= -I$ans" + + histdirdef="$libdir" + readln "History library directory [$histdirdef]" "$histdirdef" + histdir=$ans + + histlibdef="history" + readln "Name of the history library [$histlibdef]" "$histlibdef" + histlib=$ans + + echo >>Makefile.custom "HISTORY_LIB= -L$histdir -l$histlib" + fi +fi + +echo " " +readln "Specify C compiler: [cc]" "DEFAULT" +if [ "$ans" != "DEFAULT" ] ; then + echo >>Makefile.custom "CUSTOM_CC= $ans" +fi + +readln "Specify any custom C compilation flags: [none]" "DEFAULT" +if [ "$ans" != "DEFAULT" ] ; then + echo >>Makefile.custom "CUSTOM_COPT= $ans" +fi + +echo " " +echo "You may choose to switch of assert checking. This will speed the" +echo "program up, but may miss some potentially fatal bugs!" +bool "Switch off assert checking" "n" +if [ "$ans" = "y" ] ; then + echo >>Makefile.custom "CASSERT= " +fi -- 2.40.0