]> git.lyx.org Git - lyx.git/blob - lib/reLyX/configure.ac
more configure fixes
[lyx.git] / lib / reLyX / configure.ac
1 dnl Process with autoconf to generate configure script   -*- sh -*-
2 AC_INIT
3 AC_CONFIG_SRCDIR(reLyX.in)
4 AC_PREREQ(2.52)
5 AC_CONFIG_AUX_DIR(../../config)
6
7 dnl PACKAGE=reLyX
8 dnl Do this to install in $datadir/lyx/reLyX instead of $datadir/reLyX/reLyX
9
10 AM_MAINTAINER_MODE
11 AC_CANONICAL_TARGET
12
13 AC_ARG_WITH(version-suffix,
14   [  --with-version-suffix[=<version>]  install lyx files as lyx<version>],
15   [lyxname="lyx$withval"
16    program_suffix=$withval],
17   [lyxname=lyx])
18
19 dnl must make a macro that gets the reLyX version
20 VERSION=2.0
21 AM_INIT_AUTOMAKE($lyxname, $VERSION)
22
23 # if reLyX has already been generated in this directory, delete it first
24 test -x reLyX && rm -f reLyX
25
26 ### Check how the files should be packaged
27 RELYX_USE_PACKAGING
28 # fix the value of the prefixes.
29 test "x$prefix" = xNONE && prefix=$default_prefix
30 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
31 if echo $prefix |grep ' ' >/dev/null 2>/dev/null ; then
32   RELYX_WARNING([The installation prefix \"${prefix}\" contains a space, which
33    causes problems with the Makefiles. The installation will be done in 
34    directory \"`pwd`/installprefix\" instead. Please move its contents to
35    the right place after installation.])
36   prefix=`pwd`/installprefix
37 fi
38
39 # we need to expand ${datadir} to put it into the reLyX wrapper.
40 LYX_DIR=`eval "echo \`eval \"echo ${datadir}/${PACKAGE}\"\`"`
41 AC_SUBST(LYX_DIR)
42
43 # Work around a problem in automake 1.4: when invoking install-strip,
44 # INSTALL_PROGRAM is changed to 'install -s', and since
45 # INSTALL_SCRIPT==INSTALL_PROGRAM, we get errors with fileutils-4.0
46 # which returns an error condition when stripping fails.
47 INSTALL_SCRIPT='${INSTALL}'
48
49 dnl Checks for programs.
50 AC_PROG_INSTALL
51 RELYX_CHECK_PERL
52
53 dnl Finish the work
54 AC_CONFIG_FILES([Makefile])
55 AC_CONFIG_FILES([reLyX], [chmod 755 reLyX])
56 AC_CONFIG_FILES([noweb2lyx], [chmod 755 noweb2lyx])
57 AC_OUTPUT
58
59 RELYX_CHECK_ERRORS