Erik de Castro Lopo | 56c2135 | 2013-04-02 17:53:12 +1100 | [diff] [blame] | 1 | #!/bin/bash |
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 | |
| 6 | test_program_errors=0 |
| 7 | |
| 8 | function test_program { |
| 9 | if ! command -v $1 >/dev/null 2>&1 ; then |
| 10 | echo "Missing program '$1'." |
| 11 | test_program_errors=1 |
| 12 | fi |
| 13 | } |
| 14 | |
Xiyue Deng | b09ee01 | 2013-05-24 13:51:29 -0700 | [diff] [blame] | 15 | for prog in autoconf automake libtool pkg-config ; do |
Erik de Castro Lopo | 56c2135 | 2013-04-02 17:53:12 +1100 | [diff] [blame] | 16 | test_program $prog |
| 17 | done |
| 18 | |
Xiyue Deng | b09ee01 | 2013-05-24 13:51:29 -0700 | [diff] [blame] | 19 | if test $(uname -s) != "Darwin" ; then |
| 20 | test_program gettext |
| 21 | fi |
| 22 | |
Erik de Castro Lopo | 56c2135 | 2013-04-02 17:53:12 +1100 | [diff] [blame] | 23 | test $test_program_errors -ne 1 || exit 1 |
| 24 | |
| 25 | #------------------------------------------------------------------------------- |
| 26 | |
Timothy B. Terriberry | d75cb67 | 2013-02-07 12:33:03 -0800 | [diff] [blame] | 27 | set -e |
| 28 | |
Erik de Castro Lopo | 619b43d | 2013-03-18 19:35:30 +1100 | [diff] [blame] | 29 | if test $(uname -s) = "OpenBSD" ; then |
| 30 | # OpenBSD needs these environment variables set. |
| 31 | AUTOCONF_VERSION=2.69 |
| 32 | AUTOMAKE_VERSION=1.11 |
| 33 | export AUTOCONF_VERSION |
| 34 | export AUTOMAKE_VERSION |
| 35 | fi |
| 36 | |
Timothy B. Terriberry | d75cb67 | 2013-02-07 12:33:03 -0800 | [diff] [blame] | 37 | srcdir=`dirname $0` |
| 38 | test -n "$srcdir" && cd "$srcdir" |
| 39 | |
| 40 | echo "Updating build configuration files for FLAC, please wait...." |
| 41 | |
Erik de Castro Lopo | a53e85b | 2013-01-17 20:13:33 +1100 | [diff] [blame] | 42 | touch config.rpath |
Timothy B. Terriberry | d75cb67 | 2013-02-07 12:33:03 -0800 | [diff] [blame] | 43 | autoreconf -isf |
| 44 | #./configure "$@" && echo |