1 dnl aclocal.m4 generated automatically by aclocal 1.4-p6
3 dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
14 dnl @synopsis RT_ENABLE_LAYOUT()
16 dnl Enable a specific directory layout for the installation to use.
17 dnl This configures a command-line parameter that can be specified
18 dnl at ./configure invocation.
20 dnl The use of this feature in this way is a little hackish, but
21 dnl better than a heap of options for every directory.
23 dnl This code is heavily borrowed *cough* from the Apache 2 code.
26 AC_DEFUN([RT_ENABLE_LAYOUT],[
28 AC_HELP_STRING([--enable-layout=LAYOUT],
29 [Use a specific directory layout (Default: relative)]),
32 if test "x$LAYOUT" = "x"; then
35 RT_LAYOUT($srcdir/config.layout, $LAYOUT)
36 AC_MSG_CHECKING(for chosen layout)
37 if test "x$rt_layout_name" = "xno"; then
38 if test "x$LAYOUT" = "xno"; then
41 AC_MSG_RESULT($LAYOUT)
43 AC_MSG_ERROR([a valid layout must be specified (or the default used)])
45 AC_SUBST(rt_layout_name)
46 AC_MSG_RESULT($rt_layout_name)
48 if test "x$rt_layout_name" != "xinplace" ; then
49 AC_SUBST([COMMENT_INPLACE_LAYOUT], [""])
51 AC_SUBST([COMMENT_INPLACE_LAYOUT], [# ])
56 dnl @synopsis RT_LAYOUT(configlayout, layoutname)
58 dnl This macro reads an Apache-style layout file (specified as the
59 dnl configlayout parameter), and searches for a specific layout
60 dnl (named using the layoutname parameter).
62 dnl The entries for a given layout are then inserted into the
63 dnl environment such that they become available as substitution
64 dnl variables. In addition, the rt_layout_name variable is set
65 dnl (but not exported) if the layout is valid.
67 dnl This code is heavily borrowed *cough* from the Apache 2 codebase.
70 AC_DEFUN([RT_LAYOUT],[
71 if test ! -f $srcdir/config.layout; then
72 AC_MSG_WARN([Layout file $srcdir/config.layout not found])
76 $PERL -0777 -p -e "\$layout = '$2';" -e '
77 s/.*<Layout\s+$layout>//gims;
83 # m4 will not let us just use $1, we need @S|@1
84 s/^\s*((?:bin|sbin|libexec|data|sysconf|sharedstate|localstate|lib|include|oldinclude|info|man|html)dir)\s*:\s*(.*)$/@S|@1=@S|@2/gim;
85 s/^\s*(.*?)\s*:\s*(.*)$/\(test "x\@S|@@S|@1" = "xNONE" || test "x\@S|@@S|@1" = "x") && @S|@1=@S|@2/gim;
88 if test -s $pldconf; then
92 for var in prefix exec_prefix bindir sbindir \
93 sysconfdir mandir libdir datadir htmldir fontdir\
94 lexdir localstatedir logfiledir masonstatedir \
95 sessionstatedir customdir custometcdir customhtmldir \
96 customlexdir customplugindir customlibdir manualdir; do
98 val=`echo $val | sed -e 's:\(.\)/*$:\1:'`
100 sed -e 's:[\$]\([a-z_]*\):${\1}:g'`
109 RT_SUBST_EXPANDED_ARG(prefix)
110 RT_SUBST_EXPANDED_ARG(exec_prefix)
111 RT_SUBST_EXPANDED_ARG(bindir)
112 RT_SUBST_EXPANDED_ARG(sbindir)
113 RT_SUBST_EXPANDED_ARG(sysconfdir)
114 RT_SUBST_EXPANDED_ARG(mandir)
115 RT_SUBST_EXPANDED_ARG(libdir)
116 RT_SUBST_EXPANDED_ARG(lexdir)
117 RT_SUBST_EXPANDED_ARG(datadir)
118 RT_SUBST_EXPANDED_ARG(htmldir)
119 RT_SUBST_EXPANDED_ARG(fontdir)
120 RT_SUBST_EXPANDED_ARG(manualdir)
121 RT_SUBST_EXPANDED_ARG(plugindir)
122 RT_SUBST_EXPANDED_ARG(localstatedir)
123 RT_SUBST_EXPANDED_ARG(logfiledir)
124 RT_SUBST_EXPANDED_ARG(masonstatedir)
125 RT_SUBST_EXPANDED_ARG(sessionstatedir)
126 RT_SUBST_EXPANDED_ARG(customdir)
127 RT_SUBST_EXPANDED_ARG(custometcdir)
128 RT_SUBST_EXPANDED_ARG(customplugindir)
129 RT_SUBST_EXPANDED_ARG(customhtmldir)
130 RT_SUBST_EXPANDED_ARG(customlexdir)
131 RT_SUBST_EXPANDED_ARG(customlibdir)
135 dnl @synopsis RT_SUBST_EXPANDED_ARG(var)
137 dnl Export (via AC_SUBST) a given variable, along with an expanded
138 dnl version of the variable (same name, but with exp_ prefix).
140 dnl This code is heavily borrowed *cough* from the Apache 2 source.
143 AC_DEFUN([RT_SUBST_EXPANDED_ARG],[
144 RT_EXPAND_VAR(exp_$1, [$]$1)
150 dnl @synopsis RT_EXPAND_VAR(baz, $fraz)
152 dnl Iteratively expands the second parameter, until successive iterations
153 dnl yield no change. The result is then assigned to the first parameter.
155 dnl This code is heavily borrowed from the Apache 2 codebase.
158 AC_DEFUN([RT_EXPAND_VAR],[
161 while test "x${ap_cur}" != "x${ap_last}"; do
163 ap_cur=`eval "echo ${ap_cur}"`