aboutsummaryrefslogtreecommitdiff
path: root/cgi-bin/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'cgi-bin/Makefile.am')
-rw-r--r--cgi-bin/Makefile.am60
1 files changed, 39 insertions, 21 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
+

Return to:

Send suggestions and report system problems to the System administrator.