#!/bin/sh # File : build.sh # # Purpose : Build the privoxy binary, documentation and config files # for the chosen target environment # # Copyright : Written by and Copyright (C) 2001-2012 the # Privoxy team. http://www.privoxy.org/ # # This program is free software; you can redistribute it # and/or modify it under the terms of the GNU General # Public License as published by the Free Software # Foundation; either version 2 of the License, or (at # your option) any later version. # # This program is distributed in the hope that it will # be useful, but WITHOUT ANY WARRANTY; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. See the GNU General Public # License for more details. # # The GNU General Public License should be included with # this file. If not, you can view it at # http://www.gnu.org/copyleft/gpl.html # or write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # USA # # Modification : If you modify this file please consider whether your # changes ought to be passed back to the OSXPackageBuilder # module. # # # must provide target # if [ $# -eq 0 -o $# -gt 2 ]; then echo "Usage: $0 lion | snowleopard64 | snowleopard | leopardupwards | leopard | tiger | panther [-pcre]" exit 1 fi # # load common settings # . ./common.sh $1 # # must have Xcode # if [ -z ${XCODE_PATH} ]; then echo "Error: Xcode is not found." exit 1 fi # # set configure options # OPTS=${OPTS} if [ "$2" == "-pcre" ]; then CFLAGS="${CFLAGS} -I/usr/local/include/" LDFLAGS="${LDFLAGS} -L/usr/local/lib" fi # # check if privoxy group and user exist? # if [ -z ${GNAME} -o -z ${UNAME} ]; then echo "" echo "Error: a privoxy group and user do not exist." echo "A privoxy group and user must be created before continuing." echo "Review the README file for instructions on creating a privoxy group and user." exit 1 else echo "" echo "Notice: an existing privoxy group and user was found." fi # # configure privoxy # echo "" echo "Notice: configuring the privoxy software." cd ../${SOURCE_DIR} /usr/bin/autoheader /usr/bin/autoconf /usr/bin/env CFLAGS="${CFLAGS} ${SYSROOT} ${ARCH} ${MACOSX_VERSION}" LDFLAGS="${LDFLAGS} ${SYSROOT} ${ARCH} ${MACOSX_VERSION}" ./configure ${OPTS} # # clean, then make privoxy # echo "" echo "Notice: building the privoxy software." /usr/bin/make clean /usr/bin/make # # modify config file # /usr/bin/awk '{sub(/logfile.*logfile$/,"logfile logfile.log"); print}' ../${SOURCE_DIR}/config > ../${SOURCE_DIR}/config.tmp /bin/mv ../${SOURCE_DIR}/config.tmp ../${SOURCE_DIR}/config