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])
18 DEVEL_VERSION="1.0.7.3"
20 STABLE_VERSION="1.0.7"
22 WINDOWS_VERSION="1.0.5"
25 AC_SUBST(DEVEL_VERSION)
26 AC_SUBST(DEVEL_RELEASE)
27 AC_SUBST(STABLE_VERSION)
28 AC_SUBST(STABLE_RELEASE)
30 #--------------------------------------------------------------------
31 # Checks for C++ compiler
32 #--------------------------------------------------------------------
37 AH_TEMPLATE([OLD_GNU_COMPILER],[Use g++ strictly prior to g++ 3.0])
38 AC_MSG_CHECKING(whether GNU C++ compiler is default)
41 GCC_VERSION=`$CC -dumpversion`
42 GXX_VERSION=`$CXX -dumpversion`
44 AC_MSG_CHECKING(version of gcc)
45 AC_MSG_RESULT($GCC_VERSION)
46 AC_MSG_CHECKING(version of g++)
47 AC_MSG_RESULT($GXX_VERSION)
48 case "$GXX_VERSION" in
50 echo "old style GNU compiler"
51 AC_DEFINE([OLD_GNU_COMPILER],[])
59 AC_MSG_WARN(cannot find GNU C++ compiler)
63 #--------------------------------------------------------------------
65 #--------------------------------------------------------------------
67 if test -z "$GUILE_CFLAGS" -a -z "$GUILE_LDFLAGS"; then
70 AC_MSG_CHECKING(version of guile)
71 if test -z "$GUILE_VERSION" ; then
72 GUILE_VERSION=`guile --version | grep 'Guile \([[0-9]]\)' | sed 's/Guile \([[0-9]]*\)/\1/'`
74 AC_MSG_RESULT($GUILE_VERSION)
76 case "$GUILE_VERSION" in
77 1.0* | 1.1* | 1.2* | 1.3* | 1.4* | 1.5*)
78 CONFIG_GUILE_SERIAL="A"
81 CONFIG_GUILE_SERIAL="B"
84 CONFIG_GUILE_SERIAL="C"
87 AC_SUBST(CONFIG_GUILE_SERIAL)
89 #--------------------------------------------------------------------
90 # Checks for standard functionality
91 #--------------------------------------------------------------------
95 AC_CHECK_TYPES(intptr_t)
96 AC_CHECK_TYPES(time_t)
99 AC_CHECK_HEADERS(pty.h util.h)
100 AC_CHECK_FUNCS(gettimeofday)
102 #--------------------------------------------------------------------
103 # Checks for dl library
104 #--------------------------------------------------------------------
106 AC_CHECK_FUNC(dlopen)
107 if test "$ac_cv_func_dl" = "yes"; then
108 AC_DEFINE(DYNAMIC_LINKING, 1, [Dynamic linking works])
110 AC_CHECK_LIB(dl,dlopen)
111 if test "$ac_cv_lib_dl_dlopen" = "yes"; then
112 AC_CHECK_FUNCS(dlopen)
114 AC_DEFINE(DYNAMIC_LINKING, 1, [Dynamic linking works])
116 AC_CHECK_LIB(dld,dld_link)
117 if test "$ac_cv_lib_dld_dld_link" = "yes"; then
119 AC_DEFINE(DYNAMIC_LINKING, 1, [Dynamic linking works])
121 AC_CHECK_FUNCS(shl_load)
122 if test "$ac_cv_func_shl_load" = "yes"; then
124 AC_DEFINE(DYNAMIC_LINKING, 1, [Dynamic linking works])
126 AC_CHECK_FUNCS(dlopen)
127 if test "$ac_cv_func_dlopen" = "yes"; then
128 AC_DEFINE(DYNAMIC_LINKING, 1, [Dynamic linking works])
136 #--------------------------------------------------------------------
137 # Checks for iconv library
138 #--------------------------------------------------------------------
141 changequote(<<, >>)dnl
142 << --with-iconv[=DIR] where to find iconv [system]>>dnl
147 # Modified from GNOME's libxml2 configure.in
149 AC_LANG_C # compile C to avoid the 'const char**' problem
150 SAVE_CPPFLAGS="$CPPFLAGS"
151 SAVE_LDFLAGS="$LDFLAGS"
153 if test "$with_iconv" = "no" ; then
154 AC_MSG_RESULT([disabling iconv support])
156 if test -n "$ICONV_CFLAGS" -a -n "$ICONV_LDFLAGS"; then
157 CPPFLAGS="$ICONV_CFLAGS" # for AC_TRY_LINK
159 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
160 CPPFLAGS="-I$with_iconv/include" # for AC_TRY_LINK
161 ICONV_CFLAGS="-I$with_iconv/include"
162 ICONV_LDFLAGS="-L$with_iconv/lib"
165 AC_CHECK_HEADER(iconv.h,
166 AC_MSG_CHECKING(for iconv)
172 iconv_t cd = iconv_open ("","");
173 iconv (cd, NULL, NULL, NULL, NULL);
176 AC_DEFINE(USE_ICONV, 1, [Use iconv library])
179 AC_MSG_CHECKING(for iconv in -liconv)
180 LDFLAGS="${ICONV_LDFLAGS}" # for AC_TRY_LINK
181 LIBS="-liconv" # for AC_TRY_LINK
187 iconv_t cd = iconv_open ("","");
188 iconv (cd, NULL, NULL, NULL, NULL);
191 AC_DEFINE(USE_ICONV, 1, [Use iconv library])
192 ICONV_LDFLAGS="${ICONV_LDFLAGS/-liconv} -liconv"
195 AC_MSG_WARN([absence of iconv may crash HTML import])
199 CPPFLAGS="$SAVE_CPPFLAGS"
200 LDFLAGS="$SAVE_LDFLAGS"
202 AC_LANG_RESTORE # restore C++ language
203 AC_SUBST(ICONV_CFLAGS)
204 AC_SUBST(ICONV_LDFLAGS)
206 #--------------------------------------------------------------------
207 # Checks for freetype library
208 #--------------------------------------------------------------------
210 AC_ARG_WITH(freetype,
211 changequote(<<, >>)dnl
212 << --with-freetype[=ARG] with freetype support [ARG=linked]>>dnl
216 SAVE_CPPFLAGS="$CPPFLAGS"
217 SAVE_LDFLAGS="$LDFLAGS"
219 if test "$with_freetype" = "no" ; then
220 AC_MSG_RESULT([disabling freetype support])
222 if test -z "$FREETYPE_CFLAGS"; then
223 FREETYPE_CFLAGS=`freetype-config --cflags`
225 CPPFLAGS="$FREETYPE_CFLAGS"
226 if test -z "$FREETYPE_LDFLAGS"; then
227 FREETYPE_LDFLAGS=`freetype-config --libs`
229 LIBS="$FREETYPE_LDFLAGS"
230 AC_CHECK_HEADER(ft2build.h,
231 AC_MSG_CHECKING(for freetype)
234 #include <ft2build.h>
235 #include FT_FREETYPE_H
237 FT_Library ft_library;
238 (void) FT_Init_FreeType (&ft_library);
241 AC_DEFINE(USE_FREETYPE, 1, [Use freetype library])
242 FREETYPE_CFLAGS="$CPPFLAGS"
243 if test "$with_freetype" = "linked" -o "$with_freetype" = "" ; then
244 FREETYPE_LDFLAGS="$LIBS"
245 AC_DEFINE(LINKED_FREETYPE, 1, [Link freetype library with TeXmacs])
251 CPPFLAGS="$SAVE_CPPFLAGS"
252 LDFLAGS="$SAVE_LDFLAGS"
255 AC_SUBST(FREETYPE_CFLAGS)
256 AC_SUBST(FREETYPE_LDFLAGS)
258 #--------------------------------------------------------------------
259 # Checks for Cairo library
260 #--------------------------------------------------------------------
263 changequote(<<, >>)dnl
264 << --with-cairo[=ARG] with cairo support [ARG=no]>>dnl
268 SAVE_CPPFLAGS="$CPPFLAGS"
269 SAVE_LDFLAGS="$LDFLAGS"
271 if test "$with_cairo" = "no" -o "$with_cairo" = "" ; then
272 AC_MSG_RESULT([disabling cairo support])
274 CPPFLAGS=`pkg-config --cflags cairo`
275 LIBS=`pkg-config --libs cairo`
276 AC_CHECK_HEADER(cairo.h,
277 AC_MSG_CHECKING(for cairo)
282 cairo_surface_t *surface;
283 surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 120, 120);
286 AC_DEFINE(USE_CAIRO, 1, [Use cairo library])
287 CAIRO_CFLAGS="$CPPFLAGS"
288 if test "$with_cairo" = "linked" ; then
289 CAIRO_LDFLAGS="$LIBS"
290 AC_DEFINE(LINKED_CAIRO, 1, [Link cairo library with TeXmacs])
296 CPPFLAGS="$SAVE_CPPFLAGS"
297 LDFLAGS="$SAVE_LDFLAGS"
300 AC_SUBST(CAIRO_CFLAGS)
301 AC_SUBST(CAIRO_LDFLAGS)
303 #--------------------------------------------------------------------
304 # Checks for Imlib2 library
305 #--------------------------------------------------------------------
308 changequote(<<, >>)dnl
309 << --with-imlib2[=ARG] with imlib2 support [ARG=no]>>dnl
313 SAVE_CPPFLAGS="$CPPFLAGS"
314 SAVE_LDFLAGS="$LDFLAGS"
316 if test "$with_imlib2" = "no" -o "$with_imlib2" = "" ; then
317 AC_MSG_RESULT([disabling imlib2 support])
319 CPPFLAGS=`imlib2-config --cflags`
320 LIBS=`imlib2-config --libs`
321 AC_CHECK_HEADER(Imlib2.h,
322 AC_MSG_CHECKING(for imlib2)
325 #include <X11/Xlib.h>
330 Imlib_Image image= imlib_load_image("");
333 AC_DEFINE(USE_IMLIB2, 1, [Use imlib2 library])
334 IMLIB2_CFLAGS="$CPPFLAGS"
335 if test "$with_imlib2" = "linked" ; then
336 IMLIB2_LDFLAGS="$LIBS"
337 AC_DEFINE(LINKED_IMLIB2, 1, [Link imlib2 library with TeXmacs])
343 CPPFLAGS="$SAVE_CPPFLAGS"
344 LDFLAGS="$SAVE_LDFLAGS"
347 AC_SUBST(IMLIB2_CFLAGS)
348 AC_SUBST(IMLIB2_LDFLAGS)
350 #--------------------------------------------------------------------
351 # Checks for Axel library
352 #--------------------------------------------------------------------
355 changequote(<<, >>)dnl
356 << --with-axel[=ARG] with axel support [ARG=no]>>dnl
360 SAVE_CPPFLAGS="$CPPFLAGS"
361 SAVE_LDFLAGS="$LDFLAGS"
363 if test "$with_axel" = "no" -o "$with_axel" = "" ; then
364 AC_MSG_RESULT([disabling axel support])
366 CPPFLAGS=`axel-config --cflags`
367 LIBS=`axel-config --libs`
368 AC_CHECK_HEADER(QGui/Viewer.h,
369 AC_MSG_CHECKING(for axel)
372 #include <QGui/Viewer.h>
377 AC_DEFINE(USE_AXEL, 1, [Use axel library])
378 AXEL_CFLAGS="$CPPFLAGS"
379 if test "$with_axel" = "linked" ; then
381 AC_DEFINE(LINKED_AXEL, 1, [Link axel library with TeXmacs])
387 CPPFLAGS="$SAVE_CPPFLAGS"
388 LDFLAGS="$SAVE_LDFLAGS"
391 AC_SUBST(AXEL_CFLAGS)
392 AC_SUBST(AXEL_LDFLAGS)
394 #--------------------------------------------------------------------
395 # Fixes for erroneous behaviour of gcc/g++ and guile on some systems
396 #--------------------------------------------------------------------
398 AC_MSG_CHECKING(whether ... arguments behave correctly)
399 if test -z "$GUILE_CFLAGS"; then
400 CXXFLAGS="`guile-config compile`"
402 CXXFLAGS="$GUILE_CFLAGS"
405 #include <guile/gh.h>
406 #include <libguile.h>
407 typedef SCM (*FN)(...);
408 static SCM identity (SCM x) { return x; }
409 void declare () { gh_new_procedure ("identity", (FN) identity, 1, 0, 0); }
412 AC_DEFINE(DOTS_OK, 1, [Defined if ...-style argument passing works])
419 AC_MSG_CHECKING(the size_t of guile strings)
420 if test -z "$GUILE_CFLAGS"; then
421 CXXFLAGS="`guile-config compile`"
423 CXXFLAGS="$GUILE_CFLAGS"
426 #include <guile/gh.h>
427 #include <libguile.h>
428 void print_string (SCM s) {
430 char* r= gh_scm2newstr (s, &len_r); }
433 AC_DEFINE(guile_str_size_t, int, [Guile string size type])
436 AC_DEFINE(guile_str_size_t, size_t, [Guile string size type])
437 AC_MSG_RESULT(size_t)
441 AC_MSG_CHECKING([if statically linking with guile works])
442 SAVE_CPPFLAGS="$CPPFLAGS"
443 SAVE_LDFLAGS="$LDFLAGS"
445 CPPFLAGS="$GUILE_CFLAGS"
447 LIBS="$GUILE_LDFLAGS"
448 TEXMACS_LINK_GUILE([tm_link_guile_static="yes"],
449 [tm_link_guile_static="no"])
450 AC_MSG_RESULT(["$tm_link_guile_static"])
451 if test "$tm_link_guile_static" = "no" ; then
452 AC_MSG_CHECKING([if it works with -lltdl])
453 LIBS="$GUILE_LDFLAGS -lltdl"
454 TEXMACS_LINK_GUILE([tm_link_guile_static_ltdl="yes"],
455 [tm_link_guile_static_ltdl="no"])
456 AC_MSG_RESULT(["$tm_link_guile_static_ltdl"])
457 if test "$tm_link_guile_static_ltdl" = "yes" ; then
458 GUILE_LDFLAGS="$GUILE_LDFLAGS -lltdl"
460 AC_MSG_CHECKING([if it works with -lltdl -ldl])
461 LIBS="$GUILE_LDFLAGS -lltdl -ldl"
462 TEXMACS_LINK_GUILE([tm_link_guile_static_ltdl_ldl="yes"],
463 [tm_link_guile_static_ltdl_ldl="no"])
464 AC_MSG_RESULT(["$tm_link_guile_static_ltdl_ldl"])
465 if test "$tm_link_guile_static_ltdl_ldl" = "yes" ; then
466 GUILE_LDFLAGS="$GUILE_LDFLAGS -lltdl -ldl"
468 AC_MSG_WARN([unable to link statically with guile])
472 CPPFLAGS="$SAVE_CPFLAGS"
473 LDFLAGS="$SAVE_LDFLAGS"
476 #--------------------------------------------------------------------
477 # Handle different systems case by case
478 #--------------------------------------------------------------------
480 CONFIG_OS="GNU_LINUX"
481 CONFIG_OS_SUFFIX="gnu-linux"
484 CONFIG_CXXTEMPLATE=""
485 CONFIG_STD_SETENV="#define STD_SETENV"
487 CONFIG_LIB_PATH="LD_LIBRARY_PATH"
488 CONFIG_CHMOD="chmod -f"
489 CONFIG_CXXOPTIMIZE="-O2"
490 CONFIG_BSTATIC="-Wl,-Bstatic"
491 CONFIG_BSHARED="-Wl,-Bdynamic"
493 CONFIG_BPATH="-Wl,-rpath,"
494 CONFIG_WORD_LENGTH="4"
495 CONFIG_WORD_LENGTH_INC="3"
496 CONFIG_WORD_MASK="0xfffffffc"
497 CONFIG_MAX_FAST="260 // WORD_LENGTH more than power of 2"
499 X11_CFLAGS="$X_CFLAGS"
500 X11_LDFLAGS="$X_LIBS -lXext -lX11"
502 AC_CHECK_SIZEOF(void *)
503 AC_MSG_CHECKING(if we are on a 64-bits computer)
504 if test "$ac_cv_sizeof_void_p" = "8"; then
506 CONFIG_WORD_LENGTH="8"
507 CONFIG_WORD_LENGTH_INC="7"
508 CONFIG_WORD_MASK="0xfffffffffffffff8"
509 CONFIG_MAX_FAST="264 // WORD_LENGTH more than power of 2"
516 i*86-*-linux* | x86_64-*-linux*)
517 AC_MSG_RESULT(final adjustments for an Intel or AMD GNU/Linux host)
518 CONFIG_CXXOPTIMIZE="-O3 -fexpensive-optimizations"
520 i*86-*-freebsd* | x86_64-*-freebsd*)
521 AC_MSG_RESULT(final adjustments for an Intel or AMD GNU/BSD host)
522 CONFIG_CXXOPTIMIZE="-O3 -fexpensive-optimizations"
525 AC_MSG_RESULT(final adjustments for an Intel or AMS Solaris host)
526 CONFIG_CXXOPTIMIZE="-O3"
527 CONFIG_BPATH="-Wl,-R,"
528 X11_LDFLAGS="$X_LIBS -lXext -lX11 -lsocket"
531 AC_MSG_RESULT([final adjustments for mingw host])
535 AC_MSG_RESULT(final adjustments for cygwin host)
537 CONFIG_BFLAGS="-Wl,-stack,8388608"
538 # CXX="export CYGWIN=check_case:strict; $CXX"
542 echo "$ac_t""final adjustments for a MacOS host" 1>&6
544 CONFIG_CXXFLAGS="-I${prefix}/include"
546 CONFIG_BFLAGS="-framework Cocoa"
549 CONFIG_LIB_PATH="DYLD_LIBRARY_PATH"
552 echo "$ac_t""final adjustments for a generic Darwin host" 1>&6
553 CONFIG_CXXFLAGS="-I${prefix}/include"
557 CONFIG_LIB_PATH="DYLD_LIBRARY_PATH"
560 AC_MSG_RESULT(final adjustments for a PowerPC/GNU-linux host)
561 CONFIG_OS="POWERPC_GNU_LINUX"
562 CONFIG_CXXOPTIMIZE="-O3 -fexpensive-optimizations"
565 AC_MSG_RESULT(final adjustments for a SUN/solaris host)
567 CONFIG_OS_SUFFIX="sun"
570 CONFIG_BPATH="-Wl,-R,"
571 X11_LDFLAGS="$X_LIBS -lXext -lX11 -lsocket"
572 CONFIG_WORD_LENGTH="8"
573 CONFIG_WORD_LENGTH_INC="7"
574 CONFIG_WORD_MASK="0xfffffff8"
575 CONFIG_MAX_FAST="264 // WORD_LENGTH more than power of 2"
579 AC_MSG_RESULT(final adjustments for a Sparc host running GNU/Linux)
580 CONFIG_CXXOPTIMIZE="-O3 -fexpensive-optimizations"
581 CONFIG_WORD_LENGTH="8"
582 CONFIG_WORD_LENGTH_INC="7"
583 CONFIG_WORD_MASK="0xfffffff8"
584 CONFIG_MAX_FAST="264 // WORD_LENGTH more than power of 2"
588 AC_MSG_RESULT(final adjustments for a DEC/alpha host)
590 CONFIG_BSHARED="-shared"
594 AC_MSG_RESULT(final adjustments for an Alpha GNU/Linux host)
596 CONFIG_BSHARED="-shared"
599 AC_MSG_RESULT(final adjustments for an IBM S/390 GNU/Linux host)
603 AC_MSG_RESULT(final adjustments for an Itanium GNU/Linux host)
605 CONFIG_BSHARED="-shared"
608 AC_MSG_RESULT(final adjustments for an HP PA_RISC GNU/Linux host)
609 CONFIG_CXXFLAGS="$CONFIG_CXXFLAGS -fPIC"
611 CONFIG_BSHARED="-shared"
614 echo "$ac_t""final adjustments for a SGI/Irix host" 1>&6
621 X11_LDFLAGS="$X_LIBS -lX11"
622 CONFIG_WORD_MASK="0xfffffff8"
625 CONFIG_LIB_PATH="LD_LIBRARYN32_PATH"
627 m68k-*-linux* | mips-*-linux* | mipsel-*-linux* | arm*-*-linux*)
628 AC_MSG_RESULT(final adjustments for a supported GNU/Linux host)
631 AC_MSG_RESULT(final adjustments for a generic GNU/Linux host)
634 AC_MSG_RESULT(final adjustments for a generic host)
638 #--------------------------------------------------------------------
639 # Temporary fix for link problem
640 #--------------------------------------------------------------------
642 case "$GXX_VERSION" in
644 CONFIG_BSTATIC="-static"
645 CONFIG_BSHARED="-dynamic"
649 #--------------------------------------------------------------------
650 # Memory allocation options
651 #--------------------------------------------------------------------
653 AC_ARG_ENABLE(fastalloc,
654 [ --disable-fastalloc omit fast allocator for small objects],
655 [], [enable_fastalloc="yes"])
656 case "$enable_fastalloc" in
660 AC_MSG_RESULT([disabling fast allocator for small objects])
661 AC_DEFINE(NO_FAST_ALLOC, 1, [Disable fast memory allocator])
664 AC_MSG_ERROR([bad option --enable-fastalloc=$enable_fastalloc])
668 #--------------------------------------------------------------------
669 # Experimental options
670 #--------------------------------------------------------------------
672 AC_ARG_ENABLE(experimental,
673 [ --enable-experimental support new style rewriting code],
674 [], [enable_experimental="no"])
675 case "$enable_experimental" in
677 AC_MSG_RESULT([enabling experimental style rewriting code])
678 AC_DEFINE(EXPERIMENTAL, 1, [Enable experimental style rewriting code])
679 CONFIG_EXPERIMENTAL="Memorizer Environment Evaluate"
682 AC_MSG_RESULT([disabling experimental style rewriting code])
683 CONFIG_EXPERIMENTAL=""
686 AC_MSG_ERROR([bad option --enable-experimental=$enable_experimental])
689 AC_SUBST(CONFIG_EXPERIMENTAL)
691 #--------------------------------------------------------------------
692 # MacOS X extensions (spellchecker, image loading)
693 #--------------------------------------------------------------------
695 AC_ARG_ENABLE(macosx-extensions,
696 [ --enable-macosx-extensions support new style rewriting code],
697 [], [enable_macosx_extensions="no"])
698 case "$enable_macosx_extensions" in
700 AC_MSG_RESULT([enabling Mac OSX extensions])
701 AC_DEFINE(MACOSX_EXTENSIONS, 1, [Enabling Mac OSX extensions])
705 AC_MSG_RESULT([disabling Mac OSX extensions])
709 AC_MSG_ERROR([bad option --enable-macosx-extensions=$enable_macosx_extensions])
712 AC_SUBST(CONFIG_MACOS)
714 #--------------------------------------------------------------------
716 #--------------------------------------------------------------------
723 [ --enable-qt replace X11 by Qt interface],
724 [], [enable_qt="no"])
729 if test x"$at_cv_qt_build" = xko; then
730 AC_MSG_ERROR([cannot find Qt!])
732 AC_MSG_RESULT([enabling experimental Qt port])
737 AC_MSG_RESULT([disabling experimental Qt port])
740 AC_MSG_ERROR([bad option --enable-qt=$enable_qt])
745 [ --enable-cocoa replace X11 by Cocoa interface],
746 [], [enable_cocoa="no"])
747 case "$enable_cocoa" in
749 AC_MSG_RESULT([enabling experimental Cocoa port])
751 COCOA_LDFLAGS="-framework Cocoa"
755 AC_MSG_RESULT([disabling experimental Cocoa port])
758 AC_MSG_ERROR([bad option --enable-cocoa=$enable_cocoa])
762 case "$CONFIG_GUI" in
764 CONFIG_X11="X11 Widkit Ghostscript"
765 CONFIG_GUI_DEFINE="X11TEXMACS"
766 # AC_DEFINE(X11TEXMACS, 1, [Use standard X11 port])
770 CONFIG_GUI_DEFINE="AQUATEXMACS"
771 # AC_DEFINE(AQUATEXMACS, 1, [Enable experimental Cocoa port])
775 CONFIG_GUI_DEFINE="QTTEXMACS"
776 # AC_DEFINE(QTTEXMACS, 1, [Enable experimental Qt port])
781 AC_SUBST(X11_LDFLAGS)
782 AC_SUBST(COCOA_CFLAGS)
783 AC_SUBST(COCOA_LDFLAGS)
786 AC_SUBST(CONFIG_COCOA)
789 AC_SUBST(CONFIG_GUI_DEFINE)
791 #--------------------------------------------------------------------
793 #--------------------------------------------------------------------
795 STD_DEBUG_FLAGS="-fno-rtti -fno-exceptions"
796 if test "$enable_cocoa" = "yes"; then
797 STD_DEBUG_FLAGS="-fno-exceptions"
800 AC_MSG_CHECKING(if compiler supports $STD_DEBUG_FLAGS)
801 CXXFLAGS="$STD_DEBUG_FLAGS"
803 int some_variable = 0;
806 CONFIG_CXXDIALECT="$STD_DEBUG_FLAGS"
813 AC_SUBST(CONFIG_CXXDIALECT)
816 changequote(<<, >>)dnl
817 << --enable-debug[=ARG] install a debugging enable executable [-ggdb]>>,
819 [], [enable_debug="no"])
821 if test "$enable_debug" = "yes"; then
822 if test "$GXX" = "yes"; then
829 if test "$enable_debug" = "no"; then
830 AC_MSG_RESULT([disabling debugging])
833 optimize_default="yes"
835 AC_MSG_RESULT([enabling debugging, $enable_debug])
837 CONFIG_CXXDEBUG="$enable_debug"
838 optimize_default="no"
841 AC_ARG_ENABLE(assert,
842 changequote(<<, >>)dnl
843 << --enable-assert exit on failed assertions in code>>,
845 [], [enable_assert="yes"])
847 if test "$enable_assert" = "no"; then
848 AC_MSG_RESULT([disabling assertion checking])
850 AC_MSG_RESULT([enabling assertion checking])
851 AC_DEFINE(DEBUG_ASSERT, 1, [check assertions in code])
854 #--------------------------------------------------------------------
856 #--------------------------------------------------------------------
858 case "$GXX_VERSION" in
860 CONFIG_CXXWARNING="";
863 CONFIG_CXXWARNING="-Wall -Wno-return-type"
867 AC_ARG_ENABLE(warnings,
868 [ --enable-warnings print warning messages during compilation],
869 [], [enable_warnings="yes"])
870 case "$enable_warnings" in
872 AC_MSG_RESULT([enabling warning flags $CONFIG_CXXWARNING]) ;;
875 AC_MSG_RESULT([disabling warning flags]) ;;
877 CONFIG_CXXWARNING="$enable_warnings"
878 AC_MSG_RESULT([enabling warning flags $CONFIG_CXXWARNING]) ;;
881 #--------------------------------------------------------------------
882 # Optimization options
883 #--------------------------------------------------------------------
885 if test "$optimize_default" = "yes"; then
886 case "$GXX_VERSION" in
889 2.96 | 3.0 | 3.0.* | 3.1 | 3.1.* | 3.2 | 3.2.* | 3.3 | 3.3.*)
891 i*86-*-linux-gnu* | i*86-*-freebsd*)
892 AC_MSG_WARN([using g++ 3.*, optimize without inline by default])
893 optimize_default="no-inline"
896 AC_MSG_WARN([using g++ 3.*, optimize without inline by default])
897 optimize_default="no-inline"
904 AC_ARG_ENABLE(optimize,
905 changequote(<<, >>)dnl
906 << --enable-optimize[=ARG] compile with optimizations [guessed]>>,
908 [], [enable_optimize="$optimize_default"])
910 case "$enable_optimize" in
912 # keep optimization options
913 AC_MSG_RESULT([enabling optimizations, $CONFIG_CXXOPTIMIZE]) ;;
915 optimize_no_inline="-fno-default-inline -fno-inline"
916 CONFIG_CXXOPTIMIZE="$CONFIG_CXXOPTIMIZE $optimize_no_inline"
917 AC_MSG_RESULT([enabling optimizations, $CONFIG_CXXOPTIMIZE]) ;;
919 CONFIG_CXXOPTIMIZE=""
920 AC_MSG_RESULT([disabling optimizations]) ;;
922 CONFIG_CXXOPTIMIZE="$enable_optimize"
923 AC_MSG_RESULT([customizing optimizations, $enable_optimize]) ;;
926 #--------------------------------------------------------------------
927 # Substitute TeXmacs specific configuration parameters
928 #--------------------------------------------------------------------
931 AC_SUBST(CONFIG_OS_SUFFIX)
932 AC_SUBST(CONFIG_CXXWARNING)
933 AC_SUBST(CONFIG_CXXTEMPLATE)
934 AC_SUBST(CONFIG_CXXOPTIMIZE)
935 AC_SUBST(CONFIG_CXXDEBUG)
936 AC_SUBST(CONFIG_BFLAGS)
937 AC_SUBST(CONFIG_BSTATIC)
938 AC_SUBST(CONFIG_BSHARED)
939 AC_SUBST(CONFIG_BPATH)
940 AC_SUBST(CONFIG_WORD_LENGTH)
941 AC_SUBST(CONFIG_WORD_LENGTH_INC)
942 AC_SUBST(CONFIG_WORD_MASK)
943 AC_SUBST(CONFIG_MAX_FAST)
944 AC_SUBST(CONFIG_CXXFLAGS)
945 AC_SUBST(CONFIG_STD_SETENV)
947 AC_SUBST(CONFIG_LIB_PATH)
948 AC_SUBST(CONFIG_STRIP)
949 AC_SUBST(CONFIG_CHMOD)
952 #--------------------------------------------------------------------
953 # Default paths for installation
954 #--------------------------------------------------------------------
956 if test "$prefix" = ""; then
959 if test "$prefix" = "NONE"; then
962 if test "$exec_prefix" = ""; then
963 exec_prefix='${prefix}'
965 if test "$exec_prefix" = "NONE"; then
966 exec_prefix='${prefix}'
968 if test "$exec_prefix" = '${prefix}'; then
969 exec_prefix='${prefix}'
971 if test "$includedir" = ""; then
972 includedir='${prefix}/include'
974 if test "$includedir" = "NONE"; then
975 includedir='${prefix}/include'
977 if test "$includedir" = '${prefix}/include'; then
978 includedir='${prefix}/include'
980 if test "$libdir" = ""; then
981 libdir='${exec_prefix}/lib'
983 if test "$libdir" = "NONE"; then
984 libdir='${exec_prefix}/lib'
986 if test "$libdir" = '${exec_prefix}/lib'; then
987 libdir='${exec_prefix}/lib'
989 if test "$bindir" = ""; then
990 bindir='${exec_prefix}/bin'
992 if test "$bindir" = "NONE"; then
993 bindir=${exec_prefix}/bin
995 if test "$bindir" = '${exec_prefix}/bin'; then
996 bindir='${exec_prefix}/bin'
998 if test "$datarootdir" = ""; then
999 datarootdir='${prefix}/share'
1001 if test "$datarootdir" = "NONE"; then
1002 datarootdir='${prefix}/share'
1004 if test "$datarootdir" = '${prefix}/share'; then
1005 datarootdir='${prefix}/share'
1007 if test "$datadir" = ""; then
1008 datadir='${prefix}/share'
1010 if test "$datadir" = "NONE"; then
1011 datadir='${prefix}/share'
1013 if test "$datadir" = '${prefix}/share'; then
1014 datadir='${prefix}/share'
1016 if test "$mandir" = ""; then
1017 mandir='${datarootdir}/man'
1019 if test "$mandir" = "NONE"; then
1020 mandir='${datarootdir}/man'
1022 if test "$mandir" = '${datarootdir}/man'; then
1023 mandir='${datarootdir}/man'
1025 if test "$libexecdir" = ""; then
1026 libexecdir='${exec_prefix}/libexec'
1028 if test "$libexecdir" = "NONE"; then
1029 libexecdir='${exec_prefix}/libexec'
1031 if test "$libexecdir" = '${exec_prefix}/libexec'; then
1032 libexecdir='${exec_prefix}/libexec'
1038 tmsrc=${curdir}/${tmdir}
1039 tmbin=${libexecdir}/${tmdir}
1040 tmdata=${datadir}/${tmdir}
1047 if test "$DEVEL_RELEASE" = "1"; then
1048 tmtgz=${PACKAGE}-${DEVEL_VERSION}
1050 tmtgz=${PACKAGE}-${DEVEL_VERSION}-R${DEVEL_RELEASE}
1052 tmrpm=${PACKAGE}-${DEVEL_VERSION}-${DEVEL_RELEASE}
1053 if test "$STABLE_RELEASE" = "1"; then
1054 tmstgz=${PACKAGE}-${STABLE_VERSION}
1056 tmstgz=${PACKAGE}-${STABLE_VERSION}-R${STABLE_RELEASE}
1058 tmsrpm=${PACKAGE}-${STABLE_VERSION}-${STABLE_RELEASE}
1059 if test "$WINDOWS_RELEASE" = "1"; then
1060 tmwin=wintexmacs-${WINDOWS_VERSION}
1062 tmwin=wintexmacs-${WINDOWS_VERSION}-R${WINDOWS_RELEASE}
1070 #--------------------------------------------------------------------
1072 #--------------------------------------------------------------------
1074 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)