aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2015-01-10 20:14:14 +0200
committerSergey Poznyakoff <gray@gnu.org>2015-01-10 20:14:14 +0200
commit1c22a86e073d57c4b35ac5b7ffea07aa541141c4 (patch)
treec90f3fc758b5dfc2f8e8fd64f2ef0a87343b3e50 /configure.ac
parent2b99881a880d101ae32a94b3d1e0a792224cb74c (diff)
downloadellinika-1c22a86e073d57c4b35ac5b7ffea07aa541141c4.tar.gz
ellinika-1c22a86e073d57c4b35ac5b7ffea07aa541141c4.tar.bz2
Make it possible to use apache rewrite rules to create nice cgi urls
Example: configure with options: --without-script-suffix --without-script-dir, and add the following to the Apache virtual host configuration: RewriteEngine on RewriteRule ^/dict(.*) /cgi-bin/dict.cgi$1 [H=cgi-script] RewriteRule ^/nea(.*) /cgi-bin/nea.cgi$1 [H=cgi-script] RewriteRule ^/conj(.*) /cgi-bin/conj.cgi$1 [H=cgi-script] All cgi's will then be referred to directly, as in: http://ellinika/dict?lang=pl. * configure.ac (REAL_SCRIPT_SUFFIX): New subst var New options --with-script-suffix, --with-script-dir * src/cgi-bin/.gitignore: Remove cgi * src/cgi-bin/Makefile.am: Rename installed scm's in place * src/ellinika/cgi.scm4 (cgi-program-name): Suffix can be empty. * xml/lingua.conf.in: =SCRIPT_SUFFIX= always begins with dot
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac33
1 files changed, 28 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 302f2df..7cdcc32 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,7 +17,7 @@
AC_PREREQ(2.61)
-AC_REVISION(2015-01-07 14:56:15 gray)
+AC_REVISION(2015-01-10 19:52:52 gray)
AC_INIT(ellinika, 1.99.99, [gray+ellinika@gnu.org.ua])
AC_CONFIG_SRCDIR(src/cgi-bin/dict.scm4)
AC_CONFIG_AUX_DIR([build-aux])
@@ -107,12 +107,13 @@ AC_ARG_VAR([EXP_URL],
AC_ARG_VAR([STATE],
[EXP for experimental, PROD for production])
+AC_SUBST(REAL_SCRIPT_SUFFIX)
AC_SUBST(SCRIPT_SUFFIX)
AC_SUBST(SCRIPT_DIR)
AC_SUBST(CGIDIR)
if test $APACHE_IFACE = "CGI"; then
- SCRIPT_SUFFIX=cgi
+ REAL_SCRIPT_SUFFIX=.cgi
if test -n "$TARGET_DIR"; then
SCRIPT_DIR=cgi-bin
else
@@ -120,11 +121,33 @@ if test $APACHE_IFACE = "CGI"; then
fi
CGIDIR='$(prefix)/cgi-bin'
else
- SCRIPT_SUFFIX=scm
+ REAL_SCRIPT_SUFFIX=.scm
SCRIPT_DIR=scm
CGIDIR='$(prefix)/scm'
-fi
-
+fi
+
+AC_ARG_WITH(script-suffix,
+ AC_HELP_STRING([--with-script-suffix=.STRING],
+ [CGI script suffix]),
+ [if test -z "$withval"; then
+ SCRIPT_SUFFIX=
+ else
+ case $withval in
+ no) SCRIPT_SUFFIX=;;
+ .*) SCRIPT_SUFFIX=$withval;;
+ *) AC_MSG_ERROR([script suffix must begin with dot])
+ esac
+ fi],
+ [SCRIPT_SUFFIX=$REAL_SCRIPT_SUFFIX])
+
+AC_ARG_WITH(script-dir,
+ AC_HELP_STRING([--with-script-dir=DIR],
+ [script directory prefix]),
+ [case $withval in
+ no) SCRIPT_DIR=;;
+ *) SCRIPT_DIR=$withval;;
+ esac])
+
AC_ARG_WITH(cgi-bin,
AC_HELP_STRING([--with-cgi-bin=DIR],
[install CGI programs in DIR [[PREFIX/cgi-bin]]]),

Return to:

Send suggestions and report system problems to the System administrator.