summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2000-12-19 21:24:41 +0000
committerWerner Koch <wk@gnupg.org>2000-12-19 21:24:41 +0000
commit6626bbbab524a1ea01fdf8694d84777790b98757 (patch)
tree3c4f8ebb6be4e53d6df6b2f2e21d9a1608f52d20
parent1aeb5115e4ac73053bc8f6d94bdbc072ba597b2e (diff)
downloadlibgcrypt-6626bbbab524a1ea01fdf8694d84777790b98757.tar.gz
Compiles again
-rw-r--r--Makefile.am2
-rw-r--r--cipher/Makefile.am2
-rw-r--r--doc/Makefile.am2
-rw-r--r--jnlib/Makefile.am2
-rw-r--r--jnlib/libjnlib-config.h6
-rw-r--r--mpi/ChangeLog2
-rw-r--r--mpi/Makefile.am4
-rw-r--r--mpi/mpi-internal.h5
-rw-r--r--src/ChangeLog2
-rw-r--r--src/Makefile.am3
-rw-r--r--src/mpi.h2
-rw-r--r--src/types.h125
12 files changed, 146 insertions, 11 deletions
diff --git a/Makefile.am b/Makefile.am
index bc5a8bdc..0ce05c93 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
-SUBDIRS = jnlib util mpi cipher src doc
+SUBDIRS = jnlib mpi cipher src doc
EXTRA_DIST = README-alpha BUGS
DISTCLEANFILES = gcrypt-defs.h
diff --git a/cipher/Makefile.am b/cipher/Makefile.am
index 2fadfb36..0d78e93d 100644
--- a/cipher/Makefile.am
+++ b/cipher/Makefile.am
@@ -1,7 +1,7 @@
# Process this file with automake to produce Makefile.in
-INCLUDES = -I$(top_srcdir)/gcrypt -I$(top_srcdir)/mpi
+INCLUDES = -I$(top_srcdir)/src
noinst_LTLIBRARIES = libcipher.la
diff --git a/doc/Makefile.am b/doc/Makefile.am
index a594205a..adaa88c4 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -5,7 +5,7 @@ BUILT_SOURCES = version.sgml gcryptref.html gcryptref.ps
#EXTRA_DIST = DETAILS gpg.sgml gpg.1 FAQ HACKING OpenPGP \
# version.sgml.in $(BUILT_SOURCES)
-EXTRA_DIST = DETAILS HACKING OpenPGP FAQ
+#EXTRA_DIST =
#man_MANS = gpg.1
diff --git a/jnlib/Makefile.am b/jnlib/Makefile.am
index 9779caef..00f3bdae 100644
--- a/jnlib/Makefile.am
+++ b/jnlib/Makefile.am
@@ -3,7 +3,7 @@
# Those 2 files are in the CVS but currently not used.
EXTRA_DIST = README xmalloc.c xmalloc.h logging.c logging.h
-INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/intl
+INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/intl
noinst_LTLIBRARIES = libjnlib.la
diff --git a/jnlib/libjnlib-config.h b/jnlib/libjnlib-config.h
index 35cee647..1f80ff10 100644
--- a/jnlib/libjnlib-config.h
+++ b/jnlib/libjnlib-config.h
@@ -30,9 +30,9 @@
#include "types.h"
#include <gcrypt.h>
-#include "util.h"
+/*#include "util.h"
#include "i18n.h"
-
+*/
#define jnlib_xmalloc(a) gcry_xmalloc( (a) )
#define jnlib_xcalloc(a,b) gcry_xcalloc( (a), (b) )
#define jnlib_xrealloc(a,n) gcry_xrealloc( (a), (n) )
@@ -47,3 +47,5 @@
#endif /*LIBJNUTIL_CONFIG_H*/
+
+
diff --git a/mpi/ChangeLog b/mpi/ChangeLog
index b2f72b26..e41f1144 100644
--- a/mpi/ChangeLog
+++ b/mpi/ChangeLog
@@ -1,5 +1,7 @@
2000-12-19 Werner Koch <wk@gnupg.org>
+ * mpi-internal.h: Put limb_t definition in an ifdef.
+
Major change:
Removed all GnuPG stuff and renamed this piece of software
to gcrypt.
diff --git a/mpi/Makefile.am b/mpi/Makefile.am
index a9df442e..25041e87 100644
--- a/mpi/Makefile.am
+++ b/mpi/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
-INCLUDES = -I$(top_srcdir)/gcrypt
+INCLUDES = -I$(top_srcdir)/src
CFLAGS = @CFLAGS@ @MPI_OPT_FLAGS@
ASFLAGS = @MPI_SFLAGS@
@@ -64,5 +64,3 @@ libmpi_la_LIBADD = $(common_asm_objects) @MPI_EXTRA_ASM_OBJS@
# $(CPP) $(INCLUDES) $(DEFS) $< | grep -v '^#' > _$*.s
# $(COMPILE) -c _$*.s
# mv -f _$*.o $*.o
-
-
diff --git a/mpi/mpi-internal.h b/mpi/mpi-internal.h
index 3a7855de..6af3c47b 100644
--- a/mpi/mpi-internal.h
+++ b/mpi/mpi-internal.h
@@ -31,6 +31,8 @@
#define G10_MPI_INTERNAL_H
#include "mpi-asm-defs.h"
+
+#ifndef BITS_PER_MPI_LIMB
#if BYTES_PER_MPI_LIMB == SIZEOF_UNSIGNED_INT
typedef unsigned int mpi_limb_t;
typedef signed int mpi_limb_signed_t;
@@ -47,7 +49,8 @@
#error BYTES_PER_MPI_LIMB does not match any C type
#endif
#define BITS_PER_MPI_LIMB (8*BYTES_PER_MPI_LIMB)
-#define DID_MPI_LIMB_TYPEDEF 1
+#endif /*BITS_PER_MPI_LIMB*/
+
#include "mpi.h"
/* If KARATSUBA_THRESHOLD is not already defined, define it to a
diff --git a/src/ChangeLog b/src/ChangeLog
index 7bb46a34..f1dbe4f5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,7 @@
2000-12-19 Werner Koch <wk@gnupg.org>
+ * types.h: Moved from ../include to here.
+
Major change:
Removed all GnuPG stuff and renamed this piece of software
to gcrypt.
diff --git a/src/Makefile.am b/src/Makefile.am
index 7c66e19f..fe15c17b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -16,7 +16,7 @@
# It seems that we need gcrypt.m4 here too
EXTRA_DIST = gcrypt-config.in gcrypt.m4
-INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/intl
+INCLUDES = -I$(top_srcdir)/intl
OMIT_DEPENDENCIES = types.h
@@ -39,6 +39,7 @@ libgcrypt_la_LDFLAGS = -version-info \
# -export-symbols libgcrypt.sym
libgcrypt_la_SOURCES = g10lib.h \
+ types.h \
cipher.h \
misc.c \
global.c \
diff --git a/src/mpi.h b/src/mpi.h
index 8680cf96..f8279854 100644
--- a/src/mpi.h
+++ b/src/mpi.h
@@ -35,6 +35,7 @@
#include "memory.h"
#include "../mpi/mpi-asm-defs.h"
+#ifndef BITS_PER_MPI_LIMB
#if BYTES_PER_MPI_LIMB == SIZEOF_UNSIGNED_INT
typedef unsigned int mpi_limb_t;
typedef signed int mpi_limb_signed_t;
@@ -51,6 +52,7 @@
#error BYTES_PER_MPI_LIMB does not match any C type
#endif
#define BITS_PER_MPI_LIMB (8*BYTES_PER_MPI_LIMB)
+#endif /*BITS_PER_MPI_LIMB*/
#define DBG_MPI g10_get_debug_flag( 2 );
diff --git a/src/types.h b/src/types.h
new file mode 100644
index 00000000..86a8a891
--- /dev/null
+++ b/src/types.h
@@ -0,0 +1,125 @@
+/* types.h - some common typedefs
+ * Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+ *
+ * This file is part of GNUPG.
+ *
+ * GNUPG is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * GNUPG 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
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifndef GCRYPT_TYPES_H
+#define GCRYPT_TYPES_H
+
+
+/* The AC_CHECK_SIZEOF() in configure fails for some machines.
+ * we provide some fallback values here */
+#if !SIZEOF_UNSIGNED_SHORT
+ #undef SIZEOF_UNSIGNED_SHORT
+ #define SIZEOF_UNSIGNED_SHORT 2
+#endif
+#if !SIZEOF_UNSIGNED_INT
+ #undef SIZEOF_UNSIGNED_INT
+ #define SIZEOF_UNSIGNED_INT 4
+#endif
+#if !SIZEOF_UNSIGNED_LONG
+ #undef SIZEOF_UNSIGNED_LONG
+ #define SIZEOF_UNSIGNED_LONG 4
+#endif
+
+
+#include <sys/types.h>
+
+
+#ifndef HAVE_BYTE_TYPEDEF
+ #undef byte /* maybe there is a macro with this name */
+ typedef unsigned char byte;
+ #define HAVE_BYTE_TYPEDEF
+#endif
+
+#ifndef HAVE_USHORT_TYPEDEF
+ #undef ushort /* maybe there is a macro with this name */
+ typedef unsigned short ushort;
+ #define HAVE_USHORT_TYPEDEF
+#endif
+
+#ifndef HAVE_ULONG_TYPEDEF
+ #undef ulong /* maybe there is a macro with this name */
+ typedef unsigned long ulong;
+ #define HAVE_ULONG_TYPEDEF
+#endif
+
+#ifndef HAVE_U16_TYPEDEF
+ #undef u16 /* maybe there is a macro with this name */
+ #if SIZEOF_UNSIGNED_INT == 2
+ typedef unsigned int u16;
+ #elif SIZEOF_UNSIGNED_SHORT == 2
+ typedef unsigned short u16;
+ #else
+ #error no typedef for u16
+ #endif
+ #define HAVE_U16_TYPEDEF
+#endif
+
+#ifndef HAVE_U32_TYPEDEF
+ #undef u32 /* maybe there is a macro with this name */
+ #if SIZEOF_UNSIGNED_INT == 4
+ typedef unsigned int u32;
+ #elif SIZEOF_UNSIGNED_LONG == 4
+ typedef unsigned long u32;
+ #else
+ #error no typedef for u32
+ #endif
+ #define HAVE_U32_TYPEDEF
+#endif
+
+/****************
+ * Warning: Some systems segfault when this u64 typedef and
+ * the dummy code in cipher/md.c is not available. Examples are
+ * Solaris and IRIX.
+ */
+#ifndef HAVE_U64_TYPEDEF
+ #undef u64 /* maybe there is a macro with this name */
+ #if SIZEOF_UNSIGNED_INT == 8
+ typedef unsigned int u64;
+ #define HAVE_U64_TYPEDEF
+ #elif SIZEOF_UNSIGNED_LONG == 8
+ typedef unsigned long u64;
+ #define HAVE_U64_TYPEDEF
+ #elif SIZEOF_UNSIGNED_LONG_LONG == 8
+ typedef unsigned long long u64;
+ #define HAVE_U64_TYPEDEF
+ #endif
+#endif
+
+typedef union {
+ int a;
+ short b;
+ char c[1];
+ long d;
+ #ifdef HAVE_U64_TYPEDEF
+ u64 e;
+ #endif
+ float f;
+ double g;
+} PROPERLY_ALIGNED_TYPE;
+
+typedef struct string_list {
+ struct string_list *next;
+ unsigned int flags;
+ char d[1];
+} *STRLIST;
+
+
+#endif /*GCRYPT_TYPES_H*/
+