2013-11-01 09:42:29 -08:00
|
|
|
#!/bin/sh
|
|
|
|
|
# This file is part of Cockpit.
|
|
|
|
|
#
|
|
|
|
|
# Copyright (C) 2013 Red Hat, Inc.
|
|
|
|
|
#
|
|
|
|
|
# Cockpit is free software; you can redistribute it and/or modify it
|
|
|
|
|
# under the terms of the GNU Lesser General Public License as published by
|
|
|
|
|
# the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
|
# (at your option) any later version.
|
|
|
|
|
#
|
|
|
|
|
# Cockpit 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
|
|
|
|
|
# Lesser General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU Lesser General Public License
|
|
|
|
|
# along with Cockpit; If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
# Run this to generate all the initial makefiles, etc.
|
|
|
|
|
|
|
|
|
|
set -eux
|
|
|
|
|
|
|
|
|
|
srcdir=`dirname $0`
|
|
|
|
|
test -z "$srcdir" && srcdir=.
|
|
|
|
|
|
|
|
|
|
PKG_NAME="Cockpit"
|
|
|
|
|
|
2014-05-19 05:01:44 -08:00
|
|
|
(test -f $srcdir/src/ws/cockpit.service.in) || {
|
2021-01-12 06:47:14 -09:00
|
|
|
echo "**Error**: Directory "\`$srcdir\'" does not look like the top-level $PKG_NAME directory"
|
2013-11-01 09:42:29 -08:00
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
|
2014-02-12 04:18:28 -09:00
|
|
|
# Switch into srcdir until running configure
|
|
|
|
|
olddir=$(pwd)
|
|
|
|
|
cd $srcdir
|
|
|
|
|
|
2013-11-01 09:42:29 -08:00
|
|
|
rm -rf autom4te.cache
|
|
|
|
|
|
2014-04-08 01:57:44 -08:00
|
|
|
autoreconf -f -i -I tools
|
2013-11-01 09:42:29 -08:00
|
|
|
|
|
|
|
|
set +x
|
|
|
|
|
|
|
|
|
|
# NOCONFIGURE is used by gnome-common; support both
|
|
|
|
|
if ! test -z "${AUTOGEN_SUBDIR_MODE:-}"; then
|
|
|
|
|
NOCONFIGURE=1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if test -z "${NOCONFIGURE:-}"; then
|
|
|
|
|
if test -z "$*"; then
|
|
|
|
|
echo "I am going to run ./configure with no arguments - if you wish "
|
|
|
|
|
echo "to pass any to it, please specify them on the $0 command line."
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
2015-12-18 01:23:50 -09:00
|
|
|
if test -n "${NOCONFIGURE:-}"; then
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
2013-11-01 09:42:29 -08:00
|
|
|
|
2015-12-18 01:23:50 -09:00
|
|
|
cd $olddir
|
2016-04-27 23:21:59 -08:00
|
|
|
if [ -z "${NOREDIRECTMAKEFILE:-}" ]; then
|
|
|
|
|
rm -f $srcdir/Makefile
|
|
|
|
|
fi
|
2021-06-30 01:07:15 -08:00
|
|
|
$srcdir/configure ${AUTOGEN_CONFIGURE_ARGS:-} "$@" || exit $?
|
2015-12-18 01:23:50 -09:00
|
|
|
|
2017-01-02 23:06:35 -09:00
|
|
|
# Put a redirect makefile and dist directory here
|
|
|
|
|
if [ -z "${NOREDIRECTMAKEFILE:-}" ]; then
|
|
|
|
|
if [ ! -e $srcdir/Makefile ]; then
|
|
|
|
|
cat $srcdir/tools/Makefile.redirect > $srcdir/Makefile
|
|
|
|
|
printf "\nREDIRECT = %s\n" "$(realpath $olddir)" >> $srcdir/Makefile
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
mkdir -p $olddir/dist
|
|
|
|
|
cp $srcdir/tools/README.dist $olddir/dist/README.md
|
|
|
|
|
if [ ! -e $srcdir/dist ]; then
|
|
|
|
|
ln -s $olddir/dist $srcdir/dist
|
|
|
|
|
fi
|
2017-10-23 02:32:27 -08:00
|
|
|
# support out-of-tree builds, where "make dist" needs the source files with sane paths
|
|
|
|
|
if [ ! -e $olddir/pkg ] && [ ! -e $olddir/node_modules ]; then
|
|
|
|
|
ln -s "$srcdir/pkg" "$olddir/pkg"
|
|
|
|
|
ln -s "$srcdir/node_modules" "$olddir/node_modules"
|
|
|
|
|
fi
|
2013-11-01 09:42:29 -08:00
|
|
|
fi
|