#
# must provide target
#
-if [ $# -eq 0 -o $# -gt 2 ]; then
- echo "Usage: $0 current | lion | snowleopardx64 | snowleopard | snowleopardi386 | leopardupwards | leopard | leopardi386 | leopardppc | tiger | tigeri386 | tigerppc | panther [-pcre]"
+if [ $# -eq 0 -o $# -gt 3 ]; then
+ echo "Usage: $0 current | curent-Xcode | lion | snowleopardx64 | snowleopard | snowleopardi386 | leopardupwards | leopard | leopardi386 | leopardppc | tiger | tigeri386 | tigerppc | panther [-pcre] [-https]"
exit 1
fi
# load common settings
#
. ./common.sh $1
+
+# Debugging
#echo "${XCODE_PATH}"
#echo ${SYSROOT}
# must have Xcode
#
if [ -z ${XCODE_PATH} ]; then
- echo "Error: Xcode is not found."
+ echo "Error: Commandline Tools for Xcode is not found."
exit 1
fi
#
-# set configure options; include the appropriate user/group as discerned by common.sh and set pcre to dynamic (libpcre) or static (bundled)
-#
-if [ "$2" == "-pcre" ]; then
- CFLAGS="${CFLAGS} -I/usr/local/include/"
- LDFLAGS="${LDFLAGS} -L/usr/local/lib"
- OPTS=${OPTS}
-else
+# set configure options based on the parameters passed at the command line
+
+for option in "$@"
+do
+ # set pcre library source to dynamic (libpcre - more up to date but requires the external library to exist for compiling) or static (bundled with privoxy - older version)
+ if [ "$option" == "-pcre" ]; then
+ CFLAGS="${CFLAGS} -I/usr/local/include/"
+ LDFLAGS="${LDFLAGS} -L/usr/local/lib"
+ OPTS="${OPTS}"
+ fi
+
+ # enable HTTPS Inspection?
+ if [ "$option" == "-https" ]; then
+ CFLAGS="${CFLAGS} -I/usr/local/opt/openssl@3/include/"
+ CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/openssl@3/include/"
+ LDFLAGS="${LDFLAGS} -L/usr/local/opt/openssl@3/lib"
+ OPTS="${OPTS} --with-openssl"
+ fi
+done
+
+# if we didn't select external PCRE, set option to use the bundled one
+if [[ "${CFLAGS}" != *"-I/usr/local/include/"* ]]; then
OPTS="${OPTS} --disable-dynamic-pcre"
fi
#
echo ""
echo "Notice: configuring the privoxy software."
+# Debugging
+echo "${CFLAGS}"
+echo "${CPPFLAGS}"
+echo "${LDFLAGS}"
+echo "${OPTS}"
cd ../${SOURCE_DIR}
autoheader
autoconf