Mercurial > hg > xemacs-beta
diff modules/aclocal.m4 @ 265:8efd647ea9ca r20-5b31
Import from CVS: tag r20-5b31
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:25:37 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/aclocal.m4 Mon Aug 13 10:25:37 2007 +0200 @@ -0,0 +1,36 @@ +AC_DEFUN(XE_EMACS, [ + dnl + dnl Apparently, if you run a shell window in Emacs, it sets the EMACS + dnl environment variable to 't'. Lets undo the damage. + dnl + if test "${EMACS}" = "t"; then + EMACS="" + fi + + AC_ARG_WITH(xemacs, --with-xemacs Use XEmacs to build, [ if test "${withval}" = "yes"; then EMACS=xemacs; else EMACS=${withval}; fi ]) + AC_ARG_WITH(emacs, --with-emacs Use Emacs to build, [ if test "${withval}" = "yes"; then EMACS=emacs; else EMACS=${withval}; fi ]) + AC_CHECK_PROG(EMACS, xemacs, xemacs, emacs) + AC_SUBST(EMACS) +]) + +AC_DEFUN(XE_CONFIG_VALUE, [ + OUTPUT=./conftest-$$ + rm -f ${OUTPUT} + ${EMACS} -batch -eval " +(let ((hash (config-value-hash-table)) + (desired (split-string \"$1\"))) + (mapcar + (lambda (key) + (message \"Checking for %S\" (intern key)) + (if (config-value (intern key)) + (progn + (write-region (format \"%s=\\\"%s\\\"\n\" key (config-value (intern key))) + nil \"${OUTPUT}\" t)))) + desired)) +" 2> /dev/null > /dev/null + test -f ${OUTPUT} && . ${OUTPUT} + rm -f ${OUTPUT} + for ac_func in $1; do + : + done +])