1 AC_DEFUN([AC_CHECK_EMACS],
2 [dnl Check for Emacsen.
4 dnl Apparently, if you run a shell window in Emacs, it sets the EMACS
5 dnl environment variable to 't'. Lets undo the damage.
6 test "$EMACS" = t && EMACS=
9 unset ac_cv_prog_EMACS; unset ac_cv_prog_XEMACS;
12 [ --with-emacs=EMACS compile with EMACS [EMACS=emacs, mule...]],
13 [if test "$withval" = yes -o -z "$withval"; then
14 AC_CHECK_PROGS(EMACS, emacs xemacs mule, emacs)
16 AC_CHECK_PROG(EMACS, $withval, $withval, emacs)
19 [ --with-xemacs=XEMACS compile with XEMACS [XEMACS=xemacs]],
20 [if test "$withval" = yes -o -z "$withval"; then
21 AC_CHECK_PROG(XEMACS, xemacs, xemacs, xemacs)
23 AC_CHECK_PROG(XEMACS, $withval, $withval, xemacs)
27 test -z "$EMACS" && AC_CHECK_PROGS(EMACS, emacs xemacs mule, emacs)])
31 AC_DEFUN([AC_EMACS_LISP], [
34 AC_MSG_CHECKING(for $1)
36 AC_CACHE_VAL(EMACS_cv_SYS_$1,[
38 echo ${EMACS}' -batch -eval '\''(let ((x '${elisp}')) (write-region (if (stringp x) (princ x) (prin1-to-string x)) nil "'${OUTPUT}'" nil 5))'\' >& AC_FD_CC 2>&1
39 eval ${EMACS}' -batch -eval '\''(let ((x '${elisp}')) (write-region (if (stringp x) (princ x) (prin1-to-string x)) nil "'${OUTPUT}'" nil 5))'\' >& AC_FD_CC 2>&1
40 if test -f ${OUTPUT}; then
41 retval=`cat ${OUTPUT}`
42 echo "=> ${retval}" >& AC_FD_CC 2>&1
44 EMACS_cv_SYS_$1=$retval
55 AC_DEFUN([AC_CHECK_EMACS_FLAVOR],
56 [AC_MSG_CHECKING([what flavor does $EMACS have])
59 unset EMACS_cv_SYS_flavor;
62 (cond ((featurep (quote xemacs)) \"XEmacs\")\
63 ((boundp (quote MULE)) \"MULE\")\
66 case $EMACS_cv_SYS_flavor in
74 AC_MSG_RESULT($EMACS_cv_SYS_flavor)])
76 AC_DEFUN([AC_PATH_LISPDIR], [
78 if test "$prefix" = NONE; then
79 AC_MSG_CHECKING([prefix for your Emacs])
80 AC_EMACS_LISP(prefix,(expand-file-name \"..\" invocation-directory),"noecho")
81 prefix=${EMACS_cv_SYS_prefix}
82 AC_MSG_RESULT($prefix)
85 [ --with-lispdir=DIR Where to install lisp files
86 (for XEmacs package, use --with-packagedir instead)],
88 AC_MSG_CHECKING([where lisp files should go])
89 if test -z "$lispdir"; then
92 if test "$theprefix" = NONE; then
93 theprefix=$ac_default_prefix
95 lispdir="\$(datadir)/${EMACS_FLAVOR}/site-lis"
96 for thedir in share lib; do
98 if test -d ${theprefix}/${thedir}/${EMACS_FLAVOR}/site-lisp; then
99 lispdir="\$(prefix)/${thedir}/${EMACS_FLAVOR}/site-lisp"
104 if test ${EMACS_FLAVOR} = xemacs; then
105 AC_MSG_RESULT([$lispdir
106 (it will be ignored when \"make install-package[[-ja]]\" is done)])
108 AC_MSG_RESULT([$lispdir])
114 dnl Perform sanity checking and try to locate the Shimbun package
116 AC_DEFUN([AC_CHECK_SHIMBUN], [
117 AC_MSG_CHECKING(have shimbun)
120 unset EMACS_cv_SYS_shimbun_dir;
122 AC_ARG_WITH(shimbun,[ --with-shimbun[[=ARG]] Use shimbun [[ARG=yes]]],
123 [if test "$withval" = yes -o -z "$withval"; then
126 HAVE_SHIMBUN=$withval
127 fi], HAVE_SHIMBUN=yes)
129 if test "${HAVE_SHIMBUN}" = yes; then
130 AC_EMACS_LISP(shimbun_dir,(file-name-directory (locate-library \"shimbun\")),"noecho")
131 SHIMBUN_DIR=$EMACS_cv_SYS_shimbun_dir
134 if test "${HAVE_SHIMBUN}" != yes; then
136 elif test -z "${SHIMBUN_DIR}"; then
138 AC_MSG_RESULT(not found)
140 AC_MSG_RESULT(${HAVE_SHIMBUN})
145 dnl Perform sanity checking and try to locate the Gnus package
147 AC_DEFUN([AC_CHECK_GNUS], [
148 AC_MSG_CHECKING(have gnus)
151 unset EMACS_cv_SYS_gnus_dir;
153 AC_ARG_WITH(gnus,[ --with-gnus[[=ARG]] Use gnus [[ARG=yes]]],
154 [if test "$withval" = yes -o -z "$withval"; then
160 if test "${HAVE_GNUS}" = yes; then
161 AC_EMACS_LISP(gnus_dir,(file-name-directory (locate-library \"gnus\")),"noecho")
162 GNUS_DIR=$EMACS_cv_SYS_gnus_dir
165 if test "${HAVE_GNUS}" != yes; then
167 elif test -z "${GNUS_DIR}"; then
169 AC_MSG_RESULT(not found)
171 AC_MSG_RESULT(${HAVE_GNUS})
176 dnl Perform sanity checking and try to locate the Wanderlust package
178 AC_DEFUN([AC_CHECK_WL], [
179 AC_MSG_CHECKING(have wanderlust)
182 unset EMACS_cv_SYS_wl_dir;
184 AC_ARG_WITH(wl,[ --with-wl[[=ARG]] Use wanderlust [[ARG=yes]]],
185 [if test "$withval" = yes -o -z "$withval"; then
191 if test "${HAVE_WL}" = yes; then
192 AC_EMACS_LISP(wl_dir,(file-name-directory (locate-library \"wl\")),"noecho")
193 WL_DIR=$EMACS_cv_SYS_wl_dir
196 if test "${HAVE_WL}" != yes; then
198 elif test -z "${WL_DIR}"; then
200 AC_MSG_RESULT(not found)
202 AC_MSG_RESULT(${HAVE_WL})
207 dnl Perform sanity checking and try to locate the Riece package
209 AC_DEFUN([AC_CHECK_RIECE], [
210 AC_MSG_CHECKING(have riece)
213 unset EMACS_cv_SYS_riece_dir;
215 AC_ARG_WITH(riece,[ --with-riece[[=ARG]] Use riece [[ARG=yes]]],
216 [if test "$withval" = yes -o -z "$withval"; then
222 if test "${HAVE_RIECE}" = yes; then
223 AC_EMACS_LISP(riece_dir,(file-name-directory (locate-library \"riece\")),"noecho")
224 RIECE_DIR=$EMACS_cv_SYS_riece_dir
227 if test "${HAVE_RIECE}" != yes; then
229 elif test -z "${RIECE_DIR}"; then
231 AC_MSG_RESULT(not found)
233 AC_MSG_RESULT(${HAVE_RIECE})
237 AC_DEFUN([AC_EXAMINE_PACKAGEDIR],
238 [dnl Examine PACKAGEDIR.
239 AC_EMACS_LISP(PACKAGEDIR,
241 (if (boundp (quote early-packages))\
242 (let ((dirs (delq nil (append (if early-package-load-path\
244 (if late-package-load-path\
246 (if last-package-load-path\
248 (while (and dirs (not package-dir))\
249 (if (file-directory-p (car dirs))\
250 (setq package-dir (car dirs)\
251 dirs (cdr dirs))))))\
252 (or package-dir \"\")),
255 AC_DEFUN([AC_PATH_PACKAGEDIR],
256 [dnl Check for PACKAGEDIR.
257 if test ${EMACS_FLAVOR} = xemacs; then
258 AC_MSG_CHECKING([where the XEmacs package is])
259 AC_ARG_WITH(packagedir,
260 [ --with-packagedir=DIR package DIR for XEmacs],
261 [if test "$withval" != yes -a -n "$withval"; then
264 AC_EXAMINE_PACKAGEDIR
266 AC_EXAMINE_PACKAGEDIR)
267 if test -z "$PACKAGEDIR"; then
268 AC_MSG_RESULT(not found)
270 AC_MSG_RESULT($PACKAGEDIR)
275 AC_SUBST(PACKAGEDIR)])
277 AC_DEFUN([AC_ADD_LOAD_PATH],
278 [dnl Check for additional load path.
280 [ --with-addpath=PATH search Emacs-Lisp libraries with PATH
281 use colons to separate directory names],
282 [if test "$withval" != yes -a -n "$withval"; then
283 AC_MSG_CHECKING([where to find the additional elisp libraries])
284 ADDITIONAL_LOAD_PATH=$withval
285 AC_MSG_RESULT($ADDITIONAL_LOAD_PATH)
287 ADDITIONAL_LOAD_PATH=)
288 AC_SUBST(ADDITIONAL_LOAD_PATH)])
290 AC_DEFUN([AC_EXAMINE_MODULES],
291 [dnl Examine install files.
293 MODULES_MIXI="mixi.el mixi-utils.el mixi-atom.el mixi-ticker.el"
294 MODULES_SHIMBUN="sb-mixi.el"
295 MODULES_GNUS="mixi-gnus.el"
296 MODULES_WL="mixi-wl.el"
297 MODULES_RIECE="riece-mixi.el"
299 MODULES=${MODULES_MIXI}
300 MODULES_ALL="${MODULES} ${MODULES_SHIMBUN} ${MODULES_GNUS} ${MODULES_WL} ${MODULES_RIECE}"
302 if test ${HAVE_SHIMBUN} = yes; then
303 MODULES="${MODULES} ${MODULES_SHIMBUN}"
305 if test ${HAVE_GNUS} = yes; then
306 MODULES="${MODULES} ${MODULES_GNUS}"
308 if test ${HAVE_WL} = yes; then
309 MODULES="${MODULES} ${MODULES_WL}"
311 if test ${HAVE_RIECE} = yes; then
312 MODULES="${MODULES} ${MODULES_RIECE}"
316 AC_SUBST(MODULES_ALL)])