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