1 dnl Process with autoconf to generate configure script -*- sh -*-
3 AC_INIT([LyX],[2.3.8],[lyx-devel@lists.lyx.org],[lyx])
5 # Use ISO format only. The frontend needs to parse this
6 AC_SUBST(LYX_DATE, ["2024-05-02"])
8 AC_CONFIG_SRCDIR(src/main.cpp)
9 AC_CONFIG_HEADERS([config.h])
11 AC_CONFIG_AUX_DIR(config)
13 # First check the version
17 # Check how the files should be packaged
20 # We need to define these variables here and the no-define option of
21 # AM_INIT_AUTOMAKE above because we alter $PACKAGE in LYX_USE_PACKAGING.
22 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
24 dnl Default maintainer mode to true for development versions
25 if test "${enable_maintainer_mode+set}" != set; then
26 enable_maintainer_mode=$lyx_devel_version
29 AM_SILENT_RULES([yes])
30 # Automake is pulling the historical V7 format. This tar format supports
31 # file names only up to 99 characters. tar-ustar selects the ustar format defined
32 # by POSIX 1003.1-1988. This format is believed to be old enough to be portable.
34 AM_INIT_AUTOMAKE([foreign dist-bzip2 no-define 1.14 tar-ustar subdir-objects])
37 # Allow to build some parts of the code as one big chunk
38 m4_define([ALLPARTS],[boost,client,insets,mathed,core,tex2lyx,frontend_qt])
39 AC_ARG_ENABLE(monolithic-build,
40 AS_HELP_STRING([--enable-monolithic-build@<:@=LIST@:>@],[Use monolithic build for modules in LIST (default: ALLPARTS)]),
41 [test "$enable_monolithic_build" = yes && enable_monolithic_build="ALLPARTS"
42 test "$enable_monolithic_build" = no && enable_monolithic_build=
43 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=" ,"
44 for i in $enable_monolithic_build ; do
45 eval "enable_monolithic_$i=yes"
48 [enable_monolithic_build=])
50 AM_CONDITIONAL(MONOLITHIC_BOOST, test "x$enable_monolithic_boost" = "xyes")
51 AM_CONDITIONAL(MONOLITHIC_CLIENT, test "x$enable_monolithic_client" = "xyes")
52 AM_CONDITIONAL(MONOLITHIC_INSETS, test "x$enable_monolithic_insets" = "xyes")
53 AM_CONDITIONAL(MONOLITHIC_MATHED, test "x$enable_monolithic_mathed" = "xyes")
54 AM_CONDITIONAL(MONOLITHIC_CORE, test "x$enable_monolithic_core" = "xyes")
55 AM_CONDITIONAL(MONOLITHIC_TEX2LYX, test "x$enable_monolithic_tex2lyx" = "xyes")
56 AM_CONDITIONAL(MONOLITHIC_FRONTEND_QT, test "x$enable_monolithic_frontend_qt" = "xyes")
58 ### Set the execute permissions of the various scripts correctly
59 for file in config/install-sh ; do
60 chmod 755 ${srcdir}/${file}
63 # Find a suitable python interpreter
64 LYX_PATH_PYTHON23([2.7.0], [3.3.0])
65 # do the usual python setup stuff
68 # Tools for creating libraries (note that we do not use libtool)
71 dnl Recent debian/ubuntu (at least) have built 'ar' so that deterministic mode is the default.
72 dnl This means that it does not make sense to use the 'u' flag (default ARFLAGS is 'cru').
73 AC_SUBST([ARFLAGS], [cr])
75 ### Check for a C++ compiler
76 dnl We have to do weird tricks so that autoconf does not touch CXXFLAGS even
77 dnl if it is not set. We do not use autoconf defaults.
78 lyx_has_CXXFLAGS=${CXXFLAGS+yes}
79 if ! test "$lyx_has_CXXFLAGS" = yes; then
80 dnl set to a dummy value so that AC_PROG_CXX does not try to set CXXFLAGS
84 if ! test "$lyx_has_CXXFLAGS" = yes; then
89 ### Objective-C compiler
91 _AM_DEPENDENCIES([OBJC])
93 ### Add extra directories to check for libraries.
94 LYX_WITH_DIR([extra-lib],[extra library directory],extra_lib, NONE)
95 LYX_LOOP_DIR($lyx_cv_extra_lib,LYX_ADD_LIB_DIR(lyx_ldflags,$dir))
96 test ! x"$lyx_ldflags" = x && LDFLAGS="$lyx_ldflags $LDFLAGS"
98 ### Add extra directories to check for include files.
99 LYX_WITH_DIR([extra-inc],[extra include directory],extra_inc, NONE)
100 LYX_LOOP_DIR($lyx_cv_extra_inc,LYX_ADD_INC_DIR(lyx_cppflags,$dir))
101 test ! x"$lyx_cppflags" = x && CPPFLAGS="$lyx_cppflags $CPPFLAGS"
103 ### Add both includes and libraries
104 LYX_WITH_DIR([extra-prefix],[extra lib+include directory],extra_prefix, NONE, ${prefix})
105 LYX_LOOP_DIR($lyx_cv_extra_prefix,[
106 LYX_ADD_INC_DIR(CPPFLAGS,$dir/include)
107 LYX_ADD_LIB_DIR(LDFLAGS,$dir/lib)
110 ### These are needed in windows
111 AC_CHECK_LIB(shlwapi, main, [LIBSHLWAPI=-lshlwapi])
113 AC_CHECK_LIB(psapi, main, [LIBPSAPI=-lpsapi])
115 AC_CHECK_LIB(gdi32, main)
116 AC_CHECK_LIB(ole32, main)
118 LYX_USE_INCLUDED_BOOST
120 ### we need to know the byte order for unicode conversions
123 # Nice to have when an assertion triggers
124 LYX_CHECK_CALLSTACK_PRINTING
127 LYX_CHECK_DEF(make_unique, memory, [using std::make_unique;])
129 # Needed for our char_type
130 AC_CHECK_SIZEOF(wchar_t)
132 # Taken from gettext, needed for libiconv
133 AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
134 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stddef.h>
135 wchar_t foo = (wchar_t)'\0';]], [[]])],[gt_cv_c_wchar_t=yes],[gt_cv_c_wchar_t=no])])
136 if test $gt_cv_c_wchar_t = yes; then
137 AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.])
142 AC_SUBST([HAVE_WCHAR_T])
144 # Needed for Mingw-w64
145 AC_TYPE_LONG_LONG_INT
146 if test "$ac_cv_type_long_long_int" = yes; then
147 AC_CHECK_SIZEOF(long)
148 AC_CHECK_SIZEOF(long long)
151 ### We need iconv for unicode support (Qt4 frontend requires it too)
152 LYX_USE_INCLUDED_ICONV
154 ### check for compression support
155 LYX_USE_INCLUDED_ZLIB
157 ### check for file magic support (currently optional)
158 AC_CHECK_HEADERS(magic.h,
159 [AC_CHECK_LIB(magic, magic_open, [LIBS="$LIBS -lmagic"],
160 LYX_WARNING([cannot find libmagic. Please check that the libmagic library
161 is correctly installed on your system.
162 Falling back to builtin file format detection.]))],
163 [LYX_WARNING([cannot find magic.h. Please check that the libmagic library
164 is correctly installed on your system.
165 Falling back to builtin file format detection.])])
167 ### setup the qt frontend.
168 dnl The code below is not in a macro, because this would cause big
169 dnl problems with the AC_REQUIRE contained in QT_DO_IT_ALL.
170 QT_DO_IT_ALL([4.5.0])
171 AC_SUBST([FRONTENDS_SUBDIRS], [qt4])
172 FRONTEND_INFO="${FRONTEND_INFO}\
174 Qt version:\t ${QTLIB_VERSION}\n"
176 # fix the value of the prefixes.
177 test "x$prefix" = xNONE && prefix=$default_prefix
178 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
179 if echo $prefix |grep ' ' >/dev/null 2>/dev/null ; then
180 LYX_WARNING([the installation prefix \"${prefix}\" contains a space, which
181 causes problems with the Makefiles. The installation will be done in
182 directory \"`pwd`/installprefix\" instead. Please move its contents to
183 the right place after installation.])
184 prefix=`pwd`/installprefix
187 ### Setup po directory
189 if test $USE_NLS = "yes" ; then
190 AC_DEFINE(ENABLE_NLS, 1,
191 [Define to 1 if translation of program messages to the user's native language
196 # some standard header files
198 AC_CHECK_HEADERS(sys/time.h sys/types.h sys/select.h locale.h utime.h sys/utime.h)
200 # some standard types
201 AC_CHECK_TYPE(mode_t,[AC_DEFINE(HAVE_MODE_T, 1, [Define this to 1 if your compiler supports the mode_t type.])])
207 LYX_CHECK_DEF(PATH_MAX, limits.h, [int n = PATH_MAX;])
209 AC_CHECK_FUNCS(chmod close _close fork getpid _getpid lockf lstat mkfifo open _open pclose _pclose popen _popen readlink putenv setenv strerror unsetenv)
210 # Check the form of mkdir()
212 AC_FUNC_SELECT_ARGTYPES
214 LYX_CHECK_SPELL_ENGINES
215 LYX_USE_INCLUDED_MYTHES
217 lyx_client_subdir=true
219 dnl LIBS already contains some X extra libs that may interfere.
222 AC_CHECK_FUNCS(fcntl,
223 [AC_SEARCH_LIBS([gethostbyname], [nsl])
224 AC_SEARCH_LIBS([socket], [socket network], [],
225 [AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket -lnsl $LIBS"],
227 [lyx_client_subdir=false])
228 AC_SUBST(SOCKET_LIBS,$LIBS)
230 AM_CONDITIONAL(BUILD_CLIENT_SUBDIR, $lyx_client_subdir)
235 *mingw*|*cygwin*) lyx_win_res=true;;
236 *freebsd*) AC_SEARCH_LIBS(backtrace_symbols, [execinfo])
238 if test "x$lyx_win_res" = "xtrue"; then
239 AC_CHECK_TOOL(RC, windres,)
240 if test -z "$RC"; then
241 AC_MSG_ERROR(Could not find a resource compiler)
244 AM_CONDITIONAL(LYX_WIN_RESOURCE, $lyx_win_res)
248 ### Some information on what just happened
249 real_bindir=`eval "echo \`eval \"echo ${bindir}\"\`"`
250 real_pkgdatadir=`eval "echo \`eval \"echo \\\`eval \\\"echo ${pkgdatadir}\\\"\\\`\"\`"`
251 real_localedir=`eval "echo \`eval \"echo ${datadir}/locale\"\`"`
252 test -z "${lyx_included_libs}" && lyx_included_libs="(none)"
253 VERSION_INFO="Configuration\n\
254 Host type: ${host}\n\
255 Special build flags: ${lyx_flags}\n\
256 Bundled libraries: ${lyx_included_libs}\n\
257 C++ Compiler: ${CXX} ${CXX_VERSION}\n\
258 C++ Compiler flags: ${AM_CPPFLAGS} ${AM_CXXFLAGS}\n\
259 C++ Compiler user flags: ${CPPFLAGS} ${CXXFLAGS}\n\
260 Linker flags: ${AM_LDFLAGS}\n\
261 Linker user flags: ${LDFLAGS}\n\
263 Packaging: ${lyx_use_packaging}\n\
264 LyX binary dir: ${real_bindir}\n\
265 LyX files dir: ${real_pkgdatadir}\n"
267 AC_SUBST(VERSION_INFO)
268 AC_SUBST(AM_CPPFLAGS)
269 AC_SUBST(AM_CXXFLAGS)
271 AC_SUBST(real_pkgdatadir)
273 ## Some config.h stuff
279 * This file is part of LyX, the document processor.
280 * Licence details can be found in the file COPYING.
282 * This is the compilation configuration file for LyX.
283 * It was generated by autoconfs configure.
284 * You might want to change some of the defaults if something goes wrong
285 * during the compilation.
293 /************************************************************
294 ** You should not need to change anything beyond this point */
296 #ifndef HAVE_STRERROR
297 #if defined(__cplusplus)
300 char * strerror(int n);
303 #define BOOST_USER_CONFIG <config.h>
305 #if !defined(ENABLE_ASSERTIONS)
306 # define BOOST_DISABLE_ASSERTS 1
308 #define BOOST_ENABLE_ASSERT_HANDLER 1
310 #define BOOST_DISABLE_THREADS 1
311 #define BOOST_NO_WREGEX 1
312 #define BOOST_NO_WSTRING 1
315 # define _DEFAULT_SOURCE
317 # define BOOST_POSIX 1
318 # define BOOST_POSIX_API 1
319 # define BOOST_POSIX_PATH 1
323 # ifndef __BIG_ENDIAN__
324 # define __BIG_ENDIAN__ 1
328 #if defined(HAVE_WCHAR_T) && SIZEOF_WCHAR_T == 4
332 #ifdef HAVE_LONG_LONG_INT
333 #if SIZEOF_LONG_LONG > SIZEOF_LONG
334 #define LYX_USE_LONG_LONG
341 MSYS_AC_CANONICAL_PATH(lyx_abs_top_srcdir, ${srcdir})
342 MSYS_AC_CANONICAL_PATH(lyx_abs_installed_localedir, ${real_localedir})
343 MSYS_AC_CANONICAL_PATH(lyx_abs_installed_datadir, ${real_pkgdatadir})
345 AC_DEFINE_UNQUOTED([LYX_ABS_TOP_SRCDIR],
346 "${lyx_abs_top_srcdir}", [Top source directory])
347 AC_DEFINE_UNQUOTED([LYX_ABS_INSTALLED_LOCALEDIR],
348 "${lyx_abs_installed_localedir}",[Hard coded locale directory])
349 AC_DEFINE_UNQUOTED([LYX_ABS_INSTALLED_DATADIR],
350 "${lyx_abs_installed_datadir}",[Hard system support directory])
351 AC_DEFINE_UNQUOTED([PROGRAM_SUFFIX],
352 "${version_suffix}",[Program version suffix])
354 AC_DEFINE_UNQUOTED([LYX_DATE],"$LYX_DATE",[Date of release])
355 AC_DEFINE_UNQUOTED([VERSION_INFO],"$VERSION_INFO",[Full version info])
356 AC_DEFINE_UNQUOTED([LYX_DIR_VER],"$lyx_dir_ver",[Versioned env var for system dir])
357 AC_DEFINE_UNQUOTED([LYX_USERDIR_VER],"$lyx_userdir_ver",[Versioned env var for user dir])
358 AC_DEFINE_UNQUOTED([LYX_MAJOR_VERSION],$lyx_major,[Major version number])
359 AC_DEFINE_UNQUOTED([LYX_MINOR_VERSION],$lyx_minor,[Minor version number])
360 AC_DEFINE_UNQUOTED([LYX_RELEASE_LEVEL],$lyx_release,[Release version number])
361 AC_DEFINE_UNQUOTED([LYX_RELEASE_PATCH],$lyx_patch,[Patch version number])
363 AC_CONFIG_FILES([Makefile \
366 3rdparty/boost/Makefile \
367 3rdparty/hunspell/Makefile \
368 3rdparty/mythes/Makefile \
369 3rdparty/libiconv/Makefile \
371 3rdparty/zlib/Makefile \
374 development/Makefile \
375 development/MacOSX/Makefile \
376 development/MacOSX/Info.plist \
377 development/MacOSX/lyxrc.dist \
378 development/MacOSX/spotlight/Makefile \
379 development/cygwin/Makefile \
380 development/cygwin/lyxrc.dist \
381 development/lyx.spec \
382 lib/lyx.desktop-temp:lib/lyx.desktop.in
385 lib/lyx2lyx/lyx2lyx_version.py \
386 lib/lyx2lyx/Makefile \
391 src/client/Makefile \
392 src/client/lyxclient.1:src/client/lyxclient.1in \
394 src/tex2lyx/Makefile \
395 src/tex2lyx/tex2lyx.1:src/tex2lyx/tex2lyx.1in \
396 src/convert/Makefile \
397 src/support/Makefile \
398 src/frontends/Makefile \
399 src/frontends/qt4/Makefile
405 # show version information
407 printf "$VERSION_INFO"
410 # Display a final warning if there has been a LYX_WARNING
414 Configuration of LyX was successful.
415 Type 'make' to compile the program,
416 and then 'make install' to install it.