1 dnl Usage: RELYX_WARNING(message) Displays the warning "message" and sets
2 dnl the flag lyx_warning to yes.
3 AC_DEFUN([RELYX_WARNING],[
4 relyx_warning_txt="$relyx_warning_txt
10 dnl Usage: RELYX_ERROR(message) Displays the error "message" and sets
11 dnl the flag lyx_error to yes.
12 AC_DEFUN([RELYX_ERROR],[
13 relyx_error_txt="$relyx_error_txt
19 dnl RELYX_SEARCH_PROG(VARIABLE-NAME,PROGRAMS-LIST,ACTION-IF-FOUND)
21 define([RELYX_SEARCH_PROG],[dnl
22 case "`uname -s 2> /dev/null`" in
24 PATH=`echo -E "$PATH" | sed 's+\\\\+/+g'`
31 for ac_prog in $2 ; do
32 # Extract the first word of "$ac_prog", so it can be a program name with
34 set dummy $ac_prog ; ac_word=$[2]
35 if test ! -n "[$]$1"; then
36 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}$PATH_IFS"
37 for ac_dir in $PATH; do
38 test -z "$ac_dir" && ac_dir=.
39 if test -f [$ac_dir/$ac_word] -o -f [$ac_dir/$ac_word$ac_exeext]; then
47 if test -n "[$]$1"; then
53 test -n "[$]$1" && break
58 dnl Usage RELYX_PROG_PERL_OK
59 AC_DEFUN([RELYX_PROG_PERL_OK],[
60 if echo 'require 5.002;exit' | $ac_dir/$ac_prog 2>&5
67 dnl Usage RELYX_CHECK_PERL
68 AC_DEFUN([RELYX_CHECK_PERL],[
69 AC_MSG_CHECKING([for perl >= 5.002])
70 RELYX_SEARCH_PROG(PERL, perl perl5 perl5.6.1 perl5.6.0 perl5.005 perl5.004 perl5.003 perl5.002,
73 if test -n "$PERL" ; then
76 PERL="/bin/echo reLyX has been disabled because perl version 5.002 has
78 been found.\nTo reenable it, edit "
81 Configure has not been able to find a version 5.002 or better of Perl.
82 reLyX has been setup to only display a warning message.
83 Set variable PERL to some value to install a working reLyX.)
87 dnl Usage: RELYX_CHECK_ERRORS Displays a warning message if a RELYX_ERROR
88 dnl has occured previously.
89 AC_DEFUN([RELYX_CHECK_ERRORS],[
90 if test x$relyx_error = xyes; then
92 **** The following problems have been detected by configure.
93 **** Please check the messages below before running 'make'.
94 **** (see the section 'Problems' in the INSTALL file)
97 deleting cache $cache_file
102 if test x$relyx_warning = xyes; then
104 === The following minor problems have been detected by configure.
105 === Please check the messages below before running 'make'.
106 === (see the section 'Problems' in the INSTALL file)
113 dnl Check what kind of packaging should be used at install time.
114 dnl The default is autodetected.
115 AC_DEFUN([RELYX_USE_PACKAGING],
116 [AC_MSG_CHECKING([what packaging should be used])
117 AC_ARG_WITH(packaging,
118 [ --with-packaging=THIS Use THIS packaging for installation:
119 Possible values: posix, windows, macosx],
120 [lyx_use_packaging="$withval"], [
122 *-apple-darwin*) lyx_use_packaging=macosx ;;
123 *-pc-mingw32*) lyx_use_packaging=windows;;
124 *) lyx_use_packaging=posix;;
126 AC_MSG_RESULT($lyx_use_packaging)
127 case $lyx_use_packaging in
128 macosx) default_prefix="/Applications/LyX.app"
129 bindir='${prefix}/Contents/MacOS'
130 libdir='${prefix}/Contents/Resources'
131 datadir='${prefix}/Contents/Resources'
132 mandir='${prefix}/Contents/Resources/man' ;;
133 windows) default_prefix="C:/Program Files/LyX"
134 bindir='${prefix}/bin'
135 libdir='${prefix}/Resources'
136 datadir='${prefix}/Resources'
137 mandir='${prefix}/Resources/man' ;;
138 posix) default_prefix=$ac_default_prefix ;;
139 *) RELYX_ERROR([Unknown packaging type $lyx_use_packaging]) ;;