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
167 AC_CHECK_LIB(guile, gh_scm2doubles,
168 [LIBS="`echo $GUILE_LDFLAGS | sed -e 's/-L[[/-_a-zA-Z0-9]]\+ //g'` $LIBS"
169 AC_DEFINE(HAVE_LIBGUILE)], , $GUILE_LDFLAGS dnl
171 if test "$ac_cv_lib_guile_gh_scm2doubles" != yes ; then
172 AC_STEPMAKE_WARN(You should install guile 1.3 or newer)
176 AC_DEFUN(AC_STEPMAKE_INIT, [
179 FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
180 if test x$MY_PATCH_LEVEL != x; then
181 FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
184 # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
185 changequote(<<, >>)dnl
186 PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
187 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
190 # No versioning on directory names of sub-packages
192 stepmake=${datadir}/stepmake
194 if test "$prefix" = "NONE"; then
195 presome=${ac_default_prefix}
197 stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
199 if test "x$PACKAGE" = "xSTEPMAKE"; then
200 echo Stepmake package!
201 (cd stepmake; rm -f stepmake; ln -s ../stepmake .)
202 (cd stepmake; rm -f bin; ln -s ../bin .)
203 AC_CONFIG_AUX_DIR(bin)
206 echo Package: $PACKAGE
207 # Check for installed stepmake
208 if test -d $stepmake; then
209 echo Using installed stepmake: $stepmake
211 stepmake='$(depth)'/stepmake
212 echo Using local stepmake: $datadir/stepmake not found
215 $HOME/usr/local/share/stepmake/bin\
216 $HOME/usr/local/lib/stepmake/bin\
217 $HOME/usr/share/stepmake/bin\
218 $HOME/usr/lib/stepmake/bin\
219 /usr/local/share/stepmake/bin\
220 /usr/local/lib/stepmake/bin\
221 /usr/share/stepmake/bin\
222 /usr/lib/stepmake/bin\
230 AC_SUBST(PACKAGE_NAME)
231 AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
232 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
234 if test "$package_depth" = "" ; then
237 package_depth="../$package_depth"
240 AC_SUBST(package_depth)
242 AUTOGENERATE="This file was automatically generated by configure"
243 AC_SUBST(AUTOGENERATE)
244 absolute_builddir="`pwd`"
245 AC_SUBST(absolute_builddir)
247 STATE_VECTOR=`ls make/STATE-VECTOR 2>/dev/null`
248 if test "x$STATE_VECTOR" != "x"; then
249 STATE_VECTOR="\$(depth)/$STATE_VECTOR"
251 AC_SUBST(STATE_VECTOR)
254 AC_ARG_ENABLE(config,
255 [ enable-config=FILE put configure settings in config-FILE.make],
256 [CONFIGSUFFIX=$enableval])
258 if test "$CONFIGSUFFIX" != "" ; then
259 CONFIGFILE=config-$CONFIGSUFFIX
263 AC_SUBST(CONFIGSUFFIX)
266 AC_CHECK_PROGS(MAKE, gmake make, error)
267 AC_CHECK_PROGS(FIND, find, error)
269 dnl system supplied INSTALL is unsafe; use our own install.
271 dnl if test "$INSTALL" = "bin/install-sh"; then
272 dnl export INSTALL="\$\(depth\)/bin/install-sh"
275 AC_CHECK_PROGS(TAR, tar, error)
276 AC_CHECK_PROGS(BASH, bash, /bin/sh)
278 AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
281 if test $MAKE != "error" ; then
282 $MAKE -v 2> /dev/null | grep GNU > /dev/null
285 AC_STEPMAKE_WARN(Please install *GNU* make)
289 AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
291 if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
292 LN=cp # hard link does not work under cygnus-nt
293 LN_S='cp -r' # symbolic link does not work for native nt
300 # cygwin fixes all these things.
301 # it seems these were used because of dos-style TEXINPUTS and
302 # MFINPUTS needed for miktex.
303 # but this breaks parsing of all other cygwin/unix style paths.
305 # if your (mik)tex breaks, make a:
306 # /usr/local/bin/tex:
308 # TEXINPUTS=`cygpath -pw $TEXINPUTS` /texmf/miktex/bin/tex $*
314 # MFINPUTS=`cygpath -pw $MFINPUTS` /texmf/miktex/bin/mf $*
316 # this way, you may have buildscripts/out/lilypond-profile
317 # 'automatically' sourced from /usr/etc/profile.d/ too.
321 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
328 INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
335 AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
336 AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
344 AC_DEFUN(AC_STEPMAKE_LEXYACC, [
345 # ugh, automake: we want (and check for) bison
347 # ugh, automake: we want (and check for) flex
349 # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
353 ac_cv_prog_lex_root=lex.yy
355 AC_CHECK_PROGS(BISON, bison, error)
356 AC_CHECK_PROGS(FLEX, flex, error)
357 AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
358 AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
360 if test $BISON != "error"; then
361 bison_version=`$BISON --version | sed 's/^.*version 1.//g'`
362 if test `echo $bison_version | sed 's/\..*$//g'` -lt 25; then
363 AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
371 AC_DEFUN(AC_STEPMAKE_LIB, [
372 AC_CHECK_PROGS(AR, ar, error)
379 AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
381 # **Never** try to set library version numbers so that they correspond
382 # to the release number of your package. This is an abuse that only
383 # fosters misunderstanding of the purpose of library versions.
385 REVISION=$PATCH_LEVEL
386 # CURRENT=$MINOR_VERSION
387 CURRENT=`expr $MINOR_VERSION + 1`
388 # AGE=$(expr $MAJOR_VERSION + 1)
395 AC_DEFUN(AC_STEPMAKE_LOCALE, [
400 AC_ARG_WITH(localedir,
401 [ with-localedir=LOCALE use LOCALE as locale dir. Default: PREFIX/share/locale ],
402 localedir=$with_localedir,
403 localedir='${prefix}/share/locale')
406 [ with-lang=LANG use LANG as language to emit messages],
410 AC_MSG_CHECKING(language)
412 En* | en* | Am* | am* | US* | us*)
414 NL | nl | Du* | du* | Ned* | ned*)
423 if test "$lang" = "unknown" ; then
424 AC_STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
429 AC_DEFUN(AC_STEPMAKE_GETTEXT, [
430 DIR_LOCALEDIR=${localedir}
432 if test "$prefix" = "NONE"; then
433 presome=${ac_default_prefix}
435 DIR_LOCALEDIR=`echo ${DIR_LOCALEDIR} | sed "s!\\\${prefix}!$presome!"`
437 AC_SUBST(DIR_LOCALEDIR)
438 AC_DEFINE_UNQUOTED(DIR_LOCALEDIR, "${DIR_LOCALEDIR}")
440 AC_CHECK_LIB(intl, gettext)
441 AC_CHECK_FUNCS(gettext)
444 AC_DEFUN(AC_STEPMAKE_MAN, [
445 AC_CHECK_PROGS(GROFF, groff ditroff, -echo no groff)
446 AC_CHECK_PROGS(TROFF, troff, -echo no troff)
447 AC_CHECK_PROGS(TBL, tbl, cat)
450 AC_DEFUN(AC_STEPMAKE_MSGFMT, [
451 # AC_CHECK_PROGS(MSGFMT, msgfmt, -echo no msgfmt)
452 AC_CHECK_PROGS(MSGFMT, msgfmt, \$(SHELL) \$(step-bindir)/fake-msgfmt.sh )
453 AC_MSG_CHECKING(whether msgfmt accepts -o)
454 msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
455 if test "$msgfmt_output" = ""; then
459 MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh"
461 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
463 if test ! -n "$MSGFMT"; then
464 AC_STEPMAKE_WARN(please install msgfmt from GNU gettext)
468 AC_DEFUN(AC_STEPMAKE_TEXMF_DIRS, [
469 AC_ARG_ENABLE(tex-prefix,
470 [ enable-tex-prefix=DIR set the tex-directory to find TeX subdirectories. (default: PREFIX)],
471 [TEXPREFIX=$enableval],
474 AC_ARG_ENABLE(tex-dir,
475 [ enable-tex-dir=DIR set the directory to put $PACKAGE_NAME TeX files in. ],
479 AC_ARG_ENABLE(mf-dir,
480 [ enable-mf-dir=DIR set the directory to put $PACKAGE_NAME MetaFont files in. ],
484 if test "x$TEXPREFIX" = xauto ; then
485 AC_TEX_PREFIX(TEXPREFIX)
487 find_texprefix=$TEXPREFIX
490 if test "x$MFDIR" = xauto; then
494 if test "x$TEXDIR" = xauto ; then
495 AC_TEX_SUBDIR(TEXDIR)
502 AC_DEFUN(AC_STEPMAKE_TEXMF, [
503 # urg, never know what names these teTeX guys will think up
504 AC_CHECK_PROGS(METAFONT, mf, no)
505 if test "x$METAFONT" = "xno"; then
506 AC_CHECK_PROGS(MFONT, mfont, -echo no mf or mfont)
510 AC_CHECK_PROGS(METAPOST, mp, no)
511 if test "x$METAPOST" = "xno"; then
512 AC_CHECK_PROGS(MPOST, mpost, -echo no mp or mpost)
520 AC_DEFUN(AC_STEPMAKE_WARN, [
525 AC_DEFUN(AC_STEPMAKE_YODL, [
526 if test "x$YODL" = "x"; then
527 AC_CHECK_PROGS(STRIPROFF, striproff, -echo no striproff)
528 AC_CHECK_PROGS(YODL, yodl, -echo no yodl)
529 AC_CHECK_PROGS(YODL2HTML, yodl2html, -echo no yodl)
530 AC_CHECK_PROGS(YODL2LATEX, yodl2latex, )
531 AC_CHECK_PROGS(YODL2MAN, yodl2man, -echo no yodl)
532 AC_CHECK_PROGS(YODL2MSLESS, yodl2msless, -echo no yodl)
533 AC_CHECK_PROGS(YODL2TEXINFO, yodl2texinfo, -echo no yodl)
534 AC_CHECK_PROGS(YODL2TXT, yodl2txt, -echo no yodl)
535 YODL2LESS_DIR='$(bindir)/'
541 AC_SUBST(YODL2LESS_DIR)
543 AC_SUBST(YODL2MSLESS)
544 AC_SUBST(YODL2TEXINFO)
546 export STRIPROFF YODL YODL2HTML YODL2LATEX YODL2MAN YODL2MSLESS YODL2TEXINFO YODL2TXT
548 if test "x$YODL" = "-echo no yodl"; then
549 AC_STEPMAKE_WARN(Did not find YODL (Yodl is Yet Oneother Document Language, see http://www.cs.uu.nl/~hanwen/yodl))
553 dnl should cache result.
554 dnl should look in $prefix first.
555 dnl should probably assume TDS
557 AC_DEFUN(AC_TEX_PREFIX, [
560 AC_MSG_CHECKING(TeX/MF root dir directory)
562 find_root_prefix="$prefix"
565 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
567 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
568 find_texprefix="$find_root_prefix$postfix"
569 if test -d $find_texprefix; then
570 find_texpostfix=$postfix
575 if test "x$find_texpostfix" = x; then
576 find_texpostfix='/lib/texmf/tex'
577 AC_STEPMAKE_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
580 find_texprefix="$find_root_prefix/$find_texpostfix"
582 # only assign if variablename not empty
583 if test x != "x[$]$1"; then
584 $1='${prefix}'/"$find_texpostfix"
586 AC_MSG_RESULT($find_texprefix)
591 # find a directory inside a prefix,
592 # $1 the prefix (expanded version)
593 # $2 variable to assign
594 # $3 the directory name
596 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
598 AC_MSG_CHECKING($4 directory)
600 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
603 if test "x$find_dirdir" = x; then
605 AC_STEPMAKE_WARN(Cannot determine $4 subdirectory. Please set from command-line)
609 AC_MSG_RESULT($1/$find_dirdir)
612 # ugh. this is hopeless
613 AC_DEFUN(AC_KPSE_TEX_DIR, [
614 kpse_paths=`(kpsepath -n latex tex; kpsepath -n tex tex) | sed 's/:/ /g' | tr ' ' '\012' |sort | uniq -d`
615 kpse_syspaths=`echo $kpse_paths | grep '!'| sed 's/!//g'`
617 if test -w "$kpse_syspaths";
619 dir=`echo $kpse_syspaths | head -1`
621 dir=`echo $kpse_paths | grep -v '!'| head -1`
623 if test "$prefix" = "NONE"; then
624 local_prefix=$ac_default_prefix
625 local_prefix_quote='${prefix}'
629 local_prefix_quote=$prefix
631 echo $local_prefix_quote = $local_prefix
633 echo $dir | sed 's!'$local_prefix'!\$local_prefix_quote!g'
636 AC_DEFUN(AC_TEX_SUBDIR, [
637 dnl AC_REQUIRE([AC_TEX_PREFIX])
638 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
642 AC_DEFUN(AC_MF_SUBDIR, [
643 dnl AC_REQUIRE([AC_TEX_PREFIX])
644 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
648 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
649 result="`echo \"$1\" | grep echo`"
650 if test "x$1" = "xerror" -o "x$result" != "x"; then
651 AC_STEPMAKE_WARN(can\'t find $2. $3)
655 dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
657 dnl This macro runs the `guile-config' script, installed with Guile,
658 dnl to find out where Guile's header files and libraries are
659 dnl installed. It sets two variables, marked for substitution, as
662 dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
663 dnl code that uses Guile header files. This is almost
664 dnl always just a -I flag.
666 dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
667 dnl program against Guile. This includes `-lguile' for
668 dnl the Guile library itself, any libraries that Guile
669 dnl itself requires (like -lqthreads), and so on. It may
670 dnl also include a -L flag to tell the compiler where to
671 dnl find the libraries.
673 AC_DEFUN([GUILE_FLAGS],[
674 ## The GUILE_FLAGS macro.
675 ## First, let's just see if we can find Guile at all.
676 AC_MSG_CHECKING(for Guile)
677 guile-config link > /dev/null || {
678 echo "configure: cannot find guile-config; is Guile installed?" 1>&2
681 GUILE_CFLAGS="`guile-config compile`"
682 GUILE_LDFLAGS="`guile-config link`"
683 AC_SUBST(GUILE_CFLAGS)
684 AC_SUBST(GUILE_LDFLAGS)
689 # Configure paths for GTK+
690 # Owen Taylor 97-11-3
692 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
693 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
695 AC_DEFUN(AM_PATH_GTK,
697 dnl Get the cflags and libraries from the gtk-config script
699 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
700 min_gtk_version=ifelse([$1], ,1.1.1,$1)
701 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
703 if test "$GTK_CONFIG" != "no" ; then
704 GTK_CFLAGS=`$GTK_CONFIG --cflags`
705 GTK_LIBS=`$GTK_CONFIG --libs`
706 ac_save_CFLAGS="$CFLAGS"
708 ac_save_CXXFLAGS="$CXXFLAGS"
709 CFLAGS="$CFLAGS $GTK_CFLAGS"
710 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
711 LIBS="$LIBS $GTK_LIBS"
713 dnl Now check if the installed GTK is sufficiently new. (Also sanity
714 dnl checks the results of gtk-config to some extent)
723 int major, minor, micro;
725 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
726 printf("%s, bad version string\n", "$min_gtk_version");
730 return !((gtk_major_version > major) ||
731 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
732 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
734 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
735 CFLAGS="$ac_save_CFLAGS"
736 CXXFLAGS="$ac_save_CXXFLAGS"
741 if test "x$no_gtk" = x ; then
743 ifelse([$2], , :, [$2])
748 ifelse([$3], , :, [$3])
750 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
757 # Configure paths for GTK--
758 # Erik Andersen 30 May 1998
759 # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
761 dnl Test for GTK__, and define GTK___CFLAGS and GTK___LIBS
762 dnl to be used as follows:
763 dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
766 dnl Get the cflags and libraries from the gtkmm-config script
768 AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
769 Prefix where GTK-- is installed (optional)],
770 gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
771 AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
772 Exec prefix where GTK-- is installed (optional)],
773 gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
774 AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
775 , enable_gtkmmtest=yes)
777 if test x$gtkmm_config_exec_prefix != x ; then
778 gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
779 if test x${GTKMM_CONFIG+set} != xset ; then
780 GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
783 if test x$gtkmm_config_prefix != x ; then
784 gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
785 if test x${GTKMM_CONFIG+set} != xset ; then
786 GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
791 AC_DEFUN(AM_PATH_GTKMM,
795 dnl Check if the installed GTK-- is sufficiently new.
797 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
798 min_gtkmm_version=ifelse([$1], ,0.9.14,$1)
800 AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
802 if test "$GTKMM_CONFIG" = "no" ; then
808 GTK___CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
809 GTK___LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
810 gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
811 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
812 gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
813 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
814 gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
815 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
816 if test "x$enable_gtkmmtest" = "xyes" ; then
817 ac_save_CXXFLAGS="$CXXFLAGS"
819 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
820 LIBS="$LIBS $GTK___LIBS"
822 dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
823 dnl checks the results of gtkmm-config to some extent
834 int major, minor, micro;
837 system ("touch conf.gtkmmtest");
839 /* HP/UX 0 (%@#!) writes to sscanf strings */
840 tmp_version = g_strdup("$min_gtkmm_version");
841 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
842 printf("%s, bad version string\n", "$min_gtkmm_version");
846 if ((gtkmm_major_version != $gtkmm_config_major_version) ||
847 (gtkmm_minor_version != $gtkmm_config_minor_version) ||
848 (gtkmm_micro_version != $gtkmm_config_micro_version))
850 printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
851 $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
852 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
853 printf ("*** was found! If gtkmm-config was correct, then it is best\n");
854 printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
855 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
856 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
857 printf("*** required on your system.\n");
858 printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
859 printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
860 printf("*** before re-running configure\n");
862 /* GTK-- does not have the GTKMM_*_VERSION constants */
864 else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
865 (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
866 (gtkmm_micro_version != GTKMM_MICRO_VERSION))
868 printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
869 GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
870 printf("*** library (version %d.%d.%d)\n",
871 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
876 if ((gtkmm_major_version > major) ||
877 ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
878 ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
884 printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
885 gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
886 printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
887 major, minor, micro);
888 printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
890 printf("*** If you have already installed a sufficiently new version, this error\n");
891 printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
892 printf("*** being found. The easiest way to fix this is to remove the old version\n");
893 printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
894 printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
895 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
896 printf("*** so that the correct libraries are found at run-time))\n");
901 ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
902 CXXFLAGS="$ac_save_CXXFLAGS"
906 if test "x$no_gtkmm" = x ; then
908 ifelse([$2], , :, [$2])
911 if test "$GTKMM_CONFIG" = "no" ; then
912 echo "*** The gtkmm-config script installed by GTK-- could not be found"
913 echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
914 echo "*** your path, or set the GTK_CONFIG environment variable to the"
915 echo "*** full path to gtk-config."
916 echo "*** The gtkmm-config script was not available in GTK-- versions"
917 echo "*** prior to 0.9.12. Perhaps you need to update your installed"
918 echo "*** version to 0.9.12 or newer"
920 if test -f conf.gtkmmtest ; then
923 echo "*** Could not run GTK-- test program, checking why..."
924 CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
925 LIBS="$LIBS $GTK___LIBS"
929 ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
930 [ echo "*** The test program compiled, but did not run. This usually means"
931 echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
932 echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
933 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
934 echo "*** to the installed location Also, make sure you have run ldconfig if that"
935 echo "*** is required on your system"
937 echo "*** If you have an old version installed, it is best to remove it, although"
938 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
939 [ echo "*** The test program failed to compile or link. See the file config.log for the"
940 echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
941 echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
942 echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
943 CXXFLAGS="$ac_save_CXXFLAGS"
949 ifelse([$3], , :, [$3])
952 AC_SUBST(GTK___CFLAGS)
957 # Configure paths for GTK--DRAW
958 # Derek Quinn Wyatt 98-08-21 (adapted from Jan Nieuwenhuizen's code)
960 dnl AM_PATH_GTK__DRAW([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
961 dnl Test for GTK--DRAW, and define GTK___CFLAGS and GTK___LIBS
963 AC_DEFUN(AM_PATH_GTK__DRAW,
965 dnl Get the cflags and libraries from the gtk__-config script
967 AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
968 min_gtk___version=ifelse([$1], ,0.0.5,$1)
969 AC_MSG_CHECKING(for GTK--DRAW - version >= $min_gtk___version)
971 if test "$GTKMM_CONFIG" != "no" ; then
972 GTK___CFLAGS=`$GTKMM_CONFIG --cflags`
973 GTK___LIBS=`$GTKMM_CONFIG --libs`
974 GTK___DLIBS="$GTK___LIBS -lgtkmmdraw"
975 GTK___LIBS="$GTK___DLIBS"
976 ac_save_CFLAGS="$CFLAGS"
978 ac_save_CXXFLAGS="$CXXFLAGS"
979 CFLAGS="$CFLAGS $GTK___CFLAGS"
980 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
981 LIBS="$LIBS $GTK___LIBS"
983 dnl Now check if the installed GTK__ is sufficiently new. (Also sanity
984 dnl checks the results of gtk__-config to some extent)
996 ],, no_gtk__=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
997 CFLAGS="$ac_save_CFLAGS"
998 CXXFLAGS="$ac_save_CXXFLAGS"
1003 if test "x$no_gtk__" = x ; then
1005 ifelse([$2], , :, [$2])
1010 ifelse([$3], , :, [$3])
1012 CXXFLAGS="$CXXFLAGS $GTK___CFLAGS"
1014 AC_SUBST(GTK___CFLAGS)
1015 AC_SUBST(GTK___LIBS)
1018 dnl GUILE_FLAGS --- set flags for compiling and linking with Guile
1020 dnl This macro runs the `guile-config' script, installed with Guile,
1021 dnl to find out where Guile's header files and libraries are
1022 dnl installed. It sets two variables, marked for substitution, as
1025 dnl GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
1026 dnl code that uses Guile header files. This is almost
1027 dnl always just a -I flag.
1029 dnl GUILE_LDFLAGS --- flags to pass to the linker to link a
1030 dnl program against Guile. This includes `-lguile' for
1031 dnl the Guile library itself, any libraries that Guile
1032 dnl itself requires (like -lqthreads), and so on. It may
1033 dnl also include a -L flag to tell the compiler where to
1034 dnl find the libraries.
1036 AC_DEFUN([GUILE_FLAGS],[
1037 ## The GUILE_FLAGS macro.
1038 ## First, let's just see if we can find Guile at all.
1039 AC_MSG_CHECKING(for Guile)
1040 guile-config link > /dev/null || {
1041 echo "configure: cannot find guile-config; is Guile installed?" 1>&2
1044 GUILE_CFLAGS="`guile-config compile`"
1045 GUILE_LDFLAGS="`guile-config link`"
1046 AC_SUBST(GUILE_CFLAGS)
1047 AC_SUBST(GUILE_LDFLAGS)