]> git.lyx.org Git - features.git/blob - lib/reLyX/aclocal.m4
4c4ca4ec5196a8185504998647bf65364dfad662
[features.git] / lib / reLyX / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4a
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 Usage: RELYX_WARNING(message)  Displays the warning "message" and sets
14 the
15 dnl flag lyx_warning to yes.
16 AC_DEFUN(RELYX_WARNING,[
17 relyx_warning_txt="$relyx_warning_txt
18 == $1
19 "
20 relyx_warning=yes])
21
22
23 dnl RELYX_SEARCH_PROG(VARIABLE-NAME,PROGRAMS-LIST,ACTION-IF-FOUND)
24 dnl             
25 define(RELYX_SEARCH_PROG,[dnl
26 for ac_prog in $2 ; do
27 # Extract the first word of "$ac_prog", so it can be a program name with
28 # args.
29   set dummy $ac_prog ; ac_word=$[2]
30   if test ! -n "[$]$1"; then
31     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
32     for ac_dir in $PATH; do
33       test -z "$ac_dir" && ac_dir=.
34       if test -f [$ac_dir/$ac_word]; then
35         $1="$ac_prog"
36         break
37       fi
38     done
39     IFS="$ac_save_ifs"
40   fi
41
42   if test -n "[$]$1"; then
43     ac_result=yes
44   else
45     ac_result=no
46   fi
47   ifelse($3,,,[$3])
48   test -n "[$]$1" && break
49 done
50 ])
51
52
53 dnl Usage RELYX_PROG_PERL_OK
54 AC_DEFUN(RELYX_PROG_PERL_OK,[
55 if echo 'require 5.002;exit' | $ac_dir/$ac_prog 2>&5
56 then
57   PERL=$ac_dir/$ac_prog
58 else
59   PERL=
60 fi])
61
62 dnl Usage RELYX_CHECK_PERL
63 AC_DEFUN(RELYX_CHECK_PERL,[
64 AC_MSG_CHECKING([for perl >= 5.002])
65 RELYX_SEARCH_PROG(PERL, perl perl5 perl5.002 perl5.003 perl5.004,
66 RELYX_PROG_PERL_OK
67 )
68 if test -n "$PERL" ; then
69   AC_MSG_RESULT($PERL)
70 else
71   PERL="/bin/echo reLyX has been disabled because perl version 5.002 has
72 not \
73 been found.\nTo reenable it, edit "
74   AC_MSG_RESULT(no)
75   RELYX_WARNING(dnl
76 Configure has not been able to find a version 5.002 or better of Perl.
77    reLyX has been setup to only display a warning message.
78    Set variable PERL to some value to install a working reLyX.)
79 fi
80 AC_SUBST(PERL)])
81
82 dnl Usage: RELYX_CHECK_ERRORS  Displays a warning message if a RELYX_ERROR
83 dnl   has occured previously. 
84 AC_DEFUN(RELYX_CHECK_ERRORS,[
85 if test x$relyx_error = xyes; then
86 cat <<EOF
87 **** The following problems have been detected by configure. 
88 **** Please check the messages below before running 'make'.
89 **** (see the section 'Problems' in the INSTALL file)
90 $relyx_error_txt
91 $relyx_warning_txt
92 deleting cache $cache_file
93 EOF
94   rm -f $cache_file
95 else
96
97 if test x$relyx_warning = xyes; then
98 cat <<EOF
99 === The following minor problems have been detected by configure. 
100 === Please check the messages below before running 'make'.
101 === (see the section 'Problems' in the INSTALL file)
102 $relyx_warning_txt
103 EOF
104 fi
105 cat <<EOF
106 Configuration of LyX was successful.  
107 Type 'make' to compile the program, 
108 and then 'make install' to install it.
109 EOF
110 fi])
111
112
113 # Do all the work for Automake.  This macro actually does too much --
114 # some checks are only needed if your package does certain things.
115 # But this isn't really a big deal.
116
117 # serial 1
118
119 dnl Usage:
120 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
121
122 AC_DEFUN(AM_INIT_AUTOMAKE,
123 [AC_REQUIRE([AC_PROG_INSTALL])
124 dnl We require 2.13 because we rely on SHELL being computed by configure.
125 AC_PREREQ([2.13])
126 PACKAGE=[$1]
127 AC_SUBST(PACKAGE)
128 VERSION=[$2]
129 AC_SUBST(VERSION)
130 dnl test to see if srcdir already configured
131 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
132   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
133 fi
134 ifelse([$3],,
135 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
136 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
137 AC_REQUIRE([AM_SANITY_CHECK])
138 AC_REQUIRE([AC_ARG_PROGRAM])
139 dnl FIXME This is truly gross.
140 missing_dir=`cd $ac_aux_dir && pwd`
141 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
142 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
143 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
144 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
145 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
146 AC_REQUIRE([AC_PROG_MAKE_SET])])
147
148 #
149 # Check to make sure that the build environment is sane.
150 #
151
152 AC_DEFUN(AM_SANITY_CHECK,
153 [AC_MSG_CHECKING([whether build environment is sane])
154 # Just in case
155 sleep 1
156 echo timestamp > conftestfile
157 # Do `set' in a subshell so we don't clobber the current shell's
158 # arguments.  Must try -L first in case configure is actually a
159 # symlink; some systems play weird games with the mod time of symlinks
160 # (eg FreeBSD returns the mod time of the symlink's containing
161 # directory).
162 if (
163    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
164    if test "[$]*" = "X"; then
165       # -L didn't work.
166       set X `ls -t $srcdir/configure conftestfile`
167    fi
168    if test "[$]*" != "X $srcdir/configure conftestfile" \
169       && test "[$]*" != "X conftestfile $srcdir/configure"; then
170
171       # If neither matched, then we have a broken ls.  This can happen
172       # if, for instance, CONFIG_SHELL is bash and it inherits a
173       # broken ls alias from the environment.  This has actually
174       # happened.  Such a system could not be considered "sane".
175       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
176 alias in your environment])
177    fi
178
179    test "[$]2" = conftestfile
180    )
181 then
182    # Ok.
183    :
184 else
185    AC_MSG_ERROR([newly created file is older than distributed files!
186 Check your system clock])
187 fi
188 rm -f conftest*
189 AC_MSG_RESULT(yes)])
190
191 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
192 dnl The program must properly implement --version.
193 AC_DEFUN(AM_MISSING_PROG,
194 [AC_MSG_CHECKING(for working $2)
195 # Run test in a subshell; some versions of sh will print an error if
196 # an executable is not found, even if stderr is redirected.
197 # Redirect stdin to placate older versions of autoconf.  Sigh.
198 if ($2 --version) < /dev/null > /dev/null 2>&1; then
199    $1=$2
200    AC_MSG_RESULT(found)
201 else
202    $1="$3/missing $2"
203    AC_MSG_RESULT(missing)
204 fi
205 AC_SUBST($1)])
206