2000-10-31 21:11:28 +08:00
|
|
|
#
|
2001-09-23 12:12:44 +08:00
|
|
|
# $Header: /cvsroot/pgsql/contrib/pgcrypto/Makefile,v 1.7 2001/09/23 04:12:44 momjian Exp $
|
2000-10-31 21:11:28 +08:00
|
|
|
#
|
|
|
|
|
|
|
|
subdir = contrib/pgcrypto
|
|
|
|
top_builddir = ../..
|
|
|
|
include $(top_builddir)/src/Makefile.global
|
|
|
|
|
/contrib/pgcrypto:
* remove support for encode() as it is in main tree now
* remove krb5.c
* new 'PX library' architecture
* remove BSD license from my code to let the general
PostgreSQL one to apply
* md5, sha1: ANSIfy, use const where appropriate
* various other formatting and clarity changes
* hmac()
* UN*X-like crypt() - system or internal crypt
* Internal crypt: DES, Extended DES, MD5, Blowfish
crypt-des.c, crypt-md5.c from FreeBSD
crypt-blowfish.c from Solar Designer
* gen_salt() for crypt() - Blowfish, MD5, DES, Extended DES
* encrypt(), decrypt(), encrypt_iv(), decrypt_iv()
* Cipher support in mhash.c, openssl.c
* internal: Blowfish, Rijndael-128 ciphers
* blf.[ch], rijndael.[ch] from OpenBSD
* there will be generated file rijndael-tbl.inc.
Marko Kreen
2001-08-21 08:42:41 +08:00
|
|
|
# either 'builtin', 'mhash', 'openssl'
|
2000-10-31 21:11:28 +08:00
|
|
|
cryptolib = builtin
|
|
|
|
|
/contrib/pgcrypto:
* remove support for encode() as it is in main tree now
* remove krb5.c
* new 'PX library' architecture
* remove BSD license from my code to let the general
PostgreSQL one to apply
* md5, sha1: ANSIfy, use const where appropriate
* various other formatting and clarity changes
* hmac()
* UN*X-like crypt() - system or internal crypt
* Internal crypt: DES, Extended DES, MD5, Blowfish
crypt-des.c, crypt-md5.c from FreeBSD
crypt-blowfish.c from Solar Designer
* gen_salt() for crypt() - Blowfish, MD5, DES, Extended DES
* encrypt(), decrypt(), encrypt_iv(), decrypt_iv()
* Cipher support in mhash.c, openssl.c
* internal: Blowfish, Rijndael-128 ciphers
* blf.[ch], rijndael.[ch] from OpenBSD
* there will be generated file rijndael-tbl.inc.
Marko Kreen
2001-08-21 08:42:41 +08:00
|
|
|
# either 'builtin', 'system'
|
|
|
|
cryptsrc = builtin
|
|
|
|
|
2001-09-23 12:12:44 +08:00
|
|
|
# Random source, preferred order:
|
|
|
|
# 'dev' - read from random device
|
|
|
|
#
|
|
|
|
# 'openssl' - use openssl PRNG.
|
|
|
|
# Note that currently pgcrypto does not do any
|
|
|
|
# entropy feeding to it
|
|
|
|
# This works ofcouse only with cryptolib = openssl
|
|
|
|
#
|
|
|
|
# 'silly' - use libc random() - very weak
|
|
|
|
random = dev
|
|
|
|
random_dev = \"/dev/urandom\"
|
|
|
|
|
2000-10-31 21:11:28 +08:00
|
|
|
##########################
|
|
|
|
|
|
|
|
ifeq ($(cryptolib), builtin)
|
2001-02-20 23:34:14 +08:00
|
|
|
CRYPTO_CFLAGS =
|
|
|
|
CRYPTO_LDFLAGS =
|
/contrib/pgcrypto:
* remove support for encode() as it is in main tree now
* remove krb5.c
* new 'PX library' architecture
* remove BSD license from my code to let the general
PostgreSQL one to apply
* md5, sha1: ANSIfy, use const where appropriate
* various other formatting and clarity changes
* hmac()
* UN*X-like crypt() - system or internal crypt
* Internal crypt: DES, Extended DES, MD5, Blowfish
crypt-des.c, crypt-md5.c from FreeBSD
crypt-blowfish.c from Solar Designer
* gen_salt() for crypt() - Blowfish, MD5, DES, Extended DES
* encrypt(), decrypt(), encrypt_iv(), decrypt_iv()
* Cipher support in mhash.c, openssl.c
* internal: Blowfish, Rijndael-128 ciphers
* blf.[ch], rijndael.[ch] from OpenBSD
* there will be generated file rijndael-tbl.inc.
Marko Kreen
2001-08-21 08:42:41 +08:00
|
|
|
SRCS = md5.c sha1.c internal.c blf.c rijndael.c
|
2000-10-31 21:11:28 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(cryptolib), openssl)
|
2001-02-20 23:34:14 +08:00
|
|
|
CRYPTO_CFLAGS = -I/usr/include/openssl
|
|
|
|
CRYPTO_LDFLAGS = -lcrypto
|
2000-10-31 21:11:28 +08:00
|
|
|
SRCS = openssl.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(cryptolib), mhash)
|
2001-02-20 23:34:14 +08:00
|
|
|
CRYPTO_CFLAGS = -I/usr/local/include
|
/contrib/pgcrypto:
* remove support for encode() as it is in main tree now
* remove krb5.c
* new 'PX library' architecture
* remove BSD license from my code to let the general
PostgreSQL one to apply
* md5, sha1: ANSIfy, use const where appropriate
* various other formatting and clarity changes
* hmac()
* UN*X-like crypt() - system or internal crypt
* Internal crypt: DES, Extended DES, MD5, Blowfish
crypt-des.c, crypt-md5.c from FreeBSD
crypt-blowfish.c from Solar Designer
* gen_salt() for crypt() - Blowfish, MD5, DES, Extended DES
* encrypt(), decrypt(), encrypt_iv(), decrypt_iv()
* Cipher support in mhash.c, openssl.c
* internal: Blowfish, Rijndael-128 ciphers
* blf.[ch], rijndael.[ch] from OpenBSD
* there will be generated file rijndael-tbl.inc.
Marko Kreen
2001-08-21 08:42:41 +08:00
|
|
|
CRYPTO_LDFLAGS = -L/usr/local/lib -lmcrypt -lmhash -lltdl
|
2001-02-20 23:34:14 +08:00
|
|
|
SRCS = mhash.c
|
2000-10-31 21:11:28 +08:00
|
|
|
endif
|
|
|
|
|
/contrib/pgcrypto:
* remove support for encode() as it is in main tree now
* remove krb5.c
* new 'PX library' architecture
* remove BSD license from my code to let the general
PostgreSQL one to apply
* md5, sha1: ANSIfy, use const where appropriate
* various other formatting and clarity changes
* hmac()
* UN*X-like crypt() - system or internal crypt
* Internal crypt: DES, Extended DES, MD5, Blowfish
crypt-des.c, crypt-md5.c from FreeBSD
crypt-blowfish.c from Solar Designer
* gen_salt() for crypt() - Blowfish, MD5, DES, Extended DES
* encrypt(), decrypt(), encrypt_iv(), decrypt_iv()
* Cipher support in mhash.c, openssl.c
* internal: Blowfish, Rijndael-128 ciphers
* blf.[ch], rijndael.[ch] from OpenBSD
* there will be generated file rijndael-tbl.inc.
Marko Kreen
2001-08-21 08:42:41 +08:00
|
|
|
ifeq ($(cryptsrc), builtin)
|
|
|
|
SRCS += crypt-blowfish.c crypt-des.c crypt-md5.c
|
|
|
|
else
|
|
|
|
CRYPTO_CFLAGS += -DPX_SYSTEM_CRYPT
|
2000-10-31 21:11:28 +08:00
|
|
|
endif
|
|
|
|
|
2001-09-23 12:12:44 +08:00
|
|
|
ifeq ($(random), dev)
|
|
|
|
CRYPTO_CFLAGS += -DRAND_DEV=$(random_dev)
|
|
|
|
endif
|
|
|
|
ifeq ($(random), openssl)
|
|
|
|
CRYPTO_CFLAGS += -DRAND_OPENSSL
|
|
|
|
endif
|
|
|
|
ifeq ($(random), silly)
|
|
|
|
CRYPTO_CFLAGS += -DRAND_SILLY
|
|
|
|
endif
|
|
|
|
|
2000-10-31 21:11:28 +08:00
|
|
|
NAME := pgcrypto
|
2001-09-23 12:12:44 +08:00
|
|
|
SRCS += pgcrypto.c px.c px-hmac.c px-crypt.c misc.c \
|
|
|
|
crypt-gensalt.c random.c
|
2000-10-31 21:11:28 +08:00
|
|
|
OBJS := $(SRCS:.c=.o)
|
2001-02-20 23:34:14 +08:00
|
|
|
SHLIB_LINK := $(CRYPTO_LDFLAGS)
|
2000-10-31 21:11:28 +08:00
|
|
|
SO_MAJOR_VERSION = 0
|
|
|
|
SO_MINOR_VERSION = 1
|
|
|
|
|
2001-02-20 23:34:14 +08:00
|
|
|
override CPPFLAGS += $(CRYPTO_CFLAGS) -I$(srcdir)
|
2001-06-19 05:38:02 +08:00
|
|
|
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
|
2001-09-17 00:11:11 +08:00
|
|
|
rpath :=
|
2000-10-31 21:11:28 +08:00
|
|
|
|
|
|
|
all: all-lib $(NAME).sql
|
|
|
|
|
|
|
|
include $(top_srcdir)/src/Makefile.shlib
|
|
|
|
|
|
|
|
$(NAME).sql: $(NAME).sql.in
|
2001-09-17 00:11:11 +08:00
|
|
|
sed 's,@MODULE_FILENAME@,$$libdir/$(NAME),g' $< >$@
|
2000-10-31 21:11:28 +08:00
|
|
|
|
/contrib/pgcrypto:
* remove support for encode() as it is in main tree now
* remove krb5.c
* new 'PX library' architecture
* remove BSD license from my code to let the general
PostgreSQL one to apply
* md5, sha1: ANSIfy, use const where appropriate
* various other formatting and clarity changes
* hmac()
* UN*X-like crypt() - system or internal crypt
* Internal crypt: DES, Extended DES, MD5, Blowfish
crypt-des.c, crypt-md5.c from FreeBSD
crypt-blowfish.c from Solar Designer
* gen_salt() for crypt() - Blowfish, MD5, DES, Extended DES
* encrypt(), decrypt(), encrypt_iv(), decrypt_iv()
* Cipher support in mhash.c, openssl.c
* internal: Blowfish, Rijndael-128 ciphers
* blf.[ch], rijndael.[ch] from OpenBSD
* there will be generated file rijndael-tbl.inc.
Marko Kreen
2001-08-21 08:42:41 +08:00
|
|
|
rijndael.o: rijndael.tbl
|
|
|
|
|
|
|
|
rijndael.tbl:
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) -DPRINT_TABS rijndael.c -o gen-rtab
|
|
|
|
./gen-rtab > rijndael.tbl
|
|
|
|
|
2000-10-31 21:11:28 +08:00
|
|
|
install: all installdirs
|
2001-09-17 00:11:11 +08:00
|
|
|
$(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/pgcrypto$(DLSUFFIX)
|
2000-10-31 21:11:28 +08:00
|
|
|
$(INSTALL_DATA) $(NAME).sql $(DESTDIR)$(datadir)/contrib/$(NAME).sql
|
|
|
|
$(INSTALL_DATA) README.$(NAME) $(DESTDIR)$(docdir)/contrib/README.$(NAME)
|
|
|
|
|
|
|
|
installdirs:
|
2001-09-17 00:11:11 +08:00
|
|
|
$(mkinstalldirs) $(pkglibdir) $(datadir)/contrib $(docdir)/contrib
|
2000-10-31 21:11:28 +08:00
|
|
|
|
|
|
|
uninstall: uninstall-lib
|
2001-09-17 00:11:11 +08:00
|
|
|
rm -f $(DESTDIR)$(pkglibdir)/pgcrypto$(DLSUFFIX) $(datadir)/contrib/$(NAME).sql $(docdir)/contrib/README.$(NAME)
|
2000-10-31 21:11:28 +08:00
|
|
|
|
|
|
|
clean distclean maintainer-clean: clean-lib
|
/contrib/pgcrypto:
* remove support for encode() as it is in main tree now
* remove krb5.c
* new 'PX library' architecture
* remove BSD license from my code to let the general
PostgreSQL one to apply
* md5, sha1: ANSIfy, use const where appropriate
* various other formatting and clarity changes
* hmac()
* UN*X-like crypt() - system or internal crypt
* Internal crypt: DES, Extended DES, MD5, Blowfish
crypt-des.c, crypt-md5.c from FreeBSD
crypt-blowfish.c from Solar Designer
* gen_salt() for crypt() - Blowfish, MD5, DES, Extended DES
* encrypt(), decrypt(), encrypt_iv(), decrypt_iv()
* Cipher support in mhash.c, openssl.c
* internal: Blowfish, Rijndael-128 ciphers
* blf.[ch], rijndael.[ch] from OpenBSD
* there will be generated file rijndael-tbl.inc.
Marko Kreen
2001-08-21 08:42:41 +08:00
|
|
|
rm -f $(OBJS) $(NAME).sql gen-rtab
|