2 AC_DEFUN(AC_JUNK_ARGS, [
5 AC_DEFUN(AC_LILY_WARN, [
10 dnl should cache result.
11 dnl should look in $prefix first.
13 AC_DEFUN(AC_TEX_PREFIX, [
16 AC_MSG_CHECKING(TeX/MF root dir directory)
18 find_root_prefix="$prefix"
21 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
23 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
24 find_texprefix="$find_root_prefix$postfix"
25 if test -d $find_texprefix; then
26 find_texpostfix=$postfix
31 if test "x$find_texpostfix" = x; then
32 find_texpostfix='/lib/texmf/tex'
33 AC_LILY_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
36 find_texprefix="$find_root_prefix/$find_texpostfix"
38 # only assign if variablename not empty
39 if test x != "x$1"; then
40 $1='${prefix}'/"$find_texpostfix"
42 AC_MSG_RESULT($find_texprefix)
47 # find a directory inside a prefix,
48 # $1 the prefix (expanded version)
49 # $2 variable to assign
50 # $3 the directory name
52 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
54 AC_MSG_CHECKING($4 directory)
56 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
59 if test "x$find_dirdir" = x; then
61 AC_LILY_WARN(Cannot determine $4 subdirectory. Please set from command-line)
65 AC_MSG_RESULT($1/$find_dirdir)
68 AC_DEFUN(AC_TEX_SUBDIR, [
69 dnl AC_REQUIRE([AC_TEX_PREFIX])
70 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
74 AC_DEFUN(AC_MF_SUBDIR, [
75 dnl AC_REQUIRE([AC_TEX_PREFIX])
76 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
80 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
83 AC_LILY_WARN(can't find $2. $3)