bootstrap.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/sh
  2. #
  3. # Licensed to the Apache Software Foundation (ASF) under one
  4. # or more contributor license agreements. See the NOTICE file
  5. # distributed with this work for additional information
  6. # regarding copyright ownership. The ASF licenses this file
  7. # to you under the Apache License, Version 2.0 (the
  8. # "License"); you may not use this file except in compliance
  9. # with the License. You may obtain a copy of the License at
  10. #
  11. # http://www.apache.org/licenses/LICENSE-2.0
  12. #
  13. # Unless required by applicable law or agreed to in writing,
  14. # software distributed under the License is distributed on an
  15. # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. # KIND, either express or implied. See the License for the
  17. # specific language governing permissions and limitations
  18. # under the License.
  19. #
  20. ./cleanup.sh
  21. if test -d lib/php/src/ext/thrift_protocol ; then
  22. if phpize -v >/dev/null 2>/dev/null ; then
  23. (cd lib/php/src/ext/thrift_protocol && phpize)
  24. fi
  25. fi
  26. set -e
  27. # libtoolize is called "glibtoolize" on OSX.
  28. if libtoolize --version 1 >/dev/null 2>/dev/null; then
  29. LIBTOOLIZE=libtoolize
  30. elif glibtoolize --version 1 >/dev/null 2>/dev/null; then
  31. LIBTOOLIZE=glibtoolize
  32. else
  33. echo >&2 "Couldn't find libtoolize!"
  34. exit 1
  35. fi
  36. # we require automake 1.13 or later
  37. # check must happen externally due to use of newer macro
  38. AUTOMAKE_VERSION=`automake --version | grep automake | egrep -o '([0-9]{1,}\.)+[0-9]{1,}'`
  39. if [ "$AUTOMAKE_VERSION" \< "1.13" ]; then
  40. echo >&2 "automake version $AUTOMAKE_VERSION is too old (need 1.13 or later)"
  41. exit 1
  42. fi
  43. autoscan
  44. $LIBTOOLIZE --copy --automake
  45. aclocal -I ./aclocal
  46. autoheader
  47. autoconf
  48. automake --copy --add-missing --foreign