From: Tom Lane Date: Thu, 23 Aug 2001 16:50:33 +0000 (+0000) Subject: Bring chkpass build process into sync with other contrib modules; X-Git-Tag: REL7_2_BETA1~635 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0525ddc3e5233b3b5718c5d716ee43a73965301b;p=postgresql Bring chkpass build process into sync with other contrib modules; make it use Makefile.shlib, etc. --- diff --git a/contrib/chkpass/Makefile b/contrib/chkpass/Makefile index a84a6a6711..1b37743282 100644 --- a/contrib/chkpass/Makefile +++ b/contrib/chkpass/Makefile @@ -1,46 +1,51 @@ # -# $Header: /cvsroot/pgsql/contrib/chkpass/Makefile,v 1.1 2001/05/03 12:32:13 darcy Exp $ +# $Header: /cvsroot/pgsql/contrib/chkpass/Makefile,v 1.2 2001/08/23 16:50:33 tgl Exp $ # subdir = contrib/chkpass top_builddir = ../.. include $(top_builddir)/src/Makefile.global -NAME := chkpass -SONAME := $(NAME)$(DLSUFFIX) +# override libdir to install shlib in contrib not main directory +libdir := $(libdir)/contrib -SQLS = $(NAME).sql -MODS = $(NAME)$(DLSUFFIX) +# shared library parameters +NAME= chkpass +SO_MAJOR_VERSION= 1 +SO_MINOR_VERSION= 0 override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) -override CFLAGS += $(CFLAGS_SL) ifdef REFINT_VERBOSE override CPPFLAGS+= -DREFINT_VERBOSE endif -all: $(SONAME) $(NAME).sql +OBJS= chkpass.o + +all: all-lib $(NAME).sql + +# Shared library stuff +include $(top_srcdir)/src/Makefile.shlib + $(NAME).sql: $(NAME).sql.in - sed -e 's:MODULE_PATHNAME:$(libdir)/contrib/$(SONAME):g' < $< > $@ + sed -e 's:MODULE_PATHNAME:$(libdir)/$(shlib):g' < $< > $@ -install: all installdirs - $(INSTALL_SHLIB) $(SONAME) $(libdir)/contrib - $(INSTALL_DATA) README.$(NAME) $(docdir)/contrib - sed "s+%%PGDIR%%+$(libdir)+g" < chkpass.sql > $(datadir)/contrib +install: all installdirs install-lib + $(INSTALL_DATA) $(srcdir)/README.$(NAME) $(docdir)/contrib + $(INSTALL_DATA) $(NAME).sql $(datadir)/contrib installdirs: - $(mkinstalldirs) $(libdir)/contrib $(docdir)/contrib $(datadir)/contrib + $(mkinstalldirs) $(docdir)/contrib $(datadir)/contrib $(libdir) -uninstall: - rm -f $(libdir)/contrib/$(SONAME) $(docdir)/contrib/README.$(NAME) \ - $(addprefix $(datadir)/contrib/, $(NAME).sql) +uninstall: uninstall-lib + rm -f $(docdir)/contrib/README.$(NAME) $(datadir)/contrib/$(NAME).sql -clean distclean maintainer-clean: - rm -f $(SONAME) $(NAME).sql +clean distclean maintainer-clean: clean-lib + rm -f $(OBJS) $(NAME).sql depend dep: - $(CC) -MM -MG $(CFLAGS) *.c > depend + $(CC) -MM -MG $(CFLAGS) *.c >depend ifeq (depend,$(wildcard depend)) include depend diff --git a/contrib/chkpass/chkpass.sql b/contrib/chkpass/chkpass.sql.in similarity index 74% rename from contrib/chkpass/chkpass.sql rename to contrib/chkpass/chkpass.sql.in index d5299afc29..72ad5e559c 100644 --- a/contrib/chkpass/chkpass.sql +++ b/contrib/chkpass/chkpass.sql.in @@ -4,25 +4,23 @@ -- darcy@druid.net -- http://www.druid.net/darcy/ -- --- $Header: /cvsroot/pgsql/contrib/chkpass/Attic/chkpass.sql,v 1.2 2001/08/10 18:57:32 tgl Exp $ +-- $Header: /cvsroot/pgsql/contrib/chkpass/chkpass.sql.in,v 1.1 2001/08/23 16:50:33 tgl Exp $ +-- -- best viewed with tabs set to 4 --- %%PGDIR%% changed to your local directory where modules is -- -load '%%PGDIR%%/modules/chkpass.so'; - -- -- Input and output functions and the type itself: -- create function chkpass_in(opaque) returns opaque - as '%%PGDIR%%/modules/chkpass.so' + as 'MODULE_PATHNAME' language 'c'; create function chkpass_out(opaque) returns opaque - as '%%PGDIR%%/modules/chkpass.so' + as 'MODULE_PATHNAME' language 'c'; create type chkpass ( @@ -34,7 +32,7 @@ create type chkpass ( create function raw(chkpass) returns text - as '%%PGDIR%%/modules/chkpass.so', 'chkpass_rout' + as 'MODULE_PATHNAME', 'chkpass_rout' language 'c'; -- @@ -43,12 +41,12 @@ create function raw(chkpass) create function eq(chkpass, text) returns bool - as '%%PGDIR%%/modules/chkpass.so', 'chkpass_eq' + as 'MODULE_PATHNAME', 'chkpass_eq' language 'c'; create function ne(chkpass, text) returns bool - as '%%PGDIR%%/modules/chkpass.so', 'chkpass_ne' + as 'MODULE_PATHNAME', 'chkpass_ne' language 'c'; --