blob: b62a340184fdfd1bb6d2e9e9c5368220bc056bc3 [file] [log] [blame]
Erik de Castro Lopo9e2bf612015-08-01 17:47:06 +10001#!/bin/sh
Josh Coalsonc7c1a8a2006-11-17 06:50:19 +00002# Run this to set up the build system: configure, makefiles, etc.
Max Horn66c0a582012-12-12 21:33:52 +01003# We trust that the user has a recent enough autoconf & automake setup
4# (not older than a few years...)
Erik de Castro Lopo56c21352013-04-02 17:53:12 +11005
Erik de Castro Lopoc3cf5312015-08-01 17:54:49 +10006use_symlinks=" --symlink"
7
8case $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 Lopo56c21352013-04-02 17:53:12 +110018test_program_errors=0
19
Erik de Castro Lopo9e2bf612015-08-01 17:47:06 +100020test_program () {
Erik de Castro Lopo56c21352013-04-02 17:53:12 +110021 if ! command -v $1 >/dev/null 2>&1 ; then
22 echo "Missing program '$1'."
23 test_program_errors=1
24 fi
25}
26
Xiyue Dengb09ee012013-05-24 13:51:29 -070027for prog in autoconf automake libtool pkg-config ; do
Erik de Castro Lopo56c21352013-04-02 17:53:12 +110028 test_program $prog
29 done
30
Xiyue Dengb09ee012013-05-24 13:51:29 -070031if test $(uname -s) != "Darwin" ; then
32 test_program gettext
33 fi
34
Erik de Castro Lopo56c21352013-04-02 17:53:12 +110035test $test_program_errors -ne 1 || exit 1
36
37#-------------------------------------------------------------------------------
38
Timothy B. Terriberryd75cb672013-02-07 12:33:03 -080039set -e
40
Erik de Castro Lopo619b43d2013-03-18 19:35:30 +110041if test $(uname -s) = "OpenBSD" ; then
42 # OpenBSD needs these environment variables set.
43 AUTOCONF_VERSION=2.69
44 AUTOMAKE_VERSION=1.11
45 export AUTOCONF_VERSION
46 export AUTOMAKE_VERSION
47 fi
48
Timothy B. Terriberryd75cb672013-02-07 12:33:03 -080049srcdir=`dirname $0`
50test -n "$srcdir" && cd "$srcdir"
51
52echo "Updating build configuration files for FLAC, please wait...."
53
Erik de Castro Lopoa53e85b2013-01-17 20:13:33 +110054touch config.rpath
Erik de Castro Lopoc3cf5312015-08-01 17:54:49 +100055autoreconf --install $use_symlinks --force
Timothy B. Terriberryd75cb672013-02-07 12:33:03 -080056#./configure "$@" && echo