2 #--------------------------------------------------------------------
4 # MODULE : configure.in
5 # DESCRIPTION : TeXmacs configuration file for autoconf
6 # COPYRIGHT : (C) 2000 Joris van der Hoeven
8 # This software falls under the GNU general public license version 3 or later.
9 # It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
10 # in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
12 #--------------------------------------------------------------------
15 AC_CONFIG_HEADERS([src/System/config.h:src/System/config.in])
19 DEVEL_VERSION="1.0.7.3"
21 STABLE_VERSION="1.0.7"
23 WINDOWS_VERSION="1.0.5"
26 AC_SUBST(DEVEL_VERSION)
27 AC_SUBST(DEVEL_RELEASE)
28 AC_SUBST(STABLE_VERSION)
29 AC_SUBST(STABLE_RELEASE)
31 #--------------------------------------------------------------------
32 # Checks for C++ compiler
33 #--------------------------------------------------------------------
38 AH_TEMPLATE([OLD_GNU_COMPILER],[Use g++ strictly prior to g++ 3.0])
39 AC_MSG_CHECKING(whether GNU C++ compiler is default)
42 GCC_VERSION=`$CC -dumpversion`
43 GXX_VERSION=`$CXX -dumpversion`
45 AC_MSG_CHECKING(version of gcc)
46 AC_MSG_RESULT($GCC_VERSION)
47 AC_MSG_CHECKING(version of g++)
48 AC_MSG_RESULT($GXX_VERSION)
49 case "$GXX_VERSION" in
51 echo "old style GNU compiler"
52 AC_DEFINE([OLD_GNU_COMPILER],[])
60 AC_MSG_WARN(cannot find GNU C++ compiler)
64 #--------------------------------------------------------------------
66 #--------------------------------------------------------------------
68 if test -z "$GUILE_CFLAGS" -a -z "$GUILE_LDFLAGS"; then
71 AC_MSG_CHECKING(version of guile)
72 if test -z "$GUILE_VERSION" ; then
73 GUILE_VERSION=`guile --version | grep 'Guile \([[0-9]]\)' | sed 's/Guile \([[0-9]]*\)/\1/'`
75 AC_MSG_RESULT($GUILE_VERSION)
77 case "$GUILE_VERSION" in
78 1.0* | 1.1* | 1.2* | 1.3* | 1.4* | 1.5*)
79 CONFIG_GUILE_SERIAL="A"
82 CONFIG_GUILE_SERIAL="B"
85 CONFIG_GUILE_SERIAL="C"
88 AC_SUBST(CONFIG_GUILE_SERIAL)
90 #--------------------------------------------------------------------
91 # Checks for standard functionality
92 #--------------------------------------------------------------------
96 AC_CHECK_TYPES(intptr_t)
97 AC_CHECK_TYPES(time_t)
100 AC_CHECK_HEADERS(pty.h util.h)
101 AC_CHECK_FUNCS(gettimeofday)
103 #--------------------------------------------------------------------
104 # Checks for dl library
105 #--------------------------------------------------------------------
107 AC_CHECK_FUNC(dlopen)
108 if test "$ac_cv_func_dl" = "yes"; then
109 AC_DEFINE(DYNAMIC_LINKING, 1, [Dynamic linking works])
111 AC_CHECK_LIB(dl,dlopen)
112 if test "$ac_cv_lib_dl_dlopen" = "yes"; then
113 AC_CHECK_FUNCS(dlopen)
115 AC_DEFINE(DYNAMIC_LINKING, 1, [Dynamic linking works])
117 AC_CHECK_LIB(dld,dld_link)
118 if test "$ac_cv_lib_dld_dld_link" = "yes"; then
120 AC_DEFINE(DYNAMIC_LINKING, 1, [Dynamic linking works])
122 AC_CHECK_FUNCS(shl_load)
123 if test "$ac_cv_func_shl_load" = "yes"; then
125 AC_DEFINE(DYNAMIC_LINKING, 1, [Dynamic linking works])
127 AC_CHECK_FUNCS(dlopen)
128 if test "$ac_cv_func_dlopen" = "yes"; then
129 AC_DEFINE(DYNAMIC_LINKING, 1, [Dynamic linking works])
137 #--------------------------------------------------------------------
138 # Checks for iconv library
139 #--------------------------------------------------------------------
142 changequote(<<, >>)dnl
143 << --with-iconv[=DIR] where to find iconv [system]>>dnl
148 # Modified from GNOME's libxml2 configure.in
150 AC_LANG_C # compile C to avoid the 'const char**' problem
152 SAVE_CPPFLAGS="$CPPFLAGS"
153 SAVE_LDFLAGS="$LDFLAGS"
155 if test "$with_iconv" = "no" ; then
156 AC_MSG_RESULT([disabling iconv support])
158 if test -n "$ICONV_CFLAGS" -a -n "$ICONV_LDFLAGS"; then
159 CPPFLAGS="$ICONV_CFLAGS" # for AC_TRY_LINK
160 LDFLAGS="$ICONV_LDFLAGS"
162 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
163 CPPFLAGS="-I$with_iconv/include" # for AC_TRY_LINK
164 LDFLAGS="-L$with_iconv/lib"
165 ICONV_CFLAGS="-I$with_iconv/include"
166 ICONV_LDFLAGS="-L$with_iconv/lib"
169 AC_CHECK_HEADER(iconv.h,
170 AC_MSG_CHECKING(for iconv)
176 iconv_t cd = iconv_open ("","");
177 iconv (cd, NULL, NULL, NULL, NULL);
180 AC_DEFINE(USE_ICONV, 1, [Use iconv library])
183 AC_MSG_CHECKING(for iconv in -liconv)
184 # LDFLAGS="${ICONV_LDFLAGS}" # for AC_TRY_LINK
185 LIBS="-liconv" # for AC_TRY_LINK
191 iconv_t cd = iconv_open ("","");
192 iconv (cd, NULL, NULL, NULL, NULL);
195 AC_DEFINE(USE_ICONV, 1, [Use iconv library])
196 ICONV_LDFLAGS="${ICONV_LDFLAGS/-liconv} -liconv"
199 AC_MSG_WARN([absence of iconv may crash HTML import])
203 CPPFLAGS="$SAVE_CPPFLAGS"
204 LDFLAGS="$SAVE_LDFLAGS"
206 AC_LANG_RESTORE # restore C++ language
207 AC_SUBST(ICONV_CFLAGS)
208 AC_SUBST(ICONV_LDFLAGS)
210 #--------------------------------------------------------------------
211 # Checks for freetype library
212 #--------------------------------------------------------------------
214 AC_ARG_WITH(freetype,
215 changequote(<<, >>)dnl
216 << --with-freetype[=ARG] with freetype support [ARG=linked]>>dnl
220 SAVE_CPPFLAGS="$CPPFLAGS"
221 SAVE_LDFLAGS="$LDFLAGS"
223 if test "$with_freetype" = "no" ; then
224 AC_MSG_RESULT([disabling freetype support])
226 if test -z "$FREETYPE_CFLAGS"; then
227 FREETYPE_CFLAGS=`freetype-config --cflags`
229 CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
230 if test -z "$FREETYPE_LDFLAGS"; then
231 FREETYPE_LDFLAGS=`freetype-config --libs`
233 LIBS="$LDFLAGS $FREETYPE_LDFLAGS"
234 AC_CHECK_HEADER(ft2build.h,
235 AC_MSG_CHECKING(for freetype)
238 #include <ft2build.h>
239 #include FT_FREETYPE_H
241 FT_Library ft_library;
242 (void) FT_Init_FreeType (&ft_library);
245 AC_DEFINE(USE_FREETYPE, 1, [Use freetype library])
246 FREETYPE_CFLAGS="$CPPFLAGS"
247 if test "$with_freetype" = "linked" -o "$with_freetype" = "" ; then
248 FREETYPE_LDFLAGS="$LIBS"
249 AC_DEFINE(LINKED_FREETYPE, 1, [Link freetype library with TeXmacs])
255 CPPFLAGS="$SAVE_CPPFLAGS"
256 LDFLAGS="$SAVE_LDFLAGS"
259 AC_SUBST(FREETYPE_CFLAGS)
260 AC_SUBST(FREETYPE_LDFLAGS)
262 #--------------------------------------------------------------------
263 # Checks for Cairo library
264 #--------------------------------------------------------------------
267 changequote(<<, >>)dnl
268 << --with-cairo[=ARG] with cairo support [ARG=no]>>dnl
272 SAVE_CPPFLAGS="$CPPFLAGS"
273 SAVE_LDFLAGS="$LDFLAGS"
275 if test "$with_cairo" = "no" -o "$with_cairo" = "" ; then
276 AC_MSG_RESULT([disabling cairo support])
278 CPPFLAGS=`pkg-config --cflags cairo`
279 LIBS=`pkg-config --libs cairo`
280 AC_CHECK_HEADER(cairo.h,
281 AC_MSG_CHECKING(for cairo)
286 cairo_surface_t *surface;
287 surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 120, 120);
290 AC_DEFINE(USE_CAIRO, 1, [Use cairo library])
291 CAIRO_CFLAGS="$CPPFLAGS"
292 if test "$with_cairo" = "linked" ; then
293 CAIRO_LDFLAGS="$LIBS"
294 AC_DEFINE(LINKED_CAIRO, 1, [Link cairo library with TeXmacs])
300 CPPFLAGS="$SAVE_CPPFLAGS"
301 LDFLAGS="$SAVE_LDFLAGS"
304 AC_SUBST(CAIRO_CFLAGS)
305 AC_SUBST(CAIRO_LDFLAGS)
307 #--------------------------------------------------------------------
308 # Checks for Imlib2 library
309 #--------------------------------------------------------------------
312 changequote(<<, >>)dnl
313 << --with-imlib2[=ARG] with imlib2 support [ARG=no]>>dnl
317 SAVE_CPPFLAGS="$CPPFLAGS"
318 SAVE_LDFLAGS="$LDFLAGS"
320 if test "$with_imlib2" = "no" -o "$with_imlib2" = "" ; then
321 AC_MSG_RESULT([disabling imlib2 support])
323 CPPFLAGS=`imlib2-config --cflags`
324 LIBS=`imlib2-config --libs`
325 AC_CHECK_HEADER(Imlib2.h,
326 AC_MSG_CHECKING(for imlib2)
329 #include <X11/Xlib.h>
334 Imlib_Image image= imlib_load_image("");
337 AC_DEFINE(USE_IMLIB2, 1, [Use imlib2 library])
338 IMLIB2_CFLAGS="$CPPFLAGS"
339 if test "$with_imlib2" = "linked" ; then
340 IMLIB2_LDFLAGS="$LIBS"
341 AC_DEFINE(LINKED_IMLIB2, 1, [Link imlib2 library with TeXmacs])
347 CPPFLAGS="$SAVE_CPPFLAGS"
348 LDFLAGS="$SAVE_LDFLAGS"
351 AC_SUBST(IMLIB2_CFLAGS)
352 AC_SUBST(IMLIB2_LDFLAGS)
354 #--------------------------------------------------------------------
355 # Checks for Axel library
356 #--------------------------------------------------------------------
359 changequote(<<, >>)dnl
360 << --with-axel[=ARG] with axel support [ARG=no]>>dnl
364 SAVE_CPPFLAGS="$CPPFLAGS"
365 SAVE_LDFLAGS="$LDFLAGS"
367 if test "$with_axel" = "no" -o "$with_axel" = "" ; then
368 AC_MSG_RESULT([disabling axel support])
370 CPPFLAGS=`axel-config --cflags`
371 LIBS=`axel-config --libs`
372 AC_CHECK_HEADER(QGui/Viewer.h,
373 AC_MSG_CHECKING(for axel)
376 #include <QGui/Viewer.h>
381 AC_DEFINE(USE_AXEL, 1, [Use axel library])
382 AXEL_CFLAGS="$CPPFLAGS"
383 if test "$with_axel" = "linked" ; then
385 AC_DEFINE(LINKED_AXEL, 1, [Link axel library with TeXmacs])
391 CPPFLAGS="$SAVE_CPPFLAGS"
392 LDFLAGS="$SAVE_LDFLAGS"
395 AC_SUBST(AXEL_CFLAGS)
396 AC_SUBST(AXEL_LDFLAGS)
398 #--------------------------------------------------------------------
399 # Checks for ghostscript library
400 #--------------------------------------------------------------------
403 *mingw* | *-*-cygwin)
404 GS_EXE="gswin32c.exe"
406 AC_CHECK_PROG([HAS_GS_EXE], [${GS_EXE}], [yes], [no])
407 AC_CHECK_PROG([HAS_GS_LIB], [${GS_DLL}], [yes], [no])
410 AC_CHECK_PROG([HAS_GS_EXE], [gs], [yes], [no])
414 if test "x${HAS_GS_EXE}" = "xyes" -a "x${HAS_GS_LIB}" = "xyes"; then
415 AC_DEFINE([USE_GS], [1], [Use ghostscript])
416 CONFIG_GS="Ghostscript"
417 AC_SUBST([CONFIG_GS])
421 AC_MSG_RESULT([disabling ghostscript support])
424 #--------------------------------------------------------------------
425 # Fixes for erroneous behaviour of gcc/g++ and guile on some systems
426 #--------------------------------------------------------------------
428 AC_MSG_CHECKING(whether ... arguments behave correctly)
429 if test -z "$GUILE_CFLAGS"; then
430 CXXFLAGS="`guile-config compile`"
432 CXXFLAGS="$GUILE_CFLAGS"
435 #include <guile/gh.h>
436 #include <libguile.h>
437 typedef SCM (*FN)(...);
438 static SCM identity (SCM x) { return x; }
439 void declare () { gh_new_procedure ("identity", (FN) identity, 1, 0, 0); }
442 AC_DEFINE(DOTS_OK, 1, [Defined if ...-style argument passing works])
449 AC_MSG_CHECKING(the size_t of guile strings)
450 if test -z "$GUILE_CFLAGS"; then
451 CXXFLAGS="`guile-config compile`"
453 CXXFLAGS="$GUILE_CFLAGS"
456 #include <guile/gh.h>
457 #include <libguile.h>
458 void print_string (SCM s) {
460 char* r= gh_scm2newstr (s, &len_r); }
463 AC_DEFINE(guile_str_size_t, int, [Guile string size type])
466 AC_DEFINE(guile_str_size_t, size_t, [Guile string size type])
467 AC_MSG_RESULT(size_t)
471 AC_MSG_CHECKING([if statically linking with guile works])
472 SAVE_CPPFLAGS="$CPPFLAGS"
473 SAVE_LDFLAGS="$LDFLAGS"
475 CPPFLAGS="$GUILE_CFLAGS"
477 LIBS="$GUILE_LDFLAGS"
478 TEXMACS_LINK_GUILE([tm_link_guile_static="yes"],
479 [tm_link_guile_static="no"])
480 AC_MSG_RESULT(["$tm_link_guile_static"])
481 if test "$tm_link_guile_static" = "no" ; then
482 AC_MSG_CHECKING([if it works with -lltdl])
483 LIBS="$GUILE_LDFLAGS -lltdl"
484 TEXMACS_LINK_GUILE([tm_link_guile_static_ltdl="yes"],
485 [tm_link_guile_static_ltdl="no"])
486 AC_MSG_RESULT(["$tm_link_guile_static_ltdl"])
487 if test "$tm_link_guile_static_ltdl" = "yes" ; then
488 GUILE_LDFLAGS="$GUILE_LDFLAGS -lltdl"
490 AC_MSG_CHECKING([if it works with -lltdl -ldl])
491 LIBS="$GUILE_LDFLAGS -lltdl -ldl"
492 TEXMACS_LINK_GUILE([tm_link_guile_static_ltdl_ldl="yes"],
493 [tm_link_guile_static_ltdl_ldl="no"])
494 AC_MSG_RESULT(["$tm_link_guile_static_ltdl_ldl"])
495 if test "$tm_link_guile_static_ltdl_ldl" = "yes" ; then
496 GUILE_LDFLAGS="$GUILE_LDFLAGS -lltdl -ldl"
498 AC_MSG_WARN([unable to link statically with guile])
502 CPPFLAGS="$SAVE_CPPFLAGS"
503 LDFLAGS="$SAVE_LDFLAGS"
506 #--------------------------------------------------------------------
507 # Handle different systems case by case
508 #--------------------------------------------------------------------
510 CONFIG_OS="GNU_LINUX"
511 CONFIG_OS_SUFFIX="gnu-linux"
512 CONFIG_OS_COMPAT="Unix"
515 CONFIG_CXXTEMPLATE=""
516 CONFIG_STD_SETENV="#define STD_SETENV"
518 CONFIG_LIB_PATH="LD_LIBRARY_PATH"
519 CONFIG_CHMOD="chmod -f"
520 CONFIG_CXXOPTIMIZE="-O2"
521 CONFIG_BSTATIC="-Wl,-Bstatic"
522 CONFIG_BSHARED="-Wl,-Bdynamic"
524 CONFIG_BPATH="-Wl,-rpath,"
526 CONFIG_WORD_LENGTH="4"
527 CONFIG_WORD_LENGTH_INC="3"
528 CONFIG_WORD_MASK="0xfffffffc"
529 CONFIG_MAX_FAST="260 // WORD_LENGTH more than power of 2"
530 # tweak for XCode project
531 CONFIG_NATIVE_ARCH_TAG="NATIVE_ARCH"
533 X11_CFLAGS="$X_CFLAGS"
534 X11_LDFLAGS="$X_LIBS -lXext -lX11"
536 AC_CHECK_SIZEOF(void *)
537 AC_MSG_CHECKING(if we are on a 64-bits computer)
538 if test "$ac_cv_sizeof_void_p" = "8"; then
540 CONFIG_WORD_LENGTH="8"
541 CONFIG_WORD_LENGTH_INC="7"
542 CONFIG_WORD_MASK="0xfffffffffffffff8"
543 CONFIG_MAX_FAST="264 // WORD_LENGTH more than power of 2"
549 i*86-*-linux* | x86_64-*-linux*)
550 AC_MSG_RESULT(final adjustments for an Intel or AMD GNU/Linux host)
551 CONFIG_CXXOPTIMIZE="-O3 -fexpensive-optimizations"
553 i*86-*-freebsd* | x86_64-*-freebsd*)
554 AC_MSG_RESULT(final adjustments for an Intel or AMD GNU/BSD host)
555 CONFIG_CXXOPTIMIZE="-O3 -fexpensive-optimizations"
558 AC_MSG_RESULT(final adjustments for an Intel or AMS Solaris host)
559 CONFIG_CXXOPTIMIZE="-O3"
560 CONFIG_BPATH="-Wl,-R,"
561 X11_LDFLAGS="$X_LIBS -lXext -lX11 -lsocket"
564 AC_MSG_RESULT([final adjustments for mingw host])
565 CONFIG_OS_COMPAT="Windows"
566 CONFIG_LDRT="-lmingw32 -lmingwex"
569 AC_MSG_RESULT(final adjustments for cygwin host)
571 CONFIG_BFLAGS="-Wl,-stack,8388608"
572 # CXX="export CYGWIN=check_case:strict; $CXX"
576 echo "$ac_t""final adjustments for a MacOS host" 1>&6
578 CONFIG_CXXFLAGS="-I${prefix}/include"
580 CONFIG_BFLAGS="-framework Cocoa"
583 CONFIG_LIB_PATH="DYLD_LIBRARY_PATH"
586 echo "$ac_t""final adjustments for a generic Darwin host" 1>&6
587 CONFIG_CXXFLAGS="-I${prefix}/include"
591 CONFIG_LIB_PATH="DYLD_LIBRARY_PATH"
594 AC_MSG_RESULT(final adjustments for a PowerPC/GNU-linux host)
595 CONFIG_OS="POWERPC_GNU_LINUX"
596 CONFIG_CXXOPTIMIZE="-O3 -fexpensive-optimizations"
599 AC_MSG_RESULT(final adjustments for a SUN/solaris host)
601 CONFIG_OS_SUFFIX="sun"
604 CONFIG_BPATH="-Wl,-R,"
605 X11_LDFLAGS="$X_LIBS -lXext -lX11 -lsocket"
606 CONFIG_WORD_LENGTH="8"
607 CONFIG_WORD_LENGTH_INC="7"
608 CONFIG_WORD_MASK="0xfffffff8"
609 CONFIG_MAX_FAST="264 // WORD_LENGTH more than power of 2"
613 AC_MSG_RESULT(final adjustments for a Sparc host running GNU/Linux)
614 CONFIG_CXXOPTIMIZE="-O3 -fexpensive-optimizations"
615 CONFIG_WORD_LENGTH="8"
616 CONFIG_WORD_LENGTH_INC="7"
617 CONFIG_WORD_MASK="0xfffffff8"
618 CONFIG_MAX_FAST="264 // WORD_LENGTH more than power of 2"
622 AC_MSG_RESULT(final adjustments for a DEC/alpha host)
624 CONFIG_BSHARED="-shared"
628 AC_MSG_RESULT(final adjustments for an Alpha GNU/Linux host)
630 CONFIG_BSHARED="-shared"
633 AC_MSG_RESULT(final adjustments for an IBM S/390 GNU/Linux host)
637 AC_MSG_RESULT(final adjustments for an Itanium GNU/Linux host)
639 CONFIG_BSHARED="-shared"
642 AC_MSG_RESULT(final adjustments for an HP PA_RISC GNU/Linux host)
643 CONFIG_CXXFLAGS="$CONFIG_CXXFLAGS -fPIC"
645 CONFIG_BSHARED="-shared"
648 echo "$ac_t""final adjustments for a SGI/Irix host" 1>&6
655 X11_LDFLAGS="$X_LIBS -lX11"
656 CONFIG_WORD_MASK="0xfffffff8"
659 CONFIG_LIB_PATH="LD_LIBRARYN32_PATH"
661 m68k-*-linux* | mips-*-linux* | mipsel-*-linux* | arm*-*-linux*)
662 AC_MSG_RESULT(final adjustments for a supported GNU/Linux host)
665 AC_MSG_RESULT(final adjustments for a generic GNU/Linux host)
668 AC_MSG_RESULT(final adjustments for a generic host)
674 echo "$ac_t""Xcode 3.2 project tweak (only MacOSX 10.6)" 1>&6
675 CONFIG_NATIVE_ARCH_TAG="NATIVE_ARCH_ACTUAL"
679 #--------------------------------------------------------------------
680 # Temporary fix for link problem
681 #--------------------------------------------------------------------
683 case "$GXX_VERSION" in
685 CONFIG_BSTATIC="-static"
686 CONFIG_BSHARED="-dynamic"
690 #--------------------------------------------------------------------
691 # Memory allocation options
692 #--------------------------------------------------------------------
694 AC_ARG_ENABLE(fastalloc,
695 [ --disable-fastalloc omit fast allocator for small objects],
696 [], [enable_fastalloc="yes"])
697 case "$enable_fastalloc" in
701 AC_MSG_RESULT([disabling fast allocator for small objects])
702 AC_DEFINE(NO_FAST_ALLOC, 1, [Disable fast memory allocator])
705 AC_MSG_ERROR([bad option --enable-fastalloc=$enable_fastalloc])
709 #--------------------------------------------------------------------
710 # Experimental options
711 #--------------------------------------------------------------------
713 AC_ARG_ENABLE(experimental,
714 [ --enable-experimental support new style rewriting code],
715 [], [enable_experimental="no"])
716 case "$enable_experimental" in
718 AC_MSG_RESULT([enabling experimental style rewriting code])
719 AC_DEFINE(EXPERIMENTAL, 1, [Enable experimental style rewriting code])
720 CONFIG_EXPERIMENTAL="Memorizer Environment Evaluate"
723 AC_MSG_RESULT([disabling experimental style rewriting code])
724 CONFIG_EXPERIMENTAL=""
727 AC_MSG_ERROR([bad option --enable-experimental=$enable_experimental])
730 AC_SUBST(CONFIG_EXPERIMENTAL)
732 #--------------------------------------------------------------------
733 # MacOS X extensions (spellchecker, image loading)
734 #--------------------------------------------------------------------
736 AC_ARG_ENABLE(macosx-extensions,
737 [ --enable-macosx-extensions support new style rewriting code],
738 [], [enable_macosx_extensions="no"])
739 case "$enable_macosx_extensions" in
741 AC_MSG_RESULT([enabling Mac OSX extensions])
742 AC_DEFINE(MACOSX_EXTENSIONS, 1, [Enabling Mac OSX extensions])
746 AC_MSG_RESULT([disabling Mac OSX extensions])
750 AC_MSG_ERROR([bad option --enable-macosx-extensions=$enable_macosx_extensions])
753 AC_SUBST(CONFIG_MACOS)
755 #--------------------------------------------------------------------
757 #--------------------------------------------------------------------
764 [ --enable-qt replace X11 by Qt interface],
765 [], [enable_qt="no"])
770 if test x"$at_cv_qt_build" = xko; then
771 AC_MSG_ERROR([cannot find Qt!])
773 AC_MSG_RESULT([enabling experimental Qt port])
778 AC_MSG_RESULT([disabling experimental Qt port])
781 AC_MSG_ERROR([bad option --enable-qt=$enable_qt])
786 [ --enable-cocoa replace X11 by Cocoa interface],
787 [], [enable_cocoa="no"])
788 case "$enable_cocoa" in
790 AC_MSG_RESULT([enabling experimental Cocoa port])
792 COCOA_LDFLAGS="-framework Cocoa"
796 AC_MSG_RESULT([disabling experimental Cocoa port])
799 AC_MSG_ERROR([bad option --enable-cocoa=$enable_cocoa])
803 case "$CONFIG_GUI" in
805 CONFIG_X11="X11 Widkit Ghostscript"
806 CONFIG_GUI_DEFINE="X11TEXMACS"
807 # AC_DEFINE(X11TEXMACS, 1, [Use standard X11 port])
811 CONFIG_GUI_DEFINE="AQUATEXMACS"
812 # AC_DEFINE(AQUATEXMACS, 1, [Enable experimental Cocoa port])
816 CONFIG_GUI_DEFINE="QTTEXMACS"
817 # AC_DEFINE(QTTEXMACS, 1, [Enable experimental Qt port])
824 AC_SUBST(X11_LDFLAGS)
825 AC_SUBST(COCOA_CFLAGS)
826 AC_SUBST(COCOA_LDFLAGS)
829 AC_SUBST(CONFIG_COCOA)
832 AC_SUBST(CONFIG_GUI_DEFINE)
834 #--------------------------------------------------------------------
836 #--------------------------------------------------------------------
838 STD_DEBUG_FLAGS="-fno-rtti -fno-exceptions"
839 if test "$enable_cocoa" = "yes"; then
840 STD_DEBUG_FLAGS="-fno-exceptions"
843 AC_MSG_CHECKING(if compiler supports $STD_DEBUG_FLAGS)
844 CXXFLAGS="$STD_DEBUG_FLAGS"
846 int some_variable = 0;
849 CONFIG_CXXDIALECT="$STD_DEBUG_FLAGS"
856 AC_SUBST(CONFIG_CXXDIALECT)
859 changequote(<<, >>)dnl
860 << --enable-debug[=ARG] install a debugging enable executable [-ggdb]>>,
862 [], [enable_debug="no"])
864 if test "$enable_debug" = "yes"; then
865 if test "$GXX" = "yes"; then
872 if test "$enable_debug" = "no"; then
873 AC_MSG_RESULT([disabling debugging])
876 optimize_default="yes"
878 AC_MSG_RESULT([enabling debugging, $enable_debug])
880 CONFIG_CXXDEBUG="$enable_debug"
881 optimize_default="no"
884 AC_ARG_ENABLE(assert,
885 changequote(<<, >>)dnl
886 << --enable-assert exit on failed assertions in code>>,
888 [], [enable_assert="yes"])
890 if test "$enable_assert" = "no"; then
891 AC_MSG_RESULT([disabling assertion checking])
893 AC_MSG_RESULT([enabling assertion checking])
894 AC_DEFINE(DEBUG_ASSERT, 1, [check assertions in code])
897 #--------------------------------------------------------------------
899 #--------------------------------------------------------------------
901 case "$GXX_VERSION" in
903 CONFIG_CXXWARNING="";
906 CONFIG_CXXWARNING="-Wall -Wno-return-type"
910 AC_ARG_ENABLE(warnings,
911 [ --enable-warnings print warning messages during compilation],
912 [], [enable_warnings="yes"])
913 case "$enable_warnings" in
915 AC_MSG_RESULT([enabling warning flags $CONFIG_CXXWARNING]) ;;
918 AC_MSG_RESULT([disabling warning flags]) ;;
920 CONFIG_CXXWARNING="$enable_warnings"
921 AC_MSG_RESULT([enabling warning flags $CONFIG_CXXWARNING]) ;;
924 #--------------------------------------------------------------------
925 # Optimization options
926 #--------------------------------------------------------------------
928 if test "$optimize_default" = "yes"; then
929 case "$GXX_VERSION" in
932 2.96 | 3.0 | 3.0.* | 3.1 | 3.1.* | 3.2 | 3.2.* | 3.3 | 3.3.*)
934 i*86-*-linux-gnu* | i*86-*-freebsd*)
935 AC_MSG_WARN([using g++ 3.*, optimize without inline by default])
936 optimize_default="no-inline"
939 AC_MSG_WARN([using g++ 3.*, optimize without inline by default])
940 optimize_default="no-inline"
947 AC_ARG_ENABLE(optimize,
948 changequote(<<, >>)dnl
949 << --enable-optimize[=ARG] compile with optimizations [guessed]>>,
951 [], [enable_optimize="$optimize_default"])
953 case "$enable_optimize" in
955 # keep optimization options
956 AC_MSG_RESULT([enabling optimizations, $CONFIG_CXXOPTIMIZE]) ;;
958 optimize_no_inline="-fno-default-inline -fno-inline"
959 CONFIG_CXXOPTIMIZE="$CONFIG_CXXOPTIMIZE $optimize_no_inline"
960 AC_MSG_RESULT([enabling optimizations, $CONFIG_CXXOPTIMIZE]) ;;
962 CONFIG_CXXOPTIMIZE=""
963 AC_MSG_RESULT([disabling optimizations]) ;;
965 CONFIG_CXXOPTIMIZE="$enable_optimize"
966 AC_MSG_RESULT([customizing optimizations, $enable_optimize]) ;;
969 #--------------------------------------------------------------------
970 # Substitute TeXmacs specific configuration parameters
971 #--------------------------------------------------------------------
974 AC_SUBST(CONFIG_OS_SUFFIX)
975 AC_SUBST(CONFIG_OS_COMPAT)
976 AC_SUBST(CONFIG_CXXWARNING)
977 AC_SUBST(CONFIG_CXXTEMPLATE)
978 AC_SUBST(CONFIG_CXXOPTIMIZE)
979 AC_SUBST(CONFIG_CXXDEBUG)
980 AC_SUBST(CONFIG_BFLAGS)
981 AC_SUBST(CONFIG_BSTATIC)
982 AC_SUBST(CONFIG_BSHARED)
983 AC_SUBST(CONFIG_BPATH)
984 AC_SUBST(CONFIG_WORD_LENGTH)
985 AC_SUBST(CONFIG_WORD_LENGTH_INC)
986 AC_SUBST(CONFIG_WORD_MASK)
987 AC_SUBST(CONFIG_MAX_FAST)
988 AC_SUBST(CONFIG_CXXFLAGS)
989 AC_SUBST(CONFIG_STD_SETENV)
991 AC_SUBST(CONFIG_LIB_PATH)
992 AC_SUBST(CONFIG_STRIP)
993 AC_SUBST(CONFIG_CHMOD)
994 AC_SUBST(CONFIG_LDRT)
995 AC_SUBST(CONFIG_NATIVE_ARCH_TAG)
997 #--------------------------------------------------------------------
998 # Default paths for installation
999 #--------------------------------------------------------------------
1001 if test "$prefix" = ""; then
1004 if test "$prefix" = "NONE"; then
1007 if test "$exec_prefix" = ""; then
1008 exec_prefix='${prefix}'
1010 if test "$exec_prefix" = "NONE"; then
1011 exec_prefix='${prefix}'
1013 if test "$exec_prefix" = '${prefix}'; then
1014 exec_prefix='${prefix}'
1016 if test "$includedir" = ""; then
1017 includedir='${prefix}/include'
1019 if test "$includedir" = "NONE"; then
1020 includedir='${prefix}/include'
1022 if test "$includedir" = '${prefix}/include'; then
1023 includedir='${prefix}/include'
1025 if test "$libdir" = ""; then
1026 libdir='${exec_prefix}/lib'
1028 if test "$libdir" = "NONE"; then
1029 libdir='${exec_prefix}/lib'
1031 if test "$libdir" = '${exec_prefix}/lib'; then
1032 libdir='${exec_prefix}/lib'
1034 if test "$bindir" = ""; then
1035 bindir='${exec_prefix}/bin'
1037 if test "$bindir" = "NONE"; then
1038 bindir=${exec_prefix}/bin
1040 if test "$bindir" = '${exec_prefix}/bin'; then
1041 bindir='${exec_prefix}/bin'
1043 if test "$datarootdir" = ""; then
1044 datarootdir='${prefix}/share'
1046 if test "$datarootdir" = "NONE"; then
1047 datarootdir='${prefix}/share'
1049 if test "$datarootdir" = '${prefix}/share'; then
1050 datarootdir='${prefix}/share'
1052 if test "$datadir" = ""; then
1053 datadir='${prefix}/share'
1055 if test "$datadir" = "NONE"; then
1056 datadir='${prefix}/share'
1058 if test "$datadir" = '${prefix}/share'; then
1059 datadir='${prefix}/share'
1061 if test "$mandir" = ""; then
1062 mandir='${datarootdir}/man'
1064 if test "$mandir" = "NONE"; then
1065 mandir='${datarootdir}/man'
1067 if test "$mandir" = '${datarootdir}/man'; then
1068 mandir='${datarootdir}/man'
1070 if test "$libexecdir" = ""; then
1071 libexecdir='${exec_prefix}/libexec'
1073 if test "$libexecdir" = "NONE"; then
1074 libexecdir='${exec_prefix}/libexec'
1076 if test "$libexecdir" = '${exec_prefix}/libexec'; then
1077 libexecdir='${exec_prefix}/libexec'
1083 tmsrc=${curdir}/${tmdir}
1084 tmbin=${libexecdir}/${tmdir}
1085 tmdata=${datadir}/${tmdir}
1092 if test "$DEVEL_RELEASE" = "1"; then
1093 tmtgz=${PACKAGE}-${DEVEL_VERSION}
1095 tmtgz=${PACKAGE}-${DEVEL_VERSION}-R${DEVEL_RELEASE}
1097 tmrpm=${PACKAGE}-${DEVEL_VERSION}-${DEVEL_RELEASE}
1098 if test "$STABLE_RELEASE" = "1"; then
1099 tmstgz=${PACKAGE}-${STABLE_VERSION}
1101 tmstgz=${PACKAGE}-${STABLE_VERSION}-R${STABLE_RELEASE}
1103 tmsrpm=${PACKAGE}-${STABLE_VERSION}-${STABLE_RELEASE}
1104 if test "$WINDOWS_RELEASE" = "1"; then
1105 tmwin=wintexmacs-${WINDOWS_VERSION}
1107 tmwin=wintexmacs-${WINDOWS_VERSION}-R${WINDOWS_RELEASE}
1115 #--------------------------------------------------------------------
1117 #--------------------------------------------------------------------
1119 AC_OUTPUT(Makefile:Makefile.in src/makefile:src/makefile.in src/System/tm_configure.hpp:src/System/tm_configure.in misc/admin/admin.makefile:misc/admin/admin.makefile.in misc/doxygen/Doxyfile:misc/doxygen/Doxyfile.in misc/man/texmacs.1:misc/man/texmacs.1.in misc/rpm/TeXmacs.spec:misc/rpm/TeXmacs.spec.in misc/scripts/fig2ps:misc/scripts/fig2ps.in misc/scripts/texmacs:misc/scripts/texmacs.in TeXmacs/examples/plugins/dynlink/Makefile:TeXmacs/examples/plugins/dynlink/Makefile.in misc/bundle/Base.xcconfig:misc/bundle/Base.xcconfig.in)