5 # Purpose : Establish settings common to the build and privoxy-create
8 # Copyright : Written by and Copyright (C) 2001-2012 the
9 # Privoxy team. http://www.privoxy.org/
11 # This program is free software; you can redistribute it
12 # and/or modify it under the terms of the GNU General
13 # Public License as published by the Free Software
14 # Foundation; either version 2 of the License, or (at
15 # your option) any later version.
17 # This program is distributed in the hope that it will
18 # be useful, but WITHOUT ANY WARRANTY; without even the
19 # implied warranty of MERCHANTABILITY or FITNESS FOR A
20 # PARTICULAR PURPOSE. See the GNU General Public
21 # License for more details.
23 # The GNU General Public License should be included with
24 # this file. If not, you can view it at
25 # http://www.gnu.org/copyleft/gpl.html
26 # or write to the Free Software Foundation, Inc.,
27 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
30 # Modification : If you modify this file please consider whether your
31 # changes ought to be passed back to the OSXPackageBuilder
35 #========================================
36 # target specific settings
37 #========================================
40 # mac os x release name
45 # check the release name and assign the build variables accordingly
47 # 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.
49 case "${release_name}" in
50 # Mac OS X 10.7 (x86_64 only)
52 XCODE_PATH="`/usr/bin/xcode-select -print-path`"
53 # SYSROOT="-isysroot ${XCODE_PATH}/SDKs/MacOSX10.7.sdk"
54 SYSROOT="-isysroot /Developer/SDKs/MacOSX10.7.sdk"
55 MACOSX_VERSION="-mmacosx-version-min=10.7"
57 STARTUP="LaunchDaemon"
59 # Mac OS X 10.6 x86_64
61 XCODE_PATH="`/usr/bin/xcode-select -print-path`"
62 # SYSROOT="-isysroot ${XCODE_PATH}/SDKs/MacOSX10.6.sdk"
63 SYSROOT="-isysroot /Developer/SDKs/MacOSX10.6.sdk"
64 MACOSX_VERSION="-mmacosx-version-min=10.6"
66 STARTUP="LaunchDaemon"
68 # Mac OS X 10.6 all supported architectures
70 XCODE_PATH="`/usr/bin/xcode-select -print-path`"
71 # SYSROOT="-isysroot ${XCODE_PATH}/SDKs/MacOSX10.6.sdk"
72 SYSROOT="-isysroot /Developer/SDKs/MacOSX10.6.sdk"
73 MACOSX_VERSION="-mmacosx-version-min=10.6"
74 ARCH="-arch x86_64 -arch i386"
75 STARTUP="LaunchDaemon"
76 CFLAGS="-mtune=G5 ${CFLAGS}"
80 XCODE_PATH="`/usr/bin/xcode-select -print-path`"
81 # SYSROOT="-isysroot ${XCODE_PATH}/SDKs/MacOSX10.6.sdk"
82 SYSROOT="-isysroot /Developer/SDKs/MacOSX10.6.sdk"
83 MACOSX_VERSION="-mmacosx-version-min=10.6"
85 STARTUP="LaunchDaemon"
87 # Mac OS X 10.5 and all later releases
89 XCODE_PATH="`/usr/bin/xcode-select -print-path`"
90 # SYSROOT="-isysroot ${XCODE_PATH}/SDKs/MacOSX10.5.sdk"
91 SYSROOT="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
92 MACOSX_VERSION="-mmacosx-version-min=10.5"
93 ARCH="-arch x86_64 -arch i386 -arch ppc"
94 STARTUP="LaunchDaemon"
95 CFLAGS="-mtune=G5 ${CFLAGS}"
97 # Mac OS X 10.5 all supported architectures
99 XCODE_PATH="`/usr/bin/xcode-select -print-path`"
100 # SYSROOT="-isysroot ${XCODE_PATH}/SDKs/MacOSX10.5.sdk"
101 SYSROOT="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
102 MACOSX_VERSION="-mmacosx-version-min=10.5"
103 ARCH="-arch i386 -arch ppc"
104 STARTUP="LaunchDaemon"
105 CFLAGS="-mtune=G5 ${CFLAGS}"
109 XCODE_PATH="`/usr/bin/xcode-select -print-path`"
110 # SYSROOT="-isysroot ${XCODE_PATH}/SDKs/MacOSX10.5.sdk"
111 SYSROOT="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
112 MACOSX_VERSION="-mmacosx-version-min=10.5"
114 STARTUP="LaunchDaemon"
118 XCODE_PATH="`/usr/bin/xcode-select -print-path`"
119 # SYSROOT="-isysroot ${XCODE_PATH}/SDKs/MacOSX10.5.sdk"
120 SYSROOT="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
121 MACOSX_VERSION="-mmacosx-version-min=10.5"
123 STARTUP="LaunchDaemon"
124 CFLAGS="-mtune=G5 ${CFLAGS}"
126 # Mac OS X 10.4 all supported architectures
128 XCODE_PATH="/Developer"
129 # SYSROOT="-isysroot ${XCODE_PATH}/SDKs/MacOSX10.4u.sdk"
130 SYSROOT="-isysroot /Developer/SDKs/MacOSX10.4u.sdk"
131 MACOSX_VERSION="-mmacosx-version-min=10.4"
132 ARCH="-arch i386 -arch ppc"
133 STARTUP="LaunchDaemon"
134 CFLAGS="-mtune=G5 ${CFLAGS}"
138 XCODE_PATH="/Developer"
139 # SYSROOT="-isysroot ${XCODE_PATH}/SDKs/MacOSX10.4u.sdk"
140 SYSROOT="-isysroot /Developer/SDKs/MacOSX10.4u.sdk"
141 MACOSX_VERSION="-mmacosx-version-min=10.4"
143 STARTUP="LaunchDaemon"
147 XCODE_PATH="/Developer"
148 # SYSROOT="-isysroot ${XCODE_PATH}/SDKs/MacOSX10.4u.sdk"
149 SYSROOT="-isysroot ${XCODE_PATH}/SDKs/MacOSX10.4u.sdk"
150 MACOSX_VERSION="-mmacosx-version-min=10.4"
152 STARTUP="LaunchDaemon"
153 CFLAGS="-mtune=G5 ${CFLAGS}"
157 XCODE_PATH="/Developer"
158 # SYSROOT="-isysroot ${XCODE_PATH}/SDKs/MacOSX10.3.9.sdk"
159 SYSROOT="-isysroot /Developer/SDKs/MacOSX10.3.9.sdk"
160 MACOSX_VERSION="-mmacosx-version-min=10.3"
162 STARTUP="StartupItem"
163 CFLAGS="-mtune=G5 ${CFLAGS}"
176 #========================================
177 # host specific settings
178 #========================================
181 # darwin os major release number
183 darwin_major_rel_num="`/usr/bin/uname -r | /usr/bin/sed 's/\..*//'`"
186 # check the release number
188 case "${darwin_major_rel_num}" in
189 # Mac OS X 10.5 or higher
191 GNAME="`/usr/bin/dscl /Local/Default -list /groups | /usr/bin/grep -E '^(_)?privoxy?'`"
192 UNAME="`/usr/bin/dscl /Local/Default -list /users | /usr/bin/grep -E '^(_)?privoxy?'`"
193 SCRIPT="privoxy-create-dscl.sh"
194 OPTS="--with-user=_privoxy --with-group=_privoxy"
196 # Mac OS X 10.4, 10.3
198 GNAME="`/usr/bin/nireport . /groups name | /usr/bin/grep -E '^privoxy?'`"
199 UNAME="`/usr/bin/nireport . /users name | /usr/bin/grep -E '^privoxy?'`"
200 SCRIPT="privoxy-create-nicl.sh"
201 OPTS="--with-user=privoxy --with-group=privoxy"
213 # identify the directory containing Privoxy's source
221 if [ -d current ]; then
222 DIRS_FOUND=$(( DIRS_FOUND + 10 ))
224 case "${DIRS_FOUND}" in
225 # only 'current' found
233 # either both or neither found
235 read -p 'Could not select the Privoxy source directory. Please supply the directory name (e.g. current or dist): ' SOURCE_DIR
239 echo "Using ../${SOURCE_DIR} as location of Privoxy source"