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