* de.po: sync with branch.
[lyx.git] / configure.ac
blob58d6d98d145853b3fc45c6dc28ada68dc80afa87
1 dnl Process with autoconf to generate configure script   -*- sh -*-
3 AC_INIT(LyX,2.0.0svn,[lyx-devel@lists.lyx.org],[lyx])
4 # Use ISO format only. The frontend needs to parse this
5 AC_SUBST(LYX_DATE, ["2009-03-25"])
6 AC_PREREQ(2.52)
7 AC_CONFIG_SRCDIR(src/main.cpp)
8 AC_CONFIG_HEADERS([config.h])
10 AC_CONFIG_AUX_DIR(config)
12 # First check the version
13 LYX_CHECK_VERSION
14 LYX_VERSION_SUFFIX
15 # Check how the files should be packaged
16 AC_CANONICAL_TARGET
17 LYX_USE_PACKAGING
18 # We need to define these variables here and the no-define option of
19 # AM_INIT_AUTOMAKE above because we alter $PACKAGE in LYX_USE_PACKAGING.
20 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
22 dnl Default maintainer mode to true for development versions
23 if test "${enable_maintainer_mode+set}" != set; then
24   enable_maintainer_mode=$lyx_devel_version
26 AM_MAINTAINER_MODE
28 save_PACKAGE=$PACKAGE
29 AM_INIT_AUTOMAKE([foreign dist-bzip2 no-define 1.8])
30 PACKAGE=$save_PACKAGE
32 # Allow to build some parts of the code as one big chunk
33 m4_define([ALLPARTS],[boost,client,insets,mathed,core,tex2lyx,frontend_qt4])
34 AC_ARG_ENABLE(monolithic-build,
35   AC_HELP_STRING([--enable-monolithic-build@<:@=LIST@:>@],
36                 [Use monolithic build for modules in LIST (default: ALLPARTS)]),
37   [test "$enable_monolithic_build" = yes && enable_monolithic_build="ALLPARTS"
38    test "$enable_monolithic_build" = no && enable_monolithic_build=
39    IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=" ,"
40    for i in $enable_monolithic_build ; do
41        eval "enable_monolithic_$i=yes"
42    done
43    IFS="$ac_save_ifs"],
44   [enable_monolithic_build=])
46 AM_CONDITIONAL(MONOLITHIC_BOOST, test "x$enable_monolithic_boost" = "xyes")
47 AM_CONDITIONAL(MONOLITHIC_CLIENT, test "x$enable_monolithic_client" = "xyes")
48 AM_CONDITIONAL(MONOLITHIC_INSETS, test "x$enable_monolithic_insets" = "xyes")
49 AM_CONDITIONAL(MONOLITHIC_MATHED, test "x$enable_monolithic_mathed" = "xyes")
50 AM_CONDITIONAL(MONOLITHIC_CORE, test "x$enable_monolithic_core" = "xyes")
51 AM_CONDITIONAL(MONOLITHIC_TEX2LYX, test "x$enable_monolithic_tex2lyx" = "xyes")
52 AM_CONDITIONAL(MONOLITHIC_FRONTEND_QT4, test "x$enable_monolithic_frontend_qt4" = "xyes")
54 ### Set the execute permissions of the various scripts correctly
55 for file in config/install-sh ; do
56   chmod 755 ${srcdir}/${file}
57 done
59 # Check for installed python
60 AM_PATH_PYTHON(2.3.4,, :)
62 ### we need to know the byte order for unicode conversions
63 AC_C_BIGENDIAN
65 ### check which frontend we want to use
66 LYX_USE_FRONTENDS
68 ### Check for a C++ compiler
69 LYX_PROG_CXX
71 ### Objective-C compiler
72 AC_PROG_OBJC
73 _AM_DEPENDENCIES([OBJC])
75 ### Add extra directories to check for libraries.
76 LYX_WITH_DIR([extra-lib],[extra library directory],extra_lib, NONE)
77 LYX_LOOP_DIR($lyx_cv_extra_lib,LYX_ADD_LIB_DIR(lyx_ldflags,$dir))
78 test ! x"$lyx_ldflags" = x && LDFLAGS="$lyx_ldflags $LDFLAGS"
80 ### Add extra directories to check for include files.
81 LYX_WITH_DIR([extra-inc],[extra include directory],extra_inc, NONE)
82 LYX_LOOP_DIR($lyx_cv_extra_inc,LYX_ADD_INC_DIR(lyx_cppflags,$dir))
83 test ! x"$lyx_cppflags" = x && CPPFLAGS="$lyx_cppflags $CPPFLAGS"
85 ### Add both includes and libraries
86 LYX_WITH_DIR([extra-prefix],[extra lib+include directory],extra_prefix, NONE, ${prefix})
87 LYX_LOOP_DIR($lyx_cv_extra_prefix,[
88 LYX_ADD_INC_DIR(CPPFLAGS,$dir/include)
89   LYX_ADD_LIB_DIR(LDFLAGS,$dir/lib)])
91 ### These are needed in windows
92 AC_CHECK_LIB(shlwapi, main, [LIBSHLWAPI=-lshlwapi])
93 AC_SUBST(LIBSHLWAPI)
94 AC_CHECK_LIB(psapi, main, [LIBPSAPI=-lpsapi])
95 AC_SUBST(LIBPSAPI)
96 AC_CHECK_LIB(gdi32, main)
98 LYX_USE_INCLUDED_BOOST
100 # Needed for our char_type
101 AC_CHECK_SIZEOF(wchar_t)
103 ### We need iconv for unicode support (Qt4 frontend requires it too)
104 AM_ICONV
105 if test "$am_cv_func_iconv" = no; then
106   LYX_ERROR([Cannot find required library iconv])
107 else
108   LIBS="$LIBS $LIBICONV"
111 ### check for compression support
112 AC_CHECK_HEADERS(zlib.h,
113  [AC_CHECK_LIB(z, gzopen, [LIBS="$LIBS -lz"], LYX_LIB_ERROR(libz,zlib))],
114  [LYX_LIB_ERROR(zlib.h,zlib)])
117 ### check which frontend we want to use
119 dnl The code below is not in a macro, because this would cause big
120 dnl problems with the AC_REQUIRE contained in QT4_DO_IT_ALL.
121 for frontend in $FRONTENDS ; do
122   case "$frontend" in
123     qt4)
124           QT4_DO_IT_ALL
125           FRONTENDS_PROGS="$FRONTENDS_PROGS lyx-qt4\$(EXEEXT)"
126           FRONTENDS_SUBDIRS="$FRONTENDS_SUBDIRS qt4"
127           RPM_FRONTEND="qt4"
128           FRONTEND_INFO="${FRONTEND_INFO}\
129   Qt 4 Frontend:\n\
130       Qt 4 version:\t\t${QT4_VERSION}\n"
131 dnl qt 4 build will fail without moc or uic
132           if test -z "$MOC4"; then
133             LYX_ERROR([moc 4 binary not found !])
134           fi
135           if test -z "$UIC4"; then
136             LYX_ERROR([uic 4 binary not found !])
137           fi
138           if test -z "$QT4_LIB"; then
139             LYX_ERROR([qt 4 library not found !])
140           fi
141       ;;
142     *)
143           LYX_ERROR(Unknown frontend '$frontend');;
144   esac
145 done
147 # fix the value of the prefixes.
148 test "x$prefix" = xNONE && prefix=$default_prefix
149 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
150 if echo $prefix |grep ' ' >/dev/null 2>/dev/null ; then
151   LYX_WARNING([The installation prefix \"${prefix}\" contains a space, which
152    causes problems with the Makefiles. The installation will be done in
153    directory \"`pwd`/installprefix\" instead. Please move its contents to
154    the right place after installation.])
155   prefix=`pwd`/installprefix
158 ### Setup GNU gettext
159 dnl GNU gettext is written in C
160 AC_LANG_PUSH(C)
161 dnl Dirty trick ahead: disable macro AC_GNU_SOURCE because it triggers a bug with autoconf 2.62.
162 dnl this can be removed if gettext is been updated to avoid that.
163 m4_undefine([AC_GNU_SOURCE])
164 m4_defun([AC_GNU_SOURCE],[])
165 AM_GNU_GETTEXT([no-libtool])
166 AM_GNU_GETTEXT_VERSION([0.16.1])
167 AC_LANG_POP(C)
169 # some standard header files
170 AC_HEADER_MAJOR
171 AC_CHECK_HEADERS(sys/time.h sys/types.h sys/select.h strings.h locale.h io.h process.h NewAPIs.h utime.h sys/utime.h)
173 # some standard structures
174 AC_HEADER_STAT
175 AC_HEADER_TIME
177 # some standard types
178 AC_CHECK_TYPE(mode_t,[AC_DEFINE(HAVE_MODE_T, 1, [Define this to 1 if your compiler supports the mode_t type.])])
179 AC_TYPE_OFF_T
180 AC_TYPE_PID_T
181 AC_TYPE_SIGNAL
182 AC_TYPE_SIZE_T
183 AC_TYPE_UID_T
185 AC_CHECK_FUNCS(strerror)
186 AC_CHECK_FUNCS(chmod close _close getpid _getpid lstat mkfifo mkstemp mktemp open _open pclose _pclose popen _popen readlink strerror)
187 LYX_CHECK_DECL(istreambuf_iterator, iterator)
188 LYX_CHECK_DECL(mkstemp,[unistd.h stdlib.h])
189 # Check the form of mkdir()
190 AC_FUNC_MKDIR
191 AC_FUNC_SELECT_ARGTYPES
193 LYX_CHECK_SPELL_ENGINES
195 lyx_client_subdir=true
196 AC_LANG_PUSH(C)
197 dnl LIBS already contains some X extra libs that may interfere.
198 save_LIBS="$LIBS"
199 LIBS=
200 AC_CHECK_FUNCS(fcntl,
201   [AC_SEARCH_LIBS([gethostbyname], [nsl])
202    AC_SEARCH_LIBS([socket], [socket], [],
203      [AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket -lnsl $LIBS"],
204                 [], [-lnsl])])],
205   [lyx_client_subdir=false])
206 AC_SUBST(SOCKET_LIBS,$LIBS)
207 LIBS="$save_LIBS"
208 AM_CONDITIONAL(BUILD_CLIENT_SUBDIR, $lyx_client_subdir)
209 AC_LANG_POP(C)
211 lyx_win_res=false;
212 case ${host} in
213     *mingw*|*cygwin*) lyx_win_res=true;;
214 esac
215 AM_CONDITIONAL(LYX_WIN_RESOURCE, $lyx_win_res)
216 LYX_SET_VERSION_INFO
219 ### Some information on what just happened
220 real_bindir=`eval "echo \`eval \"echo ${bindir}\"\`"`
221 real_pkgdatadir=`eval "echo \`eval \"echo \\\`eval \\\"echo ${pkgdatadir}\\\"\\\`\"\`"`
222 real_localedir=`eval "echo \`eval \"echo ${datadir}/locale\"\`"`
223 VERSION_INFO="Configuration\n\
224   Host type:                    ${host}\n\
225   Special build flags:          ${lyx_flags}\n\
226   C   Compiler:                 ${CC} ${CC_VERSION}\n\
227   C   Compiler LyX flags:       ${AM_CPPFLAGS} ${AM_CFLAGS}\n\
228   C   Compiler flags:           ${CPPFLAGS} ${CFLAGS}\n\
229   C++ Compiler:                 ${CXX} ${CXX_VERSION}\n\
230   C++ Compiler LyX flags:       ${AM_CPPFLAGS} ${AM_CXXFLAGS}\n\
231   C++ Compiler flags:           ${CPPFLAGS} ${CXXFLAGS}\n\
232   Linker flags:                 ${AM_LDFLAGS}\n\
233   Linker user flags:            ${LDFLAGS}\n\
234 ${FRONTEND_INFO}\
235   Packaging:                    ${lyx_use_packaging}\n\
236   LyX binary dir:               ${real_bindir}\n\
237   LyX files dir:                ${real_pkgdatadir}\n"
239 AC_SUBST(VERSION_INFO)
240 AC_SUBST(RPM_FRONTEND)
241 AC_SUBST(AM_CPPFLAGS)
242 AC_SUBST(AM_CXXFLAGS)
243 AC_SUBST(AM_CFLAGS)
244 AC_SUBST(AM_LDFLAGS)
245 AC_SUBST(real_pkgdatadir)
247 ## Some config.h stuff
249 AH_TOP([
250 /* -*- C++ -*- */
252  * \file config.h
253  * This file is part of LyX, the document processor.
254  * Licence details can be found in the file COPYING.
256  * This is the compilation configuration file for LyX.
257  * It was generated by autoconfs configure.
258  * You might want to change some of the defaults if something goes wrong
259  * during the compilation.
260  */
262 #ifndef _CONFIG_H
263 #define _CONFIG_H
266 AH_BOTTOM([
267 /************************************************************
268  ** You should not need to change anything beyond this point */
270 #ifndef HAVE_STRERROR
271 #if defined(__cplusplus)
272 extern "C"
273 #endif
274 char * strerror(int n);
275 #endif
277 #if defined(HAVE_OSTREAM) && defined(HAVE_LOCALE) && defined(HAVE_SSTREAM)
278 #  define USE_BOOST_FORMAT 1
279 #else
280 #  define USE_BOOST_FORMAT 0
281 #endif
283 #define BOOST_USER_CONFIG <config.h>
285 #if !defined(ENABLE_ASSERTIONS)
286 #  define BOOST_DISABLE_ASSERTS 1
287 #endif
288 #define BOOST_ENABLE_ASSERT_HANDLER 1
290 #define BOOST_DISABLE_THREADS 1
291 #define BOOST_NO_WREGEX 1
292 #define BOOST_NO_WSTRING 1
294 #ifdef __CYGWIN__
295 #  define NOMINMAX
296 #  define BOOST_POSIX 1
297 #  define BOOST_POSIX_API 1
298 #  define BOOST_POSIX_PATH 1
299 #endif
301 #if defined(HAVE_NEWAPIS_H)
302 #  define WANT_GETFILEATTRIBUTESEX_WRAPPER 1
303 #endif
306  * the FreeBSD libc uses UCS4, but libstdc++ has no proper wchar_t
307  * support compiled in:
308  * http://gcc.gnu.org/onlinedocs/libstdc++/faq/index.html#3_9
309  * And we are not interested at all what libc
310  * does: What we need is a 32bit wide wchar_t, and a libstdc++ that
311  * has the needed wchar_t support and uses UCS4. Whether it
312  * implements this with the help of libc, or whether it has own code
313  * does not matter for us, because we do not use libc directly (Georg)
315 #if defined(HAVE_WCHAR_T) && SIZEOF_WCHAR_T == 4 && !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
316 #  define USE_WCHAR_T
317 #endif
319 #endif
322 MSYS_AC_CANONICAL_PATH(lyx_abs_top_srcdir, ${srcdir})
323 MSYS_AC_CANONICAL_PATH(lyx_abs_installed_localedir, ${real_localedir})
324 MSYS_AC_CANONICAL_PATH(lyx_abs_installed_datadir, ${real_pkgdatadir})
326 AC_DEFINE_UNQUOTED([LYX_ABS_TOP_SRCDIR],
327         "${lyx_abs_top_srcdir}", [Top source directory])
328 AC_DEFINE_UNQUOTED([LYX_ABS_INSTALLED_LOCALEDIR],
329         "${lyx_abs_installed_localedir}",[Hard coded locale directory])
330 AC_DEFINE_UNQUOTED([LYX_ABS_INSTALLED_DATADIR],
331         "${lyx_abs_installed_datadir}",[Hard system support directory])
332 AC_DEFINE_UNQUOTED([PROGRAM_SUFFIX],
333         "${version_suffix}",[Program version suffix])
335 AC_DEFINE_UNQUOTED([LYX_DATE],"$LYX_DATE",[Date of release])
336 AC_DEFINE_UNQUOTED([VERSION_INFO],"$VERSION_INFO",[Full version info])
337 AC_DEFINE_UNQUOTED([LYX_DIR_VER],"$lyx_dir_ver",[Versioned env var for system dir])
338 AC_DEFINE_UNQUOTED([LYX_USERDIR_VER],"$lyx_userdir_ver",[Versioned env var for user dir])
339 AC_DEFINE_UNQUOTED([LYX_MAJOR_VERSION],$lyx_major,[Major version number])
340 AC_DEFINE_UNQUOTED([LYX_MINOR_VERSION],$lyx_minor,[Minor version number])
341 AC_DEFINE_UNQUOTED([LYX_RELEASE_LEVEL],$lyx_release,[Release version number])
342 AC_DEFINE_UNQUOTED([LYX_RELEASE_PATCH],$lyx_patch,[Patch version number])
344 AC_CONFIG_FILES([Makefile \
345       lyx.1:lyx.1in \
346       boost/Makefile \
347       config/Makefile \
348       development/Makefile \
349       development/MacOSX/Makefile \
350       development/MacOSX/Info.plist \
351       development/MacOSX/lyxrc.dist \
352       development/MacOSX/spotlight/Makefile \
353       development/cygwin/Makefile \
354       development/cygwin/lyxrc.dist \
355       development/lyx.spec \
356       intl/Makefile \
357       lib/Makefile \
358       lib/doc/Makefile \
359       lib/lyx2lyx/lyx2lyx_version.py \
360       lib/lyx2lyx/Makefile \
361       m4/Makefile \
362       po/Makefile.in \
363       sourcedoc/Doxyfile \
364       sourcedoc/Makefile \
365       src/client/Makefile \
366       src/client/lyxclient.1:src/client/lyxclient.1in \
367       src/Makefile \
368       src/tex2lyx/Makefile \
369       src/tex2lyx/tex2lyx.1:src/tex2lyx/tex2lyx.1in \
370       src/support/Makefile \
371       src/frontends/Makefile \
372       src/frontends/qt4/Makefile
376 AC_OUTPUT
378 # show version information
379 echo
380 printf "$VERSION_INFO"
381 echo
383 # Display a final warning if there has been a LYX_ERROR
384 LYX_CHECK_ERRORS