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