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