]> git.donarmstrong.com Git - lilypond.git/blob - aclocal.m4
release: 0.1.49
[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 # Like AC_CONFIG_HEADER, but automatically create stamp file.
181
182 AC_DEFUN(AM_CONFIG_HEADER,
183 [AC_PREREQ([2.12])
184 AC_CONFIG_HEADER([$1])
185 dnl When config.status generates a header, we must update the stamp-h file.
186 dnl This file resides in the same directory as the config header
187 dnl that is generated.  We must strip everything past the first ":",
188 dnl and everything past the last "/".
189 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
190 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
191 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
192 <<am_indx=1
193 for am_file in <<$1>>; do
194   case " <<$>>CONFIG_HEADERS " in
195   *" <<$>>am_file "*<<)>>
196     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
197     ;;
198   esac
199   am_indx=`expr "<<$>>am_indx" + 1`
200 done<<>>dnl>>)
201 changequote([,]))])
202