aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2006-10-08 21:41:19 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2006-10-08 21:41:19 +0000
commit5c890e47bb54e51f2be5bff9a57e6da8d3b43081 (patch)
treec688c57b82c8e17d11279da5e7558fddd7fae38d
parent2d377951f87588a0d482beb64ffd6ebef4e50981 (diff)
downloadellinika-5c890e47bb54e51f2be5bff9a57e6da8d3b43081.tar.gz
ellinika-5c890e47bb54e51f2be5bff9a57e6da8d3b43081.tar.bz2
Allow to build both interpreted (using mod-guile) and CGI version of the scripts.
git-svn-id: file:///home/puszcza/svnroot/ellinika/trunk@463 941c8c0f-9102-463b-b60b-cd22ce0e6858
-rw-r--r--cgi-bin/Makefile.am60
-rw-r--r--ellinika/Makefile.am31
2 files changed, 58 insertions, 33 deletions
diff --git a/cgi-bin/Makefile.am b/cgi-bin/Makefile.am
index 2aa5760..da6ea58 100644
--- a/cgi-bin/Makefile.am
+++ b/cgi-bin/Makefile.am
@@ -16,24 +16,42 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
cgidir=@CGIDIR@
-cgi_SCRIPTS=dict.cgi nea.cgi
-EXTRA_DIST=dict.cgi.in nea.cgi.in
-CLEANFILES=dict.sed dict.cgi nea.cgi
-
-dict.sed: Makefile
- echo 's,=GUILE_BINDIR=,$(GUILE_BINDIR),' > $@
- echo 's,=GUILE_SITE=,@GUILE_SITE@,' >> $@
- echo "s,\;=GUILE_COMMENT=\;,@GUILE_COMMENT@," >> $@
- echo 's,=PACKAGE=,$(PACKAGE),'>> $@
- echo 's,=PREFIX=,$(prefix),' >> $@
- echo 's,=SYSCONFDIR=,$(sysconfdir),' >> $@
- echo 's,=LOCALEDIR=,$(datadir)/locale,' >> $@
- echo 's,=HTMLDIR=,$(HTMLDIR),' >> $@
- echo 's,=AUTOGENERATED=,@AUTOGENERATED@,' >> $@
-
-dict.cgi: $(srcdir)/dict.cgi.in dict.sed
- sed -f dict.sed $(srcdir)/dict.cgi.in > $@
-
-
-nea.cgi: $(srcdir)/nea.cgi.in dict.sed
- sed -f dict.sed $(srcdir)/nea.cgi.in > $@
+cgi_SCRIPTS=$(EXTRA_DIST:.scm4=.@SCRIPT_SUFFIX@)
+EXTRA_DIST=dict.scm4 nea.scm4
+CLEANFILES=dict.m4 dict.scm nea.scm dict.cgi nea.cgi
+
+dict.m4: Makefile
+ echo 'divert(-1)' > $@
+ echo 'changequote([,])' >> $@
+ echo 'changecom([;],[' >> $@
+ echo '])' >> $@
+ echo 'undefine([format])' >> $@
+ echo 'define([IFACE],$(APACHE_IFACE))' >> $@
+ echo 'define([GUILE_BINDIR],$(GUILE_BINDIR))' >> $@
+ echo 'define([GUILE_SITE],@GUILE_SITE@)' >> $@
+ echo 'define([PACKAGE],$(PACKAGE))'>> $@
+ echo 'define([PREFIX],$(prefix))' >> $@
+ echo 'define([SYSCONFDIR],$(sysconfdir))' >> $@
+ echo 'define([LOCALEDIR],$(datadir)/locale)' >> $@
+ echo 'define([HTMLDIR],$(HTMLDIR))' >> $@
+ echo 'divert(0)dnl' >> $@
+ echo 'ifelse(IFACE,[CGI],#! $(GUILE_BINDIR)/guile -s' >> $@
+ echo ')dnl' >> $@
+ echo '@AUTOGENERATED@' >> $@
+ echo 'ifelse(IFACE,[CGI],!#' >> $@
+ echo ')dnl' >> $@
+
+SUFFIXES = .scm4 .scm .cgi
+
+.scm4.scm:
+ m4 dict.m4 $< > $@
+
+.scm.cgi:
+ cp $< $@
+
+dict.scm: dict.scm4 dict.m4
+nea.scm: nea.scm4 dict.m4
+
+dict.cgi: dict.scm
+nea.cgi: nea.scm
+
diff --git a/ellinika/Makefile.am b/ellinika/Makefile.am
index f4dba76..4f74846 100644
--- a/ellinika/Makefile.am
+++ b/ellinika/Makefile.am
@@ -18,16 +18,23 @@
guiledir=$(GUILE_SITE)/$(PACKAGE)
guile_DATA=xlat.scm cgi.scm i18n.scm
-cgi.sed: Makefile
- echo 's,=GUILE_BINDIR=,$(GUILE_BINDIR),' > $@
- echo 's,=GUILE_SITE=,@GUILE_SITE@,' >> $@
- echo "s,\;=GUILE_COMMENT=\;,@GUILE_COMMENT@," >> $@
- echo 's,=PACKAGE=,$(PACKAGE),'>> $@
- echo 's,=PREFIX=,$(prefix),' >> $@
- echo 's,=SYSCONFDIR=,$(sysconfdir),' >> $@
- echo 's,=LOCALEDIR=,$(datadir)/locale,' >> $@
- echo 's,=HTMLDIR=,$(HTMLDIR),' >> $@
- echo 's,=AUTOGENERATED=,@AUTOGENERATED@,' >> $@
+cgi.m4: Makefile
+ echo 'divert(-1)' > $@
+ echo 'changequote([,])' >> $@
+ echo 'define([IFACE],$(APACHE_IFACE))' >> $@
+ echo 'define([GUILE_BINDIR],$(GUILE_BINDIR))' >> $@
+ echo 'define([GUILE_SITE],@GUILE_SITE@)' >> $@
+ echo 'define([PACKAGE],$(PACKAGE))'>> $@
+ echo 'define([PREFIX],$(prefix))' >> $@
+ echo 'define([SYSCONFDIR],$(sysconfdir))' >> $@
+ echo 'define([LOCALEDIR],$(datadir)/locale)' >> $@
+ echo 'define([HTMLDIR],$(HTMLDIR))' >> $@
+ echo 'divert(0)dnl' >> $@
+ echo '@AUTOGENERATED@' >> $@
-cgi.scm: $(srcdir)/cgi.scmi cgi.sed
- sed -f cgi.sed $(srcdir)/cgi.scmi > $@
+SUFFIXES = .scm4 .scm
+
+.scm4.scm:
+ m4 cgi.m4 $< > $@
+
+cgi.scm: cgi.scm4 cgi.m4 \ No newline at end of file

Return to:

Send suggestions and report system problems to the System administrator.