]> git.donarmstrong.com Git - lilypond.git/blob - aclocal.m4
release: 0.1.57
[lilypond.git] / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.3
2
3 dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
4 dnl This Makefile.in is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
12
13
14 AC_DEFUN(AC_JUNK_ARGS, [
15 ])
16
17 AC_DEFUN(AC_LILY_WARN, [
18     AC_MSG_WARN($1)
19     warn_b=yes
20 ])
21
22 dnl should cache result.
23 dnl should  look in $prefix first.
24 dnl should probably assume TDS
25
26 AC_DEFUN(AC_TEX_PREFIX, [
27     
28
29     AC_MSG_CHECKING(TeX/MF root dir directory)    
30
31     find_root_prefix="$prefix"
32     
33
34     test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
35     find_texpostfix="";
36     for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
37         find_texprefix="$find_root_prefix$postfix"
38         if test -d $find_texprefix; then
39             find_texpostfix=$postfix
40             break;
41         fi
42     done
43     
44     if test "x$find_texpostfix" = x; then
45         find_texpostfix='/lib/texmf/tex'
46         AC_LILY_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
47     fi
48
49     find_texprefix="$find_root_prefix/$find_texpostfix"
50
51     # only assign if variablename not empty
52     if test x != "x[$]$1"; then
53         $1='${prefix}'/"$find_texpostfix"
54     fi
55     AC_MSG_RESULT($find_texprefix)
56
57 ])
58  
59
60 # find a directory inside a prefix, 
61 # $1 the prefix (expanded version)
62 # $2 variable to assign
63 # $3 the directory name 
64 # $4 description
65 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
66     
67     AC_MSG_CHECKING($4 directory)    
68     find_dirdir=`(cd $1; 
69       $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
70     
71
72     if test "x$find_dirdir" = x; then
73        find_dirdir="/$3";
74        AC_LILY_WARN(Cannot determine $4 subdirectory. Please set from command-line)
75         true
76     fi
77     $2=$find_dirdir
78     AC_MSG_RESULT($1/$find_dirdir)
79 ])
80
81 AC_DEFUN(AC_TEX_SUBDIR, [
82 dnl    AC_REQUIRE([AC_TEX_PREFIX])
83     AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
84     $1="$TEXPREFIX/$$1"
85 ])
86
87 AC_DEFUN(AC_MF_SUBDIR, [
88 dnl     AC_REQUIRE([AC_TEX_PREFIX])
89     AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
90     $1="$TEXPREFIX/$$1"
91 ])
92
93 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
94         if test $1 = "error" 
95         then
96                 AC_LILY_WARN(can't find $2. $3)
97         fi
98 ])
99
100 # Do all the work for Automake.  This macro actually does too much --
101 # some checks are only needed if your package does certain things.
102 # But this isn't really a big deal.
103
104 # serial 1
105
106 dnl Usage:
107 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
108
109 AC_DEFUN(AM_INIT_AUTOMAKE,
110 [AC_REQUIRE([AM_PROG_INSTALL])
111 PACKAGE=[$1]
112 AC_SUBST(PACKAGE)
113 VERSION=[$2]
114 AC_SUBST(VERSION)
115 dnl test to see if srcdir already configured
116 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
117   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
118 fi
119 ifelse([$3],,
120 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
121 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
122 AC_REQUIRE([AM_SANITY_CHECK])
123 AC_REQUIRE([AC_ARG_PROGRAM])
124 dnl FIXME This is truly gross.
125 missing_dir=`cd $ac_aux_dir && pwd`
126 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
127 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
128 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
129 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
130 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
131 AC_REQUIRE([AC_PROG_MAKE_SET])])
132
133
134 # serial 1
135
136 AC_DEFUN(AM_PROG_INSTALL,
137 [AC_REQUIRE([AC_PROG_INSTALL])
138 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
139 AC_SUBST(INSTALL_SCRIPT)dnl
140 ])
141
142 #
143 # Check to make sure that the build environment is sane.
144 #
145
146 AC_DEFUN(AM_SANITY_CHECK,
147 [AC_MSG_CHECKING([whether build environment is sane])
148 # Just in case
149 sleep 1
150 echo timestamp > conftestfile
151 # Do `set' in a subshell so we don't clobber the current shell's
152 # arguments.  Must try -L first in case configure is actually a
153 # symlink; some systems play weird games with the mod time of symlinks
154 # (eg FreeBSD returns the mod time of the symlink's containing
155 # directory).
156 if (
157    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
158    if test "[$]*" = "X"; then
159       # -L didn't work.
160       set X `ls -t $srcdir/configure conftestfile`
161    fi
162    if test "[$]*" != "X $srcdir/configure conftestfile" \
163       && test "[$]*" != "X conftestfile $srcdir/configure"; then
164
165       # If neither matched, then we have a broken ls.  This can happen
166       # if, for instance, CONFIG_SHELL is bash and it inherits a
167       # broken ls alias from the environment.  This has actually
168       # happened.  Such a system could not be considered "sane".
169       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
170 alias in your environment])
171    fi
172
173    test "[$]2" = conftestfile
174    )
175 then
176    # Ok.
177    :
178 else
179    AC_MSG_ERROR([newly created file is older than distributed files!
180 Check your system clock])
181 fi
182 rm -f conftest*
183 AC_MSG_RESULT(yes)])
184
185 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
186 dnl The program must properly implement --version.
187 AC_DEFUN(AM_MISSING_PROG,
188 [AC_MSG_CHECKING(for working $2)
189 # Run test in a subshell; some versions of sh will print an error if
190 # an executable is not found, even if stderr is redirected.
191 # Redirect stdin to placate older versions of autoconf.  Sigh.
192 if ($2 --version) < /dev/null > /dev/null 2>&1; then
193    $1=$2
194    AC_MSG_RESULT(found)
195 else
196    $1="$3/missing $2"
197    AC_MSG_RESULT(missing)
198 fi
199 AC_SUBST($1)])
200
201
202 # serial 24 AM_PROG_LIBTOOL
203 AC_DEFUN(AM_PROG_LIBTOOL,
204 [AC_REQUIRE([AM_ENABLE_SHARED])dnl
205 AC_REQUIRE([AM_ENABLE_STATIC])dnl
206 AC_REQUIRE([AC_CANONICAL_HOST])dnl
207 AC_REQUIRE([AC_PROG_RANLIB])dnl
208 AC_REQUIRE([AC_PROG_CC])dnl
209 AC_REQUIRE([AM_PROG_LD])dnl
210 AC_REQUIRE([AM_PROG_NM])dnl
211 AC_REQUIRE([AC_PROG_LN_S])dnl
212 dnl
213 # Always use our own libtool.
214 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
215 AC_SUBST(LIBTOOL)dnl
216
217 # Check for any special flags to pass to ltconfig.
218 libtool_flags=
219 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
220 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
221 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
222 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
223 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
224
225 # Some flags need to be propagated to the compiler or linker for good
226 # libtool support.
227 case "$host" in
228 *-*-irix6*)
229   # Find out which ABI we are using.
230   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
231   if AC_TRY_EVAL(ac_compile); then
232     case "`/usr/bin/file conftest.o`" in
233     *32-bit*)
234       LD="${LD-ld} -32"
235       ;;
236     *N32*)
237       LD="${LD-ld} -n32"
238       ;;
239     *64-bit*)
240       LD="${LD-ld} -64"
241       ;;
242     esac
243   fi
244   rm -rf conftest*
245   ;;
246
247 *-*-sco3.2v5*)
248   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
249   CFLAGS="$CFLAGS -belf"
250   ;;
251 esac
252
253 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
254 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
255 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
256 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
257 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
258 || AC_MSG_ERROR([libtool configure failed])
259 ])
260
261 # AM_ENABLE_SHARED - implement the --enable-shared flag
262 # Usage: AM_ENABLE_SHARED[(DEFAULT)]
263 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
264 #   `yes'.
265 AC_DEFUN(AM_ENABLE_SHARED,
266 [define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
267 AC_ARG_ENABLE(shared,
268 changequote(<<, >>)dnl
269 <<  --enable-shared         build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
270 changequote([, ])dnl
271 [  --enable-shared=PKGS    only build shared libraries if the current package
272                           appears as an element in the PKGS list],
273 [p=${PACKAGE-default}
274 case "$enableval" in
275 yes) enable_shared=yes ;;
276 no) enable_shared=no ;;
277 *)
278   enable_shared=no
279   # Look at the argument we got.  We use all the common list separators.
280   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
281   for pkg in $enableval; do
282     if test "X$pkg" = "X$p"; then
283       enable_shared=yes
284     fi
285   done
286   IFS="$ac_save_ifs"
287   ;;
288 esac],
289 enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
290 ])
291
292 # AM_DISABLE_SHARED - set the default shared flag to --disable-shared
293 AC_DEFUN(AM_DISABLE_SHARED,
294 [AM_ENABLE_SHARED(no)])
295
296 # AM_DISABLE_STATIC - set the default static flag to --disable-static
297 AC_DEFUN(AM_DISABLE_STATIC,
298 [AM_ENABLE_STATIC(no)])
299
300 # AM_ENABLE_STATIC - implement the --enable-static flag
301 # Usage: AM_ENABLE_STATIC[(DEFAULT)]
302 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
303 #   `yes'.
304 AC_DEFUN(AM_ENABLE_STATIC,
305 [define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
306 AC_ARG_ENABLE(static,
307 changequote(<<, >>)dnl
308 <<  --enable-static         build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
309 changequote([, ])dnl
310 [  --enable-static=PKGS    only build shared libraries if the current package
311                           appears as an element in the PKGS list],
312 [p=${PACKAGE-default}
313 case "$enableval" in
314 yes) enable_static=yes ;;
315 no) enable_static=no ;;
316 *)
317   enable_static=no
318   # Look at the argument we got.  We use all the common list separators.
319   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
320   for pkg in $enableval; do
321     if test "X$pkg" = "X$p"; then
322       enable_static=yes
323     fi
324   done
325   IFS="$ac_save_ifs"
326   ;;
327 esac],
328 enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
329 ])
330
331
332 # AM_PROG_LD - find the path to the GNU or non-GNU linker
333 AC_DEFUN(AM_PROG_LD,
334 [AC_ARG_WITH(gnu-ld,
335 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
336 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
337 AC_REQUIRE([AC_PROG_CC])
338 ac_prog=ld
339 if test "$ac_cv_prog_gcc" = yes; then
340   # Check if gcc -print-prog-name=ld gives a path.
341   AC_MSG_CHECKING([for ld used by GCC])
342   ac_prog=`($CC -print-prog-name=ld) 2>&5`
343   case "$ac_prog" in
344   # Accept absolute paths.
345   /* | [A-Za-z]:\\*)
346     test -z "$LD" && LD="$ac_prog"
347     ;;
348   "")
349     # If it fails, then pretend we aren't using GCC.
350     ac_prog=ld
351     ;;
352   *)
353     # If it is relative, then search for the first ld in PATH.
354     with_gnu_ld=unknown
355     ;;
356   esac
357 elif test "$with_gnu_ld" = yes; then
358   AC_MSG_CHECKING([for GNU ld])
359 else
360   AC_MSG_CHECKING([for non-GNU ld])
361 fi
362 AC_CACHE_VAL(ac_cv_path_LD,
363 [if test -z "$LD"; then
364   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
365   for ac_dir in $PATH; do
366     test -z "$ac_dir" && ac_dir=.
367     if test -f "$ac_dir/$ac_prog"; then
368       ac_cv_path_LD="$ac_dir/$ac_prog"
369       # Check to see if the program is GNU ld.  I'd rather use --version,
370       # but apparently some GNU ld's only accept -v.
371       # Break only if it was the GNU/non-GNU ld that we prefer.
372       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
373         test "$with_gnu_ld" != no && break
374       else
375         test "$with_gnu_ld" != yes && break
376       fi
377     fi
378   done
379   IFS="$ac_save_ifs"
380 else
381   ac_cv_path_LD="$LD" # Let the user override the test with a path.
382 fi])
383 LD="$ac_cv_path_LD"
384 if test -n "$LD"; then
385   AC_MSG_RESULT($LD)
386 else
387   AC_MSG_RESULT(no)
388 fi
389 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
390 AC_SUBST(LD)
391 AM_PROG_LD_GNU
392 ])
393
394 AC_DEFUN(AM_PROG_LD_GNU,
395 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
396 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
397 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
398   ac_cv_prog_gnu_ld=yes
399 else
400   ac_cv_prog_gnu_ld=no
401 fi])
402 ])
403
404 # AM_PROG_NM - find the path to a BSD-compatible name lister
405 AC_DEFUN(AM_PROG_NM,
406 [AC_MSG_CHECKING([for BSD-compatible nm])
407 AC_CACHE_VAL(ac_cv_path_NM,
408 [case "$NM" in
409 /* | [A-Za-z]:\\*)
410   ac_cv_path_NM="$NM" # Let the user override the test with a path.
411   ;;
412 *)
413   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
414   for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
415     test -z "$ac_dir" && ac_dir=.
416     if test -f $ac_dir/nm; then
417       # Check to see if the nm accepts a BSD-compat flag.
418       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
419       #   nm: unknown option "B" ignored
420       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
421         ac_cv_path_NM="$ac_dir/nm -B"
422       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
423         ac_cv_path_NM="$ac_dir/nm -p"
424       else
425         ac_cv_path_NM="$ac_dir/nm"
426       fi
427       break
428     fi
429   done
430   IFS="$ac_save_ifs"
431   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
432   ;;
433 esac])
434 NM="$ac_cv_path_NM"
435 AC_MSG_RESULT([$NM])
436 AC_SUBST(NM)
437 ])
438
439
440 dnl AM_PROG_LEX
441 dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
442 AC_DEFUN(AM_PROG_LEX,
443 [missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
444 AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
445 AC_PROG_LEX
446 AC_DECL_YYTEXT])
447
448 # Like AC_CONFIG_HEADER, but automatically create stamp file.
449
450 AC_DEFUN(AM_CONFIG_HEADER,
451 [AC_PREREQ([2.12])
452 AC_CONFIG_HEADER([$1])
453 dnl When config.status generates a header, we must update the stamp-h file.
454 dnl This file resides in the same directory as the config header
455 dnl that is generated.  We must strip everything past the first ":",
456 dnl and everything past the last "/".
457 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
458 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
459 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
460 <<am_indx=1
461 for am_file in <<$1>>; do
462   case " <<$>>CONFIG_HEADERS " in
463   *" <<$>>am_file "*<<)>>
464     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
465     ;;
466   esac
467   am_indx=`expr "<<$>>am_indx" + 1`
468 done<<>>dnl>>)
469 changequote([,]))])
470