eb16db255d8082fa3c9f867035f60e938c364270
3 # Copyright (C) 2012 Brian Aker
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions are
10 # * Redistributions of source code must retain the above copyright
11 # notice, this list of conditions and the following disclaimer.
13 # * Redistributions in binary form must reproduce the above
14 # copyright notice, this list of conditions and the following disclaimer
15 # in the documentation and/or other materials provided with the
18 # * The names of its contributors may not be used to endorse or
19 # promote products derived from this software without specific prior
22 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 die
() { echo "$@"; exit 1; }
43 AUTORECONF_FLAGS
="--install --force --verbose -Wall -Werror"
46 AUTORECONF_FLAGS
="--install --force --verbose -Wall -Werror"
49 AUTORECONF_FLAGS
="--install --force --verbose -Wall -Werror"
52 AUTORECONF_FLAGS
="--install --force --verbose -Wall -Werror"
54 AUTORECONF_FLAGS
="--install --force --verbose -Wall"
57 LIBTOOLIZE_FLAGS
="--force --verbose"
59 if [ $
(uname
) = "Darwin" ]
61 LIBTOOLIZE
=glibtoolize
62 elif [ -z "$LIBTOOLIZE" ]
69 # Set ENV DEBUG in order to enable debugging
72 DEBUG
="--enable-debug"
75 # Set ENV ASSERT in order to enable assert
78 ASSERT
="--enable-assert"
81 # Set ENV MAKE in order to override "make"
87 # Set ENV MAKE_J in order to override "-j2"
93 # Set ENV PREFIX in order to set --prefix for ./configure
96 PREFIX
="--prefix=$PREFIX"
101 $MAKE $MAKE_J distclean
104 run
$LIBTOOLIZE $LIBTOOLIZE_FLAGS || die
"Can't execute $LIBTOOLIZE"
105 run
$AUTORECONF $AUTORECONF_FLAGS || die
"Can't execute $AUTORECONF"
107 # If we are executing on OSX use CLANG, otherwise only use it if we find it in the ENV
108 if [ $
(uname
) = "Darwin" ]
110 CC
=clang CXX
=clang
++ .
/configure
$DEBUG $ASSERT $PREFIX || die
"configure failed to run"
112 .
/configure
$DEBUG $ASSERT $PREFIX || die
"configure failed to run"
115 # Set ENV MAKE_TARGET in order to override default of "all"
116 if [ -z "$MAKE_TARGET" ]
121 run
$MAKE $MAKE_J $MAKE_TARGET || die
"Can't execute make"