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