2 AC_DEFUN(AC_JUNK_ARGS, [
5 AC_DEFUN(AC_LILY_WARN, [
10 dnl should cache result.
11 dnl should look in $prefix first.
12 dnl should probably assume TDS
14 AC_DEFUN(AC_TEX_PREFIX, [
17 AC_MSG_CHECKING(TeX/MF root dir directory)
19 find_root_prefix="$prefix"
22 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
24 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
25 find_texprefix="$find_root_prefix$postfix"
26 if test -d $find_texprefix; then
27 find_texpostfix=$postfix
32 if test "x$find_texpostfix" = x; then
33 find_texpostfix='/lib/texmf/tex'
34 AC_LILY_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
37 find_texprefix="$find_root_prefix/$find_texpostfix"
39 # only assign if variablename not empty
40 if test x != "x$1"; then
41 $1='${prefix}'/"$find_texpostfix"
43 AC_MSG_RESULT($find_texprefix)
48 # find a directory inside a prefix,
49 # $1 the prefix (expanded version)
50 # $2 variable to assign
51 # $3 the directory name
53 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
55 AC_MSG_CHECKING($4 directory)
57 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
60 if test "x$find_dirdir" = x; then
62 AC_LILY_WARN(Cannot determine $4 subdirectory. Please set from command-line)
66 AC_MSG_RESULT($1/$find_dirdir)
69 AC_DEFUN(AC_TEX_SUBDIR, [
70 dnl AC_REQUIRE([AC_TEX_PREFIX])
71 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
75 AC_DEFUN(AC_MF_SUBDIR, [
76 dnl AC_REQUIRE([AC_TEX_PREFIX])
77 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
81 AC_DEFUN(AC_CHECK_SEARCH_RESULT, [
84 AC_LILY_WARN(can't find $2. $3)