1 dnl aclocal.m4 -*-shell-script-*-
2 dnl StepMake subroutines for configure.in
4 AC_DEFUN(AC_STEPMAKE_COMPILE, [
5 # -O is necessary to get inlining
7 CXXFLAGS=${CXXFLAGS:-""}
14 AC_ARG_ENABLE(checking,
15 [ enable-checking set runtime checks (assert calls). Default: on],
16 [checking_b=$enableval] )
18 # actually, the default is: tja='-O' to get inlining...
21 #actually, that sucks.
22 # tja looks like a typo. Default is optimisation off. --hwn
24 AC_ARG_ENABLE(optimise,
25 [ enable-optimise use maximal speed optimisations. Default: off],
26 [optimise_b=$enableval])
28 AC_ARG_ENABLE(profiling,
29 [ enable-profiling compile with gprof support. Default: off],
30 [profile_b=$enableval])
32 AC_ARG_ENABLE(debugging,
33 [ enable-debugging set debug info. Default: on],
36 AC_ARG_ENABLE(mingw-prefix,
37 [ enable-mingw-prefix=DIR set the mingw32 directory (standalone windows32 exes)],
38 [MINGWPREFIX=$enableval],
41 if test "$printing_b" = no; then
44 DEFINES="$DEFINES -DNPRINT"
47 if test "$checking_b" = no; then
50 DEFINES="$DEFINES -DNDEBUG"
53 if test "$optimise_b" = yes; then
54 OPTIMIZE="-O2 -finline-functions"
57 if test "$optimise_b" = no; then
61 if test $profile_b = yes; then
63 OPTIMIZE="$OPTIMIZE -pg"
66 if test $debug_b = yes; then
67 OPTIMIZE="$OPTIMIZE -g"
70 # however, C++ support in mingw32 v 0.1.4 is still flaky
71 if test x$MINGWPREFIX != xno; then
72 ICFLAGS="-I$MINGWPREFIX/include"
73 ILDFLAGS="-$MINGWPREFIX/lib"
80 CFLAGS="$CFLAGS $OPTIMIZE"
81 CPPFLAGS=${CPPFLAGS:-""}
91 AC_DEFUN(AC_STEPMAKE_CXX, [
95 AC_CHECK_HEADER(FlexLexer.h, true,
96 AC_STEPMAKE_WARN(can"\'"t find flex header. Please install Flex headers correctly))
98 CPPFLAGS="$CPPFLAGS $DEFINES"
99 CXXFLAGS="$CXXFLAGS $OPTIMIZE"
108 AC_DEFUN(AC_STEPMAKE_CXXTEMPLATE, [
109 AC_CACHE_CHECK([whether explicit instantiation is needed],
110 lily_cv_need_explicit_instantiation,
112 template <class T> struct foo { static int baz; };
113 template <class T> int foo<T>::baz = 1;
114 ], [ return foo<int>::baz; ],
115 lily_cv_need_explicit_instantiation=no,
116 lily_cv_need_explicit_instantiation=yes))
117 if test x"$lily_cv_need_explicit_instantiation"x = x"yes"x; then
118 AC_DEFINE(NEED_EXPLICIT_INSTANTIATION)
122 AC_DEFUN(AC_STEPMAKE_DATADIR, [
123 if test "$datadir" = "\${prefix}/share"; then
124 datadir='${prefix}/share/'$package
126 DIR_DATADIR=${datadir}
128 if test "$prefix" = "NONE"; then
129 presome=${ac_default_prefix}
131 DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
133 AC_SUBST(DIR_DATADIR)
134 AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
137 AC_DEFUN(AC_STEPMAKE_END, [
138 AC_OUTPUT($CONFIGFILE.make:config.make.in)
141 cp make/toplevel.make.in ./GNUmakefile
142 chmod 444 GNUmakefile
145 AC_DEFUN(AC_STEPMAKE_GXX, [
147 # urg, egcs: how to check for egcs >= 1.1?
148 changequote(<<, >>)dnl
149 if $CXX --version | grep '2\.8' > /dev/null ||
150 $CXX --version | grep 'egcs' > /dev/null
155 AC_STEPMAKE_WARN(can\'t find g++ 2.8 or egcs 1.1)
159 AC_DEFUN(AC_STEPMAKE_GUILE, [
160 # on some systems, -lguile succeeds for guile-1.3
161 # others need readline, dl (or even more)
162 # urg, must check for different functions in libguile
163 # to force new check iso reading from cache
165 # gh_scm2doubles,gh_doubles2scm are new in 1.3
166 AC_CHECK_LIB(guile, gh_scm2doubles, \
167 LIBS="-lguile $LIBS"; AC_DEFINE(HAVE_LIBGUILE), \
168 AC_CHECK_LIB(readline, readline) \
169 AC_CHECK_LIB(dl, dlopen) \
170 AC_CHECK_LIB(socket, socket)\
171 AC_CHECK_LIB(termcap,tgetent)\
172 AC_CHECK_LIB(m, fabs)\
173 AC_CHECK_LIB(guile, gh_doubles2scm)\
175 if test "$ac_cv_lib_guile_gh_scm2doubles" != yes -a \
176 "$ac_cv_lib_guile_gh_doubles2scm" != yes ; then
177 AC_STEPMAKE_WARN(You should install guile 1.3 or newer)
181 AC_DEFUN(AC_STEPMAKE_INIT, [
184 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
185 if test x$MY_PATCH_LEVEL != x; then
186 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
189 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
190 changequote(<<, >>)dnl
191 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
192 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
195 # No versioning on directory names of sub-packages
197 stepmake=${datadir}/stepmake
199 if test "$prefix" = "NONE"; then
200 presome=${ac_default_prefix}
202 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
204 if test "x$PACKAGE" = "xSTEPMAKE"; then
205 echo Stepmake package!
206 (cd stepmake; rm -f stepmake; ln -s ../stepmake .)
207 (cd stepmake; rm -f bin; ln -s ../bin .)
208 AC_CONFIG_AUX_DIR(bin)
211 echo Package: $PACKAGE
212 # Check for installed stepmake
213 if test -d $stepmake; then
214 echo Using installed stepmake: $stepmake
216 stepmake='$(depth)'/stepmake
217 echo Using local stepmake: $datadir/stepmake not found
220 $HOME/usr/local/share/stepmake/bin\
221 $HOME/usr/local/lib/stepmake/bin\
222 $HOME/usr/share/stepmake/bin\
223 $HOME/usr/lib/stepmake/bin\
224 /usr/local/share/stepmake/bin\
225 /usr/local/lib/stepmake/bin\
226 /usr/share/stepmake/bin\
227 /usr/lib/stepmake/bin\
235 AC_SUBST(PACKAGE_NAME)
236 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
237 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
239 if test "$package_depth" = "" ; then
242 package_depth="../$package_depth"
245 AC_SUBST(package_depth)
247 AUTOGENERATE="This file was automatically generated by configure"
248 AC_SUBST(AUTOGENERATE)
249 absolute_builddir="`pwd`"
250 AC_SUBST(absolute_builddir)
252 STATE_VECTOR=`ls make/STATE-VECTOR 2>/dev/null`
253 if test "x$STATE_VECTOR" != "x"; then
254 STATE_VECTOR="\$(depth)/$STATE_VECTOR"
256 AC_SUBST(STATE_VECTOR)
259 AC_ARG_ENABLE(config,
260 [ enable-config=FILE put configure settings in config-FILE.make],
261 [CONFIGSUFFIX=$enableval])
263 if test "$CONFIGSUFFIX" != "" ; then
264 CONFIGFILE=config-$CONFIGSUFFIX
268 AC_SUBST(CONFIGSUFFIX)
271 AC_CHECK_PROGS(MAKE, gmake make, error)
272 AC_CHECK_PROGS(FIND, find, error)
274 dnl system supplied INSTALL is unsafe; use our own install.
276 dnl if test "$INSTALL" = "bin/install-sh"; then
277 dnl export INSTALL="\$\(depth\)/bin/install-sh"
280 AC_CHECK_PROGS(TAR, tar, error)
281 AC_CHECK_PROGS(BASH, bash, /bin/sh)
283 AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
286 if test $MAKE != "error" ; then
287 $MAKE -v 2> /dev/null | grep GNU > /dev/null
290 AC_STEPMAKE_WARN(Please install *GNU* make)
294 AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
296 if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
297 LN=cp # hard link does not work under cygnus-nt
298 LN_S=cp # symbolic link does not work for native nt
305 # cygwin fixes all these things.
306 # it seems these were used because of dos-style TEXINPUTS and
307 # MFINPUTS needed for miktex.
308 # but this breaks parsing of all other cygwin/unix style paths.
310 # if your (mik)tex breaks, make a:
311 # /usr/local/bin/tex:
313 # TEXINPUTS=`cygpath -pw $TEXINPUTS` /texmf/miktex/bin/tex $*
319 # MFINPUTS=`cygpath -pw $MFINPUTS` /texmf/miktex/bin/mf $*
321 # this way, you may have buildscripts/out/lilypond-profile
322 # 'automatically' sourced from /usr/etc/profile.d/ too.
326 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
333 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
340 AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
341 AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
349 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
350 # ugh, automake: we want (and check for) bison
352 # ugh, automake: we want (and check for) flex
354 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
358 ac_cv_prog_lex_root=lex.yy
360 AC_CHECK_PROGS(BISON, bison, error)
361 AC_CHECK_PROGS(FLEX, flex, error)
362 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
363 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
365 if test $BISON != "error"; then
366 bison_version=`$BISON --version| sed 's/^.*version 1.//g' `
367 if test $bison_version -lt 25; then
368 AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
376 AC_DEFUN(AC_STEPMAKE_LIB, [
377 AC_CHECK_PROGS(AR, ar, error)
384 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
386 # **Never** try to set library version numbers so that they correspond
387 # to the release number of your package. This is an abuse that only
388 # fosters misunderstanding of the purpose of library versions.
390 REVISION=$PATCH_LEVEL
391 # CURRENT=$MINOR_VERSION
392 CURRENT=`expr $MINOR_VERSION + 1`
393 # AGE=$(expr $MAJOR_VERSION + 1)
400 AC_DEFUN(AC_STEPMAKE_LOCALE, [
405 AC_ARG_WITH(localedir,
406 [ with-localedir=LOCALE use LOCALE as locale dir. Default: PREFIX/share/locale ],
407 localedir=$with_localedir,
408 localedir='${prefix}/share/locale')
411 [ with-lang=LANG use LANG as language to emit messages],
415 AC_MSG_CHECKING(language)
417 En* | en* | Am* | am* | US* | us*)
419 NL | nl | Du* | du* | Ned* | ned*)
428 if test "$lang" = "unknown" ; then
429 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
434 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
435 DIR_LOCALEDIR=${localedir}
437 if test "$prefix" = "NONE"; then
438 presome=${ac_default_prefix}
440 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
442 AC_SUBST(DIR_LOCALEDIR)
443 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
445 AC_CHECK_LIB(intl, gettext)
446 AC_CHECK_FUNCS(gettext)
449 AC_DEFUN(AC_STEPMAKE_MAN, [
450 AC_CHECK_PROGS(TROFF, troff, -echo no troff)
451 AC_CHECK_PROGS(TBL, tbl, cat)
454 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
455 # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
456 AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
457 AC_MSG_CHECKING(whether msgfmt accepts -o)
458 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
459 if test "$msgfmt_output" = ""; then
463 MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
465 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
467 if test ! -n "$MSGFMT"; then
468 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
472 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
473 AC_ARG_ENABLE(tex-prefix,
474 [ enable-tex-prefix=DIR set the tex-directory to find TeX subdirectories. (default: PREFIX)],
475 [TEXPREFIX=$enableval],
478 AC_ARG_ENABLE(tex-dir,
479 [ enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. ],
483 AC_ARG_ENABLE(mf-dir,
484 [ enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. ],
488 if test "x$TEXPREFIX" = xauto ; then
489 AC_TEX_PREFIX(TEXPREFIX)
491 find_texprefix=$TEXPREFIX
494 if test "x$MFDIR" = xauto; then
498 if test "x$TEXDIR" = xauto ; then
499 AC_TEX_SUBDIR(TEXDIR)
506 AC_DEFUN(AC_STEPMAKE_TEXMF, [
507 # urg, never know what names these teTeX guys will think up
508 AC_CHECK_PROGS(METAFONT, mf, no)
509 if test "x$METAFONT" = "xno"; then
510 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
514 AC_CHECK_PROGS(METAPOST, mp, no)
515 if test "x$METAPOST" = "xno"; then
516 AC_CHECK_PROGS(MPOST, mpost, -echo no mp or mpost)
524 AC_DEFUN(AC_STEPMAKE_WARN, [
529 AC_DEFUN(AC_STEPMAKE_YODL, [
530 if test "x$YODL" = "x"; then
531 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
532 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
533 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
534 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
535 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
536 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
537 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
538 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
539 YODL2LESS_DIR='$(bindir)/'
545 AC_SUBST(YODL2LESS_DIR)
547 AC_SUBST(YODL2MSLESS)
548 AC_SUBST(YODL2TEXINFO)
550 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
552 if test "x$YODL" = "-echo no yodl"; then
553 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
557 dnl should cache result.
558 dnl should look in $prefix first.
559 dnl should probably assume TDS
561 AC_DEFUN(AC_TEX_PREFIX, [
564 AC_MSG_CHECKING(TeX/MF root dir directory)
566 find_root_prefix="$prefix"
569 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
571 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
572 find_texprefix="$find_root_prefix$postfix"
573 if test -d $find_texprefix; then
574 find_texpostfix=$postfix
579 if test "x$find_texpostfix" = x; then
580 find_texpostfix='/lib/texmf/tex'
581 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
584 find_texprefix="$find_root_prefix/$find_texpostfix"
586 # only assign if variablename not empty
587 if test x != "x[$]$1"; then
588 $1='${prefix}'/"$find_texpostfix"
590 AC_MSG_RESULT($find_texprefix)
595 # find a directory inside a prefix,
596 # $1 the prefix (expanded version)
597 # $2 variable to assign
598 # $3 the directory name
600 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
602 AC_MSG_CHECKING($4 directory)
604 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
607 if test "x$find_dirdir" = x; then
609 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
613 AC_MSG_RESULT($1/$find_dirdir)
616 # ugh. this is hopeless
617 AC_DEFUN(AC_KPSE_TEX_DIR, [
618 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
619 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
621 if test -w "$kpse_syspaths";
623 dir=`echo $kpse_syspaths | head -1`
625 dir=`echo $kpse_paths | grep -v '!'| head -1`
627 if test "$prefix" = "NONE"; then
628 local_prefix=$ac_default_prefix
629 local_prefix_quote='${prefix}'
633 local_prefix_quote=$prefix
635 echo $local_prefix_quote = $local_prefix
637 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
640 AC_DEFUN(AC_TEX_SUBDIR, [
641 dnl AC_REQUIRE([AC_TEX_PREFIX])
642 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
646 AC_DEFUN(AC_MF_SUBDIR, [
647 dnl AC_REQUIRE([AC_TEX_PREFIX])
648 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
652 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
653 result="`echo \"$1\" | grep echo`"
654 if test "x$1" = "xerror" -o "x$result" != "x"; then
655 AC_STEPMAKE_WARN(can\'t find $2. $3)
660 # Configure paths for GTK+
661 # Owen Taylor 97-11-3
663 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
664 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
666 AC_DEFUN(AM_PATH_GTK,
668 dnl Get the cflags and libraries from the gtk-config script
670 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
671 min_gtk_version=ifelse([$1], ,1.1.1,$1)
672 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
674 if test "$GTK_CONFIG" != "no" ; then
675 GTK_CFLAGS=`$GTK_CONFIG --cflags`
676 GTK_LIBS=`$GTK_CONFIG --libs`
677 ac_save_CFLAGS="$CFLAGS"
679 ac_save_CXXFLAGS="$CXXFLAGS"
680 CFLAGS="$CFLAGS $GTK_CFLAGS"
681 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
682 LIBS="$LIBS $GTK_LIBS"
684 dnl Now check if the installed GTK is sufficiently new. (Also sanity
685 dnl checks the results of gtk-config to some extent
694 int major, minor, micro;
696 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
697 printf("%s, bad version string\n", "$min_gtk_version");
701 return !((gtk_major_version > major) ||
702 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
703 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
705 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
706 CFLAGS="$ac_save_CFLAGS"
707 CXXFLAGS="$ac_save_CXXFLAGS"
712 if test "x$no_gtk" = x ; then
714 ifelse([$2], , :, [$2])
719 ifelse([$3], , :, [$3])
721 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
728 # Configure paths for GTK--
729 # Erik Andersen 30 May 1998
730 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
732 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
733 dnl to be used as follows:
734 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
737 dnl Get the cflags and libraries from the gtkmm-config script
739 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
740 Prefix where GTK-- is installed (optional)],
741 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
742 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
743 Exec prefix where GTK-- is installed (optional)],
744 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
745 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
746 , enable_gtkmmtest=yes)
748 if test x$gtkmm_config_exec_prefix != x ; then
749 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
750 if test x${GTKMM_CONFIG+set} != xset ; then
751 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
754 if test x$gtkmm_config_prefix != x ; then
755 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
756 if test x${GTKMM_CONFIG+set} != xset ; then
757 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
762 AC_DEFUN(AM_PATH_GTKMM,
766 dnl Check check if the installed GTK-- is sufficiently new.
768 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
769 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
771 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
773 if test "$GTKMM_CONFIG" = "no" ; then
779 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
780 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
781 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
782 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
783 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
784 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
785 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
786 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
787 if test "x$enable_gtkmmtest" = "xyes" ; then
788 ac_save_CXXFLAGS="$CXXFLAGS"
790 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
791 LIBS="$LIBS $GTK___LIBS"
793 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
794 dnl checks the results of gtkmm-config to some extent
805 int major, minor, micro;
808 system ("touch conf.gtkmmtest");
810 /* HP/UX 0 (%@#!) writes to sscanf strings */
811 tmp_version = g_strdup("$min_gtkmm_version");
812 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
813 printf("%s, bad version string\n", "$min_gtkmm_version");
817 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
818 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
819 (gtkmm_micro_version != $gtkmm_config_micro_version))
821 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
822 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
823 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
824 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
825 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
826 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
827 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
828 printf("*** required on your system.\n");
829 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
830 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
831 printf("*** before re-running configure\n");
833 /* GTK-- does not have the GTKMM_*_VERSION constants */
835 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
836 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
837 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
839 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
840 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
841 printf("*** library (version %d.%d.%d)\n",
842 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
847 if ((gtkmm_major_version > major) ||
848 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
849 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
855 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
856 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
857 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
858 major, minor, micro);
859 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
861 printf("*** If you have already installed a sufficiently new version, this error\n");
862 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
863 printf("*** being found. The easiest way to fix this is to remove the old version\n");
864 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
865 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
866 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
867 printf("*** so that the correct libraries are found at run-time))\n");
872 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
873 CXXFLAGS="$ac_save_CXXFLAGS"
877 if test "x$no_gtkmm" = x ; then
879 ifelse([$2], , :, [$2])
882 if test "$GTKMM_CONFIG" = "no" ; then
883 echo "*** The gtkmm-config script installed by GTK-- could not be found"
884 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
885 echo "*** your path, or set the GTK_CONFIG environment variable to the"
886 echo "*** full path to gtk-config."
887 echo "*** The gtkmm-config script was not available in GTK-- versions"
888 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
889 echo "*** version to 0.9.12 or newer"
891 if test -f conf.gtkmmtest ; then
894 echo "*** Could not run GTK-- test program, checking why..."
895 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
896 LIBS="$LIBS $GTK___LIBS"
900 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
901 [ echo "*** The test program compiled, but did not run. This usually means"
902 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
903 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
904 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
905 echo "*** to the installed location Also, make sure you have run ldconfig if that"
906 echo "*** is required on your system"
908 echo "*** If you have an old version installed, it is best to remove it, although"
909 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
910 [ echo "*** The test program failed to compile or link. See the file config.log for the"
911 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
912 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
913 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
914 CXXFLAGS="$ac_save_CXXFLAGS"
920 ifelse([$3], , :, [$3])
923 AC_SUBST(GTK___CFLAGS)
928 # Configure paths for GTK--DRAW
929 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
931 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
932 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
934 AC_DEFUN(AM_PATH_GTK__DRAW,
936 dnl Get the cflags and libraries from the gtk__-config script
938 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
939 min_gtk___version=ifelse([$1], ,0.0.5,$1)
940 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
942 if test "$GTKMM_CONFIG" != "no" ; then
943 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
944 GTK___LIBS=`$GTKMM_CONFIG --libs`
945 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
946 GTK___LIBS="$GTK___DLIBS"
947 ac_save_CFLAGS="$CFLAGS"
949 ac_save_CXXFLAGS="$CXXFLAGS"
950 CFLAGS="$CFLAGS $GTK___CFLAGS"
951 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
952 LIBS="$LIBS $GTK___LIBS"
954 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
955 dnl checks the results of gtk__-config to some extent
967 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
968 CFLAGS="$ac_save_CFLAGS"
969 CXXFLAGS="$ac_save_CXXFLAGS"
974 if test "x$no_gtk__" = x ; then
976 ifelse([$2], , :, [$2])
981 ifelse([$3], , :, [$3])
983 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
985 AC_SUBST(GTK___CFLAGS)