This commit was generated by cvs2svn to compensate for changes in r5670,
[chise/xemacs-chise.git.1] / modules / aclocal.m4
1 AC_DEFUN(XE_EMACS, [
2         dnl
3         dnl Apparently, if you run a shell window in Emacs, it sets the EMACS
4         dnl environment variable to 't'.  Lets undo the damage.
5         dnl
6         if test "${EMACS}" = "t"; then
7                 EMACS=""
8         fi
9
10         AC_ARG_WITH(xemacs,           --with-xemacs             Use XEmacs to build, [ if test "${withval}" = "yes"; then EMACS=xemacs; else EMACS=${withval}; fi ])
11         AC_ARG_WITH(emacs,            --with-emacs              Use Emacs to build, [ if test "${withval}" = "yes"; then EMACS=emacs; else EMACS=${withval}; fi ])
12         AC_CHECK_PROG(EMACS, xemacs, xemacs, emacs)
13         AC_SUBST(EMACS)
14 ])
15
16 AC_DEFUN(XE_CONFIG_VALUE, [
17         OUTPUT=./conftest-$$
18         rm -f ${OUTPUT}
19         ${EMACS} -batch -eval "
20 (let ((hash (config-value-hash-table))
21       (desired (split-string \"$1\")))
22   (mapcar
23      (lambda (key)
24        (message \"Checking for %S\" (intern key))
25        (if (config-value (intern key))
26           (progn
27             (write-region (format \"%s=\\\"%s\\\"\n\" key (config-value (intern key)))
28                           nil \"${OUTPUT}\" t))))
29         desired))
30 " 2> /dev/null > /dev/null
31         test -f ${OUTPUT} && . ${OUTPUT}
32         rm -f ${OUTPUT}
33         for ac_func in $1; do
34                 :
35         done
36 ])