]> git.donarmstrong.com Git - lilypond.git/blob - aclocal.m4
release: 1.2.5
[lilypond.git] / aclocal.m4
1 dnl WARNING WARNING WARNING WARNING
2 dnl do not edit! this is aclocal.m4, generated from stepmake/aclocal.m4
3 dnl WARNING WARNING WARNING WARNING
4 dnl do not edit! this is aclocal.m4, generated from stepmake/aclocal.m4
5 dnl WARNING WARNING WARNING WARNING
6 dnl do not edit! this is aclocal.m4, generated from stepmake/aclocal.m4
7 dnl aclocal.m4   -*-shell-script-*-
8 dnl StepMake subroutines for configure.in
9
10 AC_DEFUN(AC_STEPMAKE_COMPILE, [
11     # -O is necessary to get inlining
12     OPTIMIZE=""
13     CXXFLAGS=${CXXFLAGS:-""}
14     CFLAGS=${CFLAGS:-""}
15     checking_b=yes
16     optimise_b=no
17     profile_b=no
18     debug_b=yes
19
20     AC_ARG_ENABLE(checking,
21     [  enable-checking         set runtime checks (assert calls). Default: on],
22     [checking_b=$enableval] )
23
24     # actually, the default is: tja='-O' to get inlining...
25     # off=''  --jcn
26
27     #actually, that sucks.
28     #  tja looks like a typo.  Default is optimisation off. --hwn
29     
30     AC_ARG_ENABLE(optimise,
31     [  enable-optimise         use maximal speed optimisations. Default: off],
32     [optimise_b=$enableval])
33     
34     AC_ARG_ENABLE(profiling, 
35     [  enable-profiling        compile with gprof support. Default: off],
36     [profile_b=$enableval])
37     
38     AC_ARG_ENABLE(debugging,
39     [  enable-debugging        set debug info. Default: on],
40     [debug_b=$enableval])
41
42     AC_ARG_ENABLE(mingw-prefix,
43     [  enable-mingw-prefix=DIR set the mingw32 directory (standalone windows32 exes)],
44     [MINGWPREFIX=$enableval],
45     [MINGWPREFIX=no])
46
47     if test "$printing_b" = no; then
48         # ugh
49         AC_DEFINE(NPRINT)
50         DEFINES="$DEFINES -DNPRINT"
51     fi
52         
53     if test "$checking_b" = no; then
54         # ugh
55         AC_DEFINE(NDEBUG)
56         DEFINES="$DEFINES -DNDEBUG"
57     fi
58
59     if test "$optimise_b" = yes; then
60         OPTIMIZE="-O2 -finline-functions"
61     fi
62
63     if test "$optimise_b" = no; then
64         OPTIMIZE=""
65     fi
66
67     if test $profile_b = yes; then
68         EXTRA_LIBES="-pg"
69         OPTIMIZE="$OPTIMIZE -pg"
70     fi
71
72     if test $debug_b = yes; then        
73         OPTIMIZE="$OPTIMIZE -g"
74     fi
75
76     # however, C++ support in mingw32 v 0.1.4 is still flaky
77     if test x$MINGWPREFIX != xno; then 
78         ICFLAGS="-I$MINGWPREFIX/include"
79         ILDFLAGS="-$MINGWPREFIX/lib"
80     fi
81
82     AC_PROG_CC
83     LD='$(CC)'
84     AC_SUBST(LD)
85
86     CFLAGS="$CFLAGS $OPTIMIZE"
87     CPPFLAGS=${CPPFLAGS:-""}
88     AC_SUBST(CFLAGS)
89     AC_SUBST(CPPFLAGS)
90     AC_SUBST(LDFLAGS)
91     AC_SUBST(ICFLAGS)
92     AC_SUBST(ILDFLAGS)
93     AC_SUBST(DEFINES)
94     AC_SUBST(EXTRA_LIBES)
95 ])
96
97 AC_DEFUN(AC_STEPMAKE_CXX, [
98     AC_LANG_CPLUSPLUS
99     AC_PROG_CXX
100
101     AC_CHECK_HEADER(FlexLexer.h, true,
102         AC_STEPMAKE_WARN(can"\'"t find flex header. Please install Flex headers correctly))
103
104     CPPFLAGS="$CPPFLAGS $DEFINES"
105     CXXFLAGS="$CXXFLAGS $OPTIMIZE"
106     LDFLAGS=$EXTRA_LIBES
107
108     AC_SUBST(CXXFLAGS)
109     AC_SUBST(CXX)
110     LD='$(CXX)'
111     AC_SUBST(LD)
112 ])
113
114 AC_DEFUN(AC_STEPMAKE_CXXTEMPLATE, [
115     AC_CACHE_CHECK([whether explicit instantiation is needed],
116         lily_cv_need_explicit_instantiation,
117         AC_TRY_LINK([
118     template <class T> struct foo { static int baz; };
119     template <class T> int foo<T>::baz = 1;
120     ], [ return foo<int>::baz; ],
121             lily_cv_need_explicit_instantiation=no,
122             lily_cv_need_explicit_instantiation=yes))
123     if test x"$lily_cv_need_explicit_instantiation"x = x"yes"x; then
124         AC_DEFINE(NEED_EXPLICIT_INSTANTIATION)
125     fi
126 ])
127
128 AC_DEFUN(AC_STEPMAKE_DATADIR, [
129     if test "$datadir" = "\${prefix}/share"; then
130             datadir='${prefix}/share/'$package
131     fi
132     DIR_DATADIR=${datadir}
133     presome=${prefix}
134     if test "$prefix" = "NONE"; then
135             presome=${ac_default_prefix}
136     fi
137     DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
138     AC_SUBST(datadir)
139     AC_SUBST(DIR_DATADIR)
140     AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
141 ])
142
143 AC_DEFUN(AC_STEPMAKE_END, [
144     AC_OUTPUT($CONFIGFILE.make:config.make.in)
145
146     rm -f GNUmakefile
147     cp make/toplevel.make.in ./GNUmakefile
148     chmod 444 GNUmakefile
149 ])
150
151 AC_DEFUN(AC_STEPMAKE_GXX, [
152     # ugh autoconf
153     # urg, egcs: how to check for egcs >= 1.1?
154     changequote(<<, >>)dnl
155     if $CXX --version | egrep '2\.[89]' > /dev/null ||
156         $CXX --version | grep 'egcs' > /dev/null
157     changequote([, ])dnl
158     then
159             true
160     else
161             AC_STEPMAKE_WARN(can\'t find g++ 2.8 or egcs 1.1)
162     fi
163 ])
164
165 AC_DEFUN(AC_STEPMAKE_GUILE, [
166     GUILE_FLAGS
167     if guile-config --version 2>&1 | grep -q 'version 1\.[012]'; then
168        AC_STEPMAKE_WARN(Guile version 1.3 or better needed)
169     fi
170 ])
171
172 AC_DEFUN(AC_STEPMAKE_INIT, [
173
174     . $srcdir/VERSION
175     FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
176     if test x$MY_PATCH_LEVEL != x; then
177         FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
178     fi
179
180     # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
181     changequote(<<, >>)dnl
182     PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
183     package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
184     changequote([, ])dnl
185
186     # No versioning on directory names of sub-packages 
187     # urg, urg
188     stepmake=${datadir}/stepmake
189     presome=${prefix}
190     if test "$prefix" = "NONE"; then
191             presome=${ac_default_prefix}
192     fi
193     stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
194
195     AC_MSG_CHECKING(Package)
196     if test "x$PACKAGE" = "xSTEPMAKE"; then
197         AC_MSG_RESULT(Stepmake package!)
198         (cd stepmake; rm -f stepmake; ln -s ../stepmake .)
199         (cd stepmake; rm -f bin; ln -s ../bin .)
200         AC_CONFIG_AUX_DIR(bin)
201         stepmake=stepmake
202     else
203         AC_MSG_RESULT($PACKAGE)
204         AC_MSG_CHECKING(for stepmake)
205         # Check for installed stepmake
206         if test -d $stepmake; then
207             AC_MSG_RESULT($stepmake)
208         else
209             stepmake='$(depth)'/stepmake
210             AC_MSG_RESULT(./stepmake  ($datadir/stepmake not found))
211         fi
212         AC_CONFIG_AUX_DIR(\
213           $HOME/usr/local/share/stepmake/bin\
214           $HOME/usr/local/lib/stepmake/bin\
215           $HOME/usr/share/stepmake/bin\
216           $HOME/usr/lib/stepmake/bin\
217           /usr/local/share/stepmake/bin\
218           /usr/local/lib/stepmake/bin\
219           /usr/share/stepmake/bin\
220           /usr/lib/stepmake/bin\
221           stepmake/bin\
222         )
223     fi
224
225     AC_SUBST(stepmake)
226     AC_SUBST(package)
227     AC_SUBST(PACKAGE)
228     AC_SUBST(PACKAGE_NAME)
229     AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
230     AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
231
232     if test "$package_depth" = "" ; then
233         package_depth="."
234     else
235         package_depth="../$package_depth"
236     fi
237     export package_depth
238     AC_SUBST(package_depth)
239
240     AUTOGENERATE="This file was automatically generated by configure"
241     AC_SUBST(AUTOGENERATE)
242     absolute_builddir="`pwd`"
243     AC_SUBST(absolute_builddir)
244
245     STATE_VECTOR=`ls make/STATE-VECTOR 2>/dev/null`
246     if test "x$STATE_VECTOR" != "x"; then
247         STATE_VECTOR="\$(depth)/$STATE_VECTOR"
248     fi
249     AC_SUBST(STATE_VECTOR)
250
251     CONFIGSUFFIX=
252     AC_ARG_ENABLE(config,
253     [  enable-config=FILE      put configure settings in config-FILE.make],
254     [CONFIGSUFFIX=$enableval])
255
256     if test "$CONFIGSUFFIX" != "" ; then
257         CONFIGFILE=config-$CONFIGSUFFIX
258     else
259         CONFIGFILE=config
260     fi
261     AC_SUBST(CONFIGSUFFIX)
262      
263     AC_CANONICAL_HOST
264     AC_CHECK_PROGS(MAKE, gmake make, error)
265     AC_CHECK_PROGS(FIND, find, error)
266
267 dnl system supplied INSTALL is unsafe; use our own install.
268 dnl    AC_PROG_INSTALL
269 dnl    if test "$INSTALL" = "bin/install-sh"; then
270 dnl     export INSTALL="\$\(depth\)/bin/install-sh"
271 dnl    fi
272
273     AC_CHECK_PROGS(TAR, tar, error)
274
275     if test "x`uname`" = "xHP-UX"; then
276         AC_PATH_PROG(BASH, bash, /bin/sh)
277         AC_STEPMAKE_WARN(avoiding buggy /bin/sh)
278         AC_PATH_PROG(SHELL, bash, /bin/ksh)
279     else
280         AC_PATH_PROG(BASH, bash, /bin/sh)
281         SHELL=/bin/sh
282         AC_SUBST(SHELL)
283     fi
284
285
286     AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
287     AC_SUBST(PYTHON)
288
289     if test $MAKE != "error" ; then
290         $MAKE -v 2> /dev/null | grep GNU > /dev/null
291         if test "$?" = 1
292         then
293                 AC_STEPMAKE_WARN(Please install *GNU* make) 
294         fi
295     fi 
296
297     AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
298
299     if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
300         LN=cp # hard link does not work under cygnus-nt
301         LN_S='cp -r' # symbolic link does not work for native nt
302         ZIP="zip -r -9" #
303         DOTEXE=.exe
304         # urg
305         # DIRSEP='\\'
306         # PATHSEP=';'
307         #
308         # cygwin fixes all these things.  
309         # it seems these were used because of dos-style TEXINPUTS and
310         # MFINPUTS needed for miktex.
311         # but this breaks parsing of all other cygwin/unix style paths.
312         #
313         # if your (mik)tex breaks, make a:
314         #    /usr/local/bin/tex:
315         #    #!/bin/sh
316         #    TEXINPUTS=`cygpath -pw $TEXINPUTS` /texmf/miktex/bin/tex $*
317         #
318         # and
319         #
320         #    /usr/local/bin/mf:
321         #    #!/bin/sh
322         #    MFINPUTS=`cygpath -pw $MFINPUTS` /texmf/miktex/bin/mf $*
323         #
324         # this way, you may have buildscripts/out/lilypond-profile 
325         # 'automatically' sourced from /usr/etc/profile.d/ too.
326         #
327         DIRSEP='/'
328         PATHSEP=':'
329         INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
330     else
331         DIRSEP='/'
332         PATHSEP=':'
333         LN=ln
334         LN_S='ln -s'
335         ZIP="zip -r -9"
336         INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
337     fi
338     AC_SUBST(DOTEXE)
339     AC_SUBST(ZIP)
340     AC_SUBST(LN)
341     AC_SUBST(LN_S)
342     AC_SUBST(INSTALL)
343     AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
344     AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
345     AC_SUBST(PATHSEP)
346     AC_SUBST(DIRSEP)
347   
348    
349     AC_STEPMAKE_DATADIR
350 ])
351
352 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
353     # ugh, automake: we want (and check for) bison
354     AC_PROG_YACC
355     # ugh, automake: we want (and check for) flex
356     # AC_PROG_LEX
357     # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
358
359     # AC_DECL_YYTEXT
360     # ugh, ugh
361     ac_cv_prog_lex_root=lex.yy
362
363     AC_CHECK_PROGS(BISON, bison, error)
364     AC_CHECK_PROGS(FLEX, flex, error)
365     AC_CHECK_SEARCH_RESULT($BISON, bison,  Please install Bison, 1.25 or newer)
366     AC_CHECK_SEARCH_RESULT($FLEX,  flex, Please install Flex, 2.5 or newer)
367
368     if test $BISON != "error"; then
369         bison_version=`$BISON --version | sed 's/^.*version 1.//g'`
370         if test `echo $bison_version | sed 's/\..*$//g'` -lt 25; then
371             AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
372         fi      
373     fi
374
375     AC_SUBST(BISON)
376     AC_SUBST(FLEX)
377 ])
378
379 AC_DEFUN(AC_STEPMAKE_LIB, [
380     AC_CHECK_PROGS(AR, ar, error)
381     AC_PROG_RANLIB
382
383     AC_SUBST(AR)
384     AC_SUBST(RANLIB)
385 ])
386
387 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
388     # libtool.info ...
389     # **Never** try to set library version numbers so that they correspond
390     # to the release number of your package.  This is an abuse that only
391     # fosters misunderstanding of the purpose of library versions.
392
393     REVISION=$PATCH_LEVEL
394     # CURRENT=$MINOR_VERSION
395     CURRENT=`expr $MINOR_VERSION + 1`
396     # AGE=$(expr $MAJOR_VERSION + 1)
397     AGE=$MAJOR_VERSION
398     AC_SUBST(CURRENT)
399     AC_SUBST(REVISION)
400     AC_SUBST(AGE)
401 ])
402
403 AC_DEFUN(AC_STEPMAKE_LOCALE, [
404     lang=English
405     ALL_LINGUAS="en nl"
406
407     # with/enable ??
408     AC_ARG_WITH(localedir,
409     [  with-localedir=LOCALE   use LOCALE as locale dir. Default: PREFIX/share/locale ],
410     localedir=$with_localedir,
411     localedir='${prefix}/share/locale')
412
413     AC_ARG_WITH(lang,
414     [  with-lang=LANG          use LANG as language to emit messages],
415     language=$with_lang,
416     language=English)
417
418     AC_MSG_CHECKING(language)    
419     case "$language" in
420       En* | en* | Am* | am* | US* | us*)
421             lang=English;;
422       NL | nl | Du* | du* | Ned* | ned*)
423             lang=Dutch;;
424       "")
425             lang=English;;
426       *)
427             lang=unknown;;
428     esac
429     AC_MSG_RESULT($lang)
430
431     if test "$lang" = "unknown" ; then
432         AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
433     fi
434
435 ])
436
437 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
438     DIR_LOCALEDIR=${localedir}
439     presome=${prefix}
440     if test "$prefix" = "NONE"; then
441             presome=${ac_default_prefix}
442     fi
443     DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
444     AC_SUBST(localedir)
445     AC_SUBST(DIR_LOCALEDIR)
446     AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
447
448     AC_CHECK_LIB(intl, gettext)
449     AC_CHECK_FUNCS(gettext)
450 ])
451
452 AC_DEFUN(AC_STEPMAKE_MAN, [
453     AC_CHECK_PROGS(GROFF, groff ditroff, -echo no groff)
454     AC_CHECK_PROGS(TROFF, troff, -echo no troff)
455     AC_CHECK_PROGS(TBL, tbl, cat)
456 ])
457
458 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
459     # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
460     AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
461     AC_MSG_CHECKING(whether msgfmt accepts -o)
462     msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
463     if test "$msgfmt_output" = ""; then
464         AC_MSG_RESULT(yes)
465     else
466         # urg
467         MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
468         AC_MSG_RESULT(no)
469         AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
470     fi
471     if test ! -n "$MSGFMT"; then
472         AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
473     fi
474 ])
475
476 #why has this been dropped?
477 AC_DEFUN(XXAC_STEPMAKE_TEXMF_DIRS, [
478     AC_ARG_ENABLE(tex-prefix,
479     [  enable-tex-prefix=DIR   set the tex-directory to find TeX subdirectories. (default: PREFIX)],
480     [TEXPREFIX=$enableval],
481     [TEXPREFIX=auto] )
482     
483     AC_ARG_ENABLE(tex-dir,
484     [  enable-tex-dir=DIR      set the directory to put $PACKAGE_NAME TeX files in. ],
485     [TEXDIR=$enableval],
486     [TEXDIR=auto] )
487
488     AC_ARG_ENABLE(mf-dir,
489     [  enable-mf-dir=DIR       set the directory to put $PACKAGE_NAME MetaFont files in. ],
490     [MFDIR=$enableval],
491     [MFDIR=auto])
492
493     if test "x$TEXPREFIX" = xauto ; then
494         AC_TEX_PREFIX(TEXPREFIX)
495     else
496      find_texprefix=$TEXPREFIX
497     fi
498
499     if test "x$MFDIR" = xauto; then
500         AC_MF_SUBDIR(MFDIR)
501     fi
502         
503     if test "x$TEXDIR" = xauto ; then
504         AC_TEX_SUBDIR(TEXDIR)
505     fi
506     AC_SUBST(TEXPREFIX)
507     AC_SUBST(TEXDIR)
508     AC_SUBST(MFDIR)
509 ])
510
511 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
512     AC_ARG_ENABLE(tex-tfmdir,
513     [  enable-tex-tfmdir=DIR   set the tex-directory where cmr10.tfm lives (default: use kpsewhich)],
514     [TFMDIR=$enableval],
515     [TFMDIR=auto] )
516
517     AC_CHECK_PROGS(KPSEWHICH, kpsewhich, no)
518     AC_MSG_CHECKING(for TeX TFM directory)
519     if test "x$TFMDIR" = xauto ; then
520         if test "x$TEX_TFMDIR" = "x" ; then
521             if test "x$KPSEWHICH" != "xno" ; then
522                 CMR10=`kpsewhich tfm cmr10.tfm`
523                 TEX_TFMDIR=`dirname $CMR10`
524             else
525                 AC_STEPMAKE_WARN(Please set TEX_TFMDIR (to where cmr10.tfm lives):
526         TEX_TFMDIR=/usr/local/TeX/lib/tex/fonts ./configure)
527             fi
528         fi
529     fi
530     AC_MSG_RESULT($TEX_TFMDIR)
531     AC_SUBST(TEX_TFMDIR)
532 ])
533
534 AC_DEFUN(AC_STEPMAKE_TEXMF, [
535     # urg, never know what names these teTeX guys will think up
536
537     AC_CHECK_PROGS(METAFONT, mf, no)
538     if test "x$METAFONT" = "xno"; then
539         AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
540         METAFONT=$MFONT
541     fi
542
543     AC_CHECK_PROGS(METAPOST, mp, no)
544     if test "x$METAPOST" = "xno"; then
545         AC_CHECK_PROGS(MPOST, mpost, -echo no mp or mpost)
546
547         METAPOST=$MPOST
548     fi
549
550     AC_CHECK_PROGS(INIMETAFONT, inimf, no)
551     if test "x$INIMETAFONT" = "xno"; then
552         AC_CHECK_PROGS(INIMFONT, inimfont, -echo no inimf or inimfont)
553         INIMETAFONT=$INIMFONT
554     fi
555
556     AC_CHECK_PROGS(INIMETAPOST, inimp, no)
557     if test "x$INIMETAPOST" = "xno"; then
558         AC_CHECK_PROGS(INIMPOST, inimpost, -echo no inimp or inimpost)
559         INIMETAPOST=$INIMPOST
560     fi
561
562     AC_MSG_CHECKING(for working metafont mode)
563     modelist='ljfour lj4 lj3 lj2 ljet laserjet'
564     for MFMODE in $modelist; do
565         $METAFONT "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
566         if test -f mfput.tfm; then
567             break;
568         fi
569     done
570     rm -f mfput.*
571     AC_MSG_RESULT($MFMODE)
572
573     AC_SUBST(METAFONT)
574     AC_SUBST(METAPOST)
575     AC_SUBST(MFMODE)
576     AC_SUBST(INIMETAFONT)
577     AC_SUBST(INIMETAPOST)
578 ])
579
580 AC_DEFUN(AC_STEPMAKE_WARN, [
581     AC_MSG_WARN($1)
582     warn_b=yes
583 ])
584
585 AC_DEFUN(AC_STEPMAKE_YODL, [
586     if test "x$YODL" = "x"; then 
587         AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
588         AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
589         AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
590         AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
591         AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
592         AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
593         AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
594         AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
595         YODL2LESS_DIR='$(bindir)/'
596     else
597         AC_SUBST(STRIPROFF)
598         AC_SUBST(YODL)
599         AC_SUBST(YODL2HTML)
600         AC_SUBST(YODL2LATEX)
601         AC_SUBST(YODL2LESS_DIR)
602         AC_SUBST(YODL2MAN)
603         AC_SUBST(YODL2MSLESS)
604         AC_SUBST(YODL2TEXINFO)
605         AC_SUBST(YODL2TXT)
606         export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
607     fi
608     if test "x$YODL" = "-echo no yodl"; then
609         AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
610     fi    
611 ])
612
613 dnl should cache result.
614 dnl should  look in $prefix first.
615 dnl should probably assume TDS
616
617 AC_DEFUN(AC_TEX_PREFIX, [
618     
619
620     AC_MSG_CHECKING(TeX/MF root dir directory)    
621
622     find_root_prefix="$prefix"
623     
624
625     test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
626     find_texpostfix="";
627     for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
628         find_texprefix="$find_root_prefix$postfix"
629         if test -d $find_texprefix; then
630             find_texpostfix=$postfix
631             break;
632         fi
633     done
634     
635     if test "x$find_texpostfix" = x; then
636         find_texpostfix='/lib/texmf/tex'
637         AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
638     fi
639
640     find_texprefix="$find_root_prefix/$find_texpostfix"
641
642     # only assign if variablename not empty
643     if test x != "x[$]$1"; then
644         $1='${prefix}'/"$find_texpostfix"
645     fi
646     AC_MSG_RESULT($find_texprefix)
647
648 ])
649  
650
651 # find a directory inside a prefix, 
652 # $1 the prefix (expanded version)
653 # $2 variable to assign
654 # $3 the directory name 
655 # $4 description
656 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
657     
658     AC_MSG_CHECKING($4 directory)    
659     find_dirdir=`(cd $1; 
660       $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
661     
662
663     if test "x$find_dirdir" = x; then
664        find_dirdir="/$3";
665        AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
666         true
667     fi
668     $2=$find_dirdir
669     AC_MSG_RESULT($1/$find_dirdir)
670 ])
671
672 # ugh.  this is hopeless
673 AC_DEFUN(AC_KPSE_TEX_DIR, [
674         kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
675         kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
676         echo $kpse_paths
677         if test -w "$kpse_syspaths";
678         then
679                 dir=`echo $kpse_syspaths | head -1`
680         else
681                 dir=`echo $kpse_paths | grep -v '!'| head -1`
682         fi
683         if test "$prefix" = "NONE"; then
684                 local_prefix=$ac_default_prefix
685                 local_prefix_quote='${prefix}'
686
687         else
688                 local_prefix=$prefix
689                 local_prefix_quote=$prefix
690         fi
691         echo $local_prefix_quote = $local_prefix
692         echo $dir
693         echo $dir  | sed 's!'$local_prefix'!\$local_prefix_quote!g'
694 ])
695
696 AC_DEFUN(AC_TEX_SUBDIR, [
697 dnl    AC_REQUIRE([AC_TEX_PREFIX])
698     AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
699     $1="$TEXPREFIX/$$1"
700 ])
701
702 AC_DEFUN(AC_MF_SUBDIR, [
703 dnl     AC_REQUIRE([AC_TEX_PREFIX])
704     AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
705     $1="$TEXPREFIX/$$1"
706 ])
707
708 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
709         result="`echo \"$1\" | grep echo`"
710         if test "x$1" = "xerror" -o "x$result" != "x"; then
711                 AC_STEPMAKE_WARN(can\'t find $2. $3)
712         fi
713 ])
714
715 dnl   GUILE_FLAGS --- set flags for compiling and linking with Guile
716 dnl
717 dnl   This macro runs the `guile-config' script, installed with Guile,
718 dnl   to find out where Guile's header files and libraries are
719 dnl   installed.  It sets two variables, marked for substitution, as
720 dnl   by AC_SUBST.
721 dnl   
722 dnl     GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
723 dnl             code that uses Guile header files.  This is almost
724 dnl             always just a -I flag.
725 dnl   
726 dnl     GUILE_LDFLAGS --- flags to pass to the linker to link a
727 dnl             program against Guile.  This includes `-lguile' for
728 dnl             the Guile library itself, any libraries that Guile
729 dnl             itself requires (like -lqthreads), and so on.  It may
730 dnl             also include a -L flag to tell the compiler where to
731 dnl             find the libraries.
732
733 AC_DEFUN([GUILE_FLAGS],[
734 ## The GUILE_FLAGS macro.
735   ## First, let's just see if we can find Guile at all.
736   AC_MSG_CHECKING(for Guile)
737   guile-config link > /dev/null || {
738     echo "configure: cannot find guile-config; is Guile installed?" 1>&2
739     exit 1
740   }
741   GUILE_CFLAGS="`guile-config compile`"
742   GUILE_LDFLAGS="`guile-config link`"
743   AC_SUBST(GUILE_CFLAGS)
744   AC_SUBST(GUILE_LDFLAGS)
745   AC_MSG_RESULT(yes)
746 ])
747
748
749 # Configure paths for GTK+
750 # Owen Taylor     97-11-3
751
752 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
753 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
754 dnl
755 AC_DEFUN(AM_PATH_GTK,
756 [dnl 
757 dnl Get the cflags and libraries from the gtk-config script
758 dnl
759   AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
760   min_gtk_version=ifelse([$1], ,1.1.1,$1)
761   AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
762   no_gtk=""
763   if test "$GTK_CONFIG" != "no" ; then
764     GTK_CFLAGS=`$GTK_CONFIG --cflags`
765     GTK_LIBS=`$GTK_CONFIG --libs`
766     ac_save_CFLAGS="$CFLAGS"
767     ac_save_LIBS="$LIBS"
768     ac_save_CXXFLAGS="$CXXFLAGS"
769     CFLAGS="$CFLAGS $GTK_CFLAGS"
770     CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
771     LIBS="$LIBS $GTK_LIBS"
772 dnl
773 dnl Now check if the installed GTK is sufficiently new. (Also sanity
774 dnl checks the results of gtk-config to some extent)
775 dnl
776     AC_TRY_RUN([
777 #include <gtk/gtk.h>
778 #include <stdio.h>
779
780 int 
781 main ()
782 {
783   int major, minor, micro;
784
785   if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, &micro) != 3) {
786      printf("%s, bad version string\n", "$min_gtk_version");
787      exit(1);
788    }
789
790    return !((gtk_major_version > major) ||
791             ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
792             ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
793 }
794 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
795      CFLAGS="$ac_save_CFLAGS"
796      CXXFLAGS="$ac_save_CXXFLAGS"
797      LIBS="$ac_save_LIBS"
798   else
799      no_gtk=yes
800   fi
801   if test "x$no_gtk" = x ; then
802      AC_MSG_RESULT(yes)
803      ifelse([$2], , :, [$2])     
804   else
805      AC_MSG_RESULT(no)
806      GTK_CFLAGS=""
807      GTK_LIBS=""
808      ifelse([$3], , :, [$3])
809   fi
810   CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
811   AC_SUBST(CXXFLAGS)
812   AC_SUBST(GTK_CFLAGS)
813   AC_SUBST(GTK_LIBS)
814 ])
815
816
817 # Configure paths for GTK--
818 # Erik Andersen 30 May 1998
819 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
820
821 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
822 dnl   to be used as follows:
823 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
824 dnl
825
826 dnl Get the cflags and libraries from the gtkmm-config script
827 dnl
828 AC_ARG_WITH(gtkmm-prefix,[  --with-gtkmm-prefix=PREFIX
829                           Prefix where GTK-- is installed (optional)],
830             gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
831 AC_ARG_WITH(gtkmm-exec-prefix,[  --with-gtkmm-exec-prefix=PREFIX
832                           Exec prefix where GTK-- is installed (optional)],
833             gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
834 AC_ARG_ENABLE(gtkmmtest, [  --disable-gtkmmtest     Do not try to compile and run a test GTK-- program],
835                     , enable_gtkmmtest=yes)
836
837   if test x$gtkmm_config_exec_prefix != x ; then
838      gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
839      if test x${GTKMM_CONFIG+set} != xset ; then
840         GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
841      fi
842   fi
843   if test x$gtkmm_config_prefix != x ; then
844      gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
845      if test x${GTKMM_CONFIG+set} != xset ; then
846         GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
847      fi
848   fi
849
850
851 AC_DEFUN(AM_PATH_GTKMM,
852 [dnl 
853
854 dnl
855 dnl Check if the installed GTK-- is sufficiently new.
856 dnl
857   AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
858   min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
859
860   AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
861   no_gtkmm=""
862   if test "$GTKMM_CONFIG" = "no" ; then
863     no_gtkmm=yes
864   else
865     AC_LANG_SAVE
866     AC_LANG_CPLUSPLUS
867
868     GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
869     GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
870     gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
871            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
872     gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
873            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
874     gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
875            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
876     if test "x$enable_gtkmmtest" = "xyes" ; then
877       ac_save_CXXFLAGS="$CXXFLAGS"
878       ac_save_LIBS="$LIBS"
879       CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
880       LIBS="$LIBS $GTK___LIBS"
881 dnl
882 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
883 dnl checks the results of gtkmm-config to some extent
884 dnl
885       rm -f conf.gtkmmtest
886       AC_TRY_RUN([
887 #include <gtk--.h>
888 #include <stdio.h>
889 #include <stdlib.h>
890
891 int 
892 main ()
893 {
894   int major, minor, micro;
895   char *tmp_version;
896
897   system ("touch conf.gtkmmtest");
898
899   /* HP/UX 0 (%@#!) writes to sscanf strings */
900   tmp_version = g_strdup("$min_gtkmm_version");
901   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
902      printf("%s, bad version string\n", "$min_gtkmm_version");
903      exit(1);
904    }
905
906   if ((gtkmm_major_version != $gtkmm_config_major_version) ||
907       (gtkmm_minor_version != $gtkmm_config_minor_version) ||
908       (gtkmm_micro_version != $gtkmm_config_micro_version))
909     {
910       printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n", 
911              $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
912              gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
913       printf ("*** was found! If gtkmm-config was correct, then it is best\n");
914       printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
915       printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
916       printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
917       printf("*** required on your system.\n");
918       printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
919       printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
920       printf("*** before re-running configure\n");
921     } 
922 /* GTK-- does not have the GTKMM_*_VERSION constants */
923 /* 
924   else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
925            (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
926            (gtkmm_micro_version != GTKMM_MICRO_VERSION))
927     {
928       printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
929              GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
930       printf("*** library (version %d.%d.%d)\n",
931              gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
932     }
933 */
934   else
935     {
936       if ((gtkmm_major_version > major) ||
937         ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
938         ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
939       {
940         return 0;
941        }
942      else
943       {
944         printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
945                gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
946         printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
947                major, minor, micro);
948         printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
949         printf("***\n");
950         printf("*** If you have already installed a sufficiently new version, this error\n");
951         printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
952         printf("*** being found. The easiest way to fix this is to remove the old version\n");
953         printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
954         printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
955         printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
956         printf("*** so that the correct libraries are found at run-time))\n");
957       }
958     }
959   return 1;
960 }
961 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
962        CXXFLAGS="$ac_save_CXXFLAGS"
963        LIBS="$ac_save_LIBS"
964      fi
965   fi
966   if test "x$no_gtkmm" = x ; then
967      AC_MSG_RESULT(yes)
968      ifelse([$2], , :, [$2])     
969   else
970      AC_MSG_RESULT(no)
971      if test "$GTKMM_CONFIG" = "no" ; then
972        echo "*** The gtkmm-config script installed by GTK-- could not be found"
973        echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
974        echo "*** your path, or set the GTK_CONFIG environment variable to the"
975        echo "*** full path to gtk-config."
976        echo "*** The gtkmm-config script was not available in GTK-- versions"
977        echo "*** prior to 0.9.12. Perhaps you need to update your installed"
978        echo "*** version to 0.9.12 or newer"
979      else
980        if test -f conf.gtkmmtest ; then
981         :
982        else
983           echo "*** Could not run GTK-- test program, checking why..."
984           CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
985           LIBS="$LIBS $GTK___LIBS"
986           AC_TRY_LINK([
987 #include <gtk--.h>
988 #include <stdio.h>
989 ],      [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
990         [ echo "*** The test program compiled, but did not run. This usually means"
991           echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
992           echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
993           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
994           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
995           echo "*** is required on your system"
996           echo "***"
997           echo "*** If you have an old version installed, it is best to remove it, although"
998           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
999         [ echo "*** The test program failed to compile or link. See the file config.log for the"
1000           echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
1001           echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
1002           echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
1003           CXXFLAGS="$ac_save_CXXFLAGS"
1004           LIBS="$ac_save_LIBS"
1005        fi
1006      fi
1007      GTK___CFLAGS=""
1008      GTK__LIBS=""
1009      ifelse([$3], , :, [$3])
1010      AC_LANG_RESTORE
1011   fi
1012   AC_SUBST(GTK___CFLAGS)
1013   AC_SUBST(GTK___LIBS)
1014   rm -f conf.gtkmmtest
1015 ])
1016
1017 # Configure paths for GTK--DRAW
1018 # Derek Quinn Wyatt   98-08-21  (adapted from Jan Nieuwenhuizen's code)
1019
1020 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1021 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
1022 dnl
1023 AC_DEFUN(AM_PATH_GTK__DRAW,
1024 [dnl 
1025 dnl Get the cflags and libraries from the gtk__-config script
1026 dnl
1027   AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
1028   min_gtk___version=ifelse([$1], ,0.0.5,$1)
1029   AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
1030   no_gtk__=""
1031   if test "$GTKMM_CONFIG" != "no" ; then
1032     GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
1033     GTK___LIBS=`$GTKMM_CONFIG --libs`
1034     GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
1035     GTK___LIBS="$GTK___DLIBS"
1036     ac_save_CFLAGS="$CFLAGS"
1037     ac_save_LIBS="$LIBS"
1038     ac_save_CXXFLAGS="$CXXFLAGS"
1039     CFLAGS="$CFLAGS $GTK___CFLAGS"
1040     CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1041     LIBS="$LIBS $GTK___LIBS"
1042 dnl
1043 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
1044 dnl checks the results of gtk__-config to some extent)
1045 dnl
1046     AC_TRY_RUN([
1047 #include <gtk--.h>
1048 #include <stdio.h>
1049
1050 int 
1051 main ()
1052 {
1053   // urg
1054   return 0;
1055 }
1056 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1057      CFLAGS="$ac_save_CFLAGS"
1058      CXXFLAGS="$ac_save_CXXFLAGS"
1059      LIBS="$ac_save_LIBS"
1060   else
1061      no_gtk__=yes
1062   fi
1063   if test "x$no_gtk__" = x ; then
1064      AC_MSG_RESULT(yes)
1065      ifelse([$2], , :, [$2])     
1066   else
1067      AC_MSG_RESULT(no)
1068      GTK___CFLAGS=""
1069      GTK___LIBS=""
1070      ifelse([$3], , :, [$3])
1071   fi
1072   CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1073   AC_SUBST(CXXFLAGS)
1074   AC_SUBST(GTK___CFLAGS)
1075   AC_SUBST(GTK___LIBS)
1076 ])