Patches for the -dev branch on CVS

Remi Guyomarch rguyom at mail.dotcom.fr
Mon Jan 31 00:26:52 CET 2000


Hi Werner and all,

I patched a bit some files in the -dev branch to compile the CVS
tree on my FreeBSD 3.4 box.
For each patch, I wrote a short description explaining why this patch
is needed.



I added the tools subdir, because checks/ needs mk-tdata which is in
tools/. But this is probably not the right way to compile mk-tdata.c,
because the other .c files in tools/ seems to be out of date.

Index: Makefile.am
===================================================================
RCS file: /home/koch/cvs/gnupg/Makefile.am,v
retrieving revision 1.41
diff -u -u -r1.41 Makefile.am
--- Makefile.am	2000/01/27 16:50:37	1.41
+++ Makefile.am	2000/01/30 22:33:59
@@ -17,7 +17,7 @@
 checks = checks
 endif
 
-SUBDIRS = intl zlib jnlib util mpi cipher ${gcrypt} g10 po doc ${checks}
+SUBDIRS = intl zlib jnlib util mpi cipher ${gcrypt} g10 po doc tools
${checks}
 EXTRA_DIST = README-alpha VERSION  PROJECTS BUGS
 # gettext never gets it right, so we take here care of deleting the
 # symlink.  my_clean_gcrypt is just a kludge until we can include


--gen-key doesn't print "(INSECURE!)" anymore, so we need to fix the
expect script. --gen-key doesn't work right now anyway, because it
doesn't use the new gcry* routines.
(heh, gcry_pk_genkey( NULL, NULL ) :)

Index: checks/genkey1024.test
===================================================================
RCS file: /home/koch/cvs/gnupg/checks/genkey1024.test,v
retrieving revision 1.15
diff -u -u -r1.15 genkey1024.test
--- checks/genkey1024.test	1999/11/13 16:43:07	1.15
+++ checks/genkey1024.test	2000/01/30 22:34:01
@@ -13,7 +13,7 @@
 LANG=
 LANGUAGE=
 
-expect  - <<EOF >/dev/null
+expect  - <<EOF # >/dev/null
 #set timeout -1
 set timeout 8
 match_max 100000
@@ -76,7 +76,7 @@
 expect {
    -exact "a test\r
 \r               \rYou selected this USER-ID:\r
-    \"Harry H. (a test) <hh at ddorf.de> (INSECURE!)\"\r
+    \"Harry H. (a test) <hh at ddorf.de>\"\r
 \r
 Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? " { send -- "o\r" }
     timeout { exit 1 } }


Some files in cipher/ needs a -I../include to compile.

Index: cipher/Makefile.am
===================================================================
RCS file: /home/koch/cvs/gnupg/cipher/Makefile.am,v
retrieving revision 1.52
diff -u -u -r1.52 Makefile.am
--- cipher/Makefile.am	1999/12/08 21:02:55	1.52
+++ cipher/Makefile.am	2000/01/30 22:34:02
@@ -1,7 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 
 
-INCLUDES = -I$(top_srcdir)/gcrypt
+INCLUDES = -I$(top_srcdir)/gcrypt -I$(top_srcdir)/include
 
 noinst_LTLIBRARIES = libcipher.la
 

I had to add libutil.la and @INTLLIBS@ (the gettext library) to link
testapi.

Index: gcrypt/Makefile.am
===================================================================
RCS file: /home/koch/cvs/gnupg/gcrypt/Makefile.am,v
retrieving revision 1.12
diff -u -u -r1.12 Makefile.am
--- gcrypt/Makefile.am	2000/01/24 11:55:46	1.12
+++ gcrypt/Makefile.am	2000/01/30 22:34:04
@@ -14,7 +14,7 @@
 #sexp_SOURCES = sexp.c mpiapi.c
 #sexp_LDADD =  ../cipher/libcipher.la ../mpi/libmpi.la	../util/libutil.la
./libgcrypt.la @INTLLIBS@
 testapi_SOURCES = testapi.c
-testapi_LDADD = libgcrypt.la
+testapi_LDADD = libgcrypt.la ../util/libutil.la @INTLLIBS@
 
 include_HEADERS = gcrypt.h
 

mpi/ files #include files which are in include/

Index: mpi/Makefile.am
===================================================================
RCS file: /home/koch/cvs/gnupg/mpi/Makefile.am,v
retrieving revision 1.22
diff -u -u -r1.22 Makefile.am
--- mpi/Makefile.am	1999/12/08 21:03:01	1.22
+++ mpi/Makefile.am	2000/01/30 22:34:05
@@ -1,7 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 
 
-INCLUDES =  -I$(top_srcdir)/gcrypt
+INCLUDES =  -I$(top_srcdir)/gcrypt -I$(top_srcdir)/include
 CFLAGS = @CFLAGS@ @MPI_OPT_FLAGS@
 SFLAGS = @MPI_SFLAGS@
 

Obvious fix.

Index: po/POTFILES.in
===================================================================
RCS file: /home/koch/cvs/gnupg/po/POTFILES.in,v
retrieving revision 1.17
diff -u -u -r1.17 POTFILES.in
--- po/POTFILES.in	2000/01/24 11:55:48	1.17
+++ po/POTFILES.in	2000/01/30 22:34:05
@@ -14,7 +14,7 @@
 
 # main program
 
-g10/g10.c
+g10/gpg.c
 g10/armor.c
 g10/pkclist.c
 g10/keygen.c


1) tools/*.c need gcrypt/*.h 
2) for some reasons, linking fails if libutil is put on the command
line before libgcrypt

Index: tools/Makefile.am
===================================================================
RCS file: /home/koch/cvs/gnupg/tools/Makefile.am,v
retrieving revision 1.18
diff -u -u -r1.18 Makefile.am
--- tools/Makefile.am	1999/12/08 21:03:02	1.18
+++ tools/Makefile.am	2000/01/30 22:34:05
@@ -1,8 +1,8 @@
 ## Process this file with automake to produce Makefile.in
 
 EXTRA_DIST = lspgpot
-INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/intl
-needed_libs = ../util/libutil.la ../gcrypt/libgcrypt.la @INTLLIBS@
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/intl
-I$(top_srcdir)/gcrypt
+needed_libs = ../gcrypt/libgcrypt.la ../util/libutil.la @INTLLIBS@
 
 
 noinst_PROGRAMS = mpicalc bftest clean-sat mk-tdata shmtest


Little fix to at least be able to compile and link this file.

Index: tools/bftest.c
===================================================================
RCS file: /home/koch/cvs/gnupg/tools/bftest.c,v
retrieving revision 1.11
diff -u -u -r1.11 bftest.c
--- tools/bftest.c	1999/10/26 12:14:35	1.11
+++ tools/bftest.c	2000/01/30 22:34:06
@@ -38,12 +38,6 @@
     exit(1);
 }
 
-const char *
-strusage( int level )
-{
-    return default_strusage(level);
-}
-
 static void
 i18n_init(void)
 {
@@ -53,7 +47,7 @@
     #else
        setlocale( LC_ALL, "" );
     #endif
-    bindtextdomain( PACKAGE, G10_LOCALEDIR );
+    bindtextdomain( PACKAGE, GNUPG_LOCALEDIR );
     textdomain( PACKAGE );
   #endif
 }


Two horrible hacks to be able to compile mpicalc and shmtest. I have
no idea if 1) they works as they should 2) they are needed anymore.

Index: tools/mpicalc.c
===================================================================
RCS file: /home/koch/cvs/gnupg/tools/mpicalc.c,v
retrieving revision 1.10
diff -u -u -r1.10 mpicalc.c
--- tools/mpicalc.c	1999/06/08 11:41:46	1.10
+++ tools/mpicalc.c	2000/01/30 22:34:06
@@ -32,6 +32,7 @@
 #include "util.h"
 #include "mpi.h"
 #include "i18n.h"
+#include "gcrypt.h"
 
 #define STACKSIZE  100
 static MPI stack[STACKSIZE];
@@ -56,7 +57,7 @@
     "\nSyntax: mpicalc [options] [files]\n"
     "MPI RPN calculator\n";
 	break;
-      default:	p = default_strusage(level);
+      default:	p = strusage(level);
     }
     return p;
 }
@@ -71,7 +72,7 @@
     #else
        setlocale( LC_ALL, "" );
     #endif
-    bindtextdomain( PACKAGE, G10_LOCALEDIR );
+    bindtextdomain( PACKAGE, GNUPG_LOCALEDIR );
     textdomain( PACKAGE );
   #endif
 }
@@ -332,11 +333,12 @@
 			mpi_free(stack[i]), stack[i] = NULL;
 		    stackidx = 0;
 		    break;
+#if 0
 		  case 'p': /* print the tos */
 		    if( !stackidx )
 			puts("stack is empty");
 		    else {
-			mpi_print(stdout, stack[stackidx-1], 1 );
+			gcry_mpi_print(stdout, stack[stackidx-1], 1 );
 			putchar('\n');
 		    }
 		    break;
@@ -347,6 +349,7 @@
 			putchar('\n');
 		    }
 		    break;
+#endif
 		  default:
 		    fputs("invalid operator\n", stderr);
 		}
Index: tools/shmtest.c
===================================================================
RCS file: /home/koch/cvs/gnupg/tools/shmtest.c,v
retrieving revision 1.5
diff -u -u -r1.5 shmtest.c
--- tools/shmtest.c	1999/02/10 16:22:38	1.5
+++ tools/shmtest.c	2000/01/30 22:34:07
@@ -36,12 +36,6 @@
     exit(1);
 }
 
-const char *
-strusage( int level )
-{
-    return default_strusage(level);
-}
-
 static void
 i18n_init(void)
 {
@@ -51,7 +45,7 @@
     #else
        setlocale( LC_ALL, "" );
     #endif
-    bindtextdomain( PACKAGE, G10_LOCALEDIR );
+    bindtextdomain( PACKAGE, GNUPG_LOCALEDIR );
     textdomain( PACKAGE );
   #endif
 }
@@ -77,7 +71,7 @@
 	memcpy( area+n+2, p, len );
 	area[n] = len >> 8;
 	area[n+1] = len;
-	m_free(p);
+	g10_private_free(p);
     }
     else { /* bool */
 	area[n] = 0;
@@ -112,7 +106,7 @@
 
     for(n=0,i=1; i < argc; i++ )
 	n += strlen(argv[i]) + 1;
-    p = m_alloc( 100 + n );
+    p = g10_private_malloc( 100 + n );
     strcpy( p, "../g10/gpg --status-fd 1 --run-as-shm-coprocess 0");
     for(i=1; i < argc; i++ ) {
 	strcat(p, " " );
@@ -120,7 +114,7 @@
     }
 
     fp = popen( p, "r" );
-    m_free( p );
+    g10_private_free( p );
     if( !fp )
 	log_error("popen failed: %s\n", strerror(errno));
 



More information about the Gnupg-devel mailing list