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.2"
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 #--------------------------------------------------------------------
68 AC_MSG_CHECKING(version of guile)
69 GUILE_VERSION=`guile --version | grep 'Guile \([[0-9]]\)' | sed 's/Guile \([[0-9]]*\)/\1/'`
70 AC_MSG_RESULT($GUILE_VERSION)
72 case "$GUILE_VERSION" in
73 1.0* | 1.1* | 1.2* | 1.3* | 1.4* | 1.5*)
74 CONFIG_GUILE_SERIAL="A"
77 CONFIG_GUILE_SERIAL="B"
80 CONFIG_GUILE_SERIAL="C"
83 AC_SUBST(CONFIG_GUILE_SERIAL)
85 #--------------------------------------------------------------------
86 # Checks for standard functionality
87 #--------------------------------------------------------------------
91 AC_CHECK_TYPES(intptr_t)
92 AC_CHECK_TYPES(time_t)
95 AC_CHECK_HEADERS(pty.h util.h)
96 AC_CHECK_FUNCS(gettimeofday)
98 #--------------------------------------------------------------------
99 # Checks for dl library
100 #--------------------------------------------------------------------
102 AC_CHECK_FUNC(dlopen)
103 if test "$ac_cv_func_dl" = "yes"; then
104 AC_DEFINE(DYNAMIC_LINKING, 1, [Dynamic linking works])
106 AC_CHECK_LIB(dl,dlopen)
107 if test "$ac_cv_lib_dl_dlopen" = "yes"; then
108 AC_CHECK_FUNCS(dlopen)
110 AC_DEFINE(DYNAMIC_LINKING, 1, [Dynamic linking works])
112 AC_CHECK_LIB(dld,dld_link)
113 if test "$ac_cv_lib_dld_dld_link" = "yes"; then
115 AC_DEFINE(DYNAMIC_LINKING, 1, [Dynamic linking works])
117 AC_CHECK_FUNCS(shl_load)
118 if test "$ac_cv_func_shl_load" = "yes"; then
120 AC_DEFINE(DYNAMIC_LINKING, 1, [Dynamic linking works])
122 AC_CHECK_FUNCS(dlopen)
123 if test "$ac_cv_func_dlopen" = "yes"; then
124 AC_DEFINE(DYNAMIC_LINKING, 1, [Dynamic linking works])
132 #--------------------------------------------------------------------
133 # Checks for iconv library
134 #--------------------------------------------------------------------
137 changequote(<<, >>)dnl
138 << --with-iconv[=DIR] where to find iconv [system]>>dnl
143 # Modified from GNOME's libxml2 configure.in
145 AC_LANG_C # compile C to avoid the 'const char**' problem
146 SAVE_CPPFLAGS="$CPPFLAGS"
147 SAVE_LDFLAGS="$LDFLAGS"
149 if test "$with_iconv" = "no" ; then
150 AC_MSG_RESULT([disabling iconv support])
152 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
153 CPPFLAGS="-I$with_iconv/include" # for AC_TRY_LINK
154 ICONV_CFLAGS="-I$with_iconv/include"
155 ICONV_LDFLAGS="-L$with_iconv/lib"
158 AC_CHECK_HEADER(iconv.h,
159 AC_MSG_CHECKING(for iconv)
165 iconv_t cd = iconv_open ("","");
166 iconv (cd, NULL, NULL, NULL, NULL);
169 AC_DEFINE(USE_ICONV, 1, [Use iconv library])
172 AC_MSG_CHECKING(for iconv in -liconv)
173 LDFLAGS="${ICONV_LDFLAGS}" # for AC_TRY_LINK
174 LIBS="-liconv" # for AC_TRY_LINK
180 iconv_t cd = iconv_open ("","");
181 iconv (cd, NULL, NULL, NULL, NULL);
184 AC_DEFINE(USE_ICONV, 1, [Use iconv library])
185 ICONV_LDFLAGS="${ICONV_LDFLAGS} -liconv"
188 AC_MSG_WARN([absence of iconv may crash HTML import])
192 CPPFLAGS="$SAVE_CPPFLAGS"
193 LDFLAGS="$SAVE_LDFLAGS"
195 AC_LANG_RESTORE # restore C++ language
197 AC_SUBST(ICONV_CFLAGS)
198 AC_SUBST(ICONV_LDFLAGS)
200 #--------------------------------------------------------------------
201 # Checks for freetype library
202 #--------------------------------------------------------------------
204 AC_ARG_WITH(freetype,
205 changequote(<<, >>)dnl
206 << --with-freetype[=ARG] with freetype support [ARG=linked]>>dnl
210 SAVE_CPPFLAGS="$CPPFLAGS"
211 SAVE_LDFLAGS="$LDFLAGS"
213 if test "$with_freetype" = "no" ; then
214 AC_MSG_RESULT([disabling freetype support])
216 CPPFLAGS=`freetype-config --cflags`
217 LIBS=`freetype-config --libs`
218 AC_CHECK_HEADER(ft2build.h,
219 AC_MSG_CHECKING(for freetype)
222 #include <ft2build.h>
223 #include FT_FREETYPE_H
225 FT_Library ft_library;
226 (void) FT_Init_FreeType (&ft_library);
229 AC_DEFINE(USE_FREETYPE, 1, [Use freetype library])
230 FREETYPE_CFLAGS="$CPPFLAGS"
231 if test "$with_freetype" = "linked" -o "$with_freetype" = "" ; then
232 FREETYPE_LDFLAGS="$LIBS"
233 AC_DEFINE(LINKED_FREETYPE, 1, [Link freetype library with TeXmacs])
239 CPPFLAGS="$SAVE_CPPFLAGS"
240 LDFLAGS="$SAVE_LDFLAGS"
243 AC_SUBST(FREETYPE_CFLAGS)
244 AC_SUBST(FREETYPE_LDFLAGS)
246 #--------------------------------------------------------------------
247 # Checks for Cairo library
248 #--------------------------------------------------------------------
251 changequote(<<, >>)dnl
252 << --with-cairo[=ARG] with cairo support [ARG=no]>>dnl
256 SAVE_CPPFLAGS="$CPPFLAGS"
257 SAVE_LDFLAGS="$LDFLAGS"
259 if test "$with_cairo" = "no" -o "$with_cairo" = "" ; then
260 AC_MSG_RESULT([disabling cairo support])
262 CPPFLAGS=`pkg-config --cflags cairo`
263 LIBS=`pkg-config --libs cairo`
264 AC_CHECK_HEADER(cairo.h,
265 AC_MSG_CHECKING(for cairo)
270 cairo_surface_t *surface;
271 surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 120, 120);
274 AC_DEFINE(USE_CAIRO, 1, [Use cairo library])
275 CAIRO_CFLAGS="$CPPFLAGS"
276 if test "$with_cairo" = "linked" ; then
277 CAIRO_LDFLAGS="$LIBS"
278 AC_DEFINE(LINKED_CAIRO, 1, [Link cairo library with TeXmacs])
284 CPPFLAGS="$SAVE_CPPFLAGS"
285 LDFLAGS="$SAVE_LDFLAGS"
288 AC_SUBST(CAIRO_CFLAGS)
289 AC_SUBST(CAIRO_LDFLAGS)
291 #--------------------------------------------------------------------
292 # Checks for Imlib2 library
293 #--------------------------------------------------------------------
296 changequote(<<, >>)dnl
297 << --with-imlib2[=ARG] with imlib2 support [ARG=no]>>dnl
301 SAVE_CPPFLAGS="$CPPFLAGS"
302 SAVE_LDFLAGS="$LDFLAGS"
304 if test "$with_imlib2" = "no" -o "$with_imlib2" = "" ; then
305 AC_MSG_RESULT([disabling imlib2 support])
307 CPPFLAGS=`imlib2-config --cflags`
308 LIBS=`imlib2-config --libs`
309 AC_CHECK_HEADER(Imlib2.h,
310 AC_MSG_CHECKING(for imlib2)
313 #include <X11/Xlib.h>
318 Imlib_Image image= imlib_load_image("");
321 AC_DEFINE(USE_IMLIB2, 1, [Use imlib2 library])
322 IMLIB2_CFLAGS="$CPPFLAGS"
323 if test "$with_imlib2" = "linked" ; then
324 IMLIB2_LDFLAGS="$LIBS"
325 AC_DEFINE(LINKED_IMLIB2, 1, [Link imlib2 library with TeXmacs])
331 CPPFLAGS="$SAVE_CPPFLAGS"
332 LDFLAGS="$SAVE_LDFLAGS"
335 AC_SUBST(IMLIB2_CFLAGS)
336 AC_SUBST(IMLIB2_LDFLAGS)
338 #--------------------------------------------------------------------
339 # Checks for Axel library
340 #--------------------------------------------------------------------
343 changequote(<<, >>)dnl
344 << --with-axel[=ARG] with axel support [ARG=no]>>dnl
348 SAVE_CPPFLAGS="$CPPFLAGS"
349 SAVE_LDFLAGS="$LDFLAGS"
351 if test "$with_axel" = "no" -o "$with_axel" = "" ; then
352 AC_MSG_RESULT([disabling axel support])
354 CPPFLAGS=`axel-config --cflags`
355 LIBS=`axel-config --libs`
356 AC_CHECK_HEADER(QGui/Viewer.h,
357 AC_MSG_CHECKING(for axel)
360 #include <QGui/Viewer.h>
365 AC_DEFINE(USE_AXEL, 1, [Use axel library])
366 AXEL_CFLAGS="$CPPFLAGS"
367 if test "$with_axel" = "linked" ; then
369 AC_DEFINE(LINKED_AXEL, 1, [Link axel library with TeXmacs])
375 CPPFLAGS="$SAVE_CPPFLAGS"
376 LDFLAGS="$SAVE_LDFLAGS"
379 AC_SUBST(AXEL_CFLAGS)
380 AC_SUBST(AXEL_LDFLAGS)
382 #--------------------------------------------------------------------
383 # Fixes for erroneous behaviour of gcc/g++ and guile on some systems
384 #--------------------------------------------------------------------
386 AC_MSG_CHECKING(whether ... arguments behave correctly)
387 CXXFLAGS="`guile-config compile`"
389 #include <guile/gh.h>
390 #include <libguile.h>
391 typedef SCM (*FN)(...);
392 static SCM identity (SCM x) { return x; }
393 void declare () { gh_new_procedure ("identity", (FN) identity, 1, 0, 0); }
396 AC_DEFINE(DOTS_OK, 1, [Defined if ...-style argument passing works])
403 AC_MSG_CHECKING(the size_t of guile strings)
404 CXXFLAGS="`guile-config compile`"
406 #include <guile/gh.h>
407 #include <libguile.h>
408 void print_string (SCM s) {
410 char* r= gh_scm2newstr (s, &len_r); }
413 AC_DEFINE(guile_str_size_t, int, [Guile string size type])
416 AC_DEFINE(guile_str_size_t, size_t, [Guile string size type])
417 AC_MSG_RESULT(size_t)
421 AC_MSG_CHECKING([if statically linking with guile works])
422 CPPFLAGS="$GUILE_CFLAGS"
424 LIBS="$GUILE_LDFLAGS"
425 TEXMACS_LINK_GUILE([tm_link_guile_static="yes"],
426 [tm_link_guile_static="no"])
427 AC_MSG_RESULT(["$tm_link_guile_static"])
428 if test "$tm_link_guile_static" = "no" ; then
429 AC_MSG_CHECKING([if it works with -lltdl])
430 LIBS="$GUILE_LDFLAGS -lltdl"
431 TEXMACS_LINK_GUILE([tm_link_guile_static_ltdl="yes"],
432 [tm_link_guile_static_ltdl="no"])
433 AC_MSG_RESULT(["$tm_link_guile_static_ltdl"])
434 if test "$tm_link_guile_static_ltdl" = "yes" ; then
435 GUILE_LDFLAGS="$GUILE_LDFLAGS -lltdl"
437 AC_MSG_CHECKING([if it works with -lltdl -ldl])
438 LIBS="$GUILE_LDFLAGS -lltdl -ldl"
439 TEXMACS_LINK_GUILE([tm_link_guile_static_ltdl_ldl="yes"],
440 [tm_link_guile_static_ltdl_ldl="no"])
441 AC_MSG_RESULT(["$tm_link_guile_static_ltdl_ldl"])
442 if test "$tm_link_guile_static_ltdl_ldl" = "yes" ; then
443 GUILE_LDFLAGS="$GUILE_LDFLAGS -lltdl -ldl"
445 AC_MSG_WARN([unable to link statically with guile])
453 #--------------------------------------------------------------------
454 # Handle different systems case by case
455 #--------------------------------------------------------------------
457 CONFIG_OS="GNU_LINUX"
458 CONFIG_OS_SUFFIX="gnu-linux"
461 CONFIG_CXXTEMPLATE=""
462 CONFIG_STD_SETENV="#define STD_SETENV"
464 CONFIG_LIB_PATH="LD_LIBRARY_PATH"
465 CONFIG_CHMOD="chmod -f"
466 CONFIG_CXXOPTIMIZE="-O2"
467 CONFIG_BSTATIC="-Wl,-Bstatic"
468 CONFIG_BSHARED="-Wl,-Bdynamic"
470 CONFIG_BPATH="-Wl,-rpath,"
471 CONFIG_WORD_LENGTH="4"
472 CONFIG_WORD_LENGTH_INC="3"
473 CONFIG_WORD_MASK="0xfffffffc"
474 CONFIG_MAX_FAST="260 // WORD_LENGTH more than power of 2"
476 X11_CFLAGS="$X_CFLAGS"
477 X11_LDFLAGS="$X_LIBS -lXext -lX11"
479 AC_MSG_CHECKING(if we are on a 64-bits computer)
480 AC_RUN_IFELSE([AC_LANG_PROGRAM([],[return(sizeof(void*))])],
481 [void_size=0],[void_size=$?])
482 if test "$void_size" = "8"; then
484 CONFIG_WORD_LENGTH="8"
485 CONFIG_WORD_LENGTH_INC="7"
486 CONFIG_WORD_MASK="0xfffffffffffffff8"
487 CONFIG_MAX_FAST="264 // WORD_LENGTH more than power of 2"
494 i*86-*-linux* | x86_64-*-linux*)
495 AC_MSG_RESULT(final adjustments for an Intel or AMD GNU/Linux host)
496 CONFIG_CXXOPTIMIZE="-O3 -fexpensive-optimizations"
498 i*86-*-freebsd* | x86_64-*-freebsd*)
499 AC_MSG_RESULT(final adjustments for an Intel or AMD GNU/BSD host)
500 CONFIG_CXXOPTIMIZE="-O3 -fexpensive-optimizations"
503 AC_MSG_RESULT(final adjustments for an Intel or AMS Solaris host)
504 CONFIG_CXXOPTIMIZE="-O3"
505 CONFIG_BPATH="-Wl,-R,"
506 X11_LDFLAGS="$X_LIBS -lXext -lX11 -lsocket"
509 AC_MSG_RESULT(final adjustments for cygwin host)
511 CONFIG_BFLAGS="-Wl,-stack,8388608"
512 # CXX="export CYGWIN=check_case:strict; $CXX"
516 echo "$ac_t""final adjustments for a MacOS host" 1>&6
518 CONFIG_CXXFLAGS="-I${prefix}/include"
520 CONFIG_BFLAGS="-framework Cocoa"
523 CONFIG_LIB_PATH="DYLD_LIBRARY_PATH"
526 echo "$ac_t""final adjustments for a generic Darwin host" 1>&6
527 CONFIG_CXXFLAGS="-I${prefix}/include"
531 CONFIG_LIB_PATH="DYLD_LIBRARY_PATH"
534 AC_MSG_RESULT(final adjustments for a PowerPC/GNU-linux host)
535 CONFIG_OS="POWERPC_GNU_LINUX"
536 CONFIG_CXXOPTIMIZE="-O3 -fexpensive-optimizations"
539 AC_MSG_RESULT(final adjustments for a SUN/solaris host)
541 CONFIG_OS_SUFFIX="sun"
544 CONFIG_BPATH="-Wl,-R,"
545 X11_LDFLAGS="$X_LIBS -lXext -lX11 -lsocket"
546 CONFIG_WORD_LENGTH="8"
547 CONFIG_WORD_LENGTH_INC="7"
548 CONFIG_WORD_MASK="0xfffffff8"
549 CONFIG_MAX_FAST="264 // WORD_LENGTH more than power of 2"
553 AC_MSG_RESULT(final adjustments for a Sparc host running GNU/Linux)
554 CONFIG_CXXOPTIMIZE="-O3 -fexpensive-optimizations"
555 CONFIG_WORD_LENGTH="8"
556 CONFIG_WORD_LENGTH_INC="7"
557 CONFIG_WORD_MASK="0xfffffff8"
558 CONFIG_MAX_FAST="264 // WORD_LENGTH more than power of 2"
562 AC_MSG_RESULT(final adjustments for a DEC/alpha host)
564 CONFIG_BSHARED="-shared"
568 AC_MSG_RESULT(final adjustments for an Alpha GNU/Linux host)
570 CONFIG_BSHARED="-shared"
573 AC_MSG_RESULT(final adjustments for an IBM S/390 GNU/Linux host)
577 AC_MSG_RESULT(final adjustments for an Itanium GNU/Linux host)
579 CONFIG_BSHARED="-shared"
582 AC_MSG_RESULT(final adjustments for an HP PA_RISC GNU/Linux host)
583 CONFIG_CXXFLAGS="$CONFIG_CXXFLAGS -fPIC"
585 CONFIG_BSHARED="-shared"
588 echo "$ac_t""final adjustments for a SGI/Irix host" 1>&6
595 X11_LDFLAGS="$X_LIBS -lX11"
596 CONFIG_WORD_MASK="0xfffffff8"
599 CONFIG_LIB_PATH="LD_LIBRARYN32_PATH"
601 m68k-*-linux* | mips-*-linux* | mipsel-*-linux* | arm*-*-linux*)
602 AC_MSG_RESULT(final adjustments for a supported GNU/Linux host)
605 AC_MSG_RESULT(final adjustments for a generic GNU/Linux host)
608 AC_MSG_RESULT(final adjustments for a generic host)
612 #--------------------------------------------------------------------
613 # Temporary fix for link problem
614 #--------------------------------------------------------------------
616 case "$GXX_VERSION" in
618 CONFIG_BSTATIC="-static"
619 CONFIG_BSHARED="-dynamic"
623 #--------------------------------------------------------------------
624 # Memory allocation options
625 #--------------------------------------------------------------------
627 AC_ARG_ENABLE(fastalloc,
628 [ --disable-fastalloc omit fast allocator for small objects],
629 [], [enable_fastalloc="yes"])
630 case "$enable_fastalloc" in
634 AC_MSG_RESULT([disabling fast allocator for small objects])
635 AC_DEFINE(NO_FAST_ALLOC, 1, [Disable fast memory allocator])
638 AC_MSG_ERROR([bad option --enable-fastalloc=$enable_fastalloc])
642 #--------------------------------------------------------------------
643 # Experimental options
644 #--------------------------------------------------------------------
646 AC_ARG_ENABLE(experimental,
647 [ --enable-experimental support new style rewriting code],
648 [], [enable_experimental="no"])
649 case "$enable_experimental" in
651 AC_MSG_RESULT([enabling experimental style rewriting code])
652 AC_DEFINE(EXPERIMENTAL, 1, [Enable experimental style rewriting code])
653 CONFIG_EXPERIMENTAL="Memorizer Environment Evaluate"
656 AC_MSG_RESULT([disabling experimental style rewriting code])
657 CONFIG_EXPERIMENTAL=""
660 AC_MSG_ERROR([bad option --enable-experimental=$enable_experimental])
663 AC_SUBST(CONFIG_EXPERIMENTAL)
665 #--------------------------------------------------------------------
666 # MacOS X extensions (spellchecker, image loading)
667 #--------------------------------------------------------------------
669 AC_ARG_ENABLE(macosx-extensions,
670 [ --enable-macosx-extensions support new style rewriting code],
671 [], [enable_macosx_extensions="no"])
672 case "$enable_macosx_extensions" in
674 AC_MSG_RESULT([enabling Mac OSX extensions])
675 AC_DEFINE(MACOSX_EXTENSIONS, 1, [Enabling Mac OSX extensions])
679 AC_MSG_RESULT([disabling Mac OSX extensions])
683 AC_MSG_ERROR([bad option --enable-macosx-extensions=$enable_macosx_extensions])
686 AC_SUBST(CONFIG_MACOS)
688 #--------------------------------------------------------------------
690 #--------------------------------------------------------------------
697 [ --enable-qt replace X11 by Qt interface],
698 [], [enable_qt="no"])
703 if test x"$at_cv_qt_build" = xko; then
704 AC_MSG_ERROR([cannot find Qt!])
706 AC_MSG_RESULT([enabling experimental Qt port])
711 AC_MSG_RESULT([disabling experimental Qt port])
714 AC_MSG_ERROR([bad option --enable-qt=$enable_qt])
719 [ --enable-cocoa replace X11 by Cocoa interface],
720 [], [enable_cocoa="no"])
721 case "$enable_cocoa" in
723 AC_MSG_RESULT([enabling experimental Cocoa port])
725 COCOA_LDFLAGS="-framework Cocoa"
729 AC_MSG_RESULT([disabling experimental Cocoa port])
732 AC_MSG_ERROR([bad option --enable-cocoa=$enable_cocoa])
736 case "$CONFIG_GUI" in
738 CONFIG_X11="X11 Widkit Ghostscript"
739 AC_DEFINE(X11TEXMACS, 1, [Use standard X11 port])
743 AC_DEFINE(AQUATEXMACS, 1, [Enable experimental Cocoa port])
747 AC_DEFINE(QTTEXMACS, 1, [Enable experimental Qt port])
752 AC_SUBST(X11_LDFLAGS)
753 AC_SUBST(COCOA_CFLAGS)
754 AC_SUBST(COCOA_LDFLAGS)
757 AC_SUBST(CONFIG_COCOA)
761 #--------------------------------------------------------------------
763 #--------------------------------------------------------------------
765 STD_DEBUG_FLAGS="-fno-rtti -fno-exceptions"
766 if test "$enable_cocoa" = "yes"; then
767 STD_DEBUG_FLAGS="-fno-exceptions"
770 AC_MSG_CHECKING(if compiler supports $STD_DEBUG_FLAGS)
771 CXXFLAGS="$STD_DEBUG_FLAGS"
773 int some_variable = 0;
776 CONFIG_CXXDIALECT="$STD_DEBUG_FLAGS"
783 AC_SUBST(CONFIG_CXXDIALECT)
786 changequote(<<, >>)dnl
787 << --enable-debug[=ARG] install a debugging enable executable [-ggdb]>>,
789 [], [enable_debug="no"])
791 if test "$enable_debug" = "yes"; then
792 if test "$GXX" = "yes"; then
799 if test "$enable_debug" = "no"; then
800 AC_MSG_RESULT([disabling debugging])
803 optimize_default="yes"
805 AC_MSG_RESULT([enabling debugging, $enable_debug])
807 CONFIG_CXXDEBUG="$enable_debug"
808 optimize_default="no"
811 AC_ARG_ENABLE(assert,
812 changequote(<<, >>)dnl
813 << --enable-assert exit on failed assertions in code>>,
815 [], [enable_assert="yes"])
817 if test "$enable_assert" = "no"; then
818 AC_MSG_RESULT([disabling assertion checking])
820 AC_MSG_RESULT([enabling assertion checking])
821 AC_DEFINE(DEBUG_ASSERT, 1, [check assertions in code])
824 #--------------------------------------------------------------------
826 #--------------------------------------------------------------------
828 case "$GXX_VERSION" in
830 CONFIG_CXXWARNING="";
833 CONFIG_CXXWARNING="-Wall -Wno-return-type"
837 AC_ARG_ENABLE(warnings,
838 [ --enable-warnings print warning messages during compilation],
839 [], [enable_warnings="yes"])
840 case "$enable_warnings" in
842 AC_MSG_RESULT([enabling warning flags $CONFIG_CXXWARNING]) ;;
845 AC_MSG_RESULT([disabling warning flags]) ;;
847 CONFIG_CXXWARNING="$enable_warnings"
848 AC_MSG_RESULT([enabling warning flags $CONFIG_CXXWARNING]) ;;
851 #--------------------------------------------------------------------
852 # Optimization options
853 #--------------------------------------------------------------------
855 if test "$optimize_default" = "yes"; then
856 case "$GXX_VERSION" in
859 2.96 | 3.0 | 3.0.* | 3.1 | 3.1.* | 3.2 | 3.2.* | 3.3 | 3.3.*)
861 i*86-*-linux-gnu* | i*86-*-freebsd*)
862 AC_MSG_WARN([using g++ 3.*, optimize without inline by default])
863 optimize_default="no-inline"
866 AC_MSG_WARN([using g++ 3.*, optimize without inline by default])
867 optimize_default="no-inline"
874 AC_ARG_ENABLE(optimize,
875 changequote(<<, >>)dnl
876 << --enable-optimize[=ARG] compile with optimizations [guessed]>>,
878 [], [enable_optimize="$optimize_default"])
880 case "$enable_optimize" in
882 # keep optimization options
883 AC_MSG_RESULT([enabling optimizations, $CONFIG_CXXOPTIMIZE]) ;;
885 optimize_no_inline="-fno-default-inline -fno-inline"
886 CONFIG_CXXOPTIMIZE="$CONFIG_CXXOPTIMIZE $optimize_no_inline"
887 AC_MSG_RESULT([enabling optimizations, $CONFIG_CXXOPTIMIZE]) ;;
889 CONFIG_CXXOPTIMIZE=""
890 AC_MSG_RESULT([disabling optimizations]) ;;
892 CONFIG_CXXOPTIMIZE="$enable_optimize"
893 AC_MSG_RESULT([customizing optimizations, $enable_optimize]) ;;
896 #--------------------------------------------------------------------
897 # Substitute TeXmacs specific configuration parameters
898 #--------------------------------------------------------------------
901 AC_SUBST(CONFIG_OS_SUFFIX)
902 AC_SUBST(CONFIG_CXXWARNING)
903 AC_SUBST(CONFIG_CXXTEMPLATE)
904 AC_SUBST(CONFIG_CXXOPTIMIZE)
905 AC_SUBST(CONFIG_CXXDEBUG)
906 AC_SUBST(CONFIG_BFLAGS)
907 AC_SUBST(CONFIG_BSTATIC)
908 AC_SUBST(CONFIG_BSHARED)
909 AC_SUBST(CONFIG_BPATH)
910 AC_SUBST(CONFIG_WORD_LENGTH)
911 AC_SUBST(CONFIG_WORD_LENGTH_INC)
912 AC_SUBST(CONFIG_WORD_MASK)
913 AC_SUBST(CONFIG_MAX_FAST)
914 AC_SUBST(CONFIG_CXXFLAGS)
915 AC_SUBST(CONFIG_STD_SETENV)
917 AC_SUBST(CONFIG_LIB_PATH)
918 AC_SUBST(CONFIG_STRIP)
919 AC_SUBST(CONFIG_CHMOD)
921 #--------------------------------------------------------------------
922 # Default paths for installation
923 #--------------------------------------------------------------------
925 if test "$prefix" = ""; then
928 if test "$prefix" = "NONE"; then
931 if test "$exec_prefix" = ""; then
932 exec_prefix='${prefix}'
934 if test "$exec_prefix" = "NONE"; then
935 exec_prefix='${prefix}'
937 if test "$exec_prefix" = '${prefix}'; then
938 exec_prefix='${prefix}'
940 if test "$includedir" = ""; then
941 includedir='${prefix}/include'
943 if test "$includedir" = "NONE"; then
944 includedir='${prefix}/include'
946 if test "$includedir" = '${prefix}/include'; then
947 includedir='${prefix}/include'
949 if test "$libdir" = ""; then
950 libdir='${exec_prefix}/lib'
952 if test "$libdir" = "NONE"; then
953 libdir='${exec_prefix}/lib'
955 if test "$libdir" = '${exec_prefix}/lib'; then
956 libdir='${exec_prefix}/lib'
958 if test "$bindir" = ""; then
959 bindir='${exec_prefix}/bin'
961 if test "$bindir" = "NONE"; then
962 bindir=${exec_prefix}/bin
964 if test "$bindir" = '${exec_prefix}/bin'; then
965 bindir='${exec_prefix}/bin'
967 if test "$datarootdir" = ""; then
968 datarootdir='${prefix}/share'
970 if test "$datarootdir" = "NONE"; then
971 datarootdir='${prefix}/share'
973 if test "$datarootdir" = '${prefix}/share'; then
974 datarootdir='${prefix}/share'
976 if test "$datadir" = ""; then
977 datadir='${prefix}/share'
979 if test "$datadir" = "NONE"; then
980 datadir='${prefix}/share'
982 if test "$datadir" = '${prefix}/share'; then
983 datadir='${prefix}/share'
985 if test "$mandir" = ""; then
986 mandir='${datarootdir}/man'
988 if test "$mandir" = "NONE"; then
989 mandir='${datarootdir}/man'
991 if test "$mandir" = '${datarootdir}/man'; then
992 mandir='${datarootdir}/man'
994 if test "$libexecdir" = ""; then
995 libexecdir='${exec_prefix}/libexec'
997 if test "$libexecdir" = "NONE"; then
998 libexecdir='${exec_prefix}/libexec'
1000 if test "$libexecdir" = '${exec_prefix}/libexec'; then
1001 libexecdir='${exec_prefix}/libexec'
1007 tmsrc=${curdir}/${tmdir}
1008 tmbin=${libexecdir}/${tmdir}
1009 tmdata=${datadir}/${tmdir}
1016 if test "$DEVEL_RELEASE" = "1"; then
1017 tmtgz=${PACKAGE}-${DEVEL_VERSION}
1019 tmtgz=${PACKAGE}-${DEVEL_VERSION}-R${DEVEL_RELEASE}
1021 tmrpm=${PACKAGE}-${DEVEL_VERSION}-${DEVEL_RELEASE}
1022 if test "$STABLE_RELEASE" = "1"; then
1023 tmstgz=${PACKAGE}-${STABLE_VERSION}
1025 tmstgz=${PACKAGE}-${STABLE_VERSION}-R${STABLE_RELEASE}
1027 tmsrpm=${PACKAGE}-${STABLE_VERSION}-${STABLE_RELEASE}
1028 if test "$WINDOWS_RELEASE" = "1"; then
1029 tmwin=wintexmacs-${WINDOWS_VERSION}
1031 tmwin=wintexmacs-${WINDOWS_VERSION}-R${WINDOWS_RELEASE}
1039 #--------------------------------------------------------------------
1041 #--------------------------------------------------------------------
1043 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)