(mml2015-epg-verify): Simplified.
[gnus.git] / aclocal.m4
blob356692666f4ba9c649667d8f96a8bdfab24aac56
1 # serial 1
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])
10     dnl Set default value
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"
15       else
16         if test -d $ac_default_prefix/lib/emacs/site-lisp; then
17           lispdir="\$(prefix)/lib/emacs/site-lisp"
18         fi
19       fi
20     else
21       if test -d $prefix/share/emacs/site-lisp; then
22         lispdir="\$(prefix)/share/emacs/site-lisp"
23       else
24         if test -d $prefix/lib/emacs/site-lisp; then
25           lispdir="\$(prefix)/lib/emacs/site-lisp"
26         fi
27       fi
28     fi
29     AC_MSG_RESULT($lispdir)
30   fi
31   AC_SUBST(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, [
38 elisp="$2"
39 if test -z "$3"; then
40         AC_MSG_CHECKING(for $1)
42 AC_CACHE_VAL(EMACS_cv_SYS_$1,[
43         OUTPUT=./conftest-$$
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
48         rm -f ${OUTPUT}
49         EMACS_cv_SYS_$1=$retval
51 $1=${EMACS_cv_SYS_$1}
52 if test -z "$3"; then
53         AC_MSG_RESULT($$1)
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}
61   EMACS_FLAVOR=emacs
62   if test "$XEMACS" = "yes"; then
63      EMACS_FLAVOR=xemacs
64   fi
65   AC_MSG_RESULT($XEMACS)
66   AC_SUBST(XEMACS)
67   AC_SUBST(EMACS_FLAVOR)
70 AC_DEFUN(AC_PATH_LISPDIR, [
71   AC_XEMACS_P
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)
77   fi
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
81     dnl Set default value
82     theprefix=$prefix
83     if test "x$theprefix" = "xNONE"; then
84         theprefix=$ac_default_prefix
85     fi
86     if test "$EMACS_FLAVOR" = "xemacs"; then
87         datadir="\$(prefix)/lib"
88         lispdir="\$(datadir)/${EMACS_FLAVOR}/site-packages/lisp/gnus"
89     else
90     lispdir="\$(datadir)/${EMACS_FLAVOR}/site-lisp/gnus"
91     fi
92     for thedir in share lib; do
93         potential=
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"
97            else
98                lispdir="\$(datadir)/${EMACS_FLAVOR}/site-lisp/gnus"
99            fi
100            break
101         fi
102     done
103   fi
104   AC_MSG_RESULT($lispdir)
105   AC_SUBST(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"
115     else
116       etcdir="\$(lispdir)/../../etc"
117     fi
118   fi
119   AC_MSG_RESULT($etcdir)
120   AC_SUBST(etcdir)
123 dnl 
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"
134     else
135       info_dir="\$(prefix)/info"
136     fi
137   else
138     info_dir=$infodir
139   fi
140   AC_MSG_RESULT($info_dir)
141   AC_SUBST(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"
154     else
155       FLAGS="-batch -q -no-site-file -l \$(srcdir)/dgnushack.el"
156     fi
157   else
158     FLAGS=$FLAGS
159   fi
160   AC_MSG_RESULT($FLAGS)
161   AC_SUBST(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
175         EMACS_cv_SYS_$1=no
177 if test "${EMACS_cv_SYS_$1}" = "t"; then
178         EMACS_cv_SYS_$1=yes
180 HAVE_$1=${EMACS_cv_SYS_$1}
181 AC_SUBST(HAVE_$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
196 else
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}
207    AC_SUBST(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
220 else
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}
231    AC_SUBST(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"])
245 WITH_FONTS_bembo='%'
246 WITHOUT_FONTS_bembo=
247 WITH_FONTS_pfu='%'
248 WITHOUT_FONTS_pfu=
249 WITH_FONTS_bcr='%'
250 WITHOUT_FONTS_bcr=
251 if test -z "${USE_FONTS}"; then
252   if test "${LATEX}" = no; then
253         :
254   else
255     OUTPUT=./conftest-$$
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"
260       else
261         USE_FONTS="${USE_FONTS}, Adobe Bembo"
262       fi
263       WITH_FONTS_bembo=
264       WITHOUT_FONTS_bembo='%'
265     fi
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  
269         :
270       else
271         if test -z "${USE_FONTS}"; then
272           USE_FONTS="Adobe Futura"
273         else
274           USE_FONTS="${USE_FONTS}, Adobe Futura"
275         fi
276         WITH_FONTS_pfu=
277         WITHOUT_FONTS_pfu='%'
278       fi
279     fi
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  
283         :
284       else
285         if test -z "${USE_FONTS}"; then
286           USE_FONTS="Bitstream Courier"
287         else
288           USE_FONTS="${USE_FONTS}, Bitstream Courier"
289         fi
290         WITH_FONTS_bcr=
291         WITHOUT_FONTS_bcr='%'
292       fi
293     fi
294     rm -f ${OUTPUT} ${OUTPUT}.aux ${OUTPUT}.log ${OUTPUT}.dvi
295   fi
296 elif test "${USE_FONTS}" = yes ; then
297   WITH_FONTS_bembo=
298   WITHOUT_FONTS_bembo='%'
299   WITH_FONTS_pfu=
300   WITHOUT_FONTS_pfu='%'
301   WITH_FONTS_bcr=
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
311   USE_FONTS=no
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
318   USE_FONTS=''
319 else
320   USE_FONTS="Set in ${USE_FONTS}."
322 AC_SUBST(USE_FONTS)
325 ifelse(dnl      Do not change this comment
326    arch-tag: 5c987641-c3ef-4f12-b067-028302282c66
327 )dnl