1 AC_DEFUN(AC_DEFINE_GNUS_PRODUCT_NAME,
2 [echo $ac_n "defining gnus product name... $ac_c"
3 AC_CACHE_VAL(EMACS_cv_GNUS_PRODUCT_NAME,[EMACS_cv_GNUS_PRODUCT_NAME=$1])
4 GNUS_PRODUCT_NAME=${EMACS_cv_GNUS_PRODUCT_NAME}
5 AC_MSG_RESULT(${GNUS_PRODUCT_NAME})
6 AC_SUBST(GNUS_PRODUCT_NAME)])
8 AC_DEFUN(AC_CHECK_EMACS,
9 [dnl Check for Emacsen.
11 dnl Apparently, if you run a shell window in Emacs, it sets the EMACS
12 dnl environment variable to 't'. Lets undo the damage.
13 test "$EMACS" = t && EMACS=
16 unset ac_cv_prog_EMACS; unset ac_cv_prog_XEMACS;
19 [ --with-emacs=EMACS compile with EMACS [EMACS=emacs, mule...]],
20 [if test "$withval" = yes -o -z "$withval"; then
21 AC_CHECK_PROGS(EMACS, emacs xemacs mule, emacs)
23 AC_CHECK_PROG(EMACS, $withval, $withval, emacs)
26 [ --with-xemacs=XEMACS compile with XEMACS [XEMACS=xemacs]],
27 [if test "$withval" = yes -o -z "$withval"; then
28 AC_CHECK_PROG(XEMACS, xemacs, xemacs, xemacs)
30 AC_CHECK_PROG(XEMACS, $withval, $withval, xemacs)
34 test -z "$EMACS" && AC_CHECK_PROGS(EMACS, emacs xemacs mule, emacs)])
38 AC_DEFUN(AC_EMACS_LISP, [
41 AC_MSG_CHECKING(for $1)
43 AC_CACHE_VAL(EMACS_cv_SYS_$1,[
45 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
46 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
47 retval=`cat ${OUTPUT}`
48 echo "=> ${retval}" >& AC_FD_CC 2>&1
50 EMACS_cv_SYS_$1=$retval
58 AC_DEFUN(AC_CHECK_EMACS_FLAVOR,
59 [AC_MSG_CHECKING([what a flavor does $EMACS have])
62 unset EMACS_cv_SYS_flavor;
65 (cond ((featurep (quote xemacs)) \"XEmacs\")\
66 ((boundp (quote MULE)) \"MULE\")\
69 case $EMACS_cv_SYS_flavor in
77 AC_MSG_RESULT($EMACS_cv_SYS_flavor)])
79 AC_DEFUN(AC_PATH_LISPDIR, [
81 if test "$prefix" = NONE; then
82 AC_MSG_CHECKING([prefix for your Emacs])
83 AC_EMACS_LISP(prefix,(expand-file-name \"..\" invocation-directory),"noecho")
84 prefix=${EMACS_cv_SYS_prefix}
85 AC_MSG_RESULT($prefix)
88 [ --with-lispdir=DIR Where to install lisp files
89 (for XEmacs package, use --with-packagedir instead)],
91 AC_MSG_CHECKING([where lisp files should go])
92 if test -z "$lispdir"; then
95 if test "$theprefix" = NONE; then
96 theprefix=$ac_default_prefix
98 if test "$EMACS_FLAVOR" = "xemacs"; then
99 lispdir="\$(datadir)/${EMACS_FLAVOR}/site-packages/lisp/${GNUS_PRODUCT_NAME}"
101 lispdir="\$(datadir)/${EMACS_FLAVOR}/site-lisp/${GNUS_PRODUCT_NAME}"
103 for thedir in share lib; do
105 if test -d ${theprefix}/${thedir}/${EMACS_FLAVOR}/site-lisp; then
106 if test "$EMACS_FLAVOR" = "xemacs"; then
107 lispdir="\$(prefix)/${thedir}/${EMACS_FLAVOR}/site-packages/lisp/${GNUS_PRODUCT_NAME}"
109 lispdir="\$(prefix)/${thedir}/${EMACS_FLAVOR}/site-lisp/${GNUS_PRODUCT_NAME}"
115 if test ${EMACS_FLAVOR} = xemacs; then
116 AC_MSG_RESULT([$lispdir
117 (it will be ignored when \"make install-package[[-ja]]\" is done)])
119 AC_MSG_RESULT([$lispdir])
124 AC_DEFUN(AC_PATH_ETCDIR, [
125 AC_ARG_WITH(etcdir,[ --with-etcdir=DIR Where to install etc files], etcdir=${withval})
126 AC_MSG_CHECKING([where etc files should go])
127 if test -z "$etcdir"; then
128 dnl Set default value.
129 if test "$EMACS_FLAVOR" = "xemacs"; then
130 etcdir="\$(lispdir)/../../etc"
132 etcdir="\$(lispdir)/../etc"
135 AC_MSG_RESULT($etcdir)
140 dnl This is a bit on the "evil hack" side of things. It is so we can
141 dnl have a different default infodir for XEmacs. A user can still specify
142 dnl someplace else with '--infodir=DIR'.
144 AC_DEFUN(AC_PATH_INFO_DIR, [
145 AC_MSG_CHECKING([where the TeXinfo docs should go])
146 dnl Set default value. This must be an absolute path.
147 if test "$infodir" = "\${prefix}/info"; then
148 if test "$EMACS_FLAVOR" = "xemacs"; then
149 info_dir="\$(prefix)/${thedir}/${EMACS_FLAVOR}/site-packages/info"
151 info_dir="\$(prefix)/info"
156 AC_MSG_RESULT($info_dir)
161 dnl Check whether a function exists in a library
162 dnl All '_' characters in the first argument are converted to '-'
164 AC_DEFUN(AC_EMACS_CHECK_LIB, [
165 if test -z "$3"; then
166 AC_MSG_CHECKING(for $2 in $1)
168 library=`echo $1 | tr _ -`
169 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")
170 if test "${EMACS_cv_SYS_$1}" = nil; then
173 if test "${EMACS_cv_SYS_$1}" = t; then
176 HAVE_$1=${EMACS_cv_SYS_$1}
178 if test -z "$3"; then
179 AC_MSG_RESULT($HAVE_$1)
184 dnl Perform sanity checking and try to locate the W3 package
186 AC_DEFUN(AC_CHECK_W3, [
187 AC_MSG_CHECKING(for acceptable W3 version)
190 unset EMACS_cv_ACCEPTABLE_W3;
191 unset EMACS_cv_SYS_w3_dir;
192 unset EMACS_cv_SYS_w3_forms;
194 AC_CACHE_VAL(EMACS_cv_ACCEPTABLE_W3,[
195 AC_EMACS_CHECK_LIB(w3_forms, w3-form-encode-xwfu,"noecho")
196 if test "${HAVE_w3_forms}" = yes; then
197 EMACS_cv_ACCEPTABLE_W3=yes
199 EMACS_cv_ACCEPTABLE_W3=
202 if test "${EMACS_cv_ACCEPTABLE_W3}" = yes; then
203 AC_EMACS_LISP(w3_dir,(file-name-directory (locate-library \"w3-forms\")),"noecho")
204 EMACS_cv_ACCEPTABLE_W3=$EMACS_cv_SYS_w3_dir
207 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` ])
208 W3=${EMACS_cv_ACCEPTABLE_W3}
210 if test -z "${EMACS_cv_ACCEPTABLE_W3}"; then
211 AC_MSG_RESULT(not found)
218 dnl Perform sanity checking and try to locate the W3 package
220 AC_DEFUN(AC_CHECK_URL, [
221 AC_MSG_CHECKING(for acceptable URL version)
224 unset EMACS_cv_ACCEPTABLE_URL;
225 unset EMACS_cv_SYS_url_dir;
226 unset EMACS_cv_SYS_url;
228 AC_CACHE_VAL(EMACS_cv_ACCEPTABLE_URL,[
229 AC_EMACS_CHECK_LIB(url, url-retrieve, "noecho")
230 if test "${HAVE_url}" = yes; then
231 EMACS_cv_ACCEPTABLE_URL=yes
233 EMACS_cv_ACCEPTABLE_URL=
236 if test "${EMACS_cv_ACCEPTABLE_URL}" = yes; then
237 AC_EMACS_LISP(url_dir,(file-name-directory (locate-library \"url\")),"noecho")
238 EMACS_cv_ACCEPTABLE_URL=$EMACS_cv_SYS_url_dir
241 AC_ARG_WITH(url,[ --with-url=DIR Specify where to find the url package], [ EMACS_cv_ACCEPTABLE_URL=`( cd $withval && pwd || echo "$withval" ) 2> /dev/null` ])
242 URL=${EMACS_cv_ACCEPTABLE_URL}
244 if test -z "${EMACS_cv_ACCEPTABLE_URL}"; then
245 AC_MSG_RESULT(not found)
247 AC_MSG_RESULT("${URL}")
252 dnl Perform checking available fonts: Adobe Bembo, Adobe Futura and
253 dnl Bitstream Courier.
256 AC_DEFUN(GNUS_CHECK_FONTS, [
257 test "$LATEX" = t && LATEX=
258 test "$LATEX" || AC_PATH_PROGS(LATEX, latex, no)
259 AC_MSG_CHECKING(for available fonts)
260 AC_ARG_WITH(fonts,[ --with-fonts Assume all fonts required are available],[USE_FONTS="$withval"])
267 if test -z "${USE_FONTS}"; then
268 if test "${LATEX}" = no; then
272 echo '\nonstopmode\documentclass{article}\usepackage{bembo}\begin{document}\end{document}' > ${OUTPUT}
273 if ${LATEX} ${OUTPUT} </dev/null >& AC_FD_CC 2>&1 ; then
274 if test -z "${USE_FONTS}"; then
275 USE_FONTS="Adobe Bembo"
277 USE_FONTS="${USE_FONTS}, Adobe Bembo"
280 WITHOUT_FONTS_bembo='%'
282 echo '\nonstopmode\documentclass{article}\begin{document}{\fontfamily{pfu}\fontsize{10pt}{10}\selectfont test}\end{document}' > ${OUTPUT}
283 if retval=`${LATEX} ${OUTPUT} </dev/null 2>& AC_FD_CC`; then
284 if echo "$retval" | grep 'Some font shapes were not available' >& AC_FD_CC 2>&1 ; then
287 if test -z "${USE_FONTS}"; then
288 USE_FONTS="Adobe Futura"
290 USE_FONTS="${USE_FONTS}, Adobe Futura"
293 WITHOUT_FONTS_pfu='%'
296 echo '\nonstopmode\documentclass{article}\begin{document}{\fontfamily{bcr}\fontsize{10pt}{10}\selectfont test}\end{document}' > ${OUTPUT}
297 if retval=`${LATEX} ${OUTPUT} </dev/null 2>& AC_FD_CC`; then
298 if echo "$retval" | grep 'Some font shapes were not available' >& AC_FD_CC 2>&1 ; then
301 if test -z "${USE_FONTS}"; then
302 USE_FONTS="Bitstream Courier"
304 USE_FONTS="${USE_FONTS}, Bitstream Courier"
307 WITHOUT_FONTS_bcr='%'
310 rm -f ${OUTPUT} ${OUTPUT}.aux ${OUTPUT}.log ${OUTPUT}.dvi
312 elif test "${USE_FONTS}" = yes ; then
314 WITHOUT_FONTS_bembo='%'
316 WITHOUT_FONTS_pfu='%'
318 WITHOUT_FONTS_bcr='%'
320 AC_SUBST(WITH_FONTS_bembo)
321 AC_SUBST(WITHOUT_FONTS_bembo)
322 AC_SUBST(WITH_FONTS_pfu)
323 AC_SUBST(WITHOUT_FONTS_pfu)
324 AC_SUBST(WITH_FONTS_bcr)
325 AC_SUBST(WITHOUT_FONTS_bcr)
326 if test -z "${USE_FONTS}" ; then
329 USE_FONTS=`echo "${USE_FONTS}" | sed 's/,\([[^,]]*\)$/ and\1/'`
330 AC_MSG_RESULT("${USE_FONTS}")
331 if test "${USE_FONTS}" = yes ; then
332 USE_FONTS='Set in Adobe Bembo, Adobe Futura and Bitstream Courier.'
333 elif test "${USE_FONTS}" = no ; then
336 USE_FONTS="Set in ${USE_FONTS}."
341 AC_DEFUN(AC_EXAMINE_PACKAGEDIR,
342 [dnl Examine PACKAGEDIR.
343 AC_EMACS_LISP(PACKAGEDIR,
345 (if (boundp (quote early-packages))\
346 (let ((dirs (delq nil (append (if early-package-load-path\
348 (if late-package-load-path\
350 (if last-package-load-path\
352 (while (and dirs (not package-dir))\
353 (if (file-directory-p (car dirs))\
354 (setq package-dir (car dirs)\
355 dirs (cdr dirs))))))\
356 (or package-dir \"\")),
359 AC_DEFUN(AC_PATH_PACKAGEDIR,
360 [dnl Check for PACKAGEDIR.
361 if test ${EMACS_FLAVOR} = xemacs; then
362 AC_MSG_CHECKING([where the XEmacs package is])
363 AC_ARG_WITH(packagedir,
364 [ --with-packagedir=DIR package DIR for XEmacs],
365 [if test "$withval" != yes -a -n "$withval"; then
368 AC_EXAMINE_PACKAGEDIR
370 AC_EXAMINE_PACKAGEDIR)
371 if test -z "$PACKAGEDIR"; then
372 AC_MSG_RESULT(not found)
374 AC_MSG_RESULT($PACKAGEDIR)
379 AC_SUBST(PACKAGEDIR)])
381 AC_DEFUN(AC_ADD_LOAD_PATH,
382 [dnl Check for additional load path.
384 [ --with-addpath=PATH search Emacs-Lisp libraries with PATH
385 use colons to separate directory names],
386 [if test "$withval" != yes -a -n "$withval"; then
387 AC_MSG_CHECKING([where to find the additional elisp libraries])
388 ADDITIONAL_LOAD_PATH=$withval
389 AC_MSG_RESULT($ADDITIONAL_LOAD_PATH)
391 ADDITIONAL_LOAD_PATH=)
392 AC_SUBST(ADDITIONAL_LOAD_PATH)])