autogen.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/bin/sh
  2. # Run this to set up the build system: configure, makefiles, etc.
  3. # We trust that the user has a recent enough autoconf & automake setup
  4. # (not older than a few years...)
  5. use_symlinks=" --symlink"
  6. case $1 in
  7. --no-symlink*)
  8. use_symlinks=""
  9. echo "Copying autotool files instead of using symlinks."
  10. ;;
  11. *)
  12. echo "Using symlinks to autotool files (use --no-symlinks to copy instead)."
  13. ;;
  14. esac
  15. test_program_errors=0
  16. test_program () {
  17. if ! command -v $1 >/dev/null 2>&1 ; then
  18. echo "Missing program '$1'."
  19. test_program_errors=1
  20. fi
  21. }
  22. for prog in autoconf automake libtool pkg-config ; do
  23. test_program $prog
  24. done
  25. if test $(uname -s) != "Darwin" ; then
  26. test_program gettext
  27. fi
  28. test $test_program_errors -ne 1 || exit 1
  29. #-------------------------------------------------------------------------------
  30. set -e
  31. if test $(uname -s) = "OpenBSD" ; then
  32. # OpenBSD needs these environment variables set.
  33. if test -z "$AUTOCONF_VERSION" ; then
  34. AUTOCONF_VERSION=2.69
  35. export AUTOCONF_VERSION
  36. echo "Defaulting to use AUTOCONF_VERSION version ${AUTOCONF_VERSION}."
  37. else
  38. echo "Using AUTOCONF_VERSION version ${AUTOCONF_VERSION}."
  39. fi
  40. if test -z "$AUTOMAKE_VERSION" ; then
  41. AUTOMAKE_VERSION=1.15
  42. export AUTOMAKE_VERSION
  43. echo "Defaulting to use AUTOMAKE_VERSION version ${AUTOMAKE_VERSION}."
  44. else
  45. echo "Using AUTOMAKE_VERSION version ${AUTOMAKE_VERSION}."
  46. fi
  47. fi
  48. srcdir=`dirname $0`
  49. test -n "$srcdir" && cd "$srcdir"
  50. echo "Updating build configuration files for FLAC, please wait...."
  51. touch config.rpath
  52. autoreconf --install $use_symlinks --force
  53. #./configure "$@" && echo