postgresql/contrib/pgcrypto/Makefile
Bruce Momjian ee85595d46 > Please find enclose a submission to fix these problems.
>
> The patch adds missing the "libpgport.a" file to the installation under
> "install-all-headers". It is needed by some contribs. I install the
> library in "pkglibdir", but I was wondering whether it should be "libdir"?
> I was wondering also whether it would make sense to have a "libpgport.so"?
>
> It fixes various macros which are used by contrib makefiles, especially
> libpq_*dir and LDFLAGS when used under PGXS. It seems to me that they are
> needed to
>
> It adds the ability to test and use PGXS with contribs, with "make
> USE_PGXS=1". Without the macro, this is exactly as before, there should be
> no difference, esp. wrt the vpath feature that seemed broken by previous
> submission. So it should not harm anybody, and it is useful at least to me.
>
> It fixes some inconsistencies in various contrib makefiles
> (useless override, ":=" instead of "=").

Fabien COELHO
2004-08-20 20:13:10 +00:00

91 lines
2.0 KiB
Makefile

#
# $PostgreSQL: pgsql/contrib/pgcrypto/Makefile,v 1.11 2004/08/20 20:13:06 momjian Exp $
#
# either 'builtin', 'mhash', 'openssl'
cryptolib = builtin
# either 'builtin', 'system'
cryptsrc = builtin
# 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 = silly
random_dev = \"/dev/urandom\"
##########################
ifeq ($(cryptolib), builtin)
CRYPTO_CFLAGS =
CRYPTO_LDFLAGS =
SRCS = md5.c sha1.c internal.c blf.c rijndael.c
endif
ifeq ($(cryptolib), openssl)
CRYPTO_CFLAGS = -I/usr/include/openssl
CRYPTO_LDFLAGS = -lcrypto
SRCS = openssl.c
endif
ifeq ($(cryptolib), mhash)
CRYPTO_CFLAGS = -I/usr/local/include
CRYPTO_LDFLAGS = -L/usr/local/lib -lmcrypt -lmhash -lltdl
SRCS = mhash.c
endif
ifeq ($(cryptsrc), builtin)
SRCS += crypt-blowfish.c crypt-des.c crypt-md5.c
else
CRYPTO_CFLAGS += -DPX_SYSTEM_CRYPT
endif
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
SRCS += pgcrypto.c px.c px-hmac.c px-crypt.c misc.c \
crypt-gensalt.c random.c
MODULE_big = pgcrypto
OBJS = $(SRCS:.c=.o)
DOCS = README.pgcrypto
DATA_built = pgcrypto.sql
EXTRA_CLEAN = gen-rtab
PG_CPPFLAGS = $(CRYPTO_CFLAGS) -I$(srcdir)
SHLIB_LINK = $(CRYPTO_LDFLAGS)
REGRESS = init md5 sha1 hmac-md5 hmac-sha1 blowfish rijndael \
crypt-des crypt-md5 crypt-blowfish crypt-xdes
ifdef USE_PGXS
PGXS = $(shell pg_config --pgxs)
include $(PGXS)
else
subdir = contrib/pgcrypto
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif
rijndael.o: rijndael.tbl
rijndael.tbl:
$(CC) $(CPPFLAGS) $(CFLAGS) -DPRINT_TABS rijndael.c -o gen-rtab
./gen-rtab > rijndael.tbl