1 dnl WARNING WARNING WARNING WARNING
2 dnl do not edit! this is aclocal.m4, generated from stepmake/aclocal.m4
3 dnl WARNING WARNING WARNING WARNING
4 dnl do not edit! this is aclocal.m4, generated from stepmake/aclocal.m4
5 dnl WARNING WARNING WARNING WARNING
6 dnl do not edit! this is aclocal.m4, generated from stepmake/aclocal.m4
7 dnl aclocal.m4 -*-shell-script-*-
8 dnl StepMake subroutines for configure.in
10 AC_DEFUN(AC_STEPMAKE_COMPILE, [
11 # -O is necessary to get inlining
14 CXXFLAGS=${CXXFLAGS:-$CFLAGS}
15 LDFLAGS=${LDFLAGS:-""}
21 AC_ARG_ENABLE(checking,
22 [ enable-checking set runtime checks (assert calls). Default: on],
23 [checking_b=$enableval] )
25 # actually, the default is: tja='-O' to get inlining...
28 #actually, that sucks.
29 # tja looks like a typo. Default is optimisation off. --hwn
31 AC_ARG_ENABLE(optimise,
32 [ enable-optimise use maximal speed optimisations. Default: off],
33 [optimise_b=$enableval])
35 AC_ARG_ENABLE(profiling,
36 [ enable-profiling compile with gprof support. Default: off],
37 [profile_b=$enableval])
39 AC_ARG_ENABLE(debugging,
40 [ enable-debugging set debug info. Default: on],
43 AC_ARG_ENABLE(mingw-prefix,
44 [ enable-mingw-prefix=DIR set the mingw32 directory (standalone windows32 exes)],
45 [MINGWPREFIX=$enableval],
48 if test "$checking_b" = no; then
51 DEFINES="$DEFINES -DNDEBUG"
54 if test "$optimise_b" = yes; then
55 OPTIMIZE="-O2 -finline-functions"
58 if test "$optimise_b" = no; then
62 if test $profile_b = yes; then
64 OPTIMIZE="$OPTIMIZE -pg"
67 if test $debug_b = yes; then
68 OPTIMIZE="$OPTIMIZE -g"
71 # however, C++ support in mingw32 v 0.1.4 is still flaky
72 if test x$MINGWPREFIX != xno; then
73 ICFLAGS="-I$MINGWPREFIX/include"
74 ILDFLAGS="-$MINGWPREFIX/lib"
81 CFLAGS="$CFLAGS $OPTIMIZE"
82 CPPFLAGS=${CPPFLAGS:-""}
92 AC_DEFUN(AC_STEPMAKE_CXX, [
96 AC_CHECK_HEADER(FlexLexer.h, true,
97 AC_STEPMAKE_WARN(can"\'"t find flex header. Please install Flex headers correctly))
99 CPPFLAGS="$CPPFLAGS $DEFINES"
100 CXXFLAGS="$CXXFLAGS $OPTIMIZE"
101 LDFLAGS="$LDFLAGS $EXTRA_LIBES"
109 AC_DEFUN(AC_STEPMAKE_CXXTEMPLATE, [
110 AC_CACHE_CHECK([whether explicit instantiation is needed],
111 lily_cv_need_explicit_instantiation,
113 template <class T> struct foo { static int baz; };
114 template <class T> int foo<T>::baz = 1;
115 ], [ return foo<int>::baz; ],
116 lily_cv_need_explicit_instantiation=no,
117 lily_cv_need_explicit_instantiation=yes))
118 if test x"$lily_cv_need_explicit_instantiation"x = x"yes"x; then
119 AC_DEFINE(NEED_EXPLICIT_INSTANTIATION)
123 AC_DEFUN(AC_STEPMAKE_DATADIR, [
124 if test "$datadir" = "\${prefix}/share"; then
125 datadir='${prefix}/share/'$package
127 DIR_DATADIR=${datadir}
129 if test "$prefix" = "NONE"; then
130 presome=${ac_default_prefix}
132 DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
134 AC_SUBST(DIR_DATADIR)
135 AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
138 AC_DEFUN(AC_STEPMAKE_END, [
139 AC_OUTPUT($CONFIGFILE.make:config.make.in)
142 cp make/toplevel.make.in ./GNUmakefile
143 chmod 444 GNUmakefile
146 AC_DEFUN(AC_STEPMAKE_GXX, [
148 # urg, egcs: how to check for egcs >= 1.1?
149 changequote(<<, >>)dnl
150 if $CXX --version | egrep '2\.[89]' > /dev/null ||
151 $CXX --version | grep 'egcs' > /dev/null
156 AC_STEPMAKE_WARN(can\'t find g++ 2.8 or egcs 1.1)
160 AC_DEFUN(AC_STEPMAKE_GUILE, [
162 if guile-config --version 2>&1 | grep -q 'version 1\.[012]'; then
163 AC_STEPMAKE_WARN(Guile version 1.3 or better needed)
165 AC_PATH_PROG(GUILE, guile, error)
169 AC_DEFUN(AC_STEPMAKE_INIT, [
172 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
173 if test x$MY_PATCH_LEVEL != x; then
174 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
177 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
178 changequote(<<, >>)dnl
179 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
180 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
183 # No versioning on directory names of sub-packages
185 stepmake=${datadir}/stepmake
187 if test "$prefix" = "NONE"; then
188 presome=${ac_default_prefix}
190 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
192 AC_MSG_CHECKING(Package)
193 if test "x$PACKAGE" = "xSTEPMAKE"; then
194 AC_MSG_RESULT(Stepmake package!)
195 (cd stepmake; rm -f stepmake; ln -s ../stepmake .)
196 (cd stepmake; rm -f bin; ln -s ../bin .)
197 AC_CONFIG_AUX_DIR(bin)
200 AC_MSG_RESULT($PACKAGE)
201 AC_MSG_CHECKING(for stepmake)
202 # Check for installed stepmake
203 if test -d $stepmake; then
204 AC_MSG_RESULT($stepmake)
206 stepmake='$(depth)'/stepmake
207 AC_MSG_RESULT(./stepmake ($datadir/stepmake not found))
210 $HOME/usr/local/share/stepmake/bin\
211 $HOME/usr/local/lib/stepmake/bin\
212 $HOME/usr/share/stepmake/bin\
213 $HOME/usr/lib/stepmake/bin\
214 /usr/local/share/stepmake/bin\
215 /usr/local/lib/stepmake/bin\
216 /usr/share/stepmake/bin\
217 /usr/lib/stepmake/bin\
225 AC_SUBST(PACKAGE_NAME)
226 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
227 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
229 if test "$package_depth" = "" ; then
232 package_depth="../$package_depth"
235 AC_SUBST(package_depth)
237 AUTOGENERATE="This file was automatically generated by configure"
238 AC_SUBST(AUTOGENERATE)
239 absolute_builddir="`pwd`"
240 AC_SUBST(absolute_builddir)
242 STATE_VECTOR=`ls make/STATE-VECTOR 2>/dev/null`
243 if test "x$STATE_VECTOR" != "x"; then
244 STATE_VECTOR="\$(depth)/$STATE_VECTOR"
246 AC_SUBST(STATE_VECTOR)
249 AC_ARG_ENABLE(config,
250 [ enable-config=FILE put configure settings in config-FILE.make],
251 [CONFIGSUFFIX=$enableval])
253 if test "$CONFIGSUFFIX" != "" ; then
254 CONFIGFILE=config-$CONFIGSUFFIX
258 AC_SUBST(CONFIGSUFFIX)
261 AC_CHECK_PROGS(MAKE, gmake make, error)
262 AC_CHECK_PROGS(FIND, find, error)
264 dnl system supplied INSTALL is unsafe; use our own install.
266 dnl if test "$INSTALL" = "bin/install-sh"; then
267 dnl export INSTALL="\$\(depth\)/bin/install-sh"
270 AC_CHECK_PROGS(TAR, tar, error)
272 if test "x`uname`" = "xHP-UX"; then
273 AC_PATH_PROG(BASH, bash, /bin/sh)
274 AC_STEPMAKE_WARN(avoiding buggy /bin/sh)
275 AC_PATH_PROG(SHELL, bash, /bin/ksh)
277 AC_PATH_PROG(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 -r' # 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}')
348 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
349 # ugh, automake: we want (and check for) bison
351 # ugh, automake: we want (and check for) flex
353 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
357 ac_cv_prog_lex_root=lex.yy
359 AC_CHECK_PROGS(BISON, bison, error)
360 AC_CHECK_PROGS(FLEX, flex, error)
361 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
362 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
364 if test $BISON != "error"; then
365 bison_version=`$BISON --version | sed 's/^.*version 1.//g'`
366 if test `echo $bison_version | sed 's/\..*$//g'` -lt 25; then
367 AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
375 AC_DEFUN(AC_STEPMAKE_LIB, [
376 AC_CHECK_PROGS(AR, ar, error)
383 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
385 # **Never** try to set library version numbers so that they correspond
386 # to the release number of your package. This is an abuse that only
387 # fosters misunderstanding of the purpose of library versions.
389 REVISION=$PATCH_LEVEL
390 # CURRENT=$MINOR_VERSION
391 CURRENT=`expr $MINOR_VERSION + 1`
392 # AGE=$(expr $MAJOR_VERSION + 1)
399 AC_DEFUN(AC_STEPMAKE_LOCALE, [
404 AC_ARG_WITH(localedir,
405 [ with-localedir=LOCALE use LOCALE as locale dir. Default: PREFIX/share/locale ],
406 localedir=$with_localedir,
407 localedir='${prefix}/share/locale')
410 [ with-lang=LANG use LANG as language to emit messages],
414 AC_MSG_CHECKING(language)
416 En* | en* | Am* | am* | US* | us*)
418 NL | nl | Du* | du* | Ned* | ned*)
427 if test "$lang" = "unknown" ; then
428 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
433 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
434 DIR_LOCALEDIR=${localedir}
436 if test "$prefix" = "NONE"; then
437 presome=${ac_default_prefix}
439 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
441 AC_SUBST(DIR_LOCALEDIR)
442 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
444 AC_CHECK_LIB(intl, gettext)
445 AC_CHECK_FUNCS(gettext)
448 AC_DEFUN(AC_STEPMAKE_MAN, [
449 AC_CHECK_PROGS(GROFF, groff ditroff, -echo no groff)
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 #why has this been dropped?
473 AC_DEFUN(XXAC_STEPMAKE_TEXMF_DIRS, [
474 AC_ARG_ENABLE(tex-prefix,
475 [ enable-tex-prefix=DIR set the tex-directory to find TeX subdirectories. (default: PREFIX)],
476 [TEXPREFIX=$enableval],
479 AC_ARG_ENABLE(tex-dir,
480 [ enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. ],
484 AC_ARG_ENABLE(mf-dir,
485 [ enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. ],
489 if test "x$TEXPREFIX" = xauto ; then
490 AC_TEX_PREFIX(TEXPREFIX)
492 find_texprefix=$TEXPREFIX
495 if test "x$MFDIR" = xauto; then
499 if test "x$TEXDIR" = xauto ; then
500 AC_TEX_SUBDIR(TEXDIR)
507 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
508 AC_ARG_ENABLE(tex-tfmdir,
509 [ enable-tex-tfmdir=DIR set the tex-directory where cmr10.tfm lives (default: use kpsewhich)],
513 AC_CHECK_PROGS(KPSEWHICH, kpsewhich, no)
514 AC_MSG_CHECKING(for TeX TFM directory)
515 if test "x$TFMDIR" = xauto ; then
516 if test "x$TEX_TFMDIR" = "x" ; then
517 if test "x$KPSEWHICH" != "xno" ; then
518 CMR10=`kpsewhich tfm cmr10.tfm`
519 TEX_TFMDIR=`dirname $CMR10`
521 AC_STEPMAKE_WARN(Please set TEX_TFMDIR (to where cmr10.tfm lives):
522 TEX_TFMDIR=/usr/local/TeX/lib/tex/fonts ./configure)
526 AC_MSG_RESULT($TEX_TFMDIR)
530 AC_DEFUN(AC_STEPMAKE_TEXMF, [
531 # urg, never know what names these teTeX guys will think up
533 AC_CHECK_PROGS(METAFONT, mf, no)
534 if test "x$METAFONT" = "xno"; then
535 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
539 AC_CHECK_PROGS(METAPOST, mp, no)
540 if test "x$METAPOST" = "xno"; then
541 AC_CHECK_PROGS(MPOST, mpost, -echo no mp or mpost)
546 AC_CHECK_PROGS(INIMETAFONT, inimf, no)
547 if test "x$INIMETAFONT" = "xno"; then
548 AC_CHECK_PROGS(INIMFONT, inimfont, -echo no inimf or inimfont)
549 INIMETAFONT=$INIMFONT
552 AC_CHECK_PROGS(INIMETAPOST, inimp, no)
553 if test "x$INIMETAPOST" = "xno"; then
554 AC_CHECK_PROGS(INIMPOST, inimpost, -echo no inimp or inimpost)
555 INIMETAPOST=$INIMPOST
558 AC_MSG_CHECKING(for working metafont mode)
559 modelist='ljfour lj4 lj3 lj2 ljet laserjet'
560 for MFMODE in $modelist; do
561 $METAFONT "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
562 if test -f mfput.tfm; then
568 # For now let people define these in their environments
570 : ${MFPLAIN_MP=`kpsewhich mp mfplain.mp`}
572 if test ${INIMETAPOST} = "inimp" ; then
573 : ${INIMETAPOST_FLAGS=''}
575 : ${INIMETAPOST_FLAGS='-interaction=nonstopmode'}
579 AC_MSG_RESULT($MFMODE)
584 AC_SUBST(INIMETAFONT)
585 AC_SUBST(INIMETAPOST)
587 AC_SUBST(INIMETAPOST_FLAGS)
590 AC_DEFUN(AC_STEPMAKE_WARN, [
595 AC_DEFUN(AC_STEPMAKE_YODL, [
596 if test "x$YODL" = "x"; then
597 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
598 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
599 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
600 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
601 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
602 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
603 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
604 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
605 YODL2LESS_DIR='$(bindir)/'
611 AC_SUBST(YODL2LESS_DIR)
613 AC_SUBST(YODL2MSLESS)
614 AC_SUBST(YODL2TEXINFO)
616 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
618 if test "x$YODL" = "-echo no yodl"; then
619 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
623 dnl should cache result.
624 dnl should look in $prefix first.
625 dnl should probably assume TDS
627 AC_DEFUN(AC_TEX_PREFIX, [
630 AC_MSG_CHECKING(TeX/MF root dir directory)
632 find_root_prefix="$prefix"
635 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
637 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
638 find_texprefix="$find_root_prefix$postfix"
639 if test -d $find_texprefix; then
640 find_texpostfix=$postfix
645 if test "x$find_texpostfix" = x; then
646 find_texpostfix='/lib/texmf/tex'
647 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
650 find_texprefix="$find_root_prefix/$find_texpostfix"
652 # only assign if variablename not empty
653 if test x != "x[$]$1"; then
654 $1='${prefix}'/"$find_texpostfix"
656 AC_MSG_RESULT($find_texprefix)
661 # find a directory inside a prefix,
662 # $1 the prefix (expanded version)
663 # $2 variable to assign
664 # $3 the directory name
666 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
668 AC_MSG_CHECKING($4 directory)
670 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
673 if test "x$find_dirdir" = x; then
675 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
679 AC_MSG_RESULT($1/$find_dirdir)
682 # ugh. this is hopeless
683 AC_DEFUN(AC_KPSE_TEX_DIR, [
684 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
685 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
687 if test -w "$kpse_syspaths";
689 dir=`echo $kpse_syspaths | head -1`
691 dir=`echo $kpse_paths | grep -v '!'| head -1`
693 if test "$prefix" = "NONE"; then
694 local_prefix=$ac_default_prefix
695 local_prefix_quote='${prefix}'
699 local_prefix_quote=$prefix
701 echo $local_prefix_quote = $local_prefix
703 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
706 AC_DEFUN(AC_TEX_SUBDIR, [
707 dnl AC_REQUIRE([AC_TEX_PREFIX])
708 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
712 AC_DEFUN(AC_MF_SUBDIR, [
713 dnl AC_REQUIRE([AC_TEX_PREFIX])
714 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
718 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
719 result="`echo \"$1\" | grep echo`"
720 if test "x$1" = "xerror" -o "x$result" != "x"; then
721 AC_STEPMAKE_WARN(can\'t find $2. $3)
725 dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
727 dnl This macro runs the `guile-config' script, installed with Guile,
728 dnl to find out where Guile's header files and libraries are
729 dnl installed. It sets two variables, marked for substitution, as
732 dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
733 dnl code that uses Guile header files. This is almost
734 dnl always just a -I flag.
736 dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
737 dnl program against Guile. This includes `-lguile' for
738 dnl the Guile library itself, any libraries that Guile
739 dnl itself requires (like -lqthreads), and so on. It may
740 dnl also include a -L flag to tell the compiler where to
741 dnl find the libraries.
743 AC_DEFUN([GUILE_FLAGS],[
744 ## The GUILE_FLAGS macro.
745 ## First, let's just see if we can find Guile at all.
746 AC_MSG_CHECKING(for Guile)
747 guile-config link > /dev/null || {
748 echo "configure: cannot find guile-config; is Guile installed?" 1>&2
751 GUILE_CFLAGS="`guile-config compile`"
752 GUILE_LDFLAGS="`guile-config link`"
753 AC_SUBST(GUILE_CFLAGS)
754 AC_SUBST(GUILE_LDFLAGS)
759 # Configure paths for GTK+
760 # Owen Taylor 97-11-3
762 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
763 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
765 AC_DEFUN(AM_PATH_GTK,
767 dnl Get the cflags and libraries from the gtk-config script
769 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
770 min_gtk_version=ifelse([$1], ,1.1.1,$1)
771 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
773 if test "$GTK_CONFIG" != "no" ; then
774 GTK_CFLAGS=`$GTK_CONFIG --cflags`
775 GTK_LIBS=`$GTK_CONFIG --libs`
776 ac_save_CFLAGS="$CFLAGS"
778 ac_save_CXXFLAGS="$CXXFLAGS"
779 CFLAGS="$CFLAGS $GTK_CFLAGS"
780 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
781 LIBS="$LIBS $GTK_LIBS"
783 dnl Now check if the installed GTK is sufficiently new. (Also sanity
784 dnl checks the results of gtk-config to some extent)
793 int major, minor, micro;
795 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
796 printf("%s, bad version string\n", "$min_gtk_version");
800 return !((gtk_major_version > major) ||
801 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
802 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
804 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
805 CFLAGS="$ac_save_CFLAGS"
806 CXXFLAGS="$ac_save_CXXFLAGS"
811 if test "x$no_gtk" = x ; then
813 ifelse([$2], , :, [$2])
818 ifelse([$3], , :, [$3])
820 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
827 # Configure paths for GTK--
828 # Erik Andersen 30 May 1998
829 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
831 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
832 dnl to be used as follows:
833 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
836 dnl Get the cflags and libraries from the gtkmm-config script
838 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
839 Prefix where GTK-- is installed (optional)],
840 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
841 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
842 Exec prefix where GTK-- is installed (optional)],
843 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
844 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
845 , enable_gtkmmtest=yes)
847 if test x$gtkmm_config_exec_prefix != x ; then
848 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
849 if test x${GTKMM_CONFIG+set} != xset ; then
850 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
853 if test x$gtkmm_config_prefix != x ; then
854 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
855 if test x${GTKMM_CONFIG+set} != xset ; then
856 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
861 AC_DEFUN(AM_PATH_GTKMM,
865 dnl Check if the installed GTK-- is sufficiently new.
867 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
868 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
870 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
872 if test "$GTKMM_CONFIG" = "no" ; then
878 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
879 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
880 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
881 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
882 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
883 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
884 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
885 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
886 if test "x$enable_gtkmmtest" = "xyes" ; then
887 ac_save_CXXFLAGS="$CXXFLAGS"
889 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
890 LIBS="$LIBS $GTK___LIBS"
892 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
893 dnl checks the results of gtkmm-config to some extent
904 int major, minor, micro;
907 system ("touch conf.gtkmmtest");
909 /* HP/UX 0 (%@#!) writes to sscanf strings */
910 tmp_version = g_strdup("$min_gtkmm_version");
911 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
912 printf("%s, bad version string\n", "$min_gtkmm_version");
916 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
917 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
918 (gtkmm_micro_version != $gtkmm_config_micro_version))
920 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
921 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
922 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
923 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
924 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
925 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
926 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
927 printf("*** required on your system.\n");
928 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
929 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
930 printf("*** before re-running configure\n");
932 /* GTK-- does not have the GTKMM_*_VERSION constants */
934 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
935 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
936 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
938 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
939 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
940 printf("*** library (version %d.%d.%d)\n",
941 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
946 if ((gtkmm_major_version > major) ||
947 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
948 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
954 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
955 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
956 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
957 major, minor, micro);
958 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
960 printf("*** If you have already installed a sufficiently new version, this error\n");
961 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
962 printf("*** being found. The easiest way to fix this is to remove the old version\n");
963 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
964 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
965 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
966 printf("*** so that the correct libraries are found at run-time))\n");
971 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
972 CXXFLAGS="$ac_save_CXXFLAGS"
976 if test "x$no_gtkmm" = x ; then
978 ifelse([$2], , :, [$2])
981 if test "$GTKMM_CONFIG" = "no" ; then
982 echo "*** The gtkmm-config script installed by GTK-- could not be found"
983 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
984 echo "*** your path, or set the GTK_CONFIG environment variable to the"
985 echo "*** full path to gtk-config."
986 echo "*** The gtkmm-config script was not available in GTK-- versions"
987 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
988 echo "*** version to 0.9.12 or newer"
990 if test -f conf.gtkmmtest ; then
993 echo "*** Could not run GTK-- test program, checking why..."
994 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
995 LIBS="$LIBS $GTK___LIBS"
999 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
1000 [ echo "*** The test program compiled, but did not run. This usually means"
1001 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
1002 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
1003 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1004 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1005 echo "*** is required on your system"
1007 echo "*** If you have an old version installed, it is best to remove it, although"
1008 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
1009 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1010 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
1011 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
1012 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
1013 CXXFLAGS="$ac_save_CXXFLAGS"
1014 LIBS="$ac_save_LIBS"
1019 ifelse([$3], , :, [$3])
1022 AC_SUBST(GTK___CFLAGS)
1023 AC_SUBST(GTK___LIBS)
1024 rm -f conf.gtkmmtest
1027 # Configure paths for GTK--DRAW
1028 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
1030 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1031 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
1033 AC_DEFUN(AM_PATH_GTK__DRAW,
1035 dnl Get the cflags and libraries from the gtk__-config script
1037 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
1038 min_gtk___version=ifelse([$1], ,0.0.5,$1)
1039 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
1041 if test "$GTKMM_CONFIG" != "no" ; then
1042 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
1043 GTK___LIBS=`$GTKMM_CONFIG --libs`
1044 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
1045 GTK___LIBS="$GTK___DLIBS"
1046 ac_save_CFLAGS="$CFLAGS"
1047 ac_save_LIBS="$LIBS"
1048 ac_save_CXXFLAGS="$CXXFLAGS"
1049 CFLAGS="$CFLAGS $GTK___CFLAGS"
1050 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1051 LIBS="$LIBS $GTK___LIBS"
1053 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
1054 dnl checks the results of gtk__-config to some extent)
1066 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1067 CFLAGS="$ac_save_CFLAGS"
1068 CXXFLAGS="$ac_save_CXXFLAGS"
1069 LIBS="$ac_save_LIBS"
1073 if test "x$no_gtk__" = x ; then
1075 ifelse([$2], , :, [$2])
1080 ifelse([$3], , :, [$3])
1082 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1084 AC_SUBST(GTK___CFLAGS)
1085 AC_SUBST(GTK___LIBS)