Blame build/aix/buildaix.ksh

Packit 90a5c9
#!/usr/bin/ksh
Packit 90a5c9
# Licensed to the Apache Software Foundation (ASF) under one or more
Packit 90a5c9
# contributor license agreements.  See the NOTICE file distributed with
Packit 90a5c9
# this work for additional information regarding copyright ownership.
Packit 90a5c9
# The ASF licenses this file to You under the Apache License, Version 2.0
Packit 90a5c9
# (the "License"); you may not use this file except in compliance with
Packit 90a5c9
# the License.  You may obtain a copy of the License at
Packit 90a5c9
#
Packit 90a5c9
#     http://www.apache.org/licenses/LICENSE-2.0
Packit 90a5c9
#
Packit 90a5c9
# Unless required by applicable law or agreed to in writing, software
Packit 90a5c9
# distributed under the License is distributed on an "AS IS" BASIS,
Packit 90a5c9
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 90a5c9
# See the License for the specific language governing permissions and
Packit 90a5c9
# limitations under the License.
Packit 90a5c9
#
Packit 90a5c9
#
Packit 90a5c9
Packit 90a5c9
# buildaix.ksh: This script builds an AIX fileset of Apache httpd
Packit 90a5c9
Packit 90a5c9
# if arguments - try to run fast
Packit 90a5c9
cmd=$0
Packit 90a5c9
Packit 90a5c9
export CFLAGS='-O2 -qlanglvl=extc99'
Packit 90a5c9
Packit 90a5c9
lslpp -L bos.adt.insttools >/dev/null
Packit 90a5c9
 [[ $? -ne 0 ]] && echo "must have bos.adt.insttools installed" && exit -1
Packit 90a5c9
Packit 90a5c9
apr_config=`which apr-1-config`
Packit 90a5c9
apu_config=`which apu-1-config`
Packit 90a5c9
Packit 90a5c9
if [[ -z ${apr_config} && -z ${apu_config} ]]
Packit 90a5c9
then
Packit 90a5c9
	export PATH=/opt/bin:${PATH}
Packit 90a5c9
	apr_config=`which apr-1-config`
Packit 90a5c9
	apu_config=`which apu-1-config`
Packit 90a5c9
fi
Packit 90a5c9
Packit 90a5c9
while test $# -gt 0
Packit 90a5c9
do
Packit 90a5c9
  # Normalize
Packit 90a5c9
  case "$1" in
Packit 90a5c9
  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
Packit 90a5c9
  *) optarg= ;;
Packit 90a5c9
  esac
Packit 90a5c9
Packit 90a5c9
  case "$1" in
Packit 90a5c9
  --with-apr=*)
Packit 90a5c9
  apr_config=$optarg
Packit 90a5c9
  ;;
Packit 90a5c9
  esac
Packit 90a5c9
Packit 90a5c9
  case "$1" in
Packit 90a5c9
  --with-apr-util=*)
Packit 90a5c9
  apu_config=$optarg
Packit 90a5c9
  ;;
Packit 90a5c9
  esac
Packit 90a5c9
Packit 90a5c9
  shift
Packit 90a5c9
  argc--
Packit 90a5c9
done
Packit 90a5c9
Packit 90a5c9
if [ ! -f "$apr_config" -a ! -f "$apr_config/configure.in" ]; then
Packit 90a5c9
  echo "The apr source directory / apr-1-config could not be found"
Packit 90a5c9
  echo "If available, install the ASF.apu.rte and ASF.apr.rte filesets"
Packit 90a5c9
  echo "Usage: $cmd [--with-apr=[dir|file]] [--with-apr-util=[dir|file]]"
Packit 90a5c9
  exit 1
Packit 90a5c9
fi
Packit 90a5c9
Packit 90a5c9
if [ ! -f "$apu_config" -a ! -f "$apu_config/configure.in" ]; then
Packit 90a5c9
  echo "The apu source directory / apu-1-config could not be found"
Packit 90a5c9
  echo "If available, install the ASF.apu.rte and ASF.apr.rte filesets"
Packit 90a5c9
  echo "Usage: $cmd [--with-apr=[dir|file]] [--with-apr-util=[dir|file]]"
Packit 90a5c9
  exit 1
Packit 90a5c9
fi
Packit 90a5c9
Packit 90a5c9
. build/aix/aixinfo
Packit 90a5c9
LAYOUT=AIX
Packit 90a5c9
TEMPDIR=/var/tmp/$USER/${NAME}.${VERSION}
Packit 90a5c9
rm -rf $TEMPDIR
Packit 90a5c9
Packit 90a5c9
if [[ ! -e ./Makefile ]] # if Makefile exists go faster
Packit 90a5c9
then
Packit 90a5c9
#		--with-mpm=worker \n\
Packit 90a5c9
	echo "+ ./configure \n\
Packit 90a5c9
		--enable-layout=$LAYOUT \n\
Packit 90a5c9
		--with-apr=$apr_config \n\
Packit 90a5c9
		--with-apr-util=$apu_config \n\
Packit 90a5c9
		--enable-mpms-shared=all \n\
Packit 90a5c9
		--enable-mods-shared=all \n\
Packit 90a5c9
		--disable-lua > build/aix/configure.out"
Packit 90a5c9
Packit 90a5c9
#		--with-mpm=worker \
Packit 90a5c9
	./configure \
Packit 90a5c9
		--enable-layout=$LAYOUT \
Packit 90a5c9
		--with-apr=$apr_config \
Packit 90a5c9
		--with-apr-util=$apu_config \
Packit 90a5c9
		--enable-mpms-shared=all \
Packit 90a5c9
		--enable-mods-shared=all \
Packit 90a5c9
		--disable-lua > build/aix/configure.out
Packit 90a5c9
		 [[ $? -ne 0 ]] && echo './configure' returned an error && exit -1
Packit 90a5c9
else
Packit 90a5c9
	echo $0: using existing Makefile
Packit 90a5c9
	echo $0: run make distclean to get a standard AIX configure
Packit 90a5c9
	echo
Packit 90a5c9
	ls -l ./Makefile config.*
Packit 90a5c9
	echo
Packit 90a5c9
fi
Packit 90a5c9
Packit 90a5c9
echo "+ make > build/aix/make.out"
Packit 90a5c9
make > build/aix/make.out
Packit 90a5c9
 [[ $? -ne 0 ]] && echo 'make' returned an error && exit -1
Packit 90a5c9
Packit 90a5c9
echo "+ make install DESTDIR=$TEMPDIR > build/aix/install.out"
Packit 90a5c9
make install DESTDIR=$TEMPDIR > build/aix/install.out
Packit 90a5c9
 [[ $? -ne 0 ]] && echo 'make install' returned an error && exit -1
Packit 90a5c9
Packit 90a5c9
echo "+ build/aix/mkinstallp.ksh $TEMPDIR > build/aix/mkinstallp.out"
Packit 90a5c9
build/aix/mkinstallp.ksh $TEMPDIR > build/aix/mkinstallp.out
Packit 90a5c9
 [[ $? -ne 0 ]] && echo mkinstallp.ksh returned an error && exit -1
Packit 90a5c9
Packit 90a5c9
rm -rf $TEMPDIR
Packit 90a5c9
Packit 90a5c9
# list installable fileset(s)
Packit 90a5c9
echo ========================
Packit 90a5c9
installp -d build/aix -L
Packit 90a5c9
echo ========================