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
151 SAVE_CPPFLAGS="$CPPFLAGS"
152 SAVE_LDFLAGS="$LDFLAGS"
154 if test "$with_iconv" = "no" ; then
155 AC_MSG_RESULT([disabling iconv support])
157 if test -n "$ICONV_CFLAGS" -a -n "$ICONV_LDFLAGS"; then
158 CPPFLAGS="$ICONV_CFLAGS" # for AC_TRY_LINK
159 LDFLAGS="$ICONV_LDFLAGS"
161 if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
162 CPPFLAGS="-I$with_iconv/include" # for AC_TRY_LINK
163 LDFLAGS="-L$with_iconv/lib"
164 ICONV_CFLAGS="-I$with_iconv/include"
165 ICONV_LDFLAGS="-L$with_iconv/lib"
168 AC_CHECK_HEADER(iconv.h,
169 AC_MSG_CHECKING(for iconv)
175 iconv_t cd = iconv_open ("","");
176 iconv (cd, NULL, NULL, NULL, NULL);
179 AC_DEFINE(USE_ICONV, 1, [Use iconv library])
182 AC_MSG_CHECKING(for iconv in -liconv)
183 # LDFLAGS="${ICONV_LDFLAGS}" # for AC_TRY_LINK
184 LIBS="-liconv" # for AC_TRY_LINK
190 iconv_t cd = iconv_open ("","");
191 iconv (cd, NULL, NULL, NULL, NULL);
194 AC_DEFINE(USE_ICONV, 1, [Use iconv library])
195 ICONV_LDFLAGS="${ICONV_LDFLAGS/-liconv} -liconv"
198 AC_MSG_WARN([absence of iconv may crash HTML import])
202 CPPFLAGS="$SAVE_CPPFLAGS"
203 LDFLAGS="$SAVE_LDFLAGS"
205 AC_LANG_RESTORE # restore C++ language
206 AC_SUBST(ICONV_CFLAGS)
207 AC_SUBST(ICONV_LDFLAGS)
209 #--------------------------------------------------------------------
210 # Checks for freetype library
211 #--------------------------------------------------------------------
213 AC_ARG_WITH(freetype,
214 changequote(<<, >>)dnl
215 << --with-freetype[=ARG] with freetype support [ARG=linked]>>dnl
219 SAVE_CPPFLAGS="$CPPFLAGS"
220 SAVE_LDFLAGS="$LDFLAGS"
222 if test "$with_freetype" = "no" ; then
223 AC_MSG_RESULT([disabling freetype support])
225 if test -z "$FREETYPE_CFLAGS"; then
226 FREETYPE_CFLAGS=`freetype-config --cflags`
228 CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
229 if test -z "$FREETYPE_LDFLAGS"; then
230 FREETYPE_LDFLAGS=`freetype-config --libs`
232 LIBS="$LDFLAGS $FREETYPE_LDFLAGS"
233 AC_CHECK_HEADER(ft2build.h,
234 AC_MSG_CHECKING(for freetype)
237 #include <ft2build.h>
238 #include FT_FREETYPE_H
240 FT_Library ft_library;
241 (void) FT_Init_FreeType (&ft_library);
244 AC_DEFINE(USE_FREETYPE, 1, [Use freetype library])
245 FREETYPE_CFLAGS="$CPPFLAGS"
246 if test "$with_freetype" = "linked" -o "$with_freetype" = "" ; then
247 FREETYPE_LDFLAGS="$LIBS"
248 AC_DEFINE(LINKED_FREETYPE, 1, [Link freetype library with TeXmacs])
254 CPPFLAGS="$SAVE_CPPFLAGS"
255 LDFLAGS="$SAVE_LDFLAGS"
258 AC_SUBST(FREETYPE_CFLAGS)
259 AC_SUBST(FREETYPE_LDFLAGS)
261 #--------------------------------------------------------------------
262 # Checks for Cairo library
263 #--------------------------------------------------------------------
266 changequote(<<, >>)dnl
267 << --with-cairo[=ARG] with cairo support [ARG=no]>>dnl
271 SAVE_CPPFLAGS="$CPPFLAGS"
272 SAVE_LDFLAGS="$LDFLAGS"
274 if test "$with_cairo" = "no" -o "$with_cairo" = "" ; then
275 AC_MSG_RESULT([disabling cairo support])
277 CPPFLAGS=`pkg-config --cflags cairo`
278 LIBS=`pkg-config --libs cairo`
279 AC_CHECK_HEADER(cairo.h,
280 AC_MSG_CHECKING(for cairo)
285 cairo_surface_t *surface;
286 surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 120, 120);
289 AC_DEFINE(USE_CAIRO, 1, [Use cairo library])
290 CAIRO_CFLAGS="$CPPFLAGS"
291 if test "$with_cairo" = "linked" ; then
292 CAIRO_LDFLAGS="$LIBS"
293 AC_DEFINE(LINKED_CAIRO, 1, [Link cairo library with TeXmacs])
299 CPPFLAGS="$SAVE_CPPFLAGS"
300 LDFLAGS="$SAVE_LDFLAGS"
303 AC_SUBST(CAIRO_CFLAGS)
304 AC_SUBST(CAIRO_LDFLAGS)
306 #--------------------------------------------------------------------
307 # Checks for Imlib2 library
308 #--------------------------------------------------------------------
311 changequote(<<, >>)dnl
312 << --with-imlib2[=ARG] with imlib2 support [ARG=no]>>dnl
316 SAVE_CPPFLAGS="$CPPFLAGS"
317 SAVE_LDFLAGS="$LDFLAGS"
319 if test "$with_imlib2" = "no" -o "$with_imlib2" = "" ; then
320 AC_MSG_RESULT([disabling imlib2 support])
322 CPPFLAGS=`imlib2-config --cflags`
323 LIBS=`imlib2-config --libs`
324 AC_CHECK_HEADER(Imlib2.h,
325 AC_MSG_CHECKING(for imlib2)
328 #include <X11/Xlib.h>
333 Imlib_Image image= imlib_load_image("");
336 AC_DEFINE(USE_IMLIB2, 1, [Use imlib2 library])
337 IMLIB2_CFLAGS="$CPPFLAGS"
338 if test "$with_imlib2" = "linked" ; then
339 IMLIB2_LDFLAGS="$LIBS"
340 AC_DEFINE(LINKED_IMLIB2, 1, [Link imlib2 library with TeXmacs])
346 CPPFLAGS="$SAVE_CPPFLAGS"
347 LDFLAGS="$SAVE_LDFLAGS"
350 AC_SUBST(IMLIB2_CFLAGS)
351 AC_SUBST(IMLIB2_LDFLAGS)
353 #--------------------------------------------------------------------
354 # Checks for Axel library
355 #--------------------------------------------------------------------
358 changequote(<<, >>)dnl
359 << --with-axel[=ARG] with axel support [ARG=no]>>dnl
363 SAVE_CPPFLAGS="$CPPFLAGS"
364 SAVE_LDFLAGS="$LDFLAGS"
366 if test "$with_axel" = "no" -o "$with_axel" = "" ; then
367 AC_MSG_RESULT([disabling axel support])
369 CPPFLAGS=`axel-config --cflags`
370 LIBS=`axel-config --libs`
371 AC_CHECK_HEADER(QGui/Viewer.h,
372 AC_MSG_CHECKING(for axel)
375 #include <QGui/Viewer.h>
380 AC_DEFINE(USE_AXEL, 1, [Use axel library])
381 AXEL_CFLAGS="$CPPFLAGS"
382 if test "$with_axel" = "linked" ; then
384 AC_DEFINE(LINKED_AXEL, 1, [Link axel library with TeXmacs])
390 CPPFLAGS="$SAVE_CPPFLAGS"
391 LDFLAGS="$SAVE_LDFLAGS"
394 AC_SUBST(AXEL_CFLAGS)
395 AC_SUBST(AXEL_LDFLAGS)
397 #--------------------------------------------------------------------
398 # Fixes for erroneous behaviour of gcc/g++ and guile on some systems
399 #--------------------------------------------------------------------
401 AC_MSG_CHECKING(whether ... arguments behave correctly)
402 if test -z "$GUILE_CFLAGS"; then
403 CXXFLAGS="`guile-config compile`"
405 CXXFLAGS="$GUILE_CFLAGS"
408 #include <guile/gh.h>
409 #include <libguile.h>
410 typedef SCM (*FN)(...);
411 static SCM identity (SCM x) { return x; }
412 void declare () { gh_new_procedure ("identity", (FN) identity, 1, 0, 0); }
415 AC_DEFINE(DOTS_OK, 1, [Defined if ...-style argument passing works])
422 AC_MSG_CHECKING(the size_t of guile strings)
423 if test -z "$GUILE_CFLAGS"; then
424 CXXFLAGS="`guile-config compile`"
426 CXXFLAGS="$GUILE_CFLAGS"
429 #include <guile/gh.h>
430 #include <libguile.h>
431 void print_string (SCM s) {
433 char* r= gh_scm2newstr (s, &len_r); }
436 AC_DEFINE(guile_str_size_t, int, [Guile string size type])
439 AC_DEFINE(guile_str_size_t, size_t, [Guile string size type])
440 AC_MSG_RESULT(size_t)
444 AC_MSG_CHECKING([if statically linking with guile works])
445 SAVE_CPPFLAGS="$CPPFLAGS"
446 SAVE_LDFLAGS="$LDFLAGS"
448 CPPFLAGS="$GUILE_CFLAGS"
450 LIBS="$GUILE_LDFLAGS"
451 TEXMACS_LINK_GUILE([tm_link_guile_static="yes"],
452 [tm_link_guile_static="no"])
453 AC_MSG_RESULT(["$tm_link_guile_static"])
454 if test "$tm_link_guile_static" = "no" ; then
455 AC_MSG_CHECKING([if it works with -lltdl])
456 LIBS="$GUILE_LDFLAGS -lltdl"
457 TEXMACS_LINK_GUILE([tm_link_guile_static_ltdl="yes"],
458 [tm_link_guile_static_ltdl="no"])
459 AC_MSG_RESULT(["$tm_link_guile_static_ltdl"])
460 if test "$tm_link_guile_static_ltdl" = "yes" ; then
461 GUILE_LDFLAGS="$GUILE_LDFLAGS -lltdl"
463 AC_MSG_CHECKING([if it works with -lltdl -ldl])
464 LIBS="$GUILE_LDFLAGS -lltdl -ldl"
465 TEXMACS_LINK_GUILE([tm_link_guile_static_ltdl_ldl="yes"],
466 [tm_link_guile_static_ltdl_ldl="no"])
467 AC_MSG_RESULT(["$tm_link_guile_static_ltdl_ldl"])
468 if test "$tm_link_guile_static_ltdl_ldl" = "yes" ; then
469 GUILE_LDFLAGS="$GUILE_LDFLAGS -lltdl -ldl"
471 AC_MSG_WARN([unable to link statically with guile])
475 CPPFLAGS="$SAVE_CPPFLAGS"
476 LDFLAGS="$SAVE_LDFLAGS"
479 #--------------------------------------------------------------------
480 # Handle different systems case by case
481 #--------------------------------------------------------------------
483 CONFIG_OS="GNU_LINUX"
484 CONFIG_OS_SUFFIX="gnu-linux"
485 CONFIG_OS_COMPAT="Unix"
488 CONFIG_CXXTEMPLATE=""
489 CONFIG_STD_SETENV="#define STD_SETENV"
491 CONFIG_LIB_PATH="LD_LIBRARY_PATH"
492 CONFIG_CHMOD="chmod -f"
493 CONFIG_CXXOPTIMIZE="-O2"
494 CONFIG_BSTATIC="-Wl,-Bstatic"
495 CONFIG_BSHARED="-Wl,-Bdynamic"
497 CONFIG_BPATH="-Wl,-rpath,"
499 CONFIG_WORD_LENGTH="4"
500 CONFIG_WORD_LENGTH_INC="3"
501 CONFIG_WORD_MASK="0xfffffffc"
502 CONFIG_MAX_FAST="260 // WORD_LENGTH more than power of 2"
503 # tweak for XCode project
504 CONFIG_NATIVE_ARCH_TAG="NATIVE_ARCH"
506 X11_CFLAGS="$X_CFLAGS"
507 X11_LDFLAGS="$X_LIBS -lXext -lX11"
509 AC_CHECK_SIZEOF(void *)
510 AC_MSG_CHECKING(if we are on a 64-bits computer)
511 if test "$ac_cv_sizeof_void_p" = "8"; then
513 CONFIG_WORD_LENGTH="8"
514 CONFIG_WORD_LENGTH_INC="7"
515 CONFIG_WORD_MASK="0xfffffffffffffff8"
516 CONFIG_MAX_FAST="264 // WORD_LENGTH more than power of 2"
523 i*86-*-linux* | x86_64-*-linux*)
524 AC_MSG_RESULT(final adjustments for an Intel or AMD GNU/Linux host)
525 CONFIG_CXXOPTIMIZE="-O3 -fexpensive-optimizations"
527 i*86-*-freebsd* | x86_64-*-freebsd*)
528 AC_MSG_RESULT(final adjustments for an Intel or AMD GNU/BSD host)
529 CONFIG_CXXOPTIMIZE="-O3 -fexpensive-optimizations"
532 AC_MSG_RESULT(final adjustments for an Intel or AMS Solaris host)
533 CONFIG_CXXOPTIMIZE="-O3"
534 CONFIG_BPATH="-Wl,-R,"
535 X11_LDFLAGS="$X_LIBS -lXext -lX11 -lsocket"
538 AC_MSG_RESULT([final adjustments for mingw host])
539 CONFIG_OS_COMPAT="Windows"
540 CONFIG_LDRT="-lmingw32 -lmingwex"
543 AC_MSG_RESULT(final adjustments for cygwin host)
545 CONFIG_BFLAGS="-Wl,-stack,8388608"
546 # CXX="export CYGWIN=check_case:strict; $CXX"
550 echo "$ac_t""final adjustments for a MacOS host" 1>&6
552 CONFIG_CXXFLAGS="-I${prefix}/include"
554 CONFIG_BFLAGS="-framework Cocoa"
557 CONFIG_LIB_PATH="DYLD_LIBRARY_PATH"
560 echo "$ac_t""final adjustments for a generic Darwin host" 1>&6
561 CONFIG_CXXFLAGS="-I${prefix}/include"
565 CONFIG_LIB_PATH="DYLD_LIBRARY_PATH"
568 AC_MSG_RESULT(final adjustments for a PowerPC/GNU-linux host)
569 CONFIG_OS="POWERPC_GNU_LINUX"
570 CONFIG_CXXOPTIMIZE="-O3 -fexpensive-optimizations"
573 AC_MSG_RESULT(final adjustments for a SUN/solaris host)
575 CONFIG_OS_SUFFIX="sun"
578 CONFIG_BPATH="-Wl,-R,"
579 X11_LDFLAGS="$X_LIBS -lXext -lX11 -lsocket"
580 CONFIG_WORD_LENGTH="8"
581 CONFIG_WORD_LENGTH_INC="7"
582 CONFIG_WORD_MASK="0xfffffff8"
583 CONFIG_MAX_FAST="264 // WORD_LENGTH more than power of 2"
587 AC_MSG_RESULT(final adjustments for a Sparc host running GNU/Linux)
588 CONFIG_CXXOPTIMIZE="-O3 -fexpensive-optimizations"
589 CONFIG_WORD_LENGTH="8"
590 CONFIG_WORD_LENGTH_INC="7"
591 CONFIG_WORD_MASK="0xfffffff8"
592 CONFIG_MAX_FAST="264 // WORD_LENGTH more than power of 2"
596 AC_MSG_RESULT(final adjustments for a DEC/alpha host)
598 CONFIG_BSHARED="-shared"
602 AC_MSG_RESULT(final adjustments for an Alpha GNU/Linux host)
604 CONFIG_BSHARED="-shared"
607 AC_MSG_RESULT(final adjustments for an IBM S/390 GNU/Linux host)
611 AC_MSG_RESULT(final adjustments for an Itanium GNU/Linux host)
613 CONFIG_BSHARED="-shared"
616 AC_MSG_RESULT(final adjustments for an HP PA_RISC GNU/Linux host)
617 CONFIG_CXXFLAGS="$CONFIG_CXXFLAGS -fPIC"
619 CONFIG_BSHARED="-shared"
622 echo "$ac_t""final adjustments for a SGI/Irix host" 1>&6
629 X11_LDFLAGS="$X_LIBS -lX11"
630 CONFIG_WORD_MASK="0xfffffff8"
633 CONFIG_LIB_PATH="LD_LIBRARYN32_PATH"
635 m68k-*-linux* | mips-*-linux* | mipsel-*-linux* | arm*-*-linux*)
636 AC_MSG_RESULT(final adjustments for a supported GNU/Linux host)
639 AC_MSG_RESULT(final adjustments for a generic GNU/Linux host)
642 AC_MSG_RESULT(final adjustments for a generic host)
648 echo "$ac_t""Xcode 3.2 project tweak (only MacOSX 10.6)" 1>&6
649 CONFIG_NATIVE_ARCH_TAG="NATIVE_ARCH_ACTUAL"
653 #--------------------------------------------------------------------
654 # Temporary fix for link problem
655 #--------------------------------------------------------------------
657 case "$GXX_VERSION" in
659 CONFIG_BSTATIC="-static"
660 CONFIG_BSHARED="-dynamic"
664 #--------------------------------------------------------------------
665 # Memory allocation options
666 #--------------------------------------------------------------------
668 AC_ARG_ENABLE(fastalloc,
669 [ --disable-fastalloc omit fast allocator for small objects],
670 [], [enable_fastalloc="yes"])
671 case "$enable_fastalloc" in
675 AC_MSG_RESULT([disabling fast allocator for small objects])
676 AC_DEFINE(NO_FAST_ALLOC, 1, [Disable fast memory allocator])
679 AC_MSG_ERROR([bad option --enable-fastalloc=$enable_fastalloc])
683 #--------------------------------------------------------------------
684 # Experimental options
685 #--------------------------------------------------------------------
687 AC_ARG_ENABLE(experimental,
688 [ --enable-experimental support new style rewriting code],
689 [], [enable_experimental="no"])
690 case "$enable_experimental" in
692 AC_MSG_RESULT([enabling experimental style rewriting code])
693 AC_DEFINE(EXPERIMENTAL, 1, [Enable experimental style rewriting code])
694 CONFIG_EXPERIMENTAL="Memorizer Environment Evaluate"
697 AC_MSG_RESULT([disabling experimental style rewriting code])
698 CONFIG_EXPERIMENTAL=""
701 AC_MSG_ERROR([bad option --enable-experimental=$enable_experimental])
704 AC_SUBST(CONFIG_EXPERIMENTAL)
706 #--------------------------------------------------------------------
707 # MacOS X extensions (spellchecker, image loading)
708 #--------------------------------------------------------------------
710 AC_ARG_ENABLE(macosx-extensions,
711 [ --enable-macosx-extensions support new style rewriting code],
712 [], [enable_macosx_extensions="no"])
713 case "$enable_macosx_extensions" in
715 AC_MSG_RESULT([enabling Mac OSX extensions])
716 AC_DEFINE(MACOSX_EXTENSIONS, 1, [Enabling Mac OSX extensions])
720 AC_MSG_RESULT([disabling Mac OSX extensions])
724 AC_MSG_ERROR([bad option --enable-macosx-extensions=$enable_macosx_extensions])
727 AC_SUBST(CONFIG_MACOS)
729 #--------------------------------------------------------------------
731 #--------------------------------------------------------------------
738 [ --enable-qt replace X11 by Qt interface],
739 [], [enable_qt="no"])
744 if test x"$at_cv_qt_build" = xko; then
745 AC_MSG_ERROR([cannot find Qt!])
747 AC_MSG_RESULT([enabling experimental Qt port])
752 AC_MSG_RESULT([disabling experimental Qt port])
755 AC_MSG_ERROR([bad option --enable-qt=$enable_qt])
760 [ --enable-cocoa replace X11 by Cocoa interface],
761 [], [enable_cocoa="no"])
762 case "$enable_cocoa" in
764 AC_MSG_RESULT([enabling experimental Cocoa port])
766 COCOA_LDFLAGS="-framework Cocoa"
770 AC_MSG_RESULT([disabling experimental Cocoa port])
773 AC_MSG_ERROR([bad option --enable-cocoa=$enable_cocoa])
777 case "$CONFIG_GUI" in
779 CONFIG_X11="X11 Widkit Ghostscript"
780 CONFIG_GUI_DEFINE="X11TEXMACS"
781 # AC_DEFINE(X11TEXMACS, 1, [Use standard X11 port])
785 CONFIG_GUI_DEFINE="AQUATEXMACS"
786 # AC_DEFINE(AQUATEXMACS, 1, [Enable experimental Cocoa port])
790 CONFIG_GUI_DEFINE="QTTEXMACS"
791 # AC_DEFINE(QTTEXMACS, 1, [Enable experimental Qt port])
798 AC_SUBST(X11_LDFLAGS)
799 AC_SUBST(COCOA_CFLAGS)
800 AC_SUBST(COCOA_LDFLAGS)
803 AC_SUBST(CONFIG_COCOA)
806 AC_SUBST(CONFIG_GUI_DEFINE)
808 #--------------------------------------------------------------------
810 #--------------------------------------------------------------------
812 STD_DEBUG_FLAGS="-fno-rtti -fno-exceptions"
813 if test "$enable_cocoa" = "yes"; then
814 STD_DEBUG_FLAGS="-fno-exceptions"
817 AC_MSG_CHECKING(if compiler supports $STD_DEBUG_FLAGS)
818 CXXFLAGS="$STD_DEBUG_FLAGS"
820 int some_variable = 0;
823 CONFIG_CXXDIALECT="$STD_DEBUG_FLAGS"
830 AC_SUBST(CONFIG_CXXDIALECT)
833 changequote(<<, >>)dnl
834 << --enable-debug[=ARG] install a debugging enable executable [-ggdb]>>,
836 [], [enable_debug="no"])
838 if test "$enable_debug" = "yes"; then
839 if test "$GXX" = "yes"; then
846 if test "$enable_debug" = "no"; then
847 AC_MSG_RESULT([disabling debugging])
850 optimize_default="yes"
852 AC_MSG_RESULT([enabling debugging, $enable_debug])
854 CONFIG_CXXDEBUG="$enable_debug"
855 optimize_default="no"
858 AC_ARG_ENABLE(assert,
859 changequote(<<, >>)dnl
860 << --enable-assert exit on failed assertions in code>>,
862 [], [enable_assert="yes"])
864 if test "$enable_assert" = "no"; then
865 AC_MSG_RESULT([disabling assertion checking])
867 AC_MSG_RESULT([enabling assertion checking])
868 AC_DEFINE(DEBUG_ASSERT, 1, [check assertions in code])
871 #--------------------------------------------------------------------
873 #--------------------------------------------------------------------
875 case "$GXX_VERSION" in
877 CONFIG_CXXWARNING="";
880 CONFIG_CXXWARNING="-Wall -Wno-return-type"
884 AC_ARG_ENABLE(warnings,
885 [ --enable-warnings print warning messages during compilation],
886 [], [enable_warnings="yes"])
887 case "$enable_warnings" in
889 AC_MSG_RESULT([enabling warning flags $CONFIG_CXXWARNING]) ;;
892 AC_MSG_RESULT([disabling warning flags]) ;;
894 CONFIG_CXXWARNING="$enable_warnings"
895 AC_MSG_RESULT([enabling warning flags $CONFIG_CXXWARNING]) ;;
898 #--------------------------------------------------------------------
899 # Optimization options
900 #--------------------------------------------------------------------
902 if test "$optimize_default" = "yes"; then
903 case "$GXX_VERSION" in
906 2.96 | 3.0 | 3.0.* | 3.1 | 3.1.* | 3.2 | 3.2.* | 3.3 | 3.3.*)
908 i*86-*-linux-gnu* | i*86-*-freebsd*)
909 AC_MSG_WARN([using g++ 3.*, optimize without inline by default])
910 optimize_default="no-inline"
913 AC_MSG_WARN([using g++ 3.*, optimize without inline by default])
914 optimize_default="no-inline"
921 AC_ARG_ENABLE(optimize,
922 changequote(<<, >>)dnl
923 << --enable-optimize[=ARG] compile with optimizations [guessed]>>,
925 [], [enable_optimize="$optimize_default"])
927 case "$enable_optimize" in
929 # keep optimization options
930 AC_MSG_RESULT([enabling optimizations, $CONFIG_CXXOPTIMIZE]) ;;
932 optimize_no_inline="-fno-default-inline -fno-inline"
933 CONFIG_CXXOPTIMIZE="$CONFIG_CXXOPTIMIZE $optimize_no_inline"
934 AC_MSG_RESULT([enabling optimizations, $CONFIG_CXXOPTIMIZE]) ;;
936 CONFIG_CXXOPTIMIZE=""
937 AC_MSG_RESULT([disabling optimizations]) ;;
939 CONFIG_CXXOPTIMIZE="$enable_optimize"
940 AC_MSG_RESULT([customizing optimizations, $enable_optimize]) ;;
943 #--------------------------------------------------------------------
944 # Substitute TeXmacs specific configuration parameters
945 #--------------------------------------------------------------------
948 AC_SUBST(CONFIG_OS_SUFFIX)
949 AC_SUBST(CONFIG_OS_COMPAT)
950 AC_SUBST(CONFIG_CXXWARNING)
951 AC_SUBST(CONFIG_CXXTEMPLATE)
952 AC_SUBST(CONFIG_CXXOPTIMIZE)
953 AC_SUBST(CONFIG_CXXDEBUG)
954 AC_SUBST(CONFIG_BFLAGS)
955 AC_SUBST(CONFIG_BSTATIC)
956 AC_SUBST(CONFIG_BSHARED)
957 AC_SUBST(CONFIG_BPATH)
958 AC_SUBST(CONFIG_WORD_LENGTH)
959 AC_SUBST(CONFIG_WORD_LENGTH_INC)
960 AC_SUBST(CONFIG_WORD_MASK)
961 AC_SUBST(CONFIG_MAX_FAST)
962 AC_SUBST(CONFIG_CXXFLAGS)
963 AC_SUBST(CONFIG_STD_SETENV)
965 AC_SUBST(CONFIG_LIB_PATH)
966 AC_SUBST(CONFIG_STRIP)
967 AC_SUBST(CONFIG_CHMOD)
968 AC_SUBST(CONFIG_LDRT)
969 AC_SUBST(CONFIG_NATIVE_ARCH_TAG)
971 #--------------------------------------------------------------------
972 # Default paths for installation
973 #--------------------------------------------------------------------
975 if test "$prefix" = ""; then
978 if test "$prefix" = "NONE"; then
981 if test "$exec_prefix" = ""; then
982 exec_prefix='${prefix}'
984 if test "$exec_prefix" = "NONE"; then
985 exec_prefix='${prefix}'
987 if test "$exec_prefix" = '${prefix}'; then
988 exec_prefix='${prefix}'
990 if test "$includedir" = ""; then
991 includedir='${prefix}/include'
993 if test "$includedir" = "NONE"; then
994 includedir='${prefix}/include'
996 if test "$includedir" = '${prefix}/include'; then
997 includedir='${prefix}/include'
999 if test "$libdir" = ""; then
1000 libdir='${exec_prefix}/lib'
1002 if test "$libdir" = "NONE"; then
1003 libdir='${exec_prefix}/lib'
1005 if test "$libdir" = '${exec_prefix}/lib'; then
1006 libdir='${exec_prefix}/lib'
1008 if test "$bindir" = ""; then
1009 bindir='${exec_prefix}/bin'
1011 if test "$bindir" = "NONE"; then
1012 bindir=${exec_prefix}/bin
1014 if test "$bindir" = '${exec_prefix}/bin'; then
1015 bindir='${exec_prefix}/bin'
1017 if test "$datarootdir" = ""; then
1018 datarootdir='${prefix}/share'
1020 if test "$datarootdir" = "NONE"; then
1021 datarootdir='${prefix}/share'
1023 if test "$datarootdir" = '${prefix}/share'; then
1024 datarootdir='${prefix}/share'
1026 if test "$datadir" = ""; then
1027 datadir='${prefix}/share'
1029 if test "$datadir" = "NONE"; then
1030 datadir='${prefix}/share'
1032 if test "$datadir" = '${prefix}/share'; then
1033 datadir='${prefix}/share'
1035 if test "$mandir" = ""; then
1036 mandir='${datarootdir}/man'
1038 if test "$mandir" = "NONE"; then
1039 mandir='${datarootdir}/man'
1041 if test "$mandir" = '${datarootdir}/man'; then
1042 mandir='${datarootdir}/man'
1044 if test "$libexecdir" = ""; then
1045 libexecdir='${exec_prefix}/libexec'
1047 if test "$libexecdir" = "NONE"; then
1048 libexecdir='${exec_prefix}/libexec'
1050 if test "$libexecdir" = '${exec_prefix}/libexec'; then
1051 libexecdir='${exec_prefix}/libexec'
1057 tmsrc=${curdir}/${tmdir}
1058 tmbin=${libexecdir}/${tmdir}
1059 tmdata=${datadir}/${tmdir}
1066 if test "$DEVEL_RELEASE" = "1"; then
1067 tmtgz=${PACKAGE}-${DEVEL_VERSION}
1069 tmtgz=${PACKAGE}-${DEVEL_VERSION}-R${DEVEL_RELEASE}
1071 tmrpm=${PACKAGE}-${DEVEL_VERSION}-${DEVEL_RELEASE}
1072 if test "$STABLE_RELEASE" = "1"; then
1073 tmstgz=${PACKAGE}-${STABLE_VERSION}
1075 tmstgz=${PACKAGE}-${STABLE_VERSION}-R${STABLE_RELEASE}
1077 tmsrpm=${PACKAGE}-${STABLE_VERSION}-${STABLE_RELEASE}
1078 if test "$WINDOWS_RELEASE" = "1"; then
1079 tmwin=wintexmacs-${WINDOWS_VERSION}
1081 tmwin=wintexmacs-${WINDOWS_VERSION}-R${WINDOWS_RELEASE}
1089 #--------------------------------------------------------------------
1091 #--------------------------------------------------------------------
1093 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)