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