summaryrefslogtreecommitdiffstats
path: root/autogen.sh
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2014-06-10 16:21:00 +0200
committerWerner Koch <wk@gnupg.org>2014-06-10 16:45:54 +0200
commit0399d87f7aaf2f2126a63899004c5c7bffd4346b (patch)
treebf3d4976a78354d6731105325612e04d775ae164 /autogen.sh
parentw32: Fix build problem with dirmngr. (diff)
downloadgnupg2-0399d87f7aaf2f2126a63899004c5c7bffd4346b.tar.xz
gnupg2-0399d87f7aaf2f2126a63899004c5c7bffd4346b.zip
build: Add more options to autogen.sh.
* autogen.sh: Add options --print-host and --print-build. -- Being able to know the build system and the host as used by GnuPG is useful to build other packages.
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh43
1 files changed, 30 insertions, 13 deletions
diff --git a/autogen.sh b/autogen.sh
index 2b0a5dc51..a6b5909b1 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -70,6 +70,8 @@ MSGMERGE=${GETTEXT_PREFIX}${MSGMERGE:-msgmerge}${GETTEXT_SUFFIX}
DIE=no
FORCE=
SILENT=
+PRINT_HOST=no
+PRINT_BUILD=no
tmp=$(dirname "$0")
tsdir=$(cd "${tmp}"; pwd)
version_parts=3
@@ -89,6 +91,14 @@ if test x"$1" = x"--force"; then
FORCE=" --force"
shift
fi
+if test x"$1" = x"--print-host"; then
+ PRINT_HOST=yes
+ shift
+fi
+if test x"$1" = x"--print-build"; then
+ PRINT_BUILD=yes
+ shift
+fi
# Reject unsafe characters in $HOME, $tsdir and cwd. We consider spaces
@@ -229,16 +239,22 @@ fi
# **** end FIND VERSION ****
+if [ ! -f "$tsdir/build-aux/config.guess" ]; then
+ fatal "$tsdir/build-aux/config.guess not found"
+ exit 1
+fi
+build=`$tsdir/build-aux/config.guess`
+if [ $PRINT_BUILD = yes ]; then
+ echo "$build"
+ exit 0
+fi
+
+
+
# ******************
# W32 build script
# ******************
if [ "$myhost" = "w32" ]; then
- if [ ! -f "$tsdir/build-aux/config.guess" ]; then
- fatal "$tsdir/build-aux/config.guess not found"
- exit 1
- fi
- build=`$tsdir/build-aux/config.guess`
-
case $myhostsub in
ce)
w32root="$w32ce_root"
@@ -279,6 +295,10 @@ if [ "$myhost" = "w32" ]; then
fi
die_p
fi
+ if [ $PRINT_HOST = yes ]; then
+ echo "$host"
+ exit 0
+ fi
if [ -f "$tsdir/config.log" ]; then
if ! head $tsdir/config.log | grep "$host" >/dev/null; then
@@ -299,13 +319,6 @@ fi
# ***** AMD64 cross build script *******
# Used to cross-compile for AMD64 (for testing)
if [ "$myhost" = "amd64" ]; then
- shift
- if [ ! -f $tsdir/build-aux/config.guess ]; then
- echo "$tsdir/build-aux/config.guess not found" >&2
- exit 1
- fi
- build=`$tsdir/build-aux/config.guess`
-
[ -z "$amd64root" ] && amd64root="$HOME/amd64root"
info "Using $amd64root as standard install directory"
replace_sysroot
@@ -326,6 +339,10 @@ if [ "$myhost" = "amd64" ]; then
echo "Stop." >&2
exit 1
fi
+ if [ $PRINT_HOST = yes ]; then
+ echo "$host"
+ exit 0
+ fi
if [ -f "$tsdir/config.log" ]; then
if ! head $tsdir/config.log | grep "$host" >/dev/null; then