Commit 6423a8ee authored by Tom Lane's avatar Tom Lane

Fix contrib/rserv to install successfully when built outside source tree.

(Not that it will actually work with 7.3, I fear.)
parent c87867f4
# $Header: /cvsroot/pgsql/contrib/contrib-global.mk,v 1.3 2002/09/05 18:28:45 petere Exp $ # $Header: /cvsroot/pgsql/contrib/contrib-global.mk,v 1.4 2002/11/01 23:45:37 tgl Exp $
# This file contains generic rules to build many kinds of simple # This file contains generic rules to build many kinds of simple
# contrib modules. You only need to set a few variables and include # contrib modules. You only need to set a few variables and include
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
# which need to be built first # which need to be built first
# DOCS -- random files to install under $PREFIX/doc/contrib # DOCS -- random files to install under $PREFIX/doc/contrib
# SCRIPTS -- script files (not binaries) to install into $PREFIX/bin # SCRIPTS -- script files (not binaries) to install into $PREFIX/bin
# SCRIPTS_built -- script files (not binaries) to install into $PREFIX/bin,
# which need to be built first
# REGRESS -- list of regression test cases (without suffix) # REGRESS -- list of regression test cases (without suffix)
# #
# or at most one of these two: # or at most one of these two:
...@@ -52,7 +54,7 @@ ifdef PG_CPPFLAGS ...@@ -52,7 +54,7 @@ ifdef PG_CPPFLAGS
override CPPFLAGS := $(PG_CPPFLAGS) $(CPPFLAGS) override CPPFLAGS := $(PG_CPPFLAGS) $(CPPFLAGS)
endif endif
all: $(PROGRAM) $(DATA_built) $(addsuffix $(DLSUFFIX), $(MODULES)) all: $(PROGRAM) $(DATA_built) $(SCRIPTS_built) $(addsuffix $(DLSUFFIX), $(MODULES))
ifdef MODULE_big ifdef MODULE_big
# shared library parameters # shared library parameters
...@@ -100,6 +102,12 @@ ifdef SCRIPTS ...@@ -100,6 +102,12 @@ ifdef SCRIPTS
$(INSTALL_SCRIPT) $$file $(DESTDIR)$(bindir); \ $(INSTALL_SCRIPT) $$file $(DESTDIR)$(bindir); \
done done
endif # SCRIPTS endif # SCRIPTS
ifdef SCRIPTS_built
@for file in $(SCRIPTS_built); do \
echo "$(INSTALL_SCRIPT) $$file $(DESTDIR)$(bindir)"; \
$(INSTALL_SCRIPT) $$file $(DESTDIR)$(bindir); \
done
endif # SCRIPTS_built
installdirs: installdirs:
...@@ -112,7 +120,7 @@ endif ...@@ -112,7 +120,7 @@ endif
ifdef DOCS ifdef DOCS
$(mkinstalldirs) $(DESTDIR)$(docdir)/contrib $(mkinstalldirs) $(DESTDIR)$(docdir)/contrib
endif endif
ifneq (,$(PROGRAM)$(SCRIPTS)) ifneq (,$(PROGRAM)$(SCRIPTS)$(SCRIPTS_built))
$(mkinstalldirs) $(DESTDIR)$(bindir) $(mkinstalldirs) $(DESTDIR)$(bindir)
endif endif
...@@ -136,6 +144,9 @@ endif ...@@ -136,6 +144,9 @@ endif
ifdef SCRIPTS ifdef SCRIPTS
rm -f $(addprefix $(DESTDIR)$(bindir)/, $(SCRIPTS)) rm -f $(addprefix $(DESTDIR)$(bindir)/, $(SCRIPTS))
endif endif
ifdef SCRIPTS_built
rm -f $(addprefix $(DESTDIR)$(bindir)/, $(SCRIPTS_built))
endif
clean: clean:
...@@ -145,6 +156,9 @@ endif ...@@ -145,6 +156,9 @@ endif
ifdef DATA_built ifdef DATA_built
rm -f $(DATA_built) rm -f $(DATA_built)
endif endif
ifdef SCRIPTS_built
rm -f $(SCRIPTS_built)
endif
ifdef PROGRAM ifdef PROGRAM
rm -f $(PROGRAM)$(X) rm -f $(PROGRAM)$(X)
endif endif
......
...@@ -11,24 +11,17 @@ DATA = RServ.pm ...@@ -11,24 +11,17 @@ DATA = RServ.pm
DATA_built = master.sql slave.sql DATA_built = master.sql slave.sql
SQLS = $(DATA_built) SQLS = $(DATA_built)
DOCS = README.rserv DOCS = README.rserv
SCRIPTS = RservTest SCRIPTS_built = RservTest
SCRIPTS += MasterInit MasterAddTable Replicate MasterSync CleanLog SCRIPTS_built += MasterInit MasterAddTable Replicate MasterSync CleanLog
SCRIPTS += SlaveInit SlaveAddTable GetSyncID SCRIPTS_built += SlaveInit SlaveAddTable GetSyncID
SCRIPTS += PrepareSnapshot ApplySnapshot SCRIPTS_built += PrepareSnapshot ApplySnapshot
SCRIPTS += InitRservTest SCRIPTS_built += InitRservTest
EXTRA_CLEAN = $(SCRIPTS)
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
override CFLAGS += $(CFLAGS_SL)
SHLIB_LINK = $(BE_DLLLIBS)
all: $(SCRIPTS) $(SQLS) $(addsuffix $(DLSUFFIX), $(MODULES))
$(SQLS): %.sql: %.sql.in $(SQLS): %.sql: %.sql.in
sed 's,@MODULE_FILENAME@,$$libdir/$(NAME),g' $< >$@ sed 's,@MODULE_FILENAME@,$$libdir/$(NAME),g' $< >$@
$(SCRIPTS): %: %.in $(SCRIPTS_built): %: %.in
sed -e 's,@MODULE_FILENAME@,$$libdir/$(NAME),g' \ sed -e 's,@MODULE_FILENAME@,$$libdir/$(NAME),g' \
-e 's:@SQLDIR@:$(datadir)/contrib:g' \ -e 's:@SQLDIR@:$(datadir)/contrib:g' \
-e 's:@BINDIR@:$(bindir):g' \ -e 's:@BINDIR@:$(bindir):g' \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment