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 dnl Apparently, if you run a shell window in Emacs, it sets the EMACS
9 dnl environment variable to 't'. Lets undo the damage.
10 test x$EMACS = xt && EMACS=
13 [ --with-emacs=EMACS compile with EMACS [EMACS=emacs, mule...]],
14 [if test x$withval = xyes -o x$withval = x; then
15 AC_CHECK_PROGS(EMACS, emacs xemacs mule, emacs)
17 AC_CHECK_PROG(EMACS, $withval, $withval, emacs)
20 [ --with-xemacs=XEMACS compile with XEMACS [XEMACS=xemacs]],
21 [if test x$withval = xyes -o x$withval = x; then
22 AC_CHECK_PROG(XEMACS, xemacs, xemacs, xemacs)
24 AC_CHECK_PROG(XEMACS, $withval, $withval, xemacs)
29 AC_CHECK_PROGS(EMACS, emacs xemacs mule, emacs)])
33 AC_DEFUN(AC_EMACS_LISP, [
36 AC_MSG_CHECKING(for $1)
38 AC_CACHE_VAL(EMACS_cv_SYS_$1,[
40 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
41 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
42 retval=`cat ${OUTPUT}`
43 echo "=> ${retval}" >& AC_FD_CC 2>&1
45 EMACS_cv_SYS_$1=$retval
53 AC_DEFUN(AC_CHECK_EMACS_FLAVOR,
54 [AC_MSG_CHECKING([what a flavor does $EMACS have])
56 (cond ((featurep (quote xemacs)) \"XEmacs\")\
57 ((boundp (quote MULE)) \"MULE\")\
60 case $EMACS_cv_SYS_flavor in
68 AC_MSG_RESULT($EMACS_cv_SYS_flavor)])
70 AC_DEFUN(AC_PATH_LISPDIR, [
72 if test "$prefix" = "NONE"; then
73 AC_MSG_CHECKING([prefix for your Emacs])
74 AC_EMACS_LISP(prefix,(expand-file-name \"..\" invocation-directory),"noecho")
75 prefix=${EMACS_cv_SYS_prefix}
76 AC_MSG_RESULT($prefix)
79 [ --with-lispdir=DIR Where to install lisp files
80 (for XEmacs package, use --with-packagedir instead)],
82 AC_MSG_CHECKING([where lisp files should go])
83 if test -z "$lispdir"; then
86 if test "x$theprefix" = "xNONE"; then
87 theprefix=$ac_default_prefix
89 lispdir="\$(datadir)/${EMACS_FLAVOR}/site-lisp/${GNUS_PRODUCT_NAME}"
90 for thedir in share lib; do
92 if test -d ${theprefix}/${thedir}/${EMACS_FLAVOR}/site-lisp; then
93 lispdir="\$(prefix)/${thedir}/${EMACS_FLAVOR}/site-lisp/${GNUS_PRODUCT_NAME}"
98 AC_MSG_RESULT([$lispdir
99 (it will be ignored when \"make install-package[[-ja]]\" is done)])
104 dnl Check whether a function exists in a library
105 dnl All '_' characters in the first argument are converted to '-'
107 AC_DEFUN(AC_EMACS_CHECK_LIB, [
108 if test -z "$3"; then
109 AC_MSG_CHECKING(for $2 in $1)
111 library=`echo $1 | tr _ -`
112 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")
113 if test "${EMACS_cv_SYS_$1}" = "nil"; then
116 if test "${EMACS_cv_SYS_$1}" = "t"; then
119 HAVE_$1=${EMACS_cv_SYS_$1}
121 if test -z "$3"; then
122 AC_MSG_RESULT($HAVE_$1)
127 dnl Perform sanity checking and try to locate the W3 package
129 AC_DEFUN(AC_CHECK_W3, [
130 AC_MSG_CHECKING(for acceptable W3 version)
131 AC_CACHE_VAL(EMACS_cv_ACCEPTABLE_W3,[
132 AC_EMACS_CHECK_LIB(w3_forms, w3-form-encode-xwfu,"noecho")
133 if test "${HAVE_w3_forms}" = "yes"; then
134 EMACS_cv_ACCEPTABLE_W3=yes
136 EMACS_cv_ACCEPTABLE_W3=no
139 if test "${EMACS_cv_ACCEPTABLE_W3}" = "yes"; then
140 AC_EMACS_LISP(w3_dir,(file-name-directory (locate-library \"w3-forms\")),"noecho")
141 EMACS_cv_ACCEPTABLE_W3=$EMACS_cv_SYS_w3_dir
144 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` ])
145 W3=${EMACS_cv_ACCEPTABLE_W3}
147 AC_MSG_RESULT("${W3}")
150 AC_DEFUN(AC_PATH_PACKAGEDIR,
151 [dnl Check for PACKAGEDIR.
152 AC_ARG_WITH(packagedir,
153 [ --with-packagedir=DIR package DIR for XEmacs],
154 [if test x$withval != xyes -a x$withval != x; then
155 AC_MSG_CHECKING([where the package should go])
157 AC_MSG_RESULT($PACKAGEDIR)
160 AC_SUBST(PACKAGEDIR)])
162 AC_DEFUN(AC_ADD_LOAD_PATH,
163 [dnl Check for additional load path.
165 [ --with-addpath=PATH search Emacs-Lisp libraries with PATH
166 use colons to separate directory names],
167 [if test x$withval != xyes -a x$withval != x; then
168 AC_MSG_CHECKING([where to find the additional elisp libraries])
169 ADDITIONAL_LOAD_PATH=$withval
170 AC_MSG_RESULT($ADDITIONAL_LOAD_PATH)
172 ADDITIONAL_LOAD_PATH=)
173 AC_SUBST(ADDITIONAL_LOAD_PATH)])