1 AC_DEFUN(AC_DEFINE_GNUS_PRODUCT_NAME,
2 [dnl Defining gnus product name.
5 AC_DEFUN(AC_CHECK_EMACS,
6 [dnl Check for Emacsen.
8 [ --with-emacs=EMACS compile with EMACS [EMACS=emacs, mule...]],
9 [if test x$withval = xyes -o x$withval = xt -o x$withval = x; then
10 AC_CHECK_PROGS(EMACS, emacs xemacs mule, emacs)
12 AC_CHECK_PROG(EMACS, $withval, $withval, emacs)
15 [ --with-xemacs=XEMACS compile with XEMACS [XEMACS=xemacs]],
16 [if test x$withval = xyes -o x$withval = x; then
17 AC_CHECK_PROG(XEMACS, xemacs, xemacs, xemacs)
19 AC_CHECK_PROG(XEMACS, $withval, $withval, xemacs)
23 test x$EMACS = xt -o x$EMACS = x &&\
24 AC_CHECK_PROGS(EMACS, emacs xemacs mule, emacs)])
28 AC_DEFUN(AC_EMACS_LISP, [
31 AC_MSG_CHECKING(for $1)
33 AC_CACHE_VAL(EMACS_cv_SYS_$1,[
35 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
36 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
37 retval=`cat ${OUTPUT}`
38 echo "=> ${retval}" >& AC_FD_CC 2>&1
40 EMACS_cv_SYS_$1=$retval
48 AC_DEFUN(AC_CHECK_EMACS_FLAVOR,
49 [AC_MSG_CHECKING([what a flavor does $EMACS have])
51 (cond ((featurep (quote xemacs)) \"XEmacs\")\
52 ((boundp (quote MULE)) \"MULE\")\
55 case $EMACS_cv_SYS_flavor in
63 AC_MSG_RESULT($EMACS_cv_SYS_flavor)])
65 AC_DEFUN(AC_PATH_LISPDIR, [
67 if test "$prefix" = "NONE"; then
68 AC_MSG_CHECKING([prefix for your Emacs])
69 AC_EMACS_LISP(prefix,(expand-file-name \"..\" invocation-directory),"noecho")
70 prefix=${EMACS_cv_SYS_prefix}
71 AC_MSG_RESULT($prefix)
74 [ --with-lispdir=DIR Where to install lisp files
75 (for XEmacs package, use --with-packagedir instead)],
77 AC_MSG_CHECKING([where lisp files should go])
78 if test -z "$lispdir"; then
81 if test "x$theprefix" = "xNONE"; then
82 theprefix=$ac_default_prefix
84 lispdir="\$(datadir)/${EMACS_FLAVOR}/site-lisp/${GNUS_PRODUCT_NAME}"
85 for thedir in share lib; do
87 if test -d ${theprefix}/${thedir}/${EMACS_FLAVOR}/site-lisp; then
88 lispdir="\$(prefix)/${thedir}/${EMACS_FLAVOR}/site-lisp/${GNUS_PRODUCT_NAME}"
93 AC_MSG_RESULT([$lispdir
94 (it will be ignored when \"make install-package[[-ja]]\" is done)])
99 dnl Check whether a function exists in a library
100 dnl All '_' characters in the first argument are converted to '-'
102 AC_DEFUN(AC_EMACS_CHECK_LIB, [
103 if test -z "$3"; then
104 AC_MSG_CHECKING(for $2 in $1)
106 library=`echo $1 | tr _ -`
107 AC_EMACS_LISP($1,(progn (fmakunbound (quote $2)) (condition-case nil (progn (require (quote $library)) (fboundp (quote $2))) (error (prog1 nil (message \"$library not found\"))))),"noecho")
108 if test "${EMACS_cv_SYS_$1}" = "nil"; then
111 if test "${EMACS_cv_SYS_$1}" = "t"; then
114 HAVE_$1=${EMACS_cv_SYS_$1}
116 if test -z "$3"; then
117 AC_MSG_RESULT($HAVE_$1)
122 dnl Perform sanity checking and try to locate the W3 package
124 AC_DEFUN(AC_CHECK_W3, [
125 AC_MSG_CHECKING(for acceptable W3 version)
126 AC_CACHE_VAL(EMACS_cv_ACCEPTABLE_W3,[
127 AC_EMACS_CHECK_LIB(w3_forms, w3-form-encode-xwfu,"noecho")
128 if test "${HAVE_w3_forms}" = "yes"; then
129 EMACS_cv_ACCEPTABLE_W3=yes
131 EMACS_cv_ACCEPTABLE_W3=no
134 if test "${EMACS_cv_ACCEPTABLE_W3}" = "yes"; then
135 AC_EMACS_LISP(w3_dir,(file-name-directory (locate-library \"w3-forms\")),"noecho")
136 EMACS_cv_ACCEPTABLE_W3=$EMACS_cv_SYS_w3_dir
139 AC_ARG_WITH(w3,[ --with-w3=DIR Specify where to find the w3 package], [ EMACS_cv_ACCEPTABLE_W3=`( cd $withval && pwd || echo "$withval" ) 2> /dev/null` ])
140 W3=${EMACS_cv_ACCEPTABLE_W3}
142 AC_MSG_RESULT("${W3}")
145 AC_DEFUN(AC_PATH_PACKAGEDIR,
146 [dnl Check for PACKAGEDIR.
147 AC_ARG_WITH(packagedir,
148 [ --with-packagedir=DIR package DIR for XEmacs],
149 [if test x$withval != xyes -a x$withval != x; then
150 AC_MSG_CHECKING([where the package should go])
152 AC_MSG_RESULT($PACKAGEDIR)
155 AC_SUBST(PACKAGEDIR)])
157 AC_DEFUN(AC_ADD_LOAD_PATH,
158 [dnl Check for additional load path.
160 [ --with-addpath=PATH search Emacs-Lisp libraries with PATH
161 use colons to separate directory names],
162 [if test x$withval != xyes -a x$withval != x; then
163 AC_MSG_CHECKING([where to find the additional elisp libraries])
164 ADDITIONAL_LOAD_PATH=$withval
165 AC_MSG_RESULT($ADDITIONAL_LOAD_PATH)
167 ADDITIONAL_LOAD_PATH=)
168 AC_SUBST(ADDITIONAL_LOAD_PATH)])