# Purpose : Establish settings common to the build and privoxy-create
# scripts.
#
-# Copyright : Written by and Copyright (C) 2001-2012 the
+# Copyright : Written by and Copyright (C) 2001-2021 the
# Privoxy team. http://www.privoxy.org/
#
# This program is free software; you can redistribute it
# NOTE: SYSROOT ought to be programmatically determined using XCODE_PATH, however since upgrading my build environment to El Capitan xcode-select returns a non-useful path, hence I am forced to set the SYSROOT explicitly for my build environment, which is now a hybrid of XCode 3.2.6 'running' on OS X 10.11. I am not going to risk upgrading XCode for fear of losing the ability to target down-level OS X versions.
#
case "${release_name}" in
+ # Mac OS X 10.11 (x86_64 only)
+ "current")
+ XCODE_PATH="`/usr/bin/xcode-select -print-path`"
+ SYSROOT="-isysroot ${XCODE_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk"
+ MACOSX_VERSION="-mmacosx-version-min=10.6"
+ ARCH="-arch x86_64"
+ STARTUP="LaunchDaemon"
+ CFLAGS="-mtune=x86_64 ${CFLAGS}"
+ ;;
# Mac OS X 10.7 (x86_64 only)
"lion")
XCODE_PATH="`/usr/bin/xcode-select -print-path`"
MACOSX_VERSION="-mmacosx-version-min=10.7"
ARCH="-arch x86_64"
STARTUP="LaunchDaemon"
+ CFLAGS="-mtune=x86_64 ${CFLAGS}"
;;
# Mac OS X 10.6 x86_64
"snowleopardx64")
MACOSX_VERSION="-mmacosx-version-min=10.6"
ARCH="-arch x86_64"
STARTUP="LaunchDaemon"
+ CFLAGS="-mtune=x86_64 ${CFLAGS}"
;;
# Mac OS X 10.6 all supported architectures
"snowleopard")
MACOSX_VERSION="-mmacosx-version-min=10.6"
ARCH="-arch x86_64 -arch i386"
STARTUP="LaunchDaemon"
- CFLAGS="-mtune=G5 ${CFLAGS}"
;;
# Mac OS X 10.6 i386
"snowleopardi386")
MACOSX_VERSION="-mmacosx-version-min=10.6"
ARCH="-arch i386"
STARTUP="LaunchDaemon"
+ CFLAGS="-mtune=i386 ${CFLAGS}"
;;
# Mac OS X 10.5 and all later releases
"leopardupwards")
MACOSX_VERSION="-mmacosx-version-min=10.5"
ARCH="-arch x86_64 -arch i386 -arch ppc"
STARTUP="LaunchDaemon"
- CFLAGS="-mtune=G5 ${CFLAGS}"
;;
# Mac OS X 10.5 all supported architectures
"leopard")
MACOSX_VERSION="-mmacosx-version-min=10.5"
ARCH="-arch i386 -arch ppc"
STARTUP="LaunchDaemon"
- CFLAGS="-mtune=G5 ${CFLAGS}"
;;
# Mac OS X 10.5 i386
"leopardi386")
MACOSX_VERSION="-mmacosx-version-min=10.5"
ARCH="-arch i386"
STARTUP="LaunchDaemon"
+ CFLAGS="-mtune=i386 ${CFLAGS}"
;;
# Mac OS X 10.5 PPC
"leopardppc")
MACOSX_VERSION="-mmacosx-version-min=10.4"
ARCH="-arch i386 -arch ppc"
STARTUP="LaunchDaemon"
- CFLAGS="-mtune=G5 ${CFLAGS}"
;;
# Mac OS X 10.4 i386
"tigeri386")
MACOSX_VERSION="-mmacosx-version-min=10.4"
ARCH="-arch i386"
STARTUP="LaunchDaemon"
+ CFLAGS="-mtune=i386 ${CFLAGS}"
;;
# Mac OS X 10.4 PPC
"tigerppc")
#
case "${darwin_major_rel_num}" in
# Mac OS X 10.5 or higher
- 9|1*)
+ 9|1*|2*|3*)
GNAME="`/usr/bin/dscl /Local/Default -list /groups | /usr/bin/grep -E '^(_)?privoxy?'`"
UNAME="`/usr/bin/dscl /Local/Default -list /users | /usr/bin/grep -E '^(_)?privoxy?'`"
SCRIPT="privoxy-create-dscl.sh"
;;
# either both or neither found
11|0)
- read -p 'Could not select the Privoxy source directory. Please supply the directory name (e.g. current or dist): ' SOURCE_DIR
+ read -p 'Could not select the Privoxy source directory (it should be in a directory parallel to that containing this build script). Please supply the directory name (e.g. current or dist): ' SOURCE_DIR
;;
esac
cd OSXPackageBuilder
-echo "Using ../${SOURCE_DIR} as location of Privoxy source"
\ No newline at end of file
+echo "Using ../${SOURCE_DIR} as location of Privoxy source"