1 dnl SXEmacs emodules configure script
2 dnl -------------------------------------------------------------------------
5 AC_INIT([SXEmacs modules], [22.1.15],[https://issues.sxemacs.org/])
6 AC_CONFIG_HEADERS([config.emods.h])
9 dnl -------------------------------------------------------------------------
10 dnl Local copyright notices.
11 dnl -------------------------------------------------------------------------
13 [#### Configuration script for SXEmacs modules.
14 #### Guess values for system-dependent variables and create Makefiles.
15 #### Copyright (C) 2006 Steve Youngs.
16 #### Copyright (C) 2006 Sebastian Freundt.
18 ### Don't edit this script!
19 ### This script was automatically generated by the `autoconf' program
20 ### from the file `./configure.ac'.
21 ### To rebuild it, execute the command
22 ### autogen.sh (or autoreconf)
23 ### in the this directory.
25 ## This file is part of SXEmacs.
27 ## Redistribution and use in source and binary forms, with or without
28 ## modification, are permitted provided that the following conditions
31 ## 1. Redistributions of source code must retain the above copyright
32 ## notice, this list of conditions and the following disclaimer.
34 ## 2. Redistributions in binary form must reproduce the above copyright
35 ## notice, this list of conditions and the following disclaimer in the
36 ## documentation and/or other materials provided with the distribution.
38 ## 3. Neither the name of the author nor the names of any contributors
39 ## may be used to endorse or promote products derived from this
40 ## software without specific prior written permission.
42 ## THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
43 ## IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
44 ## WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
45 ## DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
46 ## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
47 ## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
48 ## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
49 ## BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
50 ## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
51 ## OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
52 ## IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54 ### For usage, run `./configure --help'
56 ### If configure succeeds, it leaves its status in config.status.
57 ### A log of configuration tests can be found in config.log.
58 ### If configure fails after disturbing the status quo,
59 ### config.status is removed.
63 dnl -------------------------------------------------------------------------
64 dnl Command line argument processing.
66 dnl If you add or remove any options here, make sure you also update
67 dnl the section below it "Check for bogus options"
71 OG_OPTION_GROUP(Build Options)
73 OG_ARG_WITH([sxemacs],
74 AS_HELP_STRING([--with-sxemacs],
75 [Specify the sxemacs binary to use.]),
76 [auto], [Auto], [og_any])
78 OG_ARG_WITH([sxemacs-from-the-future],
79 AS_HELP_STRING([--with-sxemacs-from-the-future],
83 OG_ARG_WITH([sxemacs-headers],
84 AS_HELP_STRING([--with-sxemacs-headers],
85 [Specify the directory of SXEmacs headers to use.]),
86 [auto], [Auto], [og_any])
89 AS_HELP_STRING([--with-ellcc],
90 [Specify the ellcc binary to use.]),
91 [auto], [Auto], [og_any])
93 OG_ARG_WITH([make-docfile],
94 AS_HELP_STRING([--with-make-docfile],
95 [Specify the make-docfile binary to use.]),
96 [auto], [Auto], [og_any])
101 OG_OPTION_GROUP(Module Options)
103 OG_MULTIARG_WITH([ell-modules],
104 AS_HELP_STRING([--with-ell-modules],
105 [Which modules to compile and install.]),
106 [all], [all], [base64 ldap sample zlib])
108 OG_MULTIARG_WITH([static-modules],
109 AS_HELP_STRING([--with-static-modules],
110 [Which modules to compile as archives for static linking.]),
111 [none], [none], [base64 ldap sample zlib])
113 dnl Installation Options
114 dnl ====================
115 OG_OPTION_GROUP(Installation Options)
117 dnl OG_ARG_WITH([module-dir],
118 dnl AS_HELP_STRING([--with-module-dir],
119 dnl [Specify the directory where the modules go.]),
120 dnl [auto], [$prefix/lib/sxemacs/site-modules], [og_any])
121 OG_ARG_WITH([module-dir],
122 AS_HELP_STRING([--with-module-dir],
123 [Specify the directory where the modules go.]),
124 [auto], [${libdir}/${instvardir}/modules], [og_any])
126 OG_ARG_WITH([package-dir],
127 AS_HELP_STRING([--with-package-dir],
128 [Specify a package hierarchy where the elisp files go.]),
129 [auto], [$prefix/lib/sxemacs/site-packages], [og_any])
132 ## -------------------------------------------------------------------------
133 ## Check for users who regularly forget about running autoconf
134 ## -------------------------------------------------------------------------
135 if test -f $0.ac -a $0.ac -nt $0; then
136 ## `dirname $0`/autogen.sh
137 AC_MSG_ERROR([What are you doing? RUN autoconf or autogen.sh NOW!!!])
140 ## Now since the user ran us, we build a stand-alone module
141 AM_CONDITIONAL([AUTARKIC], [test "1" = "0"])
143 ### ------------------------------------------------------------------------
144 ### Detection routines
145 ### ------------------------------------------------------------------------
147 test "x$prefix" = xNONE && prefix=$ac_default_prefix
148 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
151 AM_INIT_AUTOMAKE([foreign -Wall])
154 ## Check for working SXEmacs
155 ## =========================
157 if test "$with_sxemacs_from_the_future" != "no"; then
158 EMACS=$with_sxemacs_from_the_future
159 elif test -n "$with_sxemacs" -a "$with_sxemacs" != "yes"; then
161 elif test -n "$EMACS"; then
163 elif test -n "$EDITOR"; then
169 sxebatch="$EMACS -batch -vanilla"
171 if test "$with_sxemacs_from_the_future" = "no"; then
172 AC_MSG_CHECKING([for a working Emacs])
173 $sxebatch &>/dev/null && have_sxebatch=yes || have_sxebatch=no
174 if test "$have_sxebatch" = "yes"; then
178 AC_MSG_ERROR([Your emacs is too old, buggy, or non-existent.
179 Specify a *working* emacs via the EMACS or EDITOR environment variable.
180 Please note: GNU Emacs is _not_ a working version of Emacs hereby.])
183 AC_MSG_CHECKING([for the flavour of Emacs])
184 sxeflavour=`$sxebatch -eval "(message \"%s\" (featurep 'sxemacs))" \
186 if test "$sxeflavour" = "t"; then
187 AC_MSG_RESULT([SXEmacs (fortunately)])
189 AC_MSG_RESULT([XEmacs])
190 AC_MSG_CHECKING([whether XEmacs is working])
191 majver=`$sxebatch -eval '(message "%s" emacs-major-version)' \
193 minver=`$sxebatch -eval '(message "%s" emacs-minor-version)' \
195 subver=`$sxebatch -eval '(message "%s" emacs-beta-version)' \
197 if test "$majver" -ge 21 -a "$minver" -ge "4"; then
198 if test "$minver" -eq "4"; then
199 AC_MSG_RESULT([yes ($majver.$minver.$subver)])
201 AC_MSG_RESULT([no ($majver.$minver.$subver)])
203 [We currently do not support the beta dnl
205 Consider installing SXEmacs.])
208 AC_MSG_RESULT([no ($majver.$minver.$subver)])
209 AC_MSG_ERROR([Your XEmacs is waaaay too old.])
218 ## Check for the sxemacs headers
219 ## =============================
221 if test "$with_sxemacs_from_the_future" = "no"; then
222 sxemoddir=`$sxebatch -eval "(message module-directory)" 2>&1 | tail -n1`
223 sxearchdir=`dirname $sxemoddir`
224 if test -z "$with_sxemacs_headers"; then
225 with_sxemacs_headers=$sxearchdir/include
229 COLON_TO_SPACE(with_sxemacs_headers)
231 AC_MSG_CHECKING([for SXEmacs include directory])
232 if test -n "$with_sxemacs_headers"; then
233 AC_MSG_RESULT([$with_sxemacs_headers])
236 AC_MSG_ERROR(['$with_sxemacs_headers' does not exist])
239 echo $with_sxemacs_headers
240 for i in $with_sxemacs_headers; do
242 SXEMACS_INCLUDES="$SXEMACS_INCLUDES -I$i"
244 AC_SUBST(SXEMACS_INCLUDES)
246 ## Check for the sxemacs lisp or package path
247 ## ==========================================
249 if test "$with_sxemacs_from_the_future" = "no"; then
250 if test -z "$with_lisp_dir"; then
251 sxelispdir=`$sxebatch -eval "(message lisp-directory)" \
255 if test -z "$with_package_dir"; then
256 AC_MSG_CHECKING([for package hierarchy])
258 $prefix/share/sxemacs/site-packages \
259 $prefix/share/xemacs/site-packages \
260 $prefix/lib/sxemacs/site-packages \
261 $prefix/lib/sxemacs/xemacs-packages \
262 $prefix/lib/xemacs/site-packages \
263 $prefix/lib/xemacs/xemacs-packages"
264 if test -n "$sxearchdir"; then
265 pkgdir_candidates=$pkgdir_candidates" "`dirname $sxearchdir`
267 for i in $pkgdir_candidates; do
268 if test -e "$i" -a -z "$with_package_dir"; then
274 if test -z "$with_package_dir"; then
279 AC_MSG_CHECKING([whether package directory is indeed a directory])
281 if test -d "$with_package_dir"; then
285 if test -n "$with_package_dir"; then
286 AC_MSG_ERROR(['$with_package_dir' is not a directory])
290 packagedir=$with_package_dir
291 AC_SUBST([packagedir])
293 dnl this is necessary so automake loads lisp handling
294 dnl but automake's AM_PATH_LISPDIR is simply bullshit, we fake our own version
295 AC_DEFUN([AM_PATH_LISPDIR], [])
298 infodir=$packagedir/info
301 etcdir=$packagedir/etc
304 ## Check for the sxemacs lisp or package path
305 ## ==========================================
307 if test -z "$with_module_dir"; then
308 AC_MSG_CHECKING([for module hierarchy])
310 $prefix/lib/sxemacs/site-modules \
311 $prefix/lib/xemacs/site-modules \
313 for i in $moddir_candidates; do
314 if test -e "$i" -a -z "$with_module_dir"; then
320 if test -z "$with_module_dir"; then
325 AC_MSG_CHECKING([whether module directory is indeed a directory])
327 if test -d "$with_module_dir"; then
329 elif test "$with_sxemacs_from_the_future" != "no"; then
330 AC_MSG_RESULT([probably yes ($with_module_dir)])
333 AC_MSG_ERROR(['$with_module_dir' is not a directory])
336 moduledir=$with_module_dir
346 if test -z "$with_ellcc"; then
347 with_ellcc=`which ellcc`
349 AC_MSG_CHECKING([for ellcc])
350 if test -f "$with_ellcc"; then
351 AC_MSG_RESULT([$with_ellcc])
354 AC_MSG_ERROR([ellcc is mandatory. Consider --with-ellcc])
360 ELLCCLD="$with_ellcc --mode=link"
362 MKINIT="$with_ellcc --mode=init"
370 ## Check for make-docfile
371 ## ======================
373 if test -z "$with_make_docfile"; then
374 with_make_docfile=$sxearchdir/make-docfile
376 AC_MSG_CHECKING([for make-docfile])
377 if test -f "$with_make_docfile"; then
378 AC_MSG_RESULT([$with_make_docfile])
379 elif test "$with_sxemacs_from_the_future" != "no"; then
380 AC_MSG_RESULT([probably yes ($with_make_docfile)])
383 AC_MSG_WARN([make-docfile is extremely useful, consider --with-make-docfile])
386 ELLMAKEDOC=$with_make_docfile
393 modules="base64 sample zlib"
394 AM_CONDITIONAL([EMOD_BASE64], [test "$with_ell_modules_base64" = "yes"])
395 AM_CONDITIONAL([EMOD_SAMPLE], [test "$with_ell_modules_sample" = "yes"])
396 AM_CONDITIONAL([EMOD_ZLIB], [test "$with_ell_modules_zlib" = "yes"])
397 AM_CONDITIONAL([STATIC_BASE64], [test "$with_static_modules_base64" = "yes"])
398 AM_CONDITIONAL([STATIC_SAMPLE], [test "$with_static_modules_sample" = "yes"])
399 AM_CONDITIONAL([STATIC_ZLIB], [test "$with_static_modules_zlib" = "yes"])
400 AM_CONDITIONAL([DESCEND_BASE64],
401 [test "$with_static_modules_base64" = "yes" -o \
402 "$with_ell_modules_base64" = "yes"])
403 AM_CONDITIONAL([DESCEND_SAMPLE],
404 [test "$with_static_modules_sample" = "yes" -o \
405 "$with_ell_modules_sample" = "yes"])
406 AM_CONDITIONAL([DESCEND_ZLIB],
407 [test "$with_static_modules_zlib" = "yes" -o \
408 "$with_ell_modules_zlib" = "yes"])
409 AM_CONDITIONAL([FROM_THE_FUTURE],
410 [test "$with_sxemacs_from_the_future" != "no"])
418 dnl ldap/Makefile - totally b0rked