]> git.lyx.org Git - lyx.git/blob - lib/reLyX/acinclude.m4
Improvements in the installation process; still not perfect.
[lyx.git] / lib / reLyX / acinclude.m4
1 dnl Usage: RELYX_WARNING(message)  Displays the warning "message" and sets
2 the
3 dnl flag lyx_warning to yes.
4 AC_DEFUN(RELYX_WARNING,[
5 relyx_warning_txt="$relyx_warning_txt
6 == $1
7 "
8 relyx_warning=yes])
9
10
11 dnl RELYX_SEARCH_PROG(VARIABLE-NAME,PROGRAMS-LIST,ACTION-IF-FOUND)
12 dnl             
13 define(RELYX_SEARCH_PROG,[dnl
14 for ac_prog in $2 ; do
15 # Extract the first word of "$ac_prog", so it can be a program name with
16 # args.
17   set dummy $ac_prog ; ac_word=$[2]
18   if test ! -n "[$]$1"; then
19     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
20     for ac_dir in $PATH; do
21       test -z "$ac_dir" && ac_dir=.
22       if test -f [$ac_dir/$ac_word]; then
23         $1="$ac_prog"
24         break
25       fi
26     done
27     IFS="$ac_save_ifs"
28   fi
29
30   if test -n "[$]$1"; then
31     ac_result=yes
32   else
33     ac_result=no
34   fi
35   ifelse($3,,,[$3])
36   test -n "[$]$1" && break
37 done
38 ])
39
40
41 dnl Usage RELYX_PROG_PERL_OK
42 AC_DEFUN(RELYX_PROG_PERL_OK,[
43 if echo 'require 5.002;exit' | $ac_dir/$ac_prog 2>&5
44 then
45   PERL=$ac_dir/$ac_prog
46 else
47   PERL=
48 fi])
49
50 dnl Usage RELYX_CHECK_PERL
51 AC_DEFUN(RELYX_CHECK_PERL,[
52 AC_MSG_CHECKING([for perl >= 5.002])
53 RELYX_SEARCH_PROG(PERL, perl perl5 perl5.002 perl5.003 perl5.004,
54 RELYX_PROG_PERL_OK
55 )
56 if test -n "$PERL" ; then
57   AC_MSG_RESULT($PERL)
58 else
59   PERL="/bin/echo reLyX has been disabled because perl version 5.002 has
60 not \
61 been found.\nTo reenable it, edit "
62   AC_MSG_RESULT(no)
63   RELYX_WARNING(dnl
64 Configure has not been able to find a version 5.002 or better of Perl.
65    reLyX has been setup to only display a warning message.
66    Set variable PERL to some value to install a working reLyX.)
67 fi
68 AC_SUBST(PERL)])
69
70 dnl Usage: RELYX_CHECK_ERRORS  Displays a warning message if a RELYX_ERROR
71 dnl   has occured previously. 
72 AC_DEFUN(RELYX_CHECK_ERRORS,[
73 if test x$relyx_error = xyes; then
74 cat <<EOF
75 **** The following problems have been detected by configure. 
76 **** Please check the messages below before running 'make'.
77 **** (see the section 'Problems' in the INSTALL file)
78 $relyx_error_txt
79 $relyx_warning_txt
80 deleting cache $cache_file
81 EOF
82   rm -f $cache_file
83 else
84
85 if test x$relyx_warning = xyes; then
86 cat <<EOF
87 === The following minor 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_warning_txt
91 EOF
92 fi
93 cat <<EOF
94 Configuration of LyX was successful.  
95 Type 'make' to compile the program, 
96 and then 'make install' to install it.
97 EOF
98 fi])
99