freebsd-ports/databases/postgresql84-server/scripts/configure.postgresql
Jimmy Olgeni 6e24cd8744 Fix build when BATCH is defined, and remove redundant ${MKDIR} "-p" option.
PR:		28120
Submitted by:	Palle Girgensohn <girgen@partitur.se>
2001-06-13 14:37:45 +00:00

279 lines
6.9 KiB
Bash

#!/bin/sh
# -*- tab-width: 4; -*-
# ex:ts=4
#
# $FreeBSD$
#
if [ -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc ]; then
exit
fi
if [ ! "${BATCH}" ]; then
dialog --title "Backup your data NOW" \
--msgbox "`sed -e \"s#%%PREFIX%%#${PREFIX}#\" < ${FILESDIR}/pre-install-notes`" \
-1 -1
fi
if [ "${BATCH}" ]; then
set \"MultiByte\" \"ODBC\" \"SSL\" \"TCL\" \"TCLTK\"
else
/usr/bin/dialog --title "configuration options" --clear \
--checklist "\n\
Please select desired options:" -1 -1 7 \
JDBC "Java DataBase Connectivity" OFF \
MultiByte "Multibyte for Multilingualism" ON \
ODBC "Open Database Connectivity" ON \
TCL "Tcl" ON \
TCLTK "Tcl/Tk" ON \
SSL "Secure Socket Layer" ON \
KRB5 "Kerberos 5" OFF \
2> /tmp/checklist.tmp.$$
retval=$?
if [ -s /tmp/checklist.tmp.$$ ]; then
set `cat /tmp/checklist.tmp.$$`
fi
rm -f /tmp/checklist.tmp.$$
case $retval in
0) if [ -z "$*" ]; then
echo "Nothing selected"
fi
;;
1) echo "Cancel pressed."
exit 1
;;
esac
fi
${MKDIR} ${WRKDIRPREFIX}${CURDIR}
exec > ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
while [ "$1" ]; do
case $1 in
\"JDBC\")
# We use JAVA_HOME if set correctly. If the user has
# specified a JVM with JAVA_HOME or via the javavmwrapper,
# we validate that it really exists. It is unnecessarily
# complicated and error prone to try to figure out the
# correct java version just to be able to determine a
# BUILD_DEPEND in this case. Instead, assume that a set
# JAVA_HOME together with simple sanity check mean we have
# an installed JVM, and we don't bother setting
# BUILD_DEPENDS.
echo "# JDBC"
# if JAVA_HOME is set and exists, use it
if [ "${JAVA_HOME}" -a -x "${JAVA_HOME}/bin/javac" ]; then
echo JAVA_HOME=${JAVA_HOME}
else
# No JAVA_HOME, check javavmwrapper's config file
if [ -r "${LOCALBASE}/etc/javavms" ]; then
VMS=`/usr/bin/sed 's|#.*||' < "${LOCALBASE}/etc/javavms" | uniq`
for JAVAVM in ${VMS}; do
if [ -x "${JAVAVM}" ]; then
JAVA_HOME=`echo ${JAVAVM} | /usr/bin/sed 's|/bin/java$||`
break
fi
done
fi
if [ "${JAVA_HOME}" -a -x "${JAVA_HOME}/bin/javac" ]; then
# yep, wrapper was good
echo JAVA_HOME=${JAVA_HOME}
else
# nothing, use our boring 1.1.8, the only native non-beta jdk :(
echo BUILD_DEPENDS+= \${LOCALBASE}/jdk1.1.8/bin/javac:\${PORTSDIR}/java/jdk
echo JAVA_HOME=\${LOCALBASE}/jdk1.1.8
fi
fi
cat <<-EOF
BUILD_DEPENDS+= \${LOCALBASE}/bin/ant:\${PORTSDIR}/devel/jakarta-ant
CONFIGURE_ENV+= ANT=\${LOCALBASE}/bin/ant
WITH_JDBC=YES
MAKE_ENV+= JAVA_HOME=\${JAVA_HOME}
SCRIPTS_ENV+= JAVA_HOME=\${JAVA_HOME}
CONFIGURE_ARGS+= --with-java
EOF
;;
\"MultiByte\")
MULTIBYTE=1
;;
\"ODBC\")
cat <<-EOF
# ODBC
WITH_ODBC=YES
CONFIGURE_ARGS+= --with-odbc
EOF
;;
\"TCL\")
TCL=1
;;
\"TCLTK\")
echo "#TCLTK"
echo WITH_TK=YES
echo
TCL=1
;;
\"SSL\")
cat <<-EOF
# SSL
USE_OPENSSL= yes
CFLAGS+= -DUSE_SSL
WITH_SSL= yes
CONFIGURE_ENV+= LDFLAGS="-L\${OPENSSLLIB} -lssl -lcrypto"
CONFIGURE_ARGS+= --with-openssl
EOF
;;
\"KRB5\")
KRB5=1
;;
\"nothing\"|true)
;;
*)
echo "Invalid option(s): $*" > /dev/stderr
rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
exit 1
;;
esac
shift
done
exec > /dev/stderr
# if multibyte, determine charset
echo "# Multibyte" >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
if [ ! "${MULTIBYTE}" ]; then
echo "WITHOUT_MULTIBYTE=YES" >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
else
if [ "${BATCH}" ]; then
set "nothing"
else
/usr/bin/dialog --title "configuration options" --clear \
--radiolist "\n\
Please select desired options:" -1 -1 16 \
nothing "Default Encoding" ON \
SQL_ASCII "SQL_ASCII" OFF \
LATIN1 "LATIN1" OFF \
LATIN2 "LATIN2" OFF \
LATIN3 "LATIN3" OFF \
LATIN4 "LATIN4" OFF \
LATIN5 "LATIN5" OFF \
EUC_JP "EUC_JP" OFF \
EUC_CN "EUC_CN" OFF \
EUC_KR "EUC_KR" OFF \
EUC_TW "EUC_TW" OFF \
KOI8 "KOI8" OFF \
UNICODE "UNICODE" OFF \
MULE_INTERNAL "MULE_INTERNAL" OFF \
WIN "WIN" OFF \
ALT "ALT" OFF \
2> /tmp/checklist.tmp.$$
retval=$?
if [ -s /tmp/checklist.tmp.$$ ]; then
set `cat /tmp/checklist.tmp.$$`
fi
rm -f /tmp/checklist.tmp.$$
if [ $retval = 1 ]; then
echo "Cancel pressed."
rm ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
exit 1
fi
fi
if [ "$1" = "nothing" ]; then
echo "CONFIGURE_ARGS+= --enable-multibyte" \
>> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
else
echo "CONFIGURE_ARGS+= --enable-multibyte=$1" \
>> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
fi
fi
echo
if [ "${TCL}" ]; then
echo "# TCL" >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
if [ "${BATCH}" ]; then
echo WITH_TCL=8.3 >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
else
dialog --title "TCL version" \
--inputbox "Please enter TCL version. Default is 8.3." -1 -1 "8.3" \
2> /tmp/checklist.tmp.$$
retval=$?
if [ -s /tmp/checklist.tmp.$$ ]; then
set `cat /tmp/checklist.tmp.$$`
fi
rm -f /tmp/checklist.tmp.$$
case $retval in
0) if [ -z "$*" ]; then
echo "Nothing selected"
fi
;;
1) echo "Cancel pressed."
rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
exit 1
;;
esac
echo WITH_TCL=$1 >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
fi
cat <<-EOF >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
CONFIGURE_ARGS+= --with-tcl --with-tclconfig="\${TCLCONFIG}"
TCLV=\${WITH_TCL:S/.//}
TCL_INCDIR= \${LOCALBASE}/include/tcl\${WITH_TCL}
MAKE_ENV+= TCL_INCDIR=\${TCL_INCDIR}
LIB_DEPENDS+= tcl\${TCLV}:\${PORTSDIR}/lang/tcl\${TCLV}
TCLCONFIG= "\${LOCALBASE}/lib/tcl\${WITH_TCL}"
.if defined(WITH_TK)
CONFIGURE_ARGS+= --with-tkconfig="\${TKCONFIG}"
TK_INCDIR= \${LOCALBASE}/include/tk\${WITH_TCL}
CONFIGURE_ENV+= WISH=\${LOCALBASE}/bin/wish\${WITH_TCL}
LIB_DEPENDS+= tk\${TCLV}:\${PORTSDIR}/x11-toolkits/tk\${TCLV}
TKCONFIG= "\${LOCALBASE}/lib/tk\${WITH_TCL}"
TCLCONFIG+= \${TKCONFIG}
TCL_PLIST= pkg-plist.tcl
.else
TCL_PLIST= pkg-plist.notk
CONFIGURE_ARGS+= --without-tk
.endif
EOF
fi
if [ "${KRB5}" ]; then
if [ "${BATCH}" ]; then
# never gets here, but what the heck...
echo KRB5_HOME=\${LOCALBASE} >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
else
dialog --inputbox "Please enter the KRB5_HOME path" -1 -1 "${KRB_HOME:-${LOCALBASE}}" \
2> /tmp/checklist.tmp.$$
retval=$?
if [ -s /tmp/checklist.tmp.$$ ]; then
set `cat /tmp/checklist.tmp.$$`
fi
rm -f /tmp/checklist.tmp.$$
case $retval in
0) if [ -z "$*" ]; then
echo "No input"
fi
;;
1) echo "Cancel pressed."
rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
exit 1
;;
esac
echo KRB5_HOME=\"$1\" >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
fi
cat <<-EOF >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
.if defined(KRB5_HOME) && exists(\${KRB5_HOME})
CONFIGURE_KRB= --with-krb5=\${KRB5_HOME}
.endif
EOF
fi