PageRenderTime 43ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/build/aix/buildaix.ksh

http://github.com/apache/httpd
Korn Shell | 127 lines | 84 code | 20 blank | 23 comment | 16 complexity | 794cb96eaa405afecb7027d3004ad1ba MD5 | raw file
Possible License(s): LGPL-2.0, Apache-2.0
  1. #!/usr/bin/ksh
  2. # Licensed to the Apache Software Foundation (ASF) under one or more
  3. # contributor license agreements. See the NOTICE file distributed with
  4. # this work for additional information regarding copyright ownership.
  5. # The ASF licenses this file to You under the Apache License, Version 2.0
  6. # (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. #
  18. # buildaix.ksh: This script builds an AIX fileset of Apache httpd
  19. # if arguments - try to run fast
  20. cmd=$0
  21. export CFLAGS='-O2 -qlanglvl=extc99'
  22. lslpp -L bos.adt.insttools >/dev/null
  23. [[ $? -ne 0 ]] && echo "must have bos.adt.insttools installed" && exit -1
  24. apr_config=`which apr-1-config`
  25. apu_config=`which apu-1-config`
  26. if [[ -z ${apr_config} && -z ${apu_config} ]]
  27. then
  28. export PATH=/opt/bin:${PATH}
  29. apr_config=`which apr-1-config`
  30. apu_config=`which apu-1-config`
  31. fi
  32. while test $# -gt 0
  33. do
  34. # Normalize
  35. case "$1" in
  36. -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  37. *) optarg= ;;
  38. esac
  39. case "$1" in
  40. --with-apr=*)
  41. apr_config=$optarg
  42. ;;
  43. esac
  44. case "$1" in
  45. --with-apr-util=*)
  46. apu_config=$optarg
  47. ;;
  48. esac
  49. shift
  50. argc--
  51. done
  52. if [ ! -f "$apr_config" -a ! -f "$apr_config/configure.in" ]; then
  53. echo "The apr source directory / apr-1-config could not be found"
  54. echo "If available, install the ASF.apu.rte and ASF.apr.rte filesets"
  55. echo "Usage: $cmd [--with-apr=[dir|file]] [--with-apr-util=[dir|file]]"
  56. exit 1
  57. fi
  58. if [ ! -f "$apu_config" -a ! -f "$apu_config/configure.in" ]; then
  59. echo "The apu source directory / apu-1-config could not be found"
  60. echo "If available, install the ASF.apu.rte and ASF.apr.rte filesets"
  61. echo "Usage: $cmd [--with-apr=[dir|file]] [--with-apr-util=[dir|file]]"
  62. exit 1
  63. fi
  64. . build/aix/aixinfo
  65. LAYOUT=AIX
  66. TEMPDIR=/var/tmp/$USER/${NAME}.${VERSION}
  67. rm -rf $TEMPDIR
  68. if [[ ! -e ./Makefile ]] # if Makefile exists go faster
  69. then
  70. # --with-mpm=worker \n\
  71. echo "+ ./configure \n\
  72. --enable-layout=$LAYOUT \n\
  73. --with-apr=$apr_config \n\
  74. --with-apr-util=$apu_config \n\
  75. --enable-mpms-shared=all \n\
  76. --enable-mods-shared=all \n\
  77. --disable-lua > build/aix/configure.out"
  78. # --with-mpm=worker \
  79. ./configure \
  80. --enable-layout=$LAYOUT \
  81. --with-apr=$apr_config \
  82. --with-apr-util=$apu_config \
  83. --enable-mpms-shared=all \
  84. --enable-mods-shared=all \
  85. --disable-lua > build/aix/configure.out
  86. [[ $? -ne 0 ]] && echo './configure' returned an error && exit -1
  87. else
  88. echo $0: using existing Makefile
  89. echo $0: run make distclean to get a standard AIX configure
  90. echo
  91. ls -l ./Makefile config.*
  92. echo
  93. fi
  94. echo "+ make > build/aix/make.out"
  95. make > build/aix/make.out
  96. [[ $? -ne 0 ]] && echo 'make' returned an error && exit -1
  97. echo "+ make install DESTDIR=$TEMPDIR > build/aix/install.out"
  98. make install DESTDIR=$TEMPDIR > build/aix/install.out
  99. [[ $? -ne 0 ]] && echo 'make install' returned an error && exit -1
  100. echo "+ build/aix/mkinstallp.ksh $TEMPDIR > build/aix/mkinstallp.out"
  101. build/aix/mkinstallp.ksh $TEMPDIR > build/aix/mkinstallp.out
  102. [[ $? -ne 0 ]] && echo mkinstallp.ksh returned an error && exit -1
  103. rm -rf $TEMPDIR
  104. # list installable fileset(s)
  105. echo ========================
  106. installp -d build/aix -L
  107. echo ========================