Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootstrap and autogen: add the --no-git option #825

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Options:
have gnulib sources on your machine, and
do not want to waste your bandwidth downloading
them again.
--no-git Do not use git to update gnulib. Requires that
--gnulib-srcdir point to a correct gnulib snapshot
--help Print this message
any other option Pass to the 'configure' script verbatim

Expand All @@ -30,6 +32,8 @@ test -z "$srcdir" && srcdir=.
THEDIR=`pwd`
cd $srcdir

no_git=

# Split out options for bootstrap and for configure
declare -a CF_ARGS
for option
Expand All @@ -40,6 +44,8 @@ do
exit;;
--gnulib-srcdir=*)
GNULIB_SRCDIR=$option;;
--no-git)
no_git=" --no-git";;
*)
CF_ARGS[${#CF_ARGS[@]}]=$option;;
esac
Expand Down Expand Up @@ -83,7 +89,7 @@ fi
mkdir -p $BUILD_AUX

$LIBTOOLIZE --copy --force
./bootstrap $GNULIB_SRCDIR
./bootstrap$no_git $GNULIB_SRCDIR
aclocal -I gnulib/m4
autoheader
automake --add-missing
Expand Down
57 changes: 35 additions & 22 deletions bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Options:
have gnulib sources on your machine, and
do not want to waste your bandwidth downloading
them again.
--no-git Do not use git to update gnulib. Requires that
--gnulib-srcdir point to a correct gnulib snapshot

If the file bootstrap.conf exists in the current working directory, its
contents are read as shell variables to configure the bootstrap.
Expand All @@ -19,6 +21,9 @@ Running without arguments will suffice in most cases.
"
}

# Use git to update gnulib sources
use_git=true

for option
do
case $option in
Expand All @@ -27,38 +32,46 @@ do
exit;;
--gnulib-srcdir=*)
GNULIB_SRCDIR=${option#--gnulib-srcdir=};;
--no-git)
use_git=false;;
*)
echo >&2 "$0: $option: unknown option"
exit 1;;
esac
done

# Get gnulib files.
if [ "$use_git" = false ] && [ ! -d "$GNULIB_SRCDIR" ]; then
echo >&2 "$0: Error: --no-git requires --gnulib-srcdir: $GNULIB_SRCDIR"
exit 1
fi

case ${GNULIB_SRCDIR--} in
-)
echo "$0: getting gnulib files..."
git submodule init || exit $?
git submodule update || exit $?
GNULIB_SRCDIR=.gnulib
;;
*)
# Redirect the gnulib submodule to the directory on the command line
# if possible.
if test -d "$GNULIB_SRCDIR"/.git && \
git config --file .gitmodules submodule.gnulib.url >/dev/null; then
git submodule init
GNULIB_SRCDIR=`cd $GNULIB_SRCDIR && pwd`
git config --replace-all submodule.gnulib.url $GNULIB_SRCDIR
# Get gnulib files.
if [ "$use_git" = true ]; then
case ${GNULIB_SRCDIR--} in
-)
echo "$0: getting gnulib files..."
git submodule init || exit $?
git submodule update || exit $?
GNULIB_SRCDIR=.gnulib
else
echo >&2 "$0: invalid gnulib srcdir: $GNULIB_SRCDIR"
exit 1
fi
;;
esac
;;
*)
# Redirect the gnulib submodule to the directory on the command line
# if possible.
if test -d "$GNULIB_SRCDIR"/.git && \
git config --file .gitmodules submodule.gnulib.url >/dev/null; then
git submodule init
GNULIB_SRCDIR=`cd $GNULIB_SRCDIR && pwd`
git config --replace-all submodule.gnulib.url $GNULIB_SRCDIR
echo "$0: getting gnulib files..."
git submodule update || exit $?
GNULIB_SRCDIR=.gnulib
else
echo >&2 "$0: invalid gnulib srcdir: $GNULIB_SRCDIR"
exit 1
fi
;;
esac
fi

gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
<$gnulib_tool || exit
Expand Down