diff options
author | Werner Koch <[email protected]> | 2004-12-18 11:06:09 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2004-12-18 11:06:09 +0000 |
commit | 7edea76f7e91e33298d24812b8f647699fe65642 (patch) | |
tree | e416f477c4c775c770e590102702b0aa1c091ceb | |
parent | Initial check-in. (diff) | |
download | libgpg-error-7edea76f7e91e33298d24812b8f647699fe65642.tar.gz libgpg-error-7edea76f7e91e33298d24812b8f647699fe65642.zip |
Add option --build-w32.
-rw-r--r-- | ChangeLog | 4 | ||||
-rwxr-xr-x | autogen.sh | 55 |
2 files changed, 57 insertions, 2 deletions
@@ -1,3 +1,7 @@ +2004-12-18 Werner Koch <[email protected]> + + * autogen.sh: Add option --build-w32. + 2004-09-14 Marcus Brinkmann <[email protected]> * src/gpg-error.m4: Add copyright note. @@ -28,6 +28,59 @@ check_version () { return 1 } +DIE=no + +# ***** W32 build script ******* +# Used to cross-compile for Windows. +if test "$1" = "--build-w32"; then + tmp=`dirname $0` + tsdir=`cd "$tmp"; pwd` + shift + if [ ! -f $tsdir/config.guess ]; then + echo "$tsdir/config.guess not found" >&2 + exit 1 + fi + build=`$tsdir/config.guess` + + [ -z "$w32root" ] && w32root="$HOME/w32root" + echo "Using $w32root as standard install directory" >&2 + + # See whether we have the Debian cross compiler package or the + # old mingw32/cpd system + if i586-mingw32msvc-gcc --version >/dev/null 2>&1 ; then + host=i586-mingw32msvc + crossbindir=/usr/$host/bin + else + host=i386--mingw32 + if ! mingw32 --version >/dev/null; then + echo "We need at least version 0.3 of MingW32/CPD" >&2 + exit 1 + fi + crossbindir=`mingw32 --install-dir`/bin + # Old autoconf version required us to setup the environment + # with the proper tool names. + CC=`mingw32 --get-path gcc` + CPP=`mingw32 --get-path cpp` + AR=`mingw32 --get-path ar` + RANLIB=`mingw32 --get-path ranlib` + export CC CPP AR RANLIB + fi + + if [ -f "$tsdir/config.log" ]; then + if ! head $tsdir/config.log | grep "$host" >/dev/null; then + echo "Pease run a 'make distclean' first" >&2 + exit 1 + fi + fi + + ./configure --enable-maintainer-mode --prefix=${w32root} \ + --host=i586-mingw32msvc --build=${build} \ + --disable-shared + + exit $? +fi +# ***** end W32 build script ******* + # Grep the required versions from configure.ac autoconf_vers=`sed -n '/^AC_PREREQ(/ { @@ -65,8 +118,6 @@ ACLOCAL=${AUTOMAKE_PREFIX}${ACLOCAL:-aclocal}${AUTOMAKE_SUFFIX} GETTEXT=${GETTEXT_PREFIX}${GETTEXT:-gettext}${GETTEXT_SUFFIX} MSGMERGE=${GETTEXT_PREFIX}${MSGMERGE:-msgmerge}${GETTEXT_SUFFIX} -DIE=no - if check_version $AUTOCONF $autoconf_vers_num $autoconf_vers ; then check_version $AUTOHEADER $autoconf_vers_num $autoconf_vers autoconf |