Erik de Castro Lopo | 9e2bf61 | 2015-08-01 17:47:06 +1000 | [diff] [blame] | 1 | #!/bin/sh |
Josh Coalson | c7c1a8a | 2006-11-17 06:50:19 +0000 | [diff] [blame] | 2 | # Run this to set up the build system: configure, makefiles, etc. |
Max Horn | 66c0a58 | 2012-12-12 21:33:52 +0100 | [diff] [blame] | 3 | # We trust that the user has a recent enough autoconf & automake setup |
| 4 | # (not older than a few years...) |
Erik de Castro Lopo | 56c2135 | 2013-04-02 17:53:12 +1100 | [diff] [blame] | 5 | |
Erik de Castro Lopo | c3cf531 | 2015-08-01 17:54:49 +1000 | [diff] [blame] | 6 | use_symlinks=" --symlink" |
| 7 | |
| 8 | case $1 in |
| 9 | --no-symlink*) |
| 10 | use_symlinks="" |
| 11 | echo "Copying autotool files instead of using symlinks." |
| 12 | ;; |
| 13 | *) |
| 14 | echo "Using symlinks to autotool files (use --no-symlinks to copy instead)." |
| 15 | ;; |
| 16 | esac |
| 17 | |
Erik de Castro Lopo | 56c2135 | 2013-04-02 17:53:12 +1100 | [diff] [blame] | 18 | test_program_errors=0 |
| 19 | |
Erik de Castro Lopo | 9e2bf61 | 2015-08-01 17:47:06 +1000 | [diff] [blame] | 20 | test_program () { |
Erik de Castro Lopo | 56c2135 | 2013-04-02 17:53:12 +1100 | [diff] [blame] | 21 | if ! command -v $1 >/dev/null 2>&1 ; then |
| 22 | echo "Missing program '$1'." |
| 23 | test_program_errors=1 |
| 24 | fi |
| 25 | } |
| 26 | |
Xiyue Deng | b09ee01 | 2013-05-24 13:51:29 -0700 | [diff] [blame] | 27 | for prog in autoconf automake libtool pkg-config ; do |
Erik de Castro Lopo | 56c2135 | 2013-04-02 17:53:12 +1100 | [diff] [blame] | 28 | test_program $prog |
| 29 | done |
| 30 | |
Xiyue Deng | b09ee01 | 2013-05-24 13:51:29 -0700 | [diff] [blame] | 31 | if test $(uname -s) != "Darwin" ; then |
| 32 | test_program gettext |
| 33 | fi |
| 34 | |
Erik de Castro Lopo | 56c2135 | 2013-04-02 17:53:12 +1100 | [diff] [blame] | 35 | test $test_program_errors -ne 1 || exit 1 |
| 36 | |
| 37 | #------------------------------------------------------------------------------- |
| 38 | |
Timothy B. Terriberry | d75cb67 | 2013-02-07 12:33:03 -0800 | [diff] [blame] | 39 | set -e |
| 40 | |
Erik de Castro Lopo | 619b43d | 2013-03-18 19:35:30 +1100 | [diff] [blame] | 41 | if test $(uname -s) = "OpenBSD" ; then |
| 42 | # OpenBSD needs these environment variables set. |
Erik de Castro Lopo | 906ccc3 | 2016-01-26 12:47:58 +1100 | [diff] [blame] | 43 | if test -z "$AUTOCONF_VERSION" ; then |
| 44 | AUTOCONF_VERSION=2.69 |
| 45 | export AUTOCONF_VERSION |
| 46 | echo "Defaulting to use AUTOCONF_VERSION version ${AUTOCONF_VERSION}." |
| 47 | else |
| 48 | echo "Using AUTOCONF_VERSION version ${AUTOCONF_VERSION}." |
| 49 | fi |
| 50 | if test -z "$AUTOMAKE_VERSION" ; then |
| 51 | AUTOMAKE_VERSION=1.15 |
| 52 | export AUTOMAKE_VERSION |
| 53 | echo "Defaulting to use AUTOMAKE_VERSION version ${AUTOMAKE_VERSION}." |
| 54 | else |
| 55 | echo "Using AUTOMAKE_VERSION version ${AUTOMAKE_VERSION}." |
| 56 | fi |
Erik de Castro Lopo | 619b43d | 2013-03-18 19:35:30 +1100 | [diff] [blame] | 57 | fi |
| 58 | |
Timothy B. Terriberry | d75cb67 | 2013-02-07 12:33:03 -0800 | [diff] [blame] | 59 | srcdir=`dirname $0` |
| 60 | test -n "$srcdir" && cd "$srcdir" |
| 61 | |
| 62 | echo "Updating build configuration files for FLAC, please wait...." |
| 63 | |
Erik de Castro Lopo | a53e85b | 2013-01-17 20:13:33 +1100 | [diff] [blame] | 64 | touch config.rpath |
Erik de Castro Lopo | c3cf531 | 2015-08-01 17:54:49 +1000 | [diff] [blame] | 65 | autoreconf --install $use_symlinks --force |
Timothy B. Terriberry | d75cb67 | 2013-02-07 12:33:03 -0800 | [diff] [blame] | 66 | #./configure "$@" && echo |