Initial Commit
[packages] / mule-packages / lookup / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4
2
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file 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 dnl Copyright (C) 1999 NISHIDA Keisuke <knishida@ring.aist.go.jp>
14 dnl
15 dnl This program is free software; you can redistribute it and/or modify
16 dnl it under the terms of the GNU General Public License as published by
17 dnl the Free Software Foundation; either version 2, or (at your option)
18 dnl any later version.
19 dnl
20 dnl This program is distributed in the hope that it will be useful,
21 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
22 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23 dnl GNU General Public License for more details.
24 dnl
25 dnl You should have received a copy of the GNU General Public License
26 dnl along with this program; if not, write to the Free Software
27 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
28 dnl 02111-1307, USA.
29
30 AC_DEFUN(AM_PATH_LISPDIR,
31  [dnl #
32   dnl # Check Emacs
33   dnl #
34   AC_ARG_WITH(emacs,
35     [  --with-emacs=EMACS      compile with EMACS [EMACS=emacs, xemacs...]],
36     [case "${withval}" in
37        yes)     EMACS= ;;
38        no)      AC_MSG_ERROR([emacs is not available]) ;;
39        *)       EMACS=${withval} ;;
40      esac], EMACS=)
41   if test "x$EMACS" = "xt" -o "x$EMACS" = x; then
42     AC_PATH_PROGS(EMACS, emacs xemacs mule, no)
43     if test $EMACS = no; then
44       AC_MSG_ERROR(you should install Emacs first)
45     fi
46   fi
47   dnl # 
48   dnl # Check Emacs directories
49   dnl #
50   AC_MSG_CHECKING([where emacs files are in])
51   EMACS_BASENAME="`echo x$EMACS | sed -e 's/x//' -e 's/^.*\///'`"
52   if test "x$emacsdir" = x; then
53     if test "x$prefix" = "xNONE"; then
54       prefix=$ac_default_prefix
55     fi
56     emacsdir="\$(datadir)/emacs"
57     case "$EMACS_BASENAME" in
58     emacs|emacs-*)
59       if test -d $prefix/lib/emacs; then
60         emacsdir="$prefix/lib/emacs"
61       fi
62       if test -d $prefix/share/emacs; then
63         emacsdir="$prefix/share/emacs"
64       fi
65       ;;
66     xemacs|xemacs-*)
67       if test -d $prefix/lib/xemacs; then
68         emacsdir="$prefix/lib/xemacs"
69       fi
70       if test -d $prefix/share/xemacs; then
71         emacsdir="$prefix/share/xemacs"
72       fi
73       ;;
74     mule|mule-*)
75       if test -d $prefix/lib/emacs; then
76         emacsdir="$prefix/lib/emacs"
77       fi
78       if test -d $prefix/share/emacs; then
79         emacsdir="$prefix/share/emacs"
80       fi
81       if test -d $prefix/lib/mule; then
82         emacsdir="$prefix/lib/mule"
83       fi
84       if test -d $prefix/share/mule; then
85         emacsdir="$prefix/share/mule"
86       fi
87       ;;
88     esac
89   fi
90   AC_MSG_RESULT($emacsdir)
91   AC_SUBST(emacsdir)
92   dnl # 
93   dnl # Check Emacs site-lisp directories
94   dnl #
95   AC_ARG_WITH(lispdir,
96     [  --with-lispdir=DIR      emacs lisp files go to DIR [guessed]],
97     [case "${withval}" in
98        yes)     lispdir= ;;
99        no)      AC_MSG_ERROR(lispdir is not available) ;;
100        *)       lispdir=${withval} ;;
101      esac], lispdir=)
102   AC_MSG_CHECKING([where .elc files should go])
103   if test "x$lispdir" = x; then
104     lispdir="$emacsdir/site-lisp"
105     if test -d $emacsdir/lisp; then
106       lispdir="$emacsdir/lisp"
107     fi
108     case "$EMACS_BASENAME" in
109     xemacs|xemacs-*)
110       lispdir="$lispdir/lookup"
111       ;;
112     esac
113   fi
114   AC_MSG_RESULT($lispdir)
115   AC_SUBST(lispdir)])
116
117 # Do all the work for Automake.  This macro actually does too much --
118 # some checks are only needed if your package does certain things.
119 # But this isn't really a big deal.
120
121 # serial 1
122
123 dnl Usage:
124 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
125
126 AC_DEFUN(AM_INIT_AUTOMAKE,
127 [AC_REQUIRE([AC_PROG_INSTALL])
128 PACKAGE=[$1]
129 AC_SUBST(PACKAGE)
130 VERSION=[$2]
131 AC_SUBST(VERSION)
132 dnl test to see if srcdir already configured
133 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
134   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
135 fi
136 ifelse([$3],,
137 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
138 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
139 AC_REQUIRE([AM_SANITY_CHECK])
140 AC_REQUIRE([AC_ARG_PROGRAM])
141 dnl FIXME This is truly gross.
142 missing_dir=`cd $ac_aux_dir && pwd`
143 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
144 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
145 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
146 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
147 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
148 AC_REQUIRE([AC_PROG_MAKE_SET])])
149
150 #
151 # Check to make sure that the build environment is sane.
152 #
153
154 AC_DEFUN(AM_SANITY_CHECK,
155 [AC_MSG_CHECKING([whether build environment is sane])
156 # Just in case
157 sleep 1
158 echo timestamp > conftestfile
159 # Do `set' in a subshell so we don't clobber the current shell's
160 # arguments.  Must try -L first in case configure is actually a
161 # symlink; some systems play weird games with the mod time of symlinks
162 # (eg FreeBSD returns the mod time of the symlink's containing
163 # directory).
164 if (
165    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
166    if test "[$]*" = "X"; then
167       # -L didn't work.
168       set X `ls -t $srcdir/configure conftestfile`
169    fi
170    if test "[$]*" != "X $srcdir/configure conftestfile" \
171       && test "[$]*" != "X conftestfile $srcdir/configure"; then
172
173       # If neither matched, then we have a broken ls.  This can happen
174       # if, for instance, CONFIG_SHELL is bash and it inherits a
175       # broken ls alias from the environment.  This has actually
176       # happened.  Such a system could not be considered "sane".
177       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
178 alias in your environment])
179    fi
180
181    test "[$]2" = conftestfile
182    )
183 then
184    # Ok.
185    :
186 else
187    AC_MSG_ERROR([newly created file is older than distributed files!
188 Check your system clock])
189 fi
190 rm -f conftest*
191 AC_MSG_RESULT(yes)])
192
193 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
194 dnl The program must properly implement --version.
195 AC_DEFUN(AM_MISSING_PROG,
196 [AC_MSG_CHECKING(for working $2)
197 # Run test in a subshell; some versions of sh will print an error if
198 # an executable is not found, even if stderr is redirected.
199 # Redirect stdin to placate older versions of autoconf.  Sigh.
200 if ($2 --version) < /dev/null > /dev/null 2>&1; then
201    $1=$2
202    AC_MSG_RESULT(found)
203 else
204    $1="$3/missing $2"
205    AC_MSG_RESULT(missing)
206 fi
207 AC_SUBST($1)])
208