UNPKG

1 kBPlain TextView Raw
1#!/bin/sh
2#
3# This shell script sets up the software to be built using 'make'. In
4# order to perform a build from a fresh source tree, do the following:
5#
6# 1. ./build-setup
7# 2. make
8#
9# If you don't want ./configure to be run automatically, you can do
10# the following: ./build-setup -s
11
12# Process command line options
13SKIP_CONFIGURE=0
14for arg in "$*"
15do
16 case $arg in
17 "-s" | "--setup-only" ) SKIP_CONFIGURE=1 ;;
18 esac
19done
20
21# Check and add potential aclocal dirs
22MAYBE_AC_DIRS="
23 /usr/local/share/aclocal
24 /opt/local/share/aclocal
25 /sw/share/aclocal
26 "
27ACDIRS="-I m4"
28for dir in $MAYBE_AC_DIRS; do
29 if test -d $dir; then
30 ACDIRS="$ACDIRS -I $dir"
31 fi
32done
33
34# Run aclocal on the set of local ac scripts
35cd setup
36aclocal $ACDIRS
37# Generate the configure script
38autoconf && mv configure ..
39cd ..
40
41# Run the configure script if "-s" isn't a command line option
42if [ $SKIP_CONFIGURE -eq 0 ]; then
43 # Run the configure script in default development mode
44 ./configure $*
45fi
46