buildconf 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #!/bin/sh
  2. #
  3. # Copyright 1999-2005 The Apache Software Foundation or its licensors, as
  4. # applicable.
  5. #
  6. # Licensed under the Apache License, Version 2.0 (the "License");
  7. # you may not use this file except in compliance with the License.
  8. # You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. #
  18. #
  19. # Default place to look for apr source. Can be overridden with
  20. # --with-apr=[directory]
  21. apr_src_dir=../apr
  22. while test $# -gt 0
  23. do
  24. # Normalize
  25. case "$1" in
  26. -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  27. *) optarg= ;;
  28. esac
  29. case "$1" in
  30. --with-apr=*)
  31. apr_src_dir=$optarg
  32. ;;
  33. esac
  34. shift
  35. done
  36. if [ -f "$apr_src_dir/build/apr_common.m4" ]; then
  37. apr_src_dir=`cd $apr_src_dir; pwd`
  38. echo ""
  39. echo "Looking for apr source in $apr_src_dir"
  40. else
  41. echo ""
  42. echo "Problem finding apr source in $apr_src_dir."
  43. echo "Use:"
  44. echo " --with-apr=[directory]"
  45. exit 1
  46. fi
  47. set -e
  48. # Remove some files, then copy them from apr source tree
  49. rm -f build/apr_common.m4 build/find_apr.m4 build/install.sh \
  50. build/config.guess build/config.sub build/get-version.sh
  51. cp -p $apr_src_dir/build/apr_common.m4 $apr_src_dir/build/find_apr.m4 \
  52. $apr_src_dir/build/install.sh $apr_src_dir/build/config.guess \
  53. $apr_src_dir/build/config.sub $apr_src_dir/build/get-version.sh \
  54. build/
  55. # Remove aclocal.m4 as it'll break some builds...
  56. rm -rf aclocal.m4 autom4te*.cache
  57. #
  58. # Generate the autoconf header (include/apu_config.h) and ./configure
  59. #
  60. echo "Creating include/private/apu_config.h ..."
  61. ${AUTOHEADER:-autoheader}
  62. echo "Creating configure ..."
  63. ### do some work to toss config.cache?
  64. if ${AUTOCONF:-autoconf}; then
  65. :
  66. else
  67. echo "autoconf failed"
  68. exit 1
  69. fi
  70. #
  71. # Generate build-outputs.mk for the build systme
  72. #
  73. echo "Generating 'make' outputs ..."
  74. #$apr_src_dir/build/gen-build.py make
  75. #
  76. # If Expat has been bundled, then go and configure the thing
  77. #
  78. if [ -f xml/expat/buildconf.sh ]; then
  79. echo "Invoking xml/expat/buildconf.sh ..."
  80. (cd xml/expat; ./buildconf.sh)
  81. fi
  82. # Remove autoconf cache again
  83. rm -rf autom4te*.cache
  84. # Create RPM Spec file
  85. if [ -f `which cut` ]; then
  86. echo rebuilding rpm spec file
  87. REVISION=`build/get-version.sh all include/apu_version.h APU`
  88. VERSION=`echo $REVISION | cut -d- -s -f1`
  89. RELEASE=`echo $REVISION | cut -d- -s -f2`
  90. if [ "x$VERSION" = "x" ]; then
  91. VERSION=$REVISION
  92. RELEASE=1
  93. fi
  94. sed -e "s/APU_VERSION/$VERSION/" -e "s/APU_RELEASE/$RELEASE/" \
  95. ./build/rpm/apr-util.spec.in > apr-util.spec
  96. fi