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