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