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