Tweaks for cross compiling
authorWerner Koch <wk@gnupg.org>
Mon, 6 Aug 2001 11:09:35 +0000 (11:09 +0000)
committerWerner Koch <wk@gnupg.org>
Mon, 6 Aug 2001 11:09:35 +0000 (11:09 +0000)
ChangeLog
configure.ac
scripts/ChangeLog
scripts/autogen.sh

index 6f4559c..ce80748 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2001-08-06  Werner Koch  <wk@gnupg.org>
+
+       * configure.ac: Removed cross compiling hacks.
+
 2001-08-03  Werner Koch  <wk@gnupg.org>
 
        Released 1.1.4.
index 6ec0a9a..ffb359c 100644 (file)
@@ -28,7 +28,7 @@ AC_PREREQ(2.52)
 #    AGE, set REVISION to 0.
 # 3. Interfaces removed (BAD, breaks upward compatibility): Increment
 #    CURRENT, set AGE and REVISION to 0.
-AC_INIT(libgcrypt,1.1.4)
+AC_INIT(libgcrypt,1.1.4a)
 LIBGCRYPT_LT_CURRENT=2
 LIBGCRYPT_LT_AGE=1
 LIBGCRYPT_LT_REVISION=1
@@ -160,12 +160,6 @@ dnl
 case "${target}" in
     *-*-mingw32*)
         # special stuff for Windoze NT
-        # Do we need to set cross_compiling here or is it sufficient
-        # to rely on AC_PROG_CC which is called later?
-        cross_compiling=yes
-        CC="${target}-gcc"
-        CPP="${target}-gcc -E"
-        RANLIB="${target}-ranlib"
         disallowed_modules="rndunix rndlinux rndegd"
         ;;
     *)
index 4d33d03..b073e24 100644 (file)
@@ -1,3 +1,7 @@
+2001-08-06  Werner Koch  <wk@gnupg.org>
+
+       * autogen.sh: Added --build-w32 option.
+
 2001-05-28  Werner Koch  <wk@gnupg.org>
 
        * db2html.in: Removed.
index 2bb55b9..80bb520 100755 (executable)
@@ -9,6 +9,58 @@ automake_vers=1.4
 aclocal_vers=1.4
 libtool_vers=1.3
 
+if test "$1" = "--build-w32"; then
+    tsdir=$(cd `dirname $0`; cd ..; pwd)
+    shift
+    host=i386--mingw32
+    if [ ! -f $tsdir/scripts/config.guess ]; then
+        echo "$tsdir/scripts/config.guess not found" >&2
+        exit 1
+    fi
+    build=`$tsdir/scripts/config.guess`
+        
+    if ! mingw32 --version >/dev/null; then
+        echo "We need at least version 0.3 of MingW32/CPD" >&2
+        exit 1
+    fi
+
+    if [ -f "$tsdir/config.h" ]; then
+        if grep HAVE_DOSISH_SYSTEM config.h | grep undef >/dev/null; then
+            echo "Pease run a 'make distclean' first" >&2
+            exit 1
+        fi
+    fi
+
+    crossbindir=`mingw32 --install-dir`/bin
+    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 
+
+    disable_foo_tests=""
+    if [ -n "$lib_config_files" ]; then
+        for i in $lib_config_files; do
+            j=`echo $i | tr '[a-z-]' '[A-Z_]'`
+            eval "$j=${crossbindir}/$i"
+            export $j
+            disable_foo_tests="$disable_foo_tests --disable-`echo $i| \
+                           sed 's,-config$,,'`-test"
+            if [ ! -f "${crossbindir}/$i" ]; then                   
+                echo "$i not installed for MingW32" >&2
+                DIE=yes
+            fi
+        done
+    fi
+    [ $DIE = yes ] && exit 1
+
+    $tsdir/configure --build=${build} --host=${host} \
+                ${disable_foo_tests} $*
+    exit $?
+fi
+
+
+
 if (autoconf --version) < /dev/null > /dev/null 2>&1 ; then
     if (autoconf --version | awk 'NR==1 { if( $3 >= '$autoconf_vers') \
                               exit 1; exit 0; }');