1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
|
#! /bin/sh
#
# runautotools -
#
# Copyright (C) 2004 - 2025 Eggheads Development Team
#
# This file 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 2 of the License, or
# (at your option) any later version.
#
# This program 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, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
REQUIRED_AUTOCONF_VERSION=2.71
show_usage() {
echo "Usage: `basename $0` [-h|-v]"
echo " -h, --help - Print this help and exit."
echo " -f, --force - Skip the autoconf version check (do not commit generated files with this)."
exit 0
}
if test ! -f src/main.c; then
echo "You are not in the Eggdrop root directory."
exit 1
fi
if test "x${1}" = "x-h" || test "x${1}" = "x--help"; then
show_usage
fi
FORCE=0
if test "x${1}" = "x-f" || test "x${1}" = "x--force"; then
FORCE=1
fi
# All developers should use the same autotools version to avoid unnecessary back/forth changes in configure scripts
echo "Checking autotools version..."
AUTOCONFVERSION=$(autoconf --version | head -n 1 | awk '{print $NF}')
if test $FORCE -eq 0 && test "x$AUTOCONFVERSION" != "x$REQUIRED_AUTOCONF_VERSION"; then
echo "Refusing to run autotools with mismatching version, required is $REQUIRED_AUTOCONF_VERSION, you have $AUTOCONFVERSION. Adjust requirement in misc/runautotools if this is intentional"
exit 1
fi
echo "Running autotools in root directory..."
# Necessary to regenerate misc/getcommit revision info
touch -c configure.ac
autoconf
autoheader
CURRENT_PWD=$PWD
for i in $(find ./src/mod -name "configure.ac" -exec dirname '{}' ';'); do
cd $i && touch -c configure.ac && autoconf
echo "Running autoconf in $i..."
cd $CURRENT_PWD
done
for i in $(find ./src/mod -name "config.h.in" -exec dirname '{}' ';'); do
cd $i && autoheader
echo "Running autoheader in $i..."
cd $CURRENT_PWD
done
echo ""
echo "Complete."
|