NT version compiles V0-0-0
authorWerner Koch <wk@gnupg.org>
Mon, 5 Jan 1998 19:13:13 +0000 (19:13 +0000)
committerWerner Koch <wk@gnupg.org>
Mon, 5 Jan 1998 19:13:13 +0000 (19:13 +0000)
README
acconfig.h
cipher/random.c
configure.in
scripts/config.sub

diff --git a/README b/README
index fa8596b..1830189 100644 (file)
--- a/README
+++ b/README
@@ -6,8 +6,6 @@
     THIS IS VERSION IS ONLY A TEST VERSION !  YOU SHOULD NOT
     USE IT FOR OTHER PURPOSES THAN EVALUATING THE CURRENT CODE.
 
-    * Only some parts work.
-
     * The data format may change in the next version!
 
     * Some features are not yet implemented
@@ -43,6 +41,7 @@
     1024 bit keys and this may be not enough in a couple of years.
 
 
+
     Resources
     ---------
     G10 needs a directory "~/.g10" to store the default keyrings
index 7f4943a..113ec9f 100644 (file)
@@ -37,6 +37,9 @@
 #undef HAVE_U32_TYPEDEF
 
 
+/* defined if we have a /dev/random and /dev/urandom */
+#undef HAVE_DEV_RANDOM
+
 /* RSA is only compiled in if you have these files. You can use
  * RSA without any restrictions, if your not in the U.S. or
  * wait until sep 20, 2000
index f865693..a95e7e5 100644 (file)
@@ -40,7 +40,6 @@ static struct cache cache[3];
 #define MASK_LEVEL(a) do {if( a > 2 ) a = 2; else if( a < 0 ) a = 0; } while(0)
 
 
-static int open_device( const char *name, int minor );
 static void fill_buffer( byte *buffer, size_t length, int level );
 
 /****************
@@ -70,6 +69,7 @@ get_random_byte( int level )
 
 
 
+#ifdef HAVE_DEV_RANDOM
 
 static int
 open_device( const char *name, int minor )
@@ -149,3 +149,26 @@ the OS a chance to collect more entropy! (Need %d more bytes)\n", length );
     } while( length );
 }
 
+#else /* not HAVE_DEV_RANDOM */
+
+
+static void
+fill_buffer( byte *buffer, size_t length, int level )
+{
+    static int initialized=0;
+
+    if( !initialized ) {
+       log_info("warning: using insecure random number generator!!\n");
+       tty_printf("The random number generator is only a kludge to let\n"
+                  "it compile - it is in no way a strong RNG!\n\n"
+                  "DON'T USE ANY DATA GENERATED BY THIS PROGRAM!!\n\n");
+       initialized=1;
+       srand(make_timestamp()*getpid());
+    }
+
+    while( length-- )
+       *buffer++ = ((unsigned)(1 + (int) (256.0*rand()/(RAND_MAX+1.0)))-1);
+}
+
+#endif
+
index a476acd..3377115 100644 (file)
@@ -59,10 +59,24 @@ fi
 dnl Checks for programs.
 
 AC_PROG_MAKE_SET
+
+case "${target}" in
+    i386--mingw32)
+       # special stuff for Windoze NT
+       cross_compiling=yes
+       CC="i386--mingw32-gcc"
+       CPP="i386--mingw32-gcc -E"
+       RANLIB="i386--mingw32-ranlib"
+       ac_cv_have_dev_random=no
+       ;;
+    *)
 AC_PROG_RANLIB
 AC_PROG_INSTALL
 AC_PROG_CC
 AC_PROG_CPP
+       ;;
+esac
+
 
 AC_ARG_PROGRAM
 
@@ -136,18 +150,36 @@ AC_CHECK_SIZEOF(unsigned long, 32)
 
 dnl Checks for library functions.
 AC_FUNC_VPRINTF
-AC_CHECK_FUNCS(strerror strtol strtoul)
-
+AC_CHECK_FUNCS(strerror strtol strtoul stpcpy tcgetattr)
+
+dnl check wether we have a random device
+AC_CACHE_CHECK(for random device, ac_cv_have_dev_random,
+[if test -c /dev/random && test -c /dev/urandom ; then
+  ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi])
+if test "$ac_cv_have_dev_random" = yes; then
+    AC_DEFINE(HAVE_DEV_RANDOM)
+fi
 
 
 dnl setup assembler stuff
+AC_MSG_CHECKING(configure mpi)
+mpi_config_done="no"
+AC_CACHE_VAL(ac_cv_mpi_config_done,
+            [ ac_cv_mpi_config_done="$mpi_config_done" ])
+if test "$ac_cv_mpi_config_done" = yes; then
+    AC_MSG_RESULT(done)
+else
+ac_cv_mpi_config_done=""
 if test -f ./mpi/config.links ; then
     . ./mpi/config.links
     AC_LINK_FILES( ${mpi_ln_src}, ${mpi_ln_dst} )
+    ac_cv_mpi_config_done="yes"
+    AC_MSG_RESULT(done)
 else
+    AC_MSG_RESULT(failed)
     AC_MSG_ERROR([mpi/config.links missing!])
 fi
-
+fi
 
 
 dnl checking whether we have the RSA source
index fb43869..055e545 100755 (executable)
@@ -12,7 +12,7 @@
 #
 # This program 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
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
@@ -34,7 +34,7 @@
 # and recognize all the CPU types, system types and aliases
 # that are meaningful with *any* GNU software.
 # Each package is responsible for reporting which valid configurations
-# it does not support.  The user should be able to distinguish
+# it does not support. The user should be able to distinguish
 # a failure to support a valid configuration from a meaningless
 # configuration.
 
@@ -102,15 +102,15 @@ case $os in
                os=
                basic_machine=$1
                ;;
-       -scout)                                         # CYGNUS LOCAL
+       -scout)                                         # CYGNUS LOCAL
                ;;
        -wrs)                                           # CYGNUS LOCAL
                os=vxworks
                basic_machine=$1
                ;;
-        -hiuxmpp)
-                os=-hiuxmpp
-                ;;
+       -hiuxmpp)
+               os=-hiuxmpp
+               ;;
        -hiux*)
                os=-hiuxwe2
                ;;
@@ -228,7 +228,7 @@ case $basic_machine in
                ;;
        # Recognize the various machine names and aliases which stand
        # for a CPU type and a company and sometimes even an OS.
-       386bsd)                                         # CYGNUS LOCAL
+       386bsd)                                         # CYGNUS LOCAL
                basic_machine=i386-unknown
                os=-bsd
                ;;
@@ -369,10 +369,10 @@ case $basic_machine in
                basic_machine=tron-gmicro
                os=-sysv
                ;;
-        hiuxmpp)
-                basic_machine=hppa1.1-hitachi
-                os=-hiuxmpp
-                ;;
+       hiuxmpp)
+               basic_machine=hppa1.1-hitachi
+               os=-hiuxmpp
+               ;;
        h3050r* | hiux*)
                basic_machine=hppa1.1-hitachi
                os=-hiuxwe2
@@ -404,22 +404,22 @@ case $basic_machine in
                basic_machine=m68k-hp
                os=-hpux
                ;;
-        w89k-*)                                                # CYGNUS LOCAL
-                basic_machine=hppa1.1-winbond
-                os=-proelf
-                ;;
-        op50n-*)                                       # CYGNUS LOCAL
-                basic_machine=hppa1.1-oki
-                os=-proelf
-                ;;
-        op60c-*)                                       # CYGNUS LOCAL
-                basic_machine=hppa1.1-oki
-                os=-proelf
-                ;;
-        hppro)                                         # CYGNUS LOCAL
-                basic_machine=hppa1.1-hp
-                os=-proelf
-                ;;
+       w89k-*)                                         # CYGNUS LOCAL
+               basic_machine=hppa1.1-winbond
+               os=-proelf
+               ;;
+       op50n-*)                                        # CYGNUS LOCAL
+               basic_machine=hppa1.1-oki
+               os=-proelf
+               ;;
+       op60c-*)                                        # CYGNUS LOCAL
+               basic_machine=hppa1.1-oki
+               os=-proelf
+               ;;
+       hppro)                                          # CYGNUS LOCAL
+               basic_machine=hppa1.1-hp
+               os=-proelf
+               ;;
        hp9k2[0-9][0-9] | hp9k31[0-9])
                basic_machine=m68000-hp
                ;;
@@ -519,7 +519,7 @@ case $basic_machine in
                os=-coff
                ;;
        msdos)                                          # CYGNUS LOCAL
-               basic_machine=i386-unknown      
+               basic_machine=i386-unknown
                os=-msdos
                ;;
        ncr3000)
@@ -542,7 +542,7 @@ case $basic_machine in
                basic_machine=mips-sony
                os=-newsos
                ;;
-       necv70)                                         # CYGNUS LOCAL
+       necv70)                                         # CYGNUS LOCAL
                basic_machine=v70-nec
                os=-sysv
                ;;
@@ -571,7 +571,7 @@ case $basic_machine in
                basic_machine=i960-intel
                os=-nindy
                ;;
-       mon960)                                         # CYGNUS LOCAL
+       mon960)                                         # CYGNUS LOCAL
                basic_machine=i960-intel
                os=-mon960
                ;;
@@ -600,7 +600,7 @@ case $basic_machine in
        pbb)
                basic_machine=m68k-tti
                ;;
-        pc532 | pc532-*)
+       pc532 | pc532-*)
                basic_machine=ns32k-pc532
                ;;
        pentium | p5)
@@ -629,19 +629,19 @@ case $basic_machine in
        power)  basic_machine=rs6000-ibm
                ;;
        ppc)    basic_machine=powerpc-unknown
-               ;;
+               ;;
        ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
        ppcle | powerpclittle | ppc-le | powerpc-little)
                basic_machine=powerpcle-unknown
-               ;;
+               ;;
        ppcle-* | powerpclittle-*)
                basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
        ps2)
                basic_machine=i386-ibm
                ;;
-       rom68k)                                         # CYGNUS LOCAL
+       rom68k)                                         # CYGNUS LOCAL
                basic_machine=m68k-rom68k
                os=-coff
                ;;
@@ -673,7 +673,7 @@ case $basic_machine in
        spur)
                basic_machine=spur-unknown
                ;;
-       st2000)                                         # CYGNUS LOCAL
+       st2000)                                         # CYGNUS LOCAL
                basic_machine=m68k-tandem
                ;;
        stratus)                                        # CYGNUS LOCAL
@@ -735,7 +735,7 @@ case $basic_machine in
                basic_machine=a29k-nyu
                os=-sym1
                ;;
-       v810 | necv810)                                 # CYGNUS LOCAL
+       v810 | necv810)                                 # CYGNUS LOCAL
                basic_machine=v810-nec
                os=-none
                ;;
@@ -748,8 +748,8 @@ case $basic_machine in
                os=-vms
                ;;
        vpp*|vx|vx-*)
-               basic_machine=f301-fujitsu
-               ;;
+              basic_machine=f301-fujitsu
+              ;;
        vxworks960)
                basic_machine=i960-wrs
                os=-vxworks
@@ -763,14 +763,14 @@ case $basic_machine in
                os=-vxworks
                ;;
        w65*)                                           # CYGNUS LOCAL
-               basic_machine=w65-wdc
-               os=-none
+               basic_machine=w65-wdc
+               os=-none
                ;;
        xmp)
                basic_machine=xmp-cray
                os=-unicos
                ;;
-        xps | xps100)
+       xps | xps100)
                basic_machine=xps100-honeywell
                ;;
        z8k-*-coff)                                     # CYGNUS LOCAL
@@ -818,7 +818,7 @@ case $basic_machine in
        sparc)
                basic_machine=sparc-sun
                ;;
-        cydra)
+       cydra)
                basic_machine=cydra-cydrome
                ;;
        orion)
@@ -856,8 +856,8 @@ esac
 if [ x"$os" != x"" ]
 then
 case $os in
-        # First match some system type aliases
-        # that might get confused with valid system types.
+       # First match some system type aliases
+       # that might get confused with valid system types.
        # -solaris* is a basic system type, with this one exception.
        -solaris1 | -solaris1.*)
                os=`echo $os | sed -e 's|solaris1|sunos4|'`
@@ -886,7 +886,7 @@ case $os in
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
              | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-               | -linux-gnu* | -uxpv* | -mingw32* )
+             | -linux-gnu* | -uxpv* | -mingw32* )
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
        # CYGNUS LOCAL
@@ -929,7 +929,7 @@ case $os in
                os=-sysv
                ;;
        -ns2 )
-               os=-nextstep2
+               os=-nextstep2
                ;;
        # Preserve the version number of sinix5.
        -sinix5.*)
@@ -969,6 +969,7 @@ case $os in
                ;;
        *)
                # Get rid of the `-' at the beginning of $os.
+               echo "os=($os)"
                os=`echo $os | sed 's/[^-]*-//'`
                echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
                exit 1
@@ -993,7 +994,7 @@ case $basic_machine in
        arm*-semi)
                os=-aout
                ;;
-        pdp11-*)
+       pdp11-*)
                os=-none
                ;;
        *-dec | vax-*)
@@ -1017,9 +1018,9 @@ case $basic_machine in
        mips*-cisco)                                    # CYGNUS LOCAL
                os=-elf
                ;;
-        mips*-*)                                        # CYGNUS LOCAL
-                os=-elf
-                ;;
+       mips*-*)                                        # CYGNUS LOCAL
+               os=-elf
+               ;;
        *-tti)  # must be before sparc entry or we get the wrong os.
                os=-sysv3
                ;;
@@ -1083,19 +1084,19 @@ case $basic_machine in
        *-next)
                os=-nextstep3
                ;;
-        *-gould)
+       *-gould)
                os=-sysv
                ;;
-        *-highlevel)
+       *-highlevel)
                os=-bsd
                ;;
        *-encore)
                os=-bsd
                ;;
-        *-sgi)
+       *-sgi)
                os=-irix
                ;;
-        *-siemens)
+       *-siemens)
                os=-sysv4
                ;;
        *-masscomp)
@@ -1107,7 +1108,7 @@ case $basic_machine in
        *-rom68k)                                       # CYGNUS LOCAL
                os=-coff
                ;;
-       *-*bug)                                         # CYGNUS LOCAL
+       *-*bug)                                         # CYGNUS LOCAL
                os=-coff
                ;;
        *-apple)                                        # CYGNUS LOCAL
@@ -1134,7 +1135,7 @@ case $basic_machine in
                        -aix*)
                                vendor=ibm
                                ;;
-                       -beos*)                                         # CYGNUS LOCAL
+                       -beos*)                                         # CYGNUS LOCAL
                                vendor=be
                                ;;
                        -hpux*)