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