autogen.sh 1.4 KB
Newer Older
Martin Sustrik's avatar
Martin Sustrik committed
1
#!/bin/sh
2
#   Copyright (c) 2007-2010 iMatix Corporation
Martin Sustrik's avatar
Martin Sustrik committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#
#   This file is part of 0MQ.
#
#   0MQ is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 3 of the License, or
#   (at your option) any later version.

#   0MQ is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.

#   You should have received a copy of the GNU General Public License
#   along with this program.  If not, see <http://www.gnu.org/licenses/>.

Martin Lucina's avatar
Martin Lucina committed
19
# Script to generate all required files from fresh git checkout.
Martin Sustrik's avatar
Martin Sustrik committed
20

Martin Lucina's avatar
Martin Lucina committed
21
command -v libtool >/dev/null 2>&1
malosek's avatar
malosek committed
22
if  [ $? -ne 0 ]; then
Martin Lucina's avatar
Martin Lucina committed
23
    echo "autogen.sh: error: could not find libtool.  libtool is required to run autogen.sh." 1>&2
malosek's avatar
malosek committed
24 25 26
    exit 1
fi

Martin Lucina's avatar
Martin Lucina committed
27
command -v autoreconf >/dev/null 2>&1
28
if [ $? -ne 0 ]; then
Martin Lucina's avatar
Martin Lucina committed
29
    echo "autogen.sh: error: could not find autoreconf.  autoconf and automake are required to run autogen.sh." 1>&2
Martin Lucina's avatar
Martin Lucina committed
30 31 32 33 34 35
    exit 1
fi

mkdir -p ./config
if [ $? -ne 0 ]; then
    echo "autogen.sh: error: could not create directory: ./config." 1>&2
36
    exit 1
37
fi
38

Martin Sustrik's avatar
Martin Sustrik committed
39 40
autoreconf --install --force --verbose -I config
if [ $? -ne 0 ]; then
Martin Lucina's avatar
Martin Lucina committed
41
    echo "autogen.sh: error: autoreconf exited with status $?" 1>&2
42
    exit 1
Martin Sustrik's avatar
Martin Sustrik committed
43
fi