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