diff -u -Naur gnupg-1.2.3/aclocal.m4 gnupg-1.2.3.fink/aclocal.m4
--- gnupg-1.2.3/aclocal.m4	Thu Aug 21 15:49:09 2003
+++ gnupg-1.2.3.fink/aclocal.m4	Thu Dec  4 18:38:33 2003
@@ -521,7 +521,7 @@
 aix*)
   ac_symcode='[BCDTU]'
   ;;
-freebsd* | netbsd* | openbsd* | bsdi* | sunos* | cygwin32* | mingw32*)
+freebsd* | netbsd* | openbsd* | bsdi* | sunos* | cygwin32* | mingw32* | darwin*)
   ac_sympat='_\([_A-Za-z][_A-Za-z0-9]*\)'
   ac_symxfrm='_\1 \1'
   ;;
diff -u -Naur gnupg-1.2.3/configure gnupg-1.2.3.fink/configure
--- gnupg-1.2.3/configure	Thu Aug 21 15:50:00 2003
+++ gnupg-1.2.3.fink/configure	Thu Dec  4 18:38:33 2003
@@ -4424,6 +4424,9 @@
             CFLAGS="$CFLAGS -Ae -D_HPUX_SOURCE"
         fi
         ;;
+    *-darwin*)
+        CFLAGS="$CFLAGS -no-cpp-precomp"
+        ;;
     *-dec-osf4*)
         if test -z "$GCC" ; then
             # Suppress all warnings
@@ -4524,7 +4527,7 @@
 aix*)
   ac_symcode='[BCDTU]'
   ;;
-freebsd* | netbsd* | openbsd* | bsdi* | sunos* | cygwin32* | mingw32*)
+freebsd* | netbsd* | openbsd* | bsdi* | sunos* | cygwin32* | mingw32* | darwin*)
   ac_sympat='_\([_A-Za-z][_A-Za-z0-9]*\)'
   ac_symxfrm='_\1 \1'
   ;;
@@ -4677,7 +4680,7 @@
 
 tmp_do_check="no"
 case "${target}" in
-    i386-emx-os2 | i345686-pc-os2*emx | i386-pc-msdosdjgpp)
+    i386-emx-os2 | i345686-pc-os2*emx | i386-pc-msdosdjgpp | powerpc-apple-darwin*)
         ac_cv_sys_symbol_underscore=yes
         ;;
     *)
@@ -14539,7 +14542,7 @@
          if test "$gnupg_cv_have_broken_mlock" = "yes"; then
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_BROKEN_MLOCK 1
+#define HAVE_BROKEN_MLOCK 0
 _ACEOF
 
              echo "$as_me:$LINENO: result: yes" >&5
diff -u -Naur gnupg-1.2.3/g10/getkey.c gnupg-1.2.3.fink/g10/getkey.c
--- gnupg-1.2.3/g10/getkey.c	Mon Jul 28 14:34:41 2003
+++ gnupg-1.2.3.fink/g10/getkey.c	Thu Dec  4 18:38:33 2003
@@ -1655,6 +1655,11 @@
         if ( x ) /* mask it down to the actual allowed usage */
             key_usage &= x; 
     }
+
+   /* Type 20 Elgamal keys are not usable. */
+   if(pk->pubkey_algo==PUBKEY_ALGO_ELGAMAL)
+     key_usage=0;
+
     pk->pubkey_usage = key_usage;
 
     if ( !key_expire_seen ) {
@@ -1869,6 +1874,14 @@
         if ( x ) /* mask it down to the actual allowed usage */
             key_usage &= x; 
     }
+
+   /* Type 20 Elgamal subkeys or any subkey on a type 20 primary are
+      not usable. */
+   if(mainpk->pubkey_algo==PUBKEY_ALGO_ELGAMAL
+      || subpk->pubkey_algo==PUBKEY_ALGO_ELGAMAL)
+     key_usage=0;
+
+
     subpk->pubkey_usage = key_usage;
     
     p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_KEY_EXPIRE, NULL);
diff -u -Naur gnupg-1.2.3/g10/keygen.c gnupg-1.2.3.fink/g10/keygen.c
--- gnupg-1.2.3/g10/keygen.c	Mon Jul 28 14:34:41 2003
+++ gnupg-1.2.3.fink/g10/keygen.c	Thu Dec  4 18:38:33 2003
@@ -958,8 +958,6 @@
     tty_printf(    _("   (%d) DSA (sign only)\n"), 2 );
     if( addmode )
 	tty_printf(    _("   (%d) ElGamal (encrypt only)\n"), 3 );
-    if (opt.expert)
-        tty_printf(    _("   (%d) ElGamal (sign and encrypt)\n"), 4 );
     tty_printf(    _("   (%d) RSA (sign only)\n"), 5 );
     if (addmode)
         tty_printf(    _("   (%d) RSA (encrypt only)\n"), 6 );
@@ -989,21 +987,6 @@
 	    algo = PUBKEY_ALGO_RSA;
             *r_usage = PUBKEY_USAGE_SIG;
 	    break;
-	}
-	else if( algo == 4 && opt.expert)
-	  {
-	    tty_printf(_(
-"The use of this algorithm is only supported by GnuPG.  You will not be\n"
-"able to use this key to communicate with PGP users.  This algorithm is also\n"
-"very slow, and may not be as secure as the other choices.\n"));
-
-	    if( cpr_get_answer_is_yes("keygen.algo.elg_se",
-				      _("Create anyway? ")))
-	      {
-		algo = PUBKEY_ALGO_ELGAMAL;
-		*r_usage = PUBKEY_USAGE_ENC | PUBKEY_USAGE_SIG;
-		break;
-	      }
 	}
 	else if( algo == 3 && addmode ) {
 	    algo = PUBKEY_ALGO_ELGAMAL_E;
diff -u -Naur gnupg-1.2.3/gnupg-idea-1.11/Makefile gnupg-1.2.3.fink/gnupg-idea-1.11/Makefile
--- gnupg-1.2.3/gnupg-idea-1.11/Makefile	Wed Dec 31 19:00:00 1969
+++ gnupg-1.2.3.fink/gnupg-idea-1.11/Makefile	Thu Dec  4 18:38:53 2003
@@ -0,0 +1,2 @@
+all:
+	cc -D__PPC__ -Wall -O2 -o idea idea.c -bundle -bundle_loader @PREFIX@/bin/gpg
diff -u -Naur gnupg-1.2.3/gnupg-idea-1.11/README.fink gnupg-1.2.3.fink/gnupg-idea-1.11/README.fink
--- gnupg-1.2.3/gnupg-idea-1.11/README.fink	Wed Dec 31 19:00:00 1969
+++ gnupg-1.2.3.fink/gnupg-idea-1.11/README.fink	Thu Dec  4 18:38:53 2003
@@ -0,0 +1,17 @@
+Due to patent problems, gpg doesn't include the IDEA encryption
+algorithm by default. Instead it exists in this separate module.
+If you have a legal right to use IDEA, you may enable it by
+adding the line:
+
+load-extension idea
+
+to your ~/.gnupg/options file. Once you have done this, you can 
+check that IDEA is working by typing:
+
+gpg --version
+
+
+
+_______________________________________________________________
+Christian Swinehart <cswinehart@users.sourceforge.net>
+Tue 24 April 2002
diff -u -Naur gnupg-1.2.3/gnupg-idea-1.11/idea.c gnupg-1.2.3.fink/gnupg-idea-1.11/idea.c
--- gnupg-1.2.3/gnupg-idea-1.11/idea.c	Wed Dec 31 19:00:00 1969
+++ gnupg-1.2.3.fink/gnupg-idea-1.11/idea.c	Thu Dec  4 18:38:53 2003
@@ -0,0 +1,479 @@
+/* idea.c  -  IDEA algorithm
+ * Copyright (c) 1997, 1998, 1999, 2001, 2002 by Werner Koch (dd9jn)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * WERNER KOCH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of Werner Koch shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Werner Koch.
+ *
+ * DUE TO PATENT CLAIMS THE DISTRIBUTION OF THE SOFTWARE IS NOT ALLOWED IN
+ * THESE COUNTRIES: 
+ *     AUSTRIA, FRANCE, GERMANY, ITALY, JAPAN, THE NETHERLANDS, 
+ *     SPAIN, SWEDEN, SWITZERLAND, THE UK AND THE US.
+ */
+
+/*
+ * Please see http://www.noepatents.org/ to learn why software patents
+ * are bad for society and what you can do to fight them.
+ *
+ * The code herein is based on the one from:
+ *   Bruce Schneier: Applied Cryptography. John Wiley & Sons, 1996.
+ *    ISBN 0-471-11709-9. .
+ *
+ * How to compile:
+       gcc -Wall -O2 -shared -fPIC -o idea idea.c
+ *
+ * 2001-06-08 wk  Changed distribution conditions
+ * 2001-06-11 wk  Fixed invert_key (which is not used in CFB mode) 
+ *                Thanks to Mark A. Borgerding.  Added definition for
+ *                the PowerPC.
+ * 2002-08-03 wk  Removed dependeny to g10_log_fatal and perform selftest
+ *                in idea_get_info.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+/* configuration stuff */
+#ifdef __alpha__
+  #define SIZEOF_UNSIGNED_LONG 8
+#else
+  #define SIZEOF_UNSIGNED_LONG 4
+#endif
+
+#if defined(__mc68000__) || defined (__sparc__) || defined (__PPC__) \
+    || (defined(__mips__) && (defined(MIPSEB) || defined (__MIPSEB__)) ) \
+    || defined(__powerpc__) \
+    || defined(__hpux__) /* should be replaced by the Macro for the PA */
+  #define BIG_ENDIAN_HOST 1
+#else
+  #define LITTLE_ENDIAN_HOST 1
+#endif
+
+typedef unsigned long  ulong;
+typedef unsigned short ushort;
+typedef unsigned char  byte;
+
+typedef unsigned short u16;
+typedef unsigned long  u32;
+
+/* end configurable stuff */
+
+#ifndef DIM
+  #define DIM(v) (sizeof(v)/sizeof((v)[0]))
+  #define DIMof(type,member)   DIM(((type *)0)->member)
+#endif
+
+/* imports */
+void g10_log_fatal( const char *fmt, ... );
+
+
+/* local stuff */
+
+#define FNCCAST_SETKEY(f)  ((int(*)(void*, byte*, unsigned))(f))
+#define FNCCAST_CRYPT(f)   ((void(*)(void*, byte*, byte*))(f))
+
+#define IDEA_KEYSIZE 16
+#define IDEA_BLOCKSIZE 8
+#define IDEA_ROUNDS 8
+#define IDEA_KEYLEN (6*IDEA_ROUNDS+4)
+
+typedef struct {
+    u16 ek[IDEA_KEYLEN];
+    u16 dk[IDEA_KEYLEN];
+    int have_dk;
+} IDEA_context;
+
+
+static int do_setkey( IDEA_context *c, byte *key, unsigned keylen );
+static void encrypt_block( IDEA_context *bc, byte *outbuf, byte *inbuf );
+static void decrypt_block( IDEA_context *bc, byte *outbuf, byte *inbuf );
+static int selftest(int);
+
+
+
+static u16
+mul_inv( u16 x )
+{
+    u16 t0, t1;
+    u16 q, y;
+
+    if( x < 2 )
+	return x;
+    t1 = 0x10001L / x;
+    y =  0x10001L % x;
+    if( y == 1 )
+	return (1-t1) & 0xffff;
+
+    t0 = 1;
+    do {
+	q = x / y;
+	x = x % y;
+	t0 += q * t1;
+	if( x == 1 )
+	    return t0;
+	q = y / x;
+	y = y % x;
+	t1 += q * t0;
+    } while( y != 1 );
+    return (1-t1) & 0xffff;
+}
+
+
+
+static void
+expand_key( byte *userkey, u16 *ek )
+{
+    int i,j;
+
+    for(j=0; j < 8; j++ ) {
+	ek[j] = (*userkey << 8) + userkey[1];
+	userkey += 2;
+    }
+    for(i=0; j < IDEA_KEYLEN; j++ ) {
+	i++;
+	ek[i+7] = ek[i&7] << 9 | ek[(i+1)&7] >> 7;
+	ek += i & 8;
+	i &= 7;
+    }
+}
+
+
+static void
+invert_key( u16 *ek, u16 dk[IDEA_KEYLEN] )
+{
+    int i;
+    u16 t1, t2, t3;
+    u16 temp[IDEA_KEYLEN];
+    u16 *p = temp + IDEA_KEYLEN;
+
+    t1 = mul_inv( *ek++ );
+    t2 = -*ek++;
+    t3 = -*ek++;
+    *--p = mul_inv( *ek++ );
+    *--p = t3;
+    *--p = t2;
+    *--p = t1;
+
+    for(i=0; i < IDEA_ROUNDS-1; i++ ) {
+	t1 = *ek++;
+	*--p = *ek++;
+	*--p = t1;
+
+	t1 = mul_inv( *ek++ );
+	t2 = -*ek++;
+	t3 = -*ek++;
+	*--p = mul_inv( *ek++ );
+	*--p = t2;
+	*--p = t3;
+	*--p = t1;
+    }
+    t1 = *ek++;
+    *--p = *ek++;
+    *--p = t1;
+
+    t1 = mul_inv( *ek++ );
+    t2 = -*ek++;
+    t3 = -*ek++;
+    *--p = mul_inv( *ek++ );
+    *--p = t3;
+    *--p = t2;
+    *--p = t1;
+    memcpy(dk, temp, sizeof(temp) );
+    memset(temp, 0, sizeof(temp) );  /* burn temp */
+}
+
+
+static void
+cipher( byte *outbuf, byte *inbuf, u16 *key )
+{
+    u16 x1, x2, x3,x4, s2, s3;
+    u16 *in, *out;
+    int r = IDEA_ROUNDS;
+  #define MUL(x,y) \
+	do {u16 _t16; u32 _t32; 		    \
+	    if( (_t16 = (y)) ) {		    \
+		if( (x = (x)&0xffff) ) {	    \
+		    _t32 = (u32)x * _t16;	    \
+		    x = _t32 & 0xffff;		    \
+		    _t16 = _t32 >> 16;		    \
+		    x = ((x)-_t16) + (x<_t16?1:0);  \
+		}				    \
+		else {				    \
+		    x = 1 - _t16;		    \
+		}				    \
+	    }					    \
+	    else {				    \
+		x = 1 - x;			    \
+	    }					    \
+	} while(0)
+
+    in = (u16*)inbuf;
+    x1 = *in++;
+    x2 = *in++;
+    x3 = *in++;
+    x4 = *in;
+  #ifdef LITTLE_ENDIAN_HOST
+    x1 = (x1>>8) | (x1<<8);
+    x2 = (x2>>8) | (x2<<8);
+    x3 = (x3>>8) | (x3<<8);
+    x4 = (x4>>8) | (x4<<8);
+  #endif
+    do {
+	MUL(x1, *key++);
+	x2 += *key++;
+	x3 += *key++;
+	MUL(x4, *key++ );
+
+	s3 = x3;
+	x3 ^= x1;
+	MUL(x3, *key++);
+	s2 = x2;
+	x2 ^=x4;
+	x2 += x3;
+	MUL(x2, *key++);
+	x3 += x2;
+
+	x1 ^= x2;
+	x4 ^= x3;
+
+	x2 ^= s3;
+	x3 ^= s2;
+    } while( --r );
+    MUL(x1, *key++);
+    x3 += *key++;
+    x2 += *key++;
+    MUL(x4, *key);
+
+    out = (u16*)outbuf;
+  #ifdef LITTLE_ENDIAN_HOST
+    *out++ = (x1>>8) | (x1<<8);
+    *out++ = (x3>>8) | (x3<<8);
+    *out++ = (x2>>8) | (x2<<8);
+    *out   = (x4>>8) | (x4<<8);
+  #else
+    *out++ = x1;
+    *out++ = x3;
+    *out++ = x2;
+    *out   = x4;
+  #endif
+  #undef MUL
+}
+
+
+static int
+do_setkey( IDEA_context *c, byte *key, unsigned keylen )
+{
+    assert(keylen == 16);
+    c->have_dk = 0;
+    expand_key( key, c->ek );
+    invert_key( c->ek, c->dk );
+    return 0;
+}
+
+static void
+encrypt_block( IDEA_context *c, byte *outbuf, byte *inbuf )
+{
+    cipher( outbuf, inbuf, c->ek );
+}
+
+static void
+decrypt_block( IDEA_context *c, byte *outbuf, byte *inbuf )
+{
+    if( !c->have_dk ) {
+       c->have_dk = 1;
+       invert_key( c->ek, c->dk );
+    }
+    cipher( outbuf, inbuf, c->dk );
+}
+
+
+static int
+selftest( int check_decrypt )
+{
+static struct {
+    byte key[16];
+    byte plain[8];
+    byte cipher[8];
+} test_vectors[] = {
+    { { 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04,
+	0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x00, 0x08 },
+      { 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03 },
+      { 0x11, 0xFB, 0xED, 0x2B, 0x01, 0x98, 0x6D, 0xE5 } },
+    { { 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04,
+	0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x00, 0x08 },
+      { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 },
+      { 0x54, 0x0E, 0x5F, 0xEA, 0x18, 0xC2, 0xF8, 0xB1 } },
+    { { 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04,
+	0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x00, 0x08 },
+      { 0x00, 0x19, 0x32, 0x4B, 0x64, 0x7D, 0x96, 0xAF },
+      { 0x9F, 0x0A, 0x0A, 0xB6, 0xE1, 0x0C, 0xED, 0x78 } },
+    { { 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04,
+	0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x00, 0x08 },
+      { 0xF5, 0x20, 0x2D, 0x5B, 0x9C, 0x67, 0x1B, 0x08 },
+      { 0xCF, 0x18, 0xFD, 0x73, 0x55, 0xE2, 0xC5, 0xC5 } },
+    { { 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04,
+	0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x00, 0x08 },
+      { 0xFA, 0xE6, 0xD2, 0xBE, 0xAA, 0x96, 0x82, 0x6E },
+      { 0x85, 0xDF, 0x52, 0x00, 0x56, 0x08, 0x19, 0x3D } },
+    { { 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04,
+	0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x00, 0x08 },
+      { 0x0A, 0x14, 0x1E, 0x28, 0x32, 0x3C, 0x46, 0x50 },
+      { 0x2F, 0x7D, 0xE7, 0x50, 0x21, 0x2F, 0xB7, 0x34 } },
+    { { 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04,
+	0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x00, 0x08 },
+      { 0x05, 0x0A, 0x0F, 0x14, 0x19, 0x1E, 0x23, 0x28 },
+      { 0x7B, 0x73, 0x14, 0x92, 0x5D, 0xE5, 0x9C, 0x09 } },
+    { { 0x00, 0x05, 0x00, 0x0A, 0x00, 0x0F, 0x00, 0x14,
+	0x00, 0x19, 0x00, 0x1E, 0x00, 0x23, 0x00, 0x28 },
+      { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 },
+      { 0x3E, 0xC0, 0x47, 0x80, 0xBE, 0xFF, 0x6E, 0x20 } },
+    { { 0x3A, 0x98, 0x4E, 0x20, 0x00, 0x19, 0x5D, 0xB3,
+	0x2E, 0xE5, 0x01, 0xC8, 0xC4, 0x7C, 0xEA, 0x60 },
+      { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 },
+      { 0x97, 0xBC, 0xD8, 0x20, 0x07, 0x80, 0xDA, 0x86 } },
+    { { 0x00, 0x64, 0x00, 0xC8, 0x01, 0x2C, 0x01, 0x90,
+	0x01, 0xF4, 0x02, 0x58, 0x02, 0xBC, 0x03, 0x20 },
+      { 0x05, 0x32, 0x0A, 0x64, 0x14, 0xC8, 0x19, 0xFA },
+      { 0x65, 0xBE, 0x87, 0xE7, 0xA2, 0x53, 0x8A, 0xED } },
+    { { 0x9D, 0x40, 0x75, 0xC1, 0x03, 0xBC, 0x32, 0x2A,
+	0xFB, 0x03, 0xE7, 0xBE, 0x6A, 0xB3, 0x00, 0x06 },
+      { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 },
+      { 0xF5, 0xDB, 0x1A, 0xC4, 0x5E, 0x5E, 0xF9, 0xF9 } }
+};
+    IDEA_context c;
+    byte buffer[8];
+    int i;
+
+    for(i=0; i < DIM(test_vectors); i++ ) {
+	do_setkey( &c, test_vectors[i].key, 16 );
+	if( !check_decrypt ) {
+	    encrypt_block( &c, buffer, test_vectors[i].plain );
+	    if( memcmp( buffer, test_vectors[i].cipher, 8 ) )
+              {
+		fprintf (stderr, "idea encryption (%d) failed\n", i);
+                return -1;
+              }
+	}
+	else {
+	    decrypt_block( &c, buffer, test_vectors[i].cipher );
+	    if( memcmp( buffer, test_vectors[i].plain, 8 ) )
+              {
+		fprintf (stderr, "idea decryption (%d) failed\n", i);
+                return -1;
+              }
+	}
+    }
+    return 0;
+}
+
+
+/****************
+ * Return some information about the algorithm.  We need algo here to
+ * distinguish different flavors of the algorithm.
+ * Returns: A pointer to string describing the algorithm or NULL if
+ *	    the ALGO is invalid.
+ */
+const char *
+idea_get_info( int algo, size_t *keylen,
+		   size_t *blocksize, size_t *contextsize,
+		   int	(**r_setkey)( void *c, byte *key, unsigned keylen ),
+		   void (**r_encrypt)( void *c, byte *outbuf, byte *inbuf ),
+		   void (**r_decrypt)( void *c, byte *outbuf, byte *inbuf )
+		 )
+{
+    static int initialized = 0;
+
+    if( !initialized ) {
+	initialized = 1;
+	if ( selftest(0) || selftest(1) )
+          return NULL;
+    }
+    *keylen = 128;
+    *blocksize = 8;
+    *contextsize = sizeof(IDEA_context);
+    *r_setkey = FNCCAST_SETKEY(do_setkey);
+    *r_encrypt= FNCCAST_CRYPT(encrypt_block);
+    *r_decrypt= FNCCAST_CRYPT(decrypt_block);
+    if( algo == 1 )
+	return "IDEA";
+    return NULL;
+}
+
+
+
+const char * const gnupgext_version = "IDEA ($Revision: 1.11 $)";
+
+static struct {
+    int class;
+    int version;
+    int  value;
+    void (*func)(void);
+} func_table[] = {
+    { 20, 1, 0, (void(*)(void))idea_get_info },
+    { 21, 1, 1 },
+};
+
+
+
+/****************
+ * Enumerate the names of the functions together with informations about
+ * this function. Set sequence to an integer with a initial value of 0 and
+ * do not change it.
+ * If what is 0 all kind of functions are returned.
+ * Return values: class := class of function:
+ *			   10 = message digest algorithm info function
+ *			   11 = integer with available md algorithms
+ *			   20 = cipher algorithm info function
+ *			   21 = integer with available cipher algorithms
+ *			   30 = public key algorithm info function
+ *			   31 = integer with available pubkey algorithms
+ *		  version = interface version of the function/pointer
+ *			    (currently this is 1 for all functions)
+ */
+void *
+gnupgext_enum_func( int what, int *sequence, int *class, int *vers )
+{
+    void *ret;
+    int i = *sequence;
+
+    do {
+	if( i >= DIM(func_table) || i < 0 ) {
+	    return NULL;
+	}
+	*class = func_table[i].class;
+	*vers  = func_table[i].version;
+	switch( *class ) {
+	  case 11:
+	  case 21:
+	  case 31:
+	    ret = &func_table[i].value;
+	    break;
+	  default:
+	    ret = (void*)func_table[i].func;
+	    break;
+	}
+	i++;
+    } while( what && what != *class );
+
+    *sequence = i;
+    return ret;
+}
diff -u -Naur gnupg-1.2.3/mpi/config.links gnupg-1.2.3.fink/mpi/config.links
--- gnupg-1.2.3/mpi/config.links	Thu Apr 24 07:15:58 2003
+++ gnupg-1.2.3.fink/mpi/config.links	Thu Dec  4 18:38:33 2003
@@ -221,6 +221,15 @@
 	path="powerpc32"
 	;;
 
+    powerpc-apple-darwin*)
+       echo '/* configured Darwin on powerpc */' >>./mpi/asm-syntax.h
+       echo '#define NEXT_SYNTAX'                 >>./mpi/asm-syntax.h
+       echo '#define USE_PPC_PATCHES'            >>./mpi/asm-syntax.h
+       cat   $srcdir/mpi/powerpc32/syntax.h	 >>./mpi/asm-syntax.h
+       mpi_sflags="-Wa,-mppc"
+       path="powerpc32"
+       ;;
+
     powerpc*-*-netbsd* | powerpc*-*-openbsd*)
        echo '/* configured for {Open,Net}BSD on powerpc */' >>./mpi/asm-syntax.h
        echo '#define ELF_SYNTAX'                 >>./mpi/asm-syntax.h
diff -u -Naur gnupg-1.2.3/mpi/powerpc32/mpih-add1.S gnupg-1.2.3.fink/mpi/powerpc32/mpih-add1.S
--- gnupg-1.2.3/mpi/powerpc32/mpih-add1.S	Sat Jun 29 10:14:10 2002
+++ gnupg-1.2.3.fink/mpi/powerpc32/mpih-add1.S	Thu Dec  4 18:38:33 2003
@@ -95,41 +95,41 @@
 
 EALIGN(mpihelp_add_n,3,0)
 /* Set up for loop below.  */
-       mtcrf 0x01,%r6
-       srwi. %r7,%r6,1
-       li    %r10,0
-       mtctr %r7
+       mtcrf 0x01,R(r6)
+       srwi. R(r7),R(r6),1
+       li    R(r10),0
+       mtctr R(r7)
        bt    31,2f
 
 /* Clear the carry.  */
-       addic %r0,%r0,0
+       addic R(r0),R(r0),0
 /* Adjust pointers for loop.  */
-       addi  %r3,%r3,-4
-       addi  %r4,%r4,-4
-       addi  %r5,%r5,-4
+       addi  R(r3),R(r3),-4
+       addi  R(r4),R(r4),-4
+       addi  R(r5),R(r5),-4
        b     0f
 
-2:     lwz  %r7,0(%r5)
-       lwz  %r6,0(%r4)
-       addc %r6,%r6,%r7
-       stw  %r6,0(%r3)
+2:     lwz  R(r7),0(R(r5))
+       lwz  R(r6),0(R(r4))
+       addc R(r6),R(r6),R(r7)
+       stw  R(r6),0(R(r3))
 	beq  1f
 
 /* The loop.  */
 
 /* Align start of loop to an odd word boundary to guarantee that the
    last two words can be fetched in one access (for 601).  */
-0:     lwz  %r9,4(%r4)
-       lwz  %r8,4(%r5)
-       lwzu %r6,8(%r4)
-       lwzu %r7,8(%r5)
-       adde %r8,%r9,%r8
-       stw  %r8,4(%r3)
-       adde %r6,%r6,%r7
-       stwu %r6,8(%r3)
+0:     lwz  R(r9),4(R(r4))
+       lwz  R(r8),4(R(r5))
+       lwzu R(r6),8(R(r4))
+       lwzu R(r7),8(R(r5))
+       adde R(r8),R(r9),R(r8)
+       stw  R(r8),4(R(r3))
+       adde R(r6),R(r6),R(r7)
+       stwu R(r6),8(R(r3))
        bdnz 0b
 /* Return the carry.  */
-1:     addze %r3,%r10
+1:     addze R(r3),R(r10)
        blr
 END(mpihelp_add_n)
 #endif
diff -u -Naur gnupg-1.2.3/mpi/powerpc32/mpih-lshift.S gnupg-1.2.3.fink/mpi/powerpc32/mpih-lshift.S
--- gnupg-1.2.3/mpi/powerpc32/mpih-lshift.S	Sat Jun 29 10:14:10 2002
+++ gnupg-1.2.3.fink/mpi/powerpc32/mpih-lshift.S	Thu Dec  4 18:38:33 2003
@@ -97,69 +97,69 @@
 			unsigned int cnt)  */
 
 EALIGN(mpihelp_lshift,3,0)
-       mtctr   %r5	       # copy size into CTR
-       cmplwi  %cr0,%r5,16     # is size < 16
-       slwi    %r0,%r5,2
-       add     %r7,%r3,%r0     # make r7 point at end of res
-       add     %r4,%r4,%r0     # make r4 point at end of s1
-       lwzu    %r11,-4(%r4)    # load first s1 limb
-       subfic  %r8,%r6,32
-       srw     %r3,%r11,%r8    # compute function return value
-       bge     %cr0,L(big)     # branch if size >= 16
+       mtctr   R(r5)	           /* copy size into CTR */
+       cmplwi  R(cr0),R(r5),16     /* is size < 16 */
+       slwi    R(r0),R(r5),2
+       add     R(r7),R(r3),R(r0)   /* make r7 point at end of res */
+       add     R(r4),R(r4),R(r0)   /* make r4 point at end of s1  */
+       lwzu    R(r11),-4(R(r4))    /* load first s1 limb */
+       subfic  R(r8),R(r6),32
+       srw     R(r3),R(r11),R(r8)  /* compute function return value */
+       bge     R(cr0),L(big)       /* branch if size >= 16 */
 
        bdz     L(end1)
 
-0:     lwzu    %r10,-4(%r4)
-       slw     %r9,%r11,%r6
-       srw     %r12,%r10,%r8
-       or      %r9,%r9,%r12
-       stwu    %r9,-4(%r7)
+0:     lwzu    R(r10),-4(R(r4))
+       slw     R(r9),R(r11),R(r6)
+       srw     R(r12),R(r10),R(r8)
+       or      R(r9),R(r9),R(r12)
+       stwu    R(r9),-4(R(r7))
        bdz     L(end2)
-       lwzu    %r11,-4(%r4)
-       slw     %r9,%r10,%r6
-       srw     %r12,%r11,%r8
-       or      %r9,%r9,%r12
-       stwu    %r9,-4(%r7)
+       lwzu    R(r11),-4(R(r4))
+       slw     R(r9),R(r10),R(r6)
+       srw     R(r12),R(r11),R(r8)
+       or      R(r9),R(r9),R(r12)
+       stwu    R(r9),-4(R(r7))
        bdnz    0b
 
-L(end1):slw    %r0,%r11,%r6
-       stw     %r0,-4(%r7)
+L(end1):slw    R(r0),R(r11),R(r6)
+       stw     R(r0),-4(R(r7))
        blr
 
 
 /* Guaranteed not to succeed.  */
-L(boom): tweq	 %r0,%r0
+L(boom): tweq	 R(r0),R(r0)
 
 /* We imitate a case statement, by using (yuk!) fixed-length code chunks,
    of size 4*12 bytes.	We have to do this (or something) to make this PIC.  */
-L(big):        mflr    %r9
-       bltl-   %cr0,L(boom)    # Never taken, only used to set LR.
-       slwi    %r10,%r6,4
-       mflr    %r12
-       add     %r10,%r12,%r10
-       slwi    %r8,%r6,5
-       add     %r10,%r8,%r10
-       mtctr   %r10
-       addi    %r5,%r5,-1
-       mtlr    %r9
+L(big):        mflr    R(r9)
+       bltl-   R(cr0),L(boom)    /* Never taken, only used to set LR. */
+       slwi    R(r10),R(r6),4
+       mflr    R(r12)
+       add     R(r10),R(r12),R(r10)
+       slwi    R(r8),R(r6),5
+       add     R(r10),R(r8),R(r10)
+       mtctr   R(r10)
+       addi    R(r5),R(r5),-1
+       mtlr    R(r9)
        bctr
 
-L(end2):slw    %r0,%r10,%r6
-       stw     %r0,-4(%r7)
+L(end2):slw    R(r0),R(r10),R(r6)
+       stw     R(r0),-4(R(r7))
        blr
 
 #define DO_LSHIFT(n) \
-       mtctr   %r5;						       \
-0:     lwzu    %r10,-4(%r4);					       \
-       slwi    %r9,%r11,n;					       \
-       inslwi  %r9,%r10,n,32-n; 				       \
-       stwu    %r9,-4(%r7);					       \
-       bdz-    L(end2); 					       \
-       lwzu    %r11,-4(%r4);					       \
-       slwi    %r9,%r10,n;					       \
-       inslwi  %r9,%r11,n,32-n; 				       \
-       stwu    %r9,-4(%r7);					       \
-       bdnz    0b;						       \
+       mtctr   R(r5)                 NEW_LINE \
+0:     lwzu    R(r10),-4(R(r4))      NEW_LINE \
+       slwi    R(r9),R(r11),n        NEW_LINE \
+       inslwi  R(r9),R(r10),n,(32-n) NEW_LINE \
+       stwu    R(r9),-4(R(r7))       NEW_LINE \
+       bdz-    L(end2)               NEW_LINE \
+       lwzu    R(r11),-4(R(r4))      NEW_LINE \
+       slwi    R(r9),R(r10),n        NEW_LINE \
+       inslwi  R(r9),R(r11),n,(32-n) NEW_LINE \
+       stwu    R(r9),-4(R(r7))       NEW_LINE \
+       bdnz    0b                    NEW_LINE \
        b       L(end1)
 
        DO_LSHIFT(1)
diff -u -Naur gnupg-1.2.3/mpi/powerpc32/mpih-mul1.S gnupg-1.2.3.fink/mpi/powerpc32/mpih-mul1.S
--- gnupg-1.2.3/mpi/powerpc32/mpih-mul1.S	Sat Jun 29 10:14:10 2002
+++ gnupg-1.2.3.fink/mpi/powerpc32/mpih-mul1.S	Thu Dec  4 18:38:33 2003
@@ -41,8 +41,8 @@
  * The code trivially generalizes to 64 bit limbs for the PC620.
  */
 
-	.toc
-	.csect .mpihelp_mul_1[PR]
+	/* .toc
+	.csect .mpihelp_mul_1[PR] */
 	.align 2
 	.globl mpihelp_mul_1
 	.globl .mpihelp_mul_1
@@ -97,24 +97,24 @@
    Calculate s1*s2 and put result in res_ptr; return carry.  */
 
 ENTRY(mpihelp_mul_1)
-       mtctr   %r5
+       mtctr   R(r5)
 
-       lwz     %r0,0(%r4)
-       mullw   %r7,%r0,%r6
-       mulhwu  %r10,%r0,%r6
-       addi    %r3,%r3,-4	       # adjust res_ptr
-       addic   %r5,%r5,0	       # clear cy with dummy insn
+       lwz     R(r0),0(R(r4))
+       mullw   R(r7),R(r0),R(r6)
+       mulhwu  R(r10),R(r0),R(r6)
+       addi    R(r3),R(r3),-4	       /* adjust res_ptr */
+       addic   R(r5),R(r5),0	       /* clear cy with dummy insn */
        bdz     1f
 
-0:     lwzu    %r0,4(%r4)
-       stwu    %r7,4(%r3)
-       mullw   %r8,%r0,%r6
-       adde    %r7,%r8,%r10
-       mulhwu  %r10,%r0,%r6
+0:     lwzu    R(r0),4(R(r4))
+       stwu    R(r7),4(R(r3))
+       mullw   R(r8),R(r0),R(r6)
+       adde    R(r7),R(r8),R(r10)
+       mulhwu  R(r10),R(r0),R(r6)
        bdnz    0b
 
-1:     stw     %r7,4(%r3)
-       addze   %r3,%r10
+1:     stw     R(r7),4(R(r3))
+       addze   R(r3),R(r10)
        blr
 END(mpihelp_mul_1)
 #endif
diff -u -Naur gnupg-1.2.3/mpi/powerpc32/mpih-mul2.S gnupg-1.2.3.fink/mpi/powerpc32/mpih-mul2.S
--- gnupg-1.2.3/mpi/powerpc32/mpih-mul2.S	Sat Jun 29 10:14:10 2002
+++ gnupg-1.2.3.fink/mpi/powerpc32/mpih-mul2.S	Thu Dec  4 18:38:33 2003
@@ -100,28 +100,28 @@
 			   mp_size_t s1_size, mp_limb_t s2_limb)
    Calculate res+s1*s2 and put result back in res; return carry.  */
 ENTRY(mpihelp_addmul_1)
-       mtctr   %r5
+       mtctr   R(r5)
 
-       lwz     %r0,0(%r4)
-       mullw   %r7,%r0,%r6
-       mulhwu  %r10,%r0,%r6
-       lwz     %r9,0(%r3)
-       addc    %r8,%r7,%r9
-       addi    %r3,%r3,-4	       /* adjust res_ptr */
+       lwz     R(r0),0(R(r4))
+       mullw   R(r7),R(r0),R(r6)
+       mulhwu  R(r10),R(r0),R(r6)
+       lwz     R(r9),0(R(r3))
+       addc    R(r8),R(r7),R(r9)
+       addi    R(r3),R(r3),-4	       /* adjust res_ptr */
        bdz     1f
 
-0:     lwzu    %r0,4(%r4)
-       stwu    %r8,4(%r3)
-       mullw   %r8,%r0,%r6
-       adde    %r7,%r8,%r10
-       mulhwu  %r10,%r0,%r6
-       lwz     %r9,4(%r3)
-       addze   %r10,%r10
-       addc    %r8,%r7,%r9
+0:     lwzu    R(r0),4(R(r4))
+       stwu    R(r8),4(R(r3))
+       mullw   R(r8),R(r0),R(r6)
+       adde    R(r7),R(r8),R(r10)
+       mulhwu  R(r10),R(r0),R(r6)
+       lwz     R(r9),4(R(r3))
+       addze   R(r10),R(r10)
+       addc    R(r8),R(r7),R(r9)
        bdnz    0b
 
-1:     stw     %r8,4(%r3)
-       addze   %r3,%r10
+1:     stw     R(r8),4(R(r3))
+       addze   R(r3),R(r10)
        blr
 END(mpihelp_addmul_1)
 #endif
diff -u -Naur gnupg-1.2.3/mpi/powerpc32/mpih-mul3.S gnupg-1.2.3.fink/mpi/powerpc32/mpih-mul3.S
--- gnupg-1.2.3/mpi/powerpc32/mpih-mul3.S	Sat Jun 29 10:14:10 2002
+++ gnupg-1.2.3.fink/mpi/powerpc32/mpih-mul3.S	Thu Dec  4 18:38:33 2003
@@ -101,30 +101,30 @@
    Calculate res-s1*s2 and put result back in res; return carry.  */
 
 ENTRY(mpihelp_submul_1)
-       mtctr   %r5
+       mtctr   R(r5)
 
-       lwz     %r0,0(%r4)
-       mullw   %r7,%r0,%r6
-       mulhwu  %r10,%r0,%r6
-       lwz     %r9,0(%r3)
-       subf    %r8,%r7,%r9
-       addc    %r7,%r7,%r8	       # invert cy (r7 is junk)
-       addi    %r3,%r3,-4	       # adjust res_ptr
+       lwz     R(r0),0(R(r4))
+       mullw   R(r7),R(r0),R(r6)
+       mulhwu  R(r10),R(r0),R(r6)
+       lwz     R(r9),0(R(r3))
+       subf    R(r8),R(r7),R(r9)
+       addc    R(r7),R(r7),R(r8)       /* invert cy (r7 is junk) */
+       addi    R(r3),R(r3),-4	       /* adjust res_ptr         */
        bdz     1f
 
-0:     lwzu    %r0,4(%r4)
-       stwu    %r8,4(%r3)
-       mullw   %r8,%r0,%r6
-       adde    %r7,%r8,%r10
-       mulhwu  %r10,%r0,%r6
-       lwz     %r9,4(%r3)
-       addze   %r10,%r10
-       subf    %r8,%r7,%r9
-       addc    %r7,%r7,%r8	       # invert cy (r7 is junk)
+0:     lwzu    R(r0),4(R(r4))
+       stwu    R(r8),4(R(r3))
+       mullw   R(r8),R(r0),R(r6)
+       adde    R(r7),R(r8),R(r10)
+       mulhwu  R(r10),R(r0),R(r6)
+       lwz     R(r9),4(R(r3))
+       addze   R(r10),R(r10)
+       subf    R(r8),R(r7),R(r9)
+       addc    R(r7),R(r7),R(r8)	 /* invert cy (r7 is junk) */
        bdnz    0b
 
-1:     stw     %r8,4(%r3)
-       addze   %r3,%r10
+1:     stw     R(r8),4(R(r3))
+       addze   R(r3),R(r10)
        blr
 END(mpihelp_submul_1)
 #endif
diff -u -Naur gnupg-1.2.3/mpi/powerpc32/mpih-rshift.S gnupg-1.2.3.fink/mpi/powerpc32/mpih-rshift.S
--- gnupg-1.2.3/mpi/powerpc32/mpih-rshift.S	Sat Jun 29 10:14:10 2002
+++ gnupg-1.2.3.fink/mpi/powerpc32/mpih-rshift.S	Thu Dec  4 18:38:33 2003
@@ -100,32 +100,32 @@
    cnt	       r6  */
 
 ENTRY(mpihelp_rshift)
-       mtctr   5	       # copy size into CTR
-       addi    7,3,-4	       # move adjusted res_ptr to free return reg
-       subfic  8,6,32
-       lwz     11,0(4)	       # load first s1 limb
-       slw     3,11,8	       # compute function return value
+       mtctr   R(r5)	       /* copy size into CTR */
+       addi    R(r7),R(r3),-4	       /* move adjusted res_ptr to free return reg */
+       subfic  R(r8),R(r6),32
+       lwz     R(r11),0(R(r4))	       /* load first s1 limb */
+       slw     R(r3),R(r11),R(r8)	       /* compute function return value */
        bdz     1f
 
-0:     lwzu    10,4(4)
-       srw     9,11,6
-       slw     12,10,8
-       or      9,9,12
-       stwu    9,4(7)
+0:     lwzu    R(r10),4(R(r4))
+       srw     R(r9),R(r11),R(r6)
+       slw     R(r12),R(r10),R(r8)
+       or      R(r9),R(r9),R(r12)
+       stwu    R(r9),4(R(r7))
        bdz     2f
-       lwzu    11,4(4)
-       srw     9,10,6
-       slw     12,11,8
-       or      9,9,12
-       stwu    9,4(7)
+       lwzu    R(r11),4(R(r4))
+       srw     R(r9),R(r10),R(r6)
+       slw     R(r12),R(r11),R(r8)
+       or      R(r9),R(r9),R(r12)
+       stwu    R(r9),4(R(r7))
        bdnz    0b
 
-1:     srw     0,11,6
-       stw     0,4(7)
+1:     srw     R(r0),R(r11),R(r6)
+       stw     R(r0),4(R(r7))
        blr
 
-2:     srw     0,10,6
-       stw     0,4(7)
+2:     srw     R(r0),R(r10),R(r6)
+       stw     R(r0),4(R(r7))
        blr
 END(mpihelp_rshift)
 #endif
diff -u -Naur gnupg-1.2.3/mpi/powerpc32/mpih-sub1.S gnupg-1.2.3.fink/mpi/powerpc32/mpih-sub1.S
--- gnupg-1.2.3/mpi/powerpc32/mpih-sub1.S	Sat Jun 29 10:14:10 2002
+++ gnupg-1.2.3.fink/mpi/powerpc32/mpih-sub1.S	Thu Dec  4 18:38:33 2003
@@ -92,41 +92,41 @@
 
 EALIGN(mpihelp_sub_n,3,1)
 /* Set up for loop below.  */
-       mtcrf 0x01,%r6
-       srwi. %r7,%r6,1
-       mtctr %r7
+       mtcrf 0x01,R(r6)
+       srwi. R(r7),R(r6),1
+       mtctr R(r7)
        bt    31,2f
 
 /* Set the carry (clear the borrow).  */
-       subfc %r0,%r0,%r0
+       subfc R(r0),R(r0),R(r0)
 /* Adjust pointers for loop.  */
-       addi  %r3,%r3,-4
-       addi  %r4,%r4,-4
-       addi  %r5,%r5,-4
+       addi  R(r3),R(r3),-4
+       addi  R(r4),R(r4),-4
+       addi  R(r5),R(r5),-4
        b     0f
 
-2:     lwz   %r7,0(%r5)
-       lwz   %r6,0(%r4)
-       subfc %r6,%r7,%r6
-       stw   %r6,0(%r3)
+2:     lwz   R(r7),0(R(r5))
+       lwz   R(r6),0(R(r4))
+       subfc R(r6),R(r7),R(r6)
+       stw   R(r6),0(R(r3))
 	beq   1f
 
 /* Align start of loop to an odd word boundary to guarantee that the
    last two words can be fetched in one access (for 601).  This turns
    out to be important.  */
 0:
-       lwz   %r9,4(%r4)
-       lwz   %r8,4(%r5)
-       lwzu  %r6,8(%r4)
-       lwzu  %r7,8(%r5)
-       subfe %r8,%r8,%r9
-       stw   %r8,4(%r3)
-       subfe %r6,%r7,%r6
-       stwu  %r6,8(%r3)
+       lwz   R(r9),4(R(r4))
+       lwz   R(r8),4(R(r5))
+       lwzu  R(r6),8(R(r4))
+       lwzu  R(r7),8(R(r5))
+       subfe R(r8),R(r8),R(r9)
+       stw   R(r8),4(R(r3))
+       subfe R(r6),R(r7),R(r6)
+       stwu  R(r6),8(R(r3))
        bdnz  0b
 /* Return the borrow. */
-1:     subfe %r3,%r3,%r3
-       neg   %r3,%r3
+1:     subfe R(r3),R(r3),R(r3)
+       neg   R(r3),R(r3)
        blr
 END(mpihelp_sub_n)
 #endif
diff -u -Naur gnupg-1.2.3/mpi/powerpc32/syntax.h gnupg-1.2.3.fink/mpi/powerpc32/syntax.h
--- gnupg-1.2.3/mpi/powerpc32/syntax.h	Sat Jun 29 10:14:10 2002
+++ gnupg-1.2.3.fink/mpi/powerpc32/syntax.h	Thu Dec  4 18:38:33 2003
@@ -20,12 +20,27 @@
    Boston, MA 02111-1307, USA.	*/
 
 
-#define USE_PPC_PATCHES 1
+/* Define the syntax for specifying a CPU register */
+#if defined(BSD_SYNTAX) || defined(ELF_SYNTAX)
+#ifdef __STDC__
+# define R(reg) %##reg
+#else
+# define R(reg) %/**/reg
+#endif
+#elif defined(NEXT_SYNTAX)
+# define R(reg) reg
+#endif
 
 /* This seems to always be the case on PPC.  */
 #define ALIGNARG(log2) log2
+
 /* For ELF we need the `.type' directive to make shared libs work right.  */
+#if defined(BSD_SYNTAX) || defined(ELF_SYNTAX)
 #define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg;
+#elif defined(NEXT_SYNTAX)
+#define ASM_TYPE_DIRECTIVE(name,typearg) 
+#endif
+
 #define ASM_SIZE_DIRECTIVE(name) .size name,.-name
 #define ASM_GLOBAL_DIRECTIVE   .globl
 
@@ -41,35 +56,45 @@
 # define L(body) .L/**/body
 #endif
 
+/* How to begin a new line of assembly */
+#if defined(BSD_SYNTAX) || defined(ELF_SYNTAX)
+#define	NEW_LINE ;
+#elif defined(NEXT_SYNTAX)
+#define NEW_LINE @
+#endif
+
 /* No profiling of gmp's assembly for now... */
 #define CALL_MCOUNT /* no profiling */
 
-#define        ENTRY(name)				    \
-  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name);		    \
-  ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function)	    \
-  .align ALIGNARG(2);					    \
-  C_LABEL(name) 					    \
+#define        ENTRY(name)                                    \
+  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name) NEW_LINE           \
+  ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) NEW_LINE \
+  .align ALIGNARG(2) NEW_LINE                                 \
+  C_LABEL(name)                                               \
   CALL_MCOUNT
 
 #define EALIGN_W_0  /* No words to insert.  */
 #define EALIGN_W_1  nop
-#define EALIGN_W_2  nop;nop
-#define EALIGN_W_3  nop;nop;nop
-#define EALIGN_W_4  EALIGN_W_3;nop
-#define EALIGN_W_5  EALIGN_W_4;nop
-#define EALIGN_W_6  EALIGN_W_5;nop
-#define EALIGN_W_7  EALIGN_W_6;nop
+#define EALIGN_W_2  nop NEW_LINE nop
+#define EALIGN_W_3  nop NEW_LINE nop NEW_LINE nop
+#define EALIGN_W_4  EALIGN_W_3 NEW_LINE nop
+#define EALIGN_W_5  EALIGN_W_4 NEW_LINE nop
+#define EALIGN_W_6  EALIGN_W_5 NEW_LINE nop
+#define EALIGN_W_7  EALIGN_W_6 NEW_LINE nop
 
 /* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes
    past a 2^align boundary.  */
-#define EALIGN(name, alignt, words)			\
-  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name);		\
-  ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function)	\
-  .align ALIGNARG(alignt);				\
-  EALIGN_W_##words;					\
+#define EALIGN(name, alignt, words)                     \
+  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name) NEW_LINE     \
+  ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function)    \
+  .align ALIGNARG(alignt) NEW_LINE                      \
+  EALIGN_W_##words NEW_LINE                             \
   C_LABEL(name)
 
 #undef END
-#define END(name)		     \
-  ASM_SIZE_DIRECTIVE(name)
+#if defined(BSD_SYNTAX) || defined(ELF_SYNTAX)
+#define END(name)	ASM_SIZE_DIRECTIVE(name)
+#elif defined(NEXT_SYNTAX)
+#define END(name)
+#endif
 
