root/lyx-devel/branches/BRANCH_1_4_X/configure.ac

Revision 19314, 13.0 kB (checked in by uwestoehr, 1 year ago)

configure.ac: fix whitespace character

  • Property svn:eol-style set to LF
Line 
1 dnl Process with autoconf to generate configure script   -*- sh -*-
2
3 AC_INIT(LyX,1.4.6svn,[lyx-devel@lists.lyx.org],[lyx])
4 AC_SUBST(LYX_DATE, ["2007/07/25"])
5 AC_PREREQ(2.52)
6 AC_CONFIG_SRCDIR(src/main.C)
7 AC_CONFIG_HEADERS([src/config.h])
8
9 AC_CONFIG_AUX_DIR(config)
10
11 # First check the version
12 LYX_CHECK_VERSION
13 LYX_VERSION_SUFFIX
14 # Check how the files should be packaged
15 AC_CANONICAL_TARGET
16 LYX_USE_PACKAGING
17 # We need to define these variables here and the no-define option of
18 # AM_INIT_AUTOMAKE above because we alter $PACKAGE in LYX_USE_PACKAGING.
19 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
20
21 dnl default maintainer mode to true for development versions
22 if test "${enable_maintainer_mode+set}" != set; then
23   enable_maintainer_mode=$lyx_devel_version
24 fi
25 AM_MAINTAINER_MODE
26
27 save_PACKAGE=$PACKAGE
28 AM_INIT_AUTOMAKE([foreign dist-bzip2 tar-ustar no-define 1.9])
29 PACKAGE=$save_PACKAGE
30
31 ### Set the execute permissions of the various scripts correctly
32 for file in config/install-sh config/mkinstalldirs ; do
33   chmod 755 ${srcdir}/${file}
34 done
35
36 ### Check for programs
37 AC_PROG_MAKE_SET
38 AC_PROG_INSTALL
39
40 AC_PROG_AWK
41 test "$AWK" = gawk && AWK="gawk --posix"
42
43 #AC_PROG_RANLIB
44 AC_CHECK_PROG(KPSEWHICH, kpsewhich, kpsewhich, :)
45 if test "x$KPSEWHICH" = xkpsewhich ; then
46     AC_DEFINE(HAVE_KPSEWHICH, 1,
47     [Define this if you have the kpsewhich program working on your system.])
48 fi
49 AC_CHECK_PROGS(M4, gm4 gnum4 m4, m4)
50
51 # Check for installed python
52 AM_PATH_PYTHON(2.3,, :)
53
54 # Work around a problem in automake 1.4: when invoking install-strip,
55 # INSTALL_PROGRAM is changed to 'install -s', and since
56 # INSTALL_SCRIPT==INSTALL_PROGRAM, we get errors with fileutils-4.0
57 # which returns an error condition when stripping fails.
58 INSTALL_SCRIPT='${INSTALL}'
59
60 ### we will also need a C compiler to compile GNU gettext
61 AC_PROG_CC
62
63 ### check for special systems
64 AC_ISC_POSIX
65 AC_AIX
66
67 ### check which frontend we want to use
68 LYX_USE_FRONTENDS
69
70 ### Check for a C++ compiler
71 LYX_PROG_CXX
72 ### Some checks on what the C++ compiler can(not) do
73 AC_LANG(C++)
74 dnl we do not need that currently (and probably all our supported
75 dnl compiler allow that)
76 dnl LYX_CXX_PARTIAL
77 LYX_CXX_EXPLICIT
78 LYX_CXX_GLOBAL_CSTD
79 LYX_STD_COUNT
80 dnl we disable rtti for now
81 dnl LYX_CXX_RTTI
82 AC_CHECK_HEADERS(ostream istream sstream locale limits ios)
83 LYX_CXX_STL_MODERN_STREAMS
84
85 ### and now some special lyx flags.
86 AC_ARG_ENABLE(assertions,
87   AC_HELP_STRING([--enable-assertions],[add runtime sanity checks in the program]),,
88   [if test $lyx_devel_version = yes -o $lyx_prerelease = yes ; then
89         enable_assertions=yes;
90     else
91         enable_assertions=no;
92     fi;])
93 if test "x$enable_assertions" = xyes ; then
94    lyx_flags="assertions $lyx_flags"
95    AC_DEFINE(ENABLE_ASSERTIONS,1,
96     [Define if you want assertions to be enabled in the code])
97 fi
98
99 ### Library Files
100 dnl by testing these we check if it is ok to have
101 dnl -lc and -lm as args to the compiler
102 AC_CHECK_LIB(m, sin)
103 AC_CHECK_LIB(c, fopen)
104
105 ### Add extra directories to check for libraries.
106 LYX_WITH_DIR([extra-lib],[extra library directory],extra_lib, NONE)
107 LYX_LOOP_DIR($lyx_cv_extra_lib,LYX_ADD_LIB_DIR(lyx_ldflags,$dir))
108 test ! x"$lyx_ldflags" = x && LDFLAGS="$lyx_ldflags $LDFLAGS"
109
110 ### Add extra directories to check for include files.
111 LYX_WITH_DIR([extra-inc],[extra include directory],extra_inc, NONE)
112 LYX_LOOP_DIR($lyx_cv_extra_inc,LYX_ADD_INC_DIR(lyx_cppflags,$dir))
113 test ! x"$lyx_cppflags" = x && CPPFLAGS="$lyx_cppflags $CPPFLAGS"
114
115 ### Add both includes and libraries
116 LYX_WITH_DIR([extra-prefix],[extra lib+include directory],extra_prefix, NONE, ${prefix})
117 LYX_LOOP_DIR($lyx_cv_extra_prefix,[
118 LYX_ADD_INC_DIR(CPPFLAGS,$dir/include)
119   LYX_ADD_LIB_DIR(LDFLAGS,$dir/lib)])
120
121 ### These are needed in windows
122 AC_CHECK_LIB(shlwapi, main, [LIBSHLWAPI=-lshlwapi])
123 AC_SUBST(LIBSHLWAPI)
124 AC_CHECK_LIB(gdi32, main)
125
126 AC_ARG_WITH(aiksaurus,
127   [  --without-aiksaurus     do not use the Aiksaurus library],
128   [lyx_use_aiksaurus=$withval])
129 if test x$lyx_use_aiksaurus != xno; then
130 AC_CHECK_LIB(Aiksaurus, main,
131         [AC_DEFINE(HAVE_LIBAIKSAURUS,1,[Define this if you have the AikSaurus library])
132          AIKSAURUS_LIBS="-lAiksaurus"
133          lyx_flags="aiksaurus $lyx_flags"
134         ])
135 AC_CHECK_HEADER(Aiksaurus.h,[
136   ac_cv_header_aiksaurus_h=yes
137   lyx_cv_aiksaurus_h_location="<Aiksaurus.h>"])
138 AC_CHECK_HEADER(Aiksaurus/Aiksaurus.h,[
139   ac_cv_header_aiksaurus_h=yes
140   lyx_cv_aiksaurus_h_location="<Aiksaurus/Aiksaurus.h>"])
141 AC_DEFINE_UNQUOTED(AIKSAURUS_H_LOCATION,$lyx_cv_aiksaurus_h_location,[Location of Aiksaurus.h])
142 fi
143 AC_SUBST(AIKSAURUS_LIBS)
144
145 LYX_USE_INCLUDED_BOOST
146
147 ### Setup libtool
148 AC_DISABLE_SHARED
149 AC_LIBTOOL_WIN32_DLL
150 #AM_PROG_LIBTOOL
151 LYX_PROG_LIBTOOL
152
153 ### Check for X libraries
154 AC_PATH_XTRA
155 case $have_x in
156   yes) LIBS="$X_PRE_LIBS $LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
157        CPPFLAGS="$CPPFLAGS $X_CFLAGS";;
158   no) LYX_ERROR(dnl
159 [Cannot find X window libraries and/or headers. Check your installation.
160   If you use a Linux system, check that you have installed
161   the development tools.]);;
162   disable) ;;
163 esac
164
165 ### check which frontend we want to use
166
167 dnl The code below is not in a macro, because this would cause big
168 dnl problems with the AC_REQUIRE contained in QT_DO_IT_ALL.
169 for frontend in $FRONTENDS ; do
170   case "$frontend" in
171     xforms)
172           XFORMS_DO_IT_ALL
173           FRONTENDS_PROGS="$FRONTENDS_PROGS lyx-xforms\$(EXEEXT)"
174           FRONTENDS_SUBDIRS="$FRONTENDS_SUBDIRS xforms"
175           RPM_FRONTEND="xforms"
176           FRONTEND_INFO="${FRONTEND_INFO}\
177   XForms Frontend:\n\
178       libXpm version:\t\t${XPM_VERSION}\n\
179       libforms version:\t\t${XFORMS_VERSION}\n"
180           ;;
181     gtk)
182           PKG_CHECK_MODULES(GTK_FRONTEND, gtkmm-2.4 libglademm-2.4 xft)
183           FRONTENDS_PROGS="$FRONTENDS_PROGS lyx-gtk\$(EXEEXT)"
184           FRONTENDS_SUBDIRS="$FRONTENDS_SUBDIRS gtk"
185           RPM_FRONTEND="gtk"
186           GTKMM_VERSION=`pkg-config --modversion gtkmm-2.4`
187           LIBGLADEMM_VERSION=`pkg-config --modversion libglademm-2.4`
188           FRONTEND_INFO="${FRONTEND_INFO}\
189   GTK Frontend:\n\
190     libgtkmm version:\t\t${GTKMM_VERSION}\n\
191     libglademm version:\t\t${LIBGLADEMM_VERSION}\n"
192           ;;
193
194     qt)
195           QT_DO_IT_ALL
196           FRONTENDS_PROGS="$FRONTENDS_PROGS lyx-qt\$(EXEEXT)"
197           FRONTENDS_SUBDIRS="$FRONTENDS_SUBDIRS qt2"
198           RPM_FRONTEND="qt"
199           FRONTEND_INFO="${FRONTEND_INFO}\
200   Qt Frontend:\n\
201       Qt version:\t\t${QT_VERSION}\n"
202 dnl qt build will fail without moc or uic
203           if test -z "$MOC"; then
204             LYX_ERROR([moc binary not found !])
205           fi
206           if test -z "$UIC"; then
207             LYX_ERROR([uic binary not found !])
208           fi
209           if test -z "$QT_LIB"; then
210             LYX_ERROR([qt library not found !])
211           fi
212       ;;
213     *)
214           LYX_ERROR(Unknown frontend '$frontend');;
215   esac
216 done
217
218 # fix the value of the prefixes.
219 test "x$prefix" = xNONE && prefix=$default_prefix
220 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
221 if echo $prefix |grep ' ' >/dev/null 2>/dev/null ; then
222   LYX_WARNING([The installation prefix \"${prefix}\" contains a space, which
223    causes problems with the Makefiles. The installation will be done in
224    directory \"`pwd`/installprefix\" instead. Please move its contents to
225    the right place after installation.])
226   prefix=`pwd`/installprefix
227 fi
228
229 ### Setup GNU gettext
230 dnl GNU gettext is written in C
231 AC_LANG_PUSH(C)
232 AM_GNU_GETTEXT
233 AC_LANG_POP(C)
234
235 # some standard header files
236 AC_HEADER_DIRENT
237 AC_HEADER_MAJOR
238 AC_CHECK_HEADERS(sys/time.h sys/types.h sys/select.h strings.h locale.h utime.h sys/utime.h io.h process.h NewAPIs.h)
239
240 # some standard structures
241 AC_HEADER_STAT
242 AC_HEADER_TIME
243
244 # some standard types
245 AC_TYPE_MODE_T
246 AC_TYPE_OFF_T
247 AC_TYPE_PID_T
248 AC_TYPE_SIGNAL
249 AC_TYPE_SIZE_T
250 AC_TYPE_UID_T
251
252 AC_CHECK_FUNCS(strerror)
253 LYX_CHECK_DECL(istreambuf_iterator, iterator)
254 LYX_CHECK_DECL(mkstemp,[unistd.h stdlib.h])
255
256 # Check the form of mkdir()
257 AC_FUNC_MKDIR
258
259 # check for compression support
260 AC_CHECK_HEADERS(zlib.h,
261  [AC_CHECK_LIB(z, gzopen, [LIBS="$LIBS -lz"], LYX_LIB_ERROR(libz,zlib))],
262  [LYX_LIB_ERROR(zlib.h,zlib)])
263
264 dnl This is a slight hack: the tests generated by autoconf 2.52 do not
265 dnl work correctly because of some conflict with stdlib.h with g++ 2.96
266 dnl We aim to remove this eventually, since we should test as much as
267 dnl possible with the compiler which will use the functions (JMarc)
268 AC_LANG_PUSH(C)
269 AC_CHECK_FUNCS(close _close getpid _getpid lstat mkfifo mkstemp mktemp open _open pclose _pclose popen _popen readlink)
270 AC_LANG_POP(C)
271
272 LYX_CHECK_SPELL_ENGINES
273
274 lyx_client_subdir=true
275 AC_LANG_PUSH(C)
276 dnl LIBS already contains some X extra libs that may interfere.
277 save_LIBS="$LIBS"
278 LIBS=
279 AC_CHECK_FUNCS(fcntl,
280   [AC_SEARCH_LIBS([gethostbyname], [nsl])
281    AC_SEARCH_LIBS([socket], [socket], [],
282      [AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket -lnsl $LIBS"],
283                 [], [-lnsl])])],
284   [lyx_client_subdir=false])
285 AC_SUBST(SOCKET_LIBS,$LIBS)
286 LIBS="$save_LIBS"
287 AM_CONDITIONAL(BUILD_CLIENT_SUBDIR, $lyx_client_subdir)
288 AC_LANG_POP(C)
289
290 AC_FUNC_SELECT_ARGTYPES
291
292 ### Some information on what just happened
293 real_bindir=`eval "echo \`eval \"echo ${bindir}\"\`"`
294 real_pkgdatadir=`eval "echo \`eval \"echo \\\`eval \\\"echo ${pkgdatadir}\\\"\\\`\"\`"`
295 real_localedir=`eval "echo \`eval \"echo ${datadir}/locale\"\`"`
296 VERSION_INFO="Configuration\n\
297   Host type:                      ${host}\n\
298   Special build flags:            ${lyx_flags}\n\
299   C   Compiler:                   ${CC} ${CC_VERSION}\n\
300   C   Compiler LyX flags:         ${AM_CPPFLAGS} ${AM_CFLAGS}\n\
301   C   Compiler flags:             ${CPPFLAGS} ${CFLAGS}\n\
302   C++ Compiler:                   ${CXX} ${CXX_VERSION}\n\
303   C++ Compiler LyX flags:         ${AM_CPPFLAGS} ${AM_CXXFLAGS}\n\
304   C++ Compiler flags:             ${CPPFLAGS} ${CXXFLAGS}\n\
305   Linker flags:                   ${AM_LDFLAGS}\n\
306   Linker user flags:              ${LDFLAGS}\n\
307 ${FRONTEND_INFO}\
308   Packaging:                      ${lyx_use_packaging}\n\
309   LyX binary dir:                 ${real_bindir}\n\
310   LyX files dir:                  ${real_pkgdatadir}\n"
311
312 MSYS_AC_CANONICAL_PATH(LYX_ABS_TOP_SRCDIR, ${srcdir})
313 MSYS_AC_CANONICAL_PATH(LYX_ABS_INSTALLED_LOCALEDIR, ${real_localedir})
314 MSYS_AC_CANONICAL_PATH(LYX_ABS_INSTALLED_DATADIR, ${real_pkgdatadir})
315
316 AC_SUBST(VERSION_INFO)
317 AC_SUBST(RPM_FRONTEND)
318 AC_SUBST(AM_CPPFLAGS)
319 AC_SUBST(AM_CXXFLAGS)
320 AC_SUBST(AM_CFLAGS)
321 AC_SUBST(AM_LDFLAGS)
322 AC_SUBST(LYX_ABS_TOP_SRCDIR)
323 AC_SUBST(LYX_ABS_INSTALLED_LOCALEDIR)
324 AC_SUBST(LYX_ABS_INSTALLED_DATADIR)
325
326 ## Some config.h stuff
327
328 AH_TOP([
329 /* -*- C++ -*- */
330 /*
331  * \file config.h
332  * This file is part of LyX, the document processor.
333  * Licence details can be found in the file COPYING.
334  *
335  * This is the compilation configuration file for LyX.
336  * It was generated by autoconfs configure.
337  * You might want to change some of the defaults if something goes wrong
338  * during the compilation.
339  */
340
341 #ifndef _CONFIG_H
342 #define _CONFIG_H
343 ])
344
345 AH_BOTTOM([
346 /************************************************************
347  ** You should not need to change anything beyond this point */
348
349 #ifndef HAVE_STRERROR
350 #if defined(__cplusplus)
351 extern "C"
352 #endif
353 char * strerror(int n);
354 #endif
355
356 #ifdef HAVE_MKSTEMP
357 #ifndef HAVE_DECL_MKSTEMP
358 #if defined(__cplusplus)
359 extern "C"
360 #endif
361 int mkstemp(char*);
362 #endif
363 #endif
364
365 #ifdef __EMX__
366 #include "support/os2_defines.h"
367 #endif
368
369 #if defined(HAVE_OSTREAM) && defined(HAVE_LOCALE) && defined(HAVE_SSTREAM)
370 #define USE_BOOST_FORMAT 1
371 #else
372 #define USE_BOOST_FORMAT 0
373 #endif
374
375 #define BOOST_USER_CONFIG <config.h>
376
377 #if defined(ENABLE_ASSERTIONS)
378 #define BOOST_ENABLE_ASSERT_HANDLER 1
379 #else
380 #define BOOST_DISABLE_ASSERTS 1
381 #endif
382
383 #define BOOST_DISABLE_THREADS 1
384 #define BOOST_NO_WREGEX 1
385 #define BOOST_NO_WSTRING 1
386
387 #ifdef __CYGWIN__
388 #define BOOST_POSIX 1
389 #endif
390
391 #if defined(HAVE_NEWAPIS_H)
392 #define WANT_GETFILEATTRIBUTESEX_WRAPPER 1
393 #endif
394
395 #endif
396 ])
397
398 ### Finish the work.
399 AC_CONFIG_FILES([Makefile  m4/Makefile \
400        boost/Makefile \
401        boost/libs/Makefile \
402        boost/libs/filesystem/Makefile \
403        boost/libs/filesystem/src/Makefile \
404        boost/libs/regex/Makefile \
405        boost/libs/regex/src/Makefile \
406        boost/libs/signals/Makefile \
407        boost/libs/signals/src/Makefile \
408        config/Makefile \
409        development/Makefile \
410        development/lyx.spec \
411        lib/Makefile \
412        lib/doc/Makefile \
413        lib/lyx2lyx/Makefile \
414        intl/Makefile \
415        po/Makefile.in \
416        sourcedoc/Doxyfile \
417        sourcedoc/Makefile \
418        src/client/Makefile \
419        src/Makefile \
420        src/version.C-tmp:src/version.C.in \
421        src/tex2lyx/Makefile \
422        src/mathed/Makefile \
423        src/graphics/Makefile \
424        src/insets/Makefile \
425        src/support/Makefile \
426        src/support/tests/Makefile \
427        src/frontends/Makefile \
428        src/frontends/controllers/Makefile \
429        src/frontends/xforms/Makefile \
430        src/frontends/xforms/lyx_forms.h-tmp:src/frontends/xforms/lyx_forms.h.in \
431        src/frontends/xforms/lyx_xpm.h-tmp:src/frontends/xforms/lyx_xpm.h.in \
432        src/frontends/xforms/forms/Makefile \
433        src/frontends/gtk/Makefile \
434        src/frontends/gtk/gimages/Makefile \
435        src/frontends/gtk/glade/Makefile \
436        src/frontends/qt2/Makefile \
437        src/frontends/qt2/moc/Makefile \
438        src/frontends/qt2/ui/Makefile \
439        src/frontends/qt2/ui/moc/Makefile \
440 ])
441
442 AC_OUTPUT
443 # show version information
444 echo
445 printf "$VERSION_INFO"
446 echo
447
448 # Display a final warning if there has been a LYX_ERROR
449 LYX_CHECK_ERRORS
Note: See TracBrowser for help on using the browser.