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