3 AC_DEFUN(AM_PATH_LISPDIR,
4 [# If set to t, that means we are running in a shell under Emacs.
5 # If you have an Emacs named "t", then use the full path.
6 test "$EMACS" = t && EMACS=
7 test "$EMACS" || AC_PATH_PROGS(EMACS, emacs xemacs, no)
8 if test "$EMACS" != "no"; then
9 AC_MSG_CHECKING([where .elc files should go])
11 lispdir="\$(datadir)/emacs/site-lisp"
12 if test "x$prefix" = "xNONE"; then
13 if test -d $ac_default_prefix/share/emacs/site-lisp; then
14 lispdir="\$(prefix)/share/emacs/site-lisp"
16 if test -d $ac_default_prefix/lib/emacs/site-lisp; then
17 lispdir="\$(prefix)/lib/emacs/site-lisp"
21 if test -d $prefix/share/emacs/site-lisp; then
22 lispdir="\$(prefix)/share/emacs/site-lisp"
24 if test -d $prefix/lib/emacs/site-lisp; then
25 lispdir="\$(prefix)/lib/emacs/site-lisp"
29 AC_MSG_RESULT($lispdir)
33 dnl AC_EMACS_LIST AC_XEMACS_P AC_PATH_LISPDIR and AC_EMACS_CHECK_LIB
34 dnl are stolen from w3.
35 dnl AC_PATH_LISPDIR obsoletes AM_PATH_LISPDIR.
37 AC_DEFUN(AC_EMACS_LISP, [
40 AC_MSG_CHECKING(for $1)
42 AC_CACHE_VAL(EMACS_cv_SYS_$1,[
44 echo ${EMACS} -batch -eval "(let ((x ${elisp})) (write-region (if (stringp x) (princ x) (prin1-to-string x)) nil \"${OUTPUT}\"))" >& AC_FD_CC 2>&1
45 ${EMACS} -batch -eval "(let ((x ${elisp})) (write-region (if (stringp x) (princ x 'ignore) (prin1-to-string x)) nil \"${OUTPUT}\"nil 5))" >& AC_FD_CC 2>&1
46 retval=`cat ${OUTPUT}`
47 echo "=> ${retval}" >& AC_FD_CC 2>&1
49 EMACS_cv_SYS_$1=$retval
57 AC_DEFUN(AC_XEMACS_P, [
58 AC_MSG_CHECKING([if $EMACS is really XEmacs])
59 AC_EMACS_LISP(xemacsp,(if (string-match \"XEmacs\" emacs-version) \"yes\" \"no\") ,"noecho")
60 XEMACS=${EMACS_cv_SYS_xemacsp}
62 if test "$XEMACS" = "yes"; then
65 AC_MSG_RESULT($XEMACS)
67 AC_SUBST(EMACS_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)
78 AC_ARG_WITH(lispdir,[ --with-lispdir=DIR Where to install lisp files], lispdir=${withval})
79 AC_MSG_CHECKING([where .elc files should go])
80 if test -z "$lispdir"; then
83 if test "x$theprefix" = "xNONE"; then
84 theprefix=$ac_default_prefix
86 if test "$EMACS_FLAVOR" = "xemacs"; then
87 datadir="\$(prefix)/lib"
88 lispdir="\$(datadir)/${EMACS_FLAVOR}/site-packages/lisp/gnus"
90 lispdir="\$(datadir)/${EMACS_FLAVOR}/site-lisp/gnus"
92 for thedir in share lib; do
94 if test -d ${theprefix}/${thedir}/${EMACS_FLAVOR}/site-lisp; then
95 if test "$EMACS_FLAVOR" = "xemacs"; then
96 lispdir="\$(prefix)/${thedir}/${EMACS_FLAVOR}/site-packages/lisp/gnus"
98 lispdir="\$(datadir)/${EMACS_FLAVOR}/site-lisp/gnus"
104 AC_MSG_RESULT($lispdir)
108 AC_DEFUN(AC_PATH_ETCDIR, [
109 AC_ARG_WITH(etcdir,[ --with-etcdir=DIR Where to install etc files], etcdir=${withval})
110 AC_MSG_CHECKING([where etc files should go])
111 if test -z "$etcdir"; then
112 dnl Set default value.
113 if test "$EMACS_FLAVOR" = "xemacs"; then
114 etcdir="\$(lispdir)/../../etc"
116 etcdir="\$(lispdir)/../../etc"
119 AC_MSG_RESULT($etcdir)
124 dnl This is a bit on the "evil hack" side of things. It is so we can
125 dnl have a different default infodir for XEmacs. A user can still specify
126 dnl someplace else with '--infodir=DIR'.
128 AC_DEFUN(AC_PATH_INFO_DIR, [
129 AC_MSG_CHECKING([where the TeXinfo docs should go])
130 dnl Set default value. This must be an absolute path.
131 if test "$infodir" = "\${prefix}/info"; then
132 if test "$EMACS_FLAVOR" = "xemacs"; then
133 info_dir="\$(prefix)/${thedir}/${EMACS_FLAVOR}/site-packages/info"
135 info_dir="\$(prefix)/info"
140 AC_MSG_RESULT($info_dir)
145 dnl This will set the XEmacs command line options to be slightly different
146 dnl from the Emacs ones. If building with XEmacs the options will be
147 dnl "-batch -no-autoloads..." to give a much cleaner build environment.
149 AC_DEFUN(AC_SET_BUILD_FLAGS, [
150 AC_MSG_CHECKING([which options to pass on to (X)Emacs])
151 if test "x$FLAGS" = "x"; then
152 if test "$EMACS_FLAVOR" = "xemacs"; then
153 FLAGS="-batch -no-autoloads -l \$(srcdir)/dgnushack.el"
155 FLAGS="-batch -q -no-site-file -l \$(srcdir)/dgnushack.el"
160 AC_MSG_RESULT($FLAGS)
165 dnl Check whether a function exists in a library
166 dnl All '_' characters in the first argument are converted to '-'
168 AC_DEFUN(AC_EMACS_CHECK_LIB, [
169 if test -z "$3"; then
170 AC_MSG_CHECKING(for $2 in $1)
172 library=`echo $1 | tr _ -`
173 AC_EMACS_LISP($1,(progn (fmakunbound '$2) (condition-case nil (progn (require '$library) (fboundp '$2)) (error (prog1 nil (message \"$library not found\"))))),"noecho")
174 if test "${EMACS_cv_SYS_$1}" = "nil"; then
177 if test "${EMACS_cv_SYS_$1}" = "t"; then
180 HAVE_$1=${EMACS_cv_SYS_$1}
182 if test -z "$3"; then
183 AC_MSG_RESULT($HAVE_$1)
188 dnl Perform sanity checking and try to locate the W3 package
190 AC_DEFUN(AC_CHECK_W3, [
191 AC_MSG_CHECKING(for acceptable W3 version)
192 AC_CACHE_VAL(EMACS_cv_ACCEPTABLE_W3,[
193 AC_EMACS_CHECK_LIB(w3_forms, w3-form-encode-xwfu,"noecho")
194 if test "${HAVE_w3_forms}" = "yes"; then
195 EMACS_cv_ACCEPTABLE_W3=yes
197 EMACS_cv_ACCEPTABLE_W3=no
200 if test "${EMACS_cv_ACCEPTABLE_W3}" = "yes"; then
201 AC_EMACS_LISP(w3_dir,(file-name-directory (locate-library \"w3-forms\")),"noecho")
202 EMACS_cv_ACCEPTABLE_W3=$EMACS_cv_SYS_w3_dir
205 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` ])
206 W3=${EMACS_cv_ACCEPTABLE_W3}
208 AC_MSG_RESULT("${W3}")
212 dnl Perform sanity checking and try to locate the W3 package
214 AC_DEFUN(AC_CHECK_URL, [
215 AC_MSG_CHECKING(for acceptable URL version)
216 AC_CACHE_VAL(EMACS_cv_ACCEPTABLE_URL,[
217 AC_EMACS_CHECK_LIB(url, url-retrieve, "noecho")
218 if test "${HAVE_url}" = "yes"; then
219 EMACS_cv_ACCEPTABLE_URL=yes
221 EMACS_cv_ACCEPTABLE_URL=no
224 if test "${EMACS_cv_ACCEPTABLE_URL}" = "yes"; then
225 AC_EMACS_LISP(url_dir,(file-name-directory (locate-library \"url\")),"noecho")
226 EMACS_cv_ACCEPTABLE_URL=$EMACS_cv_SYS_url_dir
229 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` ])
230 URL=${EMACS_cv_ACCEPTABLE_URL}
232 AC_MSG_RESULT("${URL}")
236 dnl Perform checking available fonts: Adobe Bembo, Adobe Futura and
237 dnl Bitstream Courier.
240 AC_DEFUN(GNUS_CHECK_FONTS, [
241 test "$LATEX" = t && LATEX=
242 test "$LATEX" || AC_PATH_PROGS(LATEX, latex, no)
243 AC_MSG_CHECKING(for available fonts)
244 AC_ARG_WITH(fonts,[ --with-fonts Assume all fonts required are available],[USE_FONTS="$withval"])
251 if test -z "${USE_FONTS}"; then
252 if test "${LATEX}" = no; then
256 echo '\nonstopmode\documentclass{article}\usepackage{bembo}\begin{document}\end{document}' > ${OUTPUT}
257 if ${LATEX} ${OUTPUT} </dev/null >& AC_FD_CC 2>&1 ; then
258 if test -z "${USE_FONTS}"; then
259 USE_FONTS="Adobe Bembo"
261 USE_FONTS="${USE_FONTS}, Adobe Bembo"
264 WITHOUT_FONTS_bembo='%'
266 echo '\nonstopmode\documentclass{article}\begin{document}{\fontfamily{pfu}\fontsize{10pt}{10}\selectfont test}\end{document}' > ${OUTPUT}
267 if retval=`${LATEX} ${OUTPUT} </dev/null 2>& AC_FD_CC`; then
268 if echo "$retval" | grep 'Some font shapes were not available' >& AC_FD_CC 2>&1 ; then
271 if test -z "${USE_FONTS}"; then
272 USE_FONTS="Adobe Futura"
274 USE_FONTS="${USE_FONTS}, Adobe Futura"
277 WITHOUT_FONTS_pfu='%'
280 echo '\nonstopmode\documentclass{article}\begin{document}{\fontfamily{bcr}\fontsize{10pt}{10}\selectfont test}\end{document}' > ${OUTPUT}
281 if retval=`${LATEX} ${OUTPUT} </dev/null 2>& AC_FD_CC`; then
282 if echo "$retval" | grep 'Some font shapes were not available' >& AC_FD_CC 2>&1 ; then
285 if test -z "${USE_FONTS}"; then
286 USE_FONTS="Bitstream Courier"
288 USE_FONTS="${USE_FONTS}, Bitstream Courier"
291 WITHOUT_FONTS_bcr='%'
294 rm -f ${OUTPUT} ${OUTPUT}.aux ${OUTPUT}.log ${OUTPUT}.dvi
296 elif test "${USE_FONTS}" = yes ; then
298 WITHOUT_FONTS_bembo='%'
300 WITHOUT_FONTS_pfu='%'
302 WITHOUT_FONTS_bcr='%'
304 AC_SUBST(WITH_FONTS_bembo)
305 AC_SUBST(WITHOUT_FONTS_bembo)
306 AC_SUBST(WITH_FONTS_pfu)
307 AC_SUBST(WITHOUT_FONTS_pfu)
308 AC_SUBST(WITH_FONTS_bcr)
309 AC_SUBST(WITHOUT_FONTS_bcr)
310 if test -z "${USE_FONTS}" ; then
313 USE_FONTS=`echo "${USE_FONTS}" | sed 's/,\([[^,]]*\)$/ and\1/'`
314 AC_MSG_RESULT("${USE_FONTS}")
315 if test "${USE_FONTS}" = yes ; then
316 USE_FONTS='Set in Adobe Bembo, Adobe Futura and Bitstream Courier.'
317 elif test "${USE_FONTS}" = no ; then
320 USE_FONTS="Set in ${USE_FONTS}."
325 ifelse(dnl Do not change this comment
326 arch-tag: 5c987641-c3ef-4f12-b067-028302282c66