Thread: pgcrypto update

pgcrypto update

From
Marko Kreen
Date:
Changes:

* reverse the change #include <> -> "" in krb.c.
  It _must not_ include files in "."
* Makefile update.  Inconsistent var usage and SHLIB was
  not set.

Now it should work with all external libs.

--
marko


Index: contrib/pgcrypto/Makefile
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/contrib/pgcrypto/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- contrib/pgcrypto/Makefile    2001/01/24 03:46:16    1.2
+++ contrib/pgcrypto/Makefile    2001/02/20 13:19:41
@@ -12,34 +12,37 @@
 ##########################

 ifeq ($(cryptolib), builtin)
-SRCS= md5.c sha1.c internal.c
+CRYPTO_CFLAGS =
+CRYPTO_LDFLAGS =
+SRCS = md5.c sha1.c internal.c
 endif

 ifeq ($(cryptolib), openssl)
-cryptoinc := -I/usr/include/openssl
-cryptolib := -lcrypto
+CRYPTO_CFLAGS = -I/usr/include/openssl
+CRYPTO_LDFLAGS = -lcrypto
 SRCS = openssl.c
 endif

 ifeq ($(cryptolib), mhash)
-cryptoinc=
-cryptolib=-lmhash
-SRCS=mhash.c
+CRYPTO_CFLAGS = -I/usr/local/include
+CRYPTO_LDFLAGS = -L/usr/local/lib -lmhash
+SRCS = mhash.c
 endif

 ifeq ($(cryptolib), krb5)
-cryptoinc=-I/usr/include
-cryptolib=-ldes
-SRCS=krb.c
+CRYPTO_CFLAGS = -I/usr/include
+CRYPTO_LDFLAGS = -ldes
+SRCS = krb.c
 endif

 NAME    := pgcrypto
 SRCS    += pgcrypto.c encode.c
 OBJS    := $(SRCS:.c=.o)
+SHLIB_LINK := $(CRYPTO_LDFLAGS)
 SO_MAJOR_VERSION = 0
 SO_MINOR_VERSION = 1

-override CPPFLAGS    += -I$(srcdir) $(cryptoinc)
+override CPPFLAGS    += $(CRYPTO_CFLAGS) -I$(srcdir)

 all: all-lib $(NAME).sql

Index: contrib/pgcrypto/krb.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/contrib/pgcrypto/krb.c,v
retrieving revision 1.2
diff -u -r1.2 krb.c
--- contrib/pgcrypto/krb.c    2001/02/10 02:31:25    1.2
+++ contrib/pgcrypto/krb.c    2001/02/20 13:19:41
@@ -38,8 +38,8 @@

 #include "pgcrypto.h"

-#include "md5.h"
-#include "sha.h"
+#include <md5.h>
+#include <sha.h>

 #ifndef MD5_DIGEST_LENGTH
 #define MD5_DIGEST_LENGTH 16

Re: pgcrypto update

From
Bruce Momjian
Date:
Applied.

> Changes:
>
> * reverse the change #include <> -> "" in krb.c.
>   It _must not_ include files in "."
> * Makefile update.  Inconsistent var usage and SHLIB was
>   not set.
>
> Now it should work with all external libs.
>
> --
> marko
>
>
> Index: contrib/pgcrypto/Makefile
> ===================================================================
> RCS file: /home/projects/pgsql/cvsroot/pgsql/contrib/pgcrypto/Makefile,v
> retrieving revision 1.2
> diff -u -r1.2 Makefile
> --- contrib/pgcrypto/Makefile    2001/01/24 03:46:16    1.2
> +++ contrib/pgcrypto/Makefile    2001/02/20 13:19:41
> @@ -12,34 +12,37 @@
>  ##########################
>
>  ifeq ($(cryptolib), builtin)
> -SRCS= md5.c sha1.c internal.c
> +CRYPTO_CFLAGS =
> +CRYPTO_LDFLAGS =
> +SRCS = md5.c sha1.c internal.c
>  endif
>
>  ifeq ($(cryptolib), openssl)
> -cryptoinc := -I/usr/include/openssl
> -cryptolib := -lcrypto
> +CRYPTO_CFLAGS = -I/usr/include/openssl
> +CRYPTO_LDFLAGS = -lcrypto
>  SRCS = openssl.c
>  endif
>
>  ifeq ($(cryptolib), mhash)
> -cryptoinc=
> -cryptolib=-lmhash
> -SRCS=mhash.c
> +CRYPTO_CFLAGS = -I/usr/local/include
> +CRYPTO_LDFLAGS = -L/usr/local/lib -lmhash
> +SRCS = mhash.c
>  endif
>
>  ifeq ($(cryptolib), krb5)
> -cryptoinc=-I/usr/include
> -cryptolib=-ldes
> -SRCS=krb.c
> +CRYPTO_CFLAGS = -I/usr/include
> +CRYPTO_LDFLAGS = -ldes
> +SRCS = krb.c
>  endif
>
>  NAME    := pgcrypto
>  SRCS    += pgcrypto.c encode.c
>  OBJS    := $(SRCS:.c=.o)
> +SHLIB_LINK := $(CRYPTO_LDFLAGS)
>  SO_MAJOR_VERSION = 0
>  SO_MINOR_VERSION = 1
>
> -override CPPFLAGS    += -I$(srcdir) $(cryptoinc)
> +override CPPFLAGS    += $(CRYPTO_CFLAGS) -I$(srcdir)
>
>  all: all-lib $(NAME).sql
>
> Index: contrib/pgcrypto/krb.c
> ===================================================================
> RCS file: /home/projects/pgsql/cvsroot/pgsql/contrib/pgcrypto/krb.c,v
> retrieving revision 1.2
> diff -u -r1.2 krb.c
> --- contrib/pgcrypto/krb.c    2001/02/10 02:31:25    1.2
> +++ contrib/pgcrypto/krb.c    2001/02/20 13:19:41
> @@ -38,8 +38,8 @@
>
>  #include "pgcrypto.h"
>
> -#include "md5.h"
> -#include "sha.h"
> +#include <md5.h>
> +#include <sha.h>
>
>  #ifndef MD5_DIGEST_LENGTH
>  #define MD5_DIGEST_LENGTH 16
>


--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026