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