autogen.sh 1.67 KB
Newer Older
Martin Sustrik's avatar
Martin Sustrik committed
1
#!/bin/sh
2

3
#    Copyright (c) 2007-2009 iMatix Corporation
4
#    Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
Martin Sustrik's avatar
Martin Sustrik committed
5 6 7
#
#   This file is part of 0MQ.
#
8 9
#   0MQ is free software; you can redistribute it and/or modify it under
#   the terms of the GNU Lesser General Public License as published by
Martin Sustrik's avatar
Martin Sustrik committed
10 11
#   the Free Software Foundation; either version 3 of the License, or
#   (at your option) any later version.
12
#
Martin Sustrik's avatar
Martin Sustrik committed
13 14 15
#   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
16
#   GNU Lesser General Public License for more details.
17
#
18
#   You should have received a copy of the GNU Lesser General Public License
Martin Sustrik's avatar
Martin Sustrik committed
19 20
#   along with this program.  If not, see <http://www.gnu.org/licenses/>.

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

Davor Lozic's avatar
Davor Lozic committed
23
# Debian and Ubuntu do not ship libtool anymore, but OSX does not ship libtoolize.
24
command -v libtoolize >/dev/null 2>&1
malosek's avatar
malosek committed
25
if  [ $? -ne 0 ]; then
26 27 28 29 30
    command -v libtool >/dev/null 2>&1
    if  [ $? -ne 0 ]; then
        echo "autogen.sh: error: could not find libtool.  libtool is required to run autogen.sh." 1>&2
        exit 1
    fi
malosek's avatar
malosek committed
31 32
fi

Martin Lucina's avatar
Martin Lucina committed
33
command -v autoreconf >/dev/null 2>&1
34
if [ $? -ne 0 ]; then
Martin Lucina's avatar
Martin Lucina committed
35
    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
36 37 38 39 40 41
    exit 1
fi

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

Martin Sustrik's avatar
Martin Sustrik committed
45 46
autoreconf --install --force --verbose -I config
if [ $? -ne 0 ]; then
Martin Lucina's avatar
Martin Lucina committed
47
    echo "autogen.sh: error: autoreconf exited with status $?" 1>&2
48
    exit 1
Martin Sustrik's avatar
Martin Sustrik committed
49
fi