comparison configure.in @ 272:c5d627a313b1 r21-0b34

Import from CVS: tag r21-0b34
author cvs
date Mon, 13 Aug 2007 10:28:48 +0200
parents b2472a1930f2
children ca9a9ec9c1c1
comparison
equal deleted inserted replaced
271:c7b7086b0a39 272:c5d627a313b1
345 with_site_lisp='no' 345 with_site_lisp='no'
346 with_menubars='' 346 with_menubars=''
347 with_scrollbars='' 347 with_scrollbars=''
348 with_dialogs='' 348 with_dialogs=''
349 with_file_coding='' 349 with_file_coding=''
350 const_is_losing='yes' 350 dnl const_is_losing is removed - we rely on AC_C_CONST instead.
351 dnl We accept (and ignore) the --const-is-losing option for compatibility.
352 dnl const_is_losing='yes'
351 puresize='' 353 puresize=''
352 cflags='UNSPECIFIED' 354 cpp='' cppflags='' libs='' ldflags=''
353 dynamic='' 355 dynamic=''
354 with_x11='' 356 with_x11=''
355 with_msw='' 357 with_msw=''
356 with_gung='no'
357 with_minimal_tagbits='no'
358 rel_alloc='default' 358 rel_alloc='default'
359 with_system_malloc='default' 359 with_system_malloc='default'
360 with_dlmalloc='default' 360 with_dlmalloc='default'
361 native_sound_lib='' 361 native_sound_lib=''
362 dnl use-assertions should be 'yes' by default. Too many people in this 362 dnl use_assertions should be 'yes' by default. Too many people in this
363 dnl world have core dumps turned off by default or \"cannot find where the 363 dnl world have core dumps turned off by default or \"cannot find where the
364 dnl core file went\". At least we should get some useful output ... 364 dnl core file went\". At least we should get some useful output ...
365 use_assertions="yes" 365 use_assertions="yes"
366 dnl the following is set to yes or no later. 366 dnl the following is set to yes or no later.
367 with_toolbars="" 367 with_toolbars=""
453 with_x11 | \ 453 with_x11 | \
454 with_msw | \ 454 with_msw | \
455 with_gcc | \ 455 with_gcc | \
456 with_gnu_make | \ 456 with_gnu_make | \
457 dynamic | \ 457 dynamic | \
458 with_gung | \
459 with_ncurses | \ 458 with_ncurses | \
460 with_dnet | \ 459 with_dnet | \
461 with_socks | \ 460 with_socks | \
462 with_cde | \ 461 with_cde | \
463 with_offix | \ 462 with_offix | \
494 const_is_losing | \ 493 const_is_losing | \
495 usage_tracking | \ 494 usage_tracking | \
496 use_union_type | \ 495 use_union_type | \
497 debug | \ 496 debug | \
498 use_assertions | \ 497 use_assertions | \
498 use_minimal_tagbits | \
499 use_indexed_lrecord_implementation | \
500 gung_ho | \
501 use_assertions | \
499 memory_usage_stats | \ 502 memory_usage_stats | \
500 with_clash_detection | \ 503 with_clash_detection | \
501 with_shlib | \ 504 with_shlib | \
502 no_doc_file ) 505 no_doc_file )
503 dnl Make sure the value given was either "yes" or "no". 506 dnl Make sure the value given was either "yes" or "no".
512 dnl Options that take a user-supplied value, as in --puresize=8000000 515 dnl Options that take a user-supplied value, as in --puresize=8000000
513 dnl The cache-file option is ignored (for compatibility with other configures) 516 dnl The cache-file option is ignored (for compatibility with other configures)
514 srcdir | \ 517 srcdir | \
515 compiler | \ 518 compiler | \
516 cflags | \ 519 cflags | \
520 cpp | \
521 cppflags | \
522 libs | \
523 ldflags | \
517 puresize | \ 524 puresize | \
518 cache_file | \ 525 cache_file | \
519 native_sound_lib | \ 526 native_sound_lib | \
520 site_lisp | \ 527 site_lisp | \
521 x_includes | \ 528 x_includes | \
748 755
749 dnl ------------------------- 756 dnl -------------------------
750 dnl Finish options processing 757 dnl Finish options processing
751 dnl ------------------------- 758 dnl -------------------------
752 759
760 dnl Several options are equivalent to, and override, environment variables.
761 test -n "$cpp" && CPP="$cpp"
762 test -n "$cppflags" && CPPFLAGS="$cppflags"
763 test -n "$libs" && LIBS="$libs"
764 test -n "$ldflags" && LDFLAGS="$ldflags"
765
766 dnl Personal settings shouldn't affect the configuration process.
767 dnl if test "$infopath_user_defined" = "no" -a -n "$INFOPATH" ; then
768 dnl infopath="$INFOPATH"
769 dnl fi
770
753 dnl Get the arguments back. See the diatribe on Shell Magic above. 771 dnl Get the arguments back. See the diatribe on Shell Magic above.
754 eval set x "$quoted_arguments"; shift 772 eval set x "$quoted_arguments"; shift
755 773
756 dnl --extra-verbose implies --verbose 774 dnl --extra-verbose implies --verbose
757 test "$extra_verbose" = "yes" && verbose=yes 775 test "$extra_verbose" = "yes" && verbose=yes
764 COLON_TO_SPACE(site_prefixes) 782 COLON_TO_SPACE(site_prefixes)
765 COLON_TO_SPACE(site_runtime_libraries) 783 COLON_TO_SPACE(site_runtime_libraries)
766 784
767 dnl with_x is an obsolete synonym for with_x11 785 dnl with_x is an obsolete synonym for with_x11
768 test -n "$with_x" && with_x11="$with_x" 786 test -n "$with_x" && with_x11="$with_x"
787
788 dnl --gung-ho=val is a synonym for
789 dnl --use-minimal-tagbits=val --use-indexed-lrecord-implementation=val
790
791 if test -n "$gung_ho"; then
792 test -z "$use_minimal_tagbits" && use_minimal_tagbits="$gung_ho"
793 test -z "$use_indexed_lrecord_implementation" && \
794 use_indexed_lrecord_implementation="$gung_ho"
795 fi
796 if test "$use_minimal_tagbits" = "no"; then
797 test "$with_dlmalloc" = "yes" && \
798 USAGE_ERROR(--with-dlmalloc=yes requires --use-minimal-tagbits=yes)
799 with_dlmalloc=no
800 fi
769 801
770 dnl# Ignore useless run-in-place flag 802 dnl# Ignore useless run-in-place flag
771 if test "$run_in_place" = "yes"; then 803 if test "$run_in_place" = "yes"; then
772 AC_MSG_WARN("The --run-in-place option is ignored because it is unnecessary.") 804 AC_MSG_WARN("The --run-in-place option is ignored because it is unnecessary.")
773 fi 805 fi
899 test "${error_check_gc=$beta}" = yes && AC_DEFINE(ERROR_CHECK_GC) 931 test "${error_check_gc=$beta}" = yes && AC_DEFINE(ERROR_CHECK_GC)
900 test "${error_check_malloc=$beta}" = yes && AC_DEFINE(ERROR_CHECK_MALLOC) 932 test "${error_check_malloc=$beta}" = yes && AC_DEFINE(ERROR_CHECK_MALLOC)
901 dnl debug=yes must be set when error checking is present. This should be 933 dnl debug=yes must be set when error checking is present. This should be
902 dnl fixed up. 934 dnl fixed up.
903 dnl debug implies other options 935 dnl debug implies other options
904 if test "${debug=beta}" = "yes"; then 936 if test "${debug:=$beta}" = "yes"; then
905 use_assertions=yes memory_usage_stats=yes 937 use_assertions=yes memory_usage_stats=yes
906 XE_ADD_OBJS(debug.o) 938 XE_ADD_OBJS(debug.o)
907 AC_DEFINE(DEBUG_XEMACS) 939 AC_DEFINE(DEBUG_XEMACS)
908 fi 940 fi
909 test "$use_assertions" = "yes" && AC_DEFINE(USE_ASSERTIONS) 941 test "$use_assertions" = "yes" && AC_DEFINE(USE_ASSERTIONS)
1464 fi 1496 fi
1465 1497
1466 dnl If we don't set CFLAGS here, AC_PROG_CC will set it. 1498 dnl If we don't set CFLAGS here, AC_PROG_CC will set it.
1467 dnl But we know better what's good for us, so we do our own 1499 dnl But we know better what's good for us, so we do our own
1468 dnl computation of real CFLAGS later. 1500 dnl computation of real CFLAGS later.
1469 test "$cflags" != "UNSPECIFIED" && CFLAGS="$cflags" 1501 dnl --cflags overrides environment variable CFLAGS
1502 test "${cflags-unset}" != unset && CFLAGS="$cflags"
1503 if test "${CFLAGS-unset}" != unset
1504 then cflags_specified=yes;
1505 else cflags_specified=no;
1506 fi
1507
1470 xe_save_CFLAGS="$CFLAGS" 1508 xe_save_CFLAGS="$CFLAGS"
1471 1509
1472 AC_PROG_CC dnl Autoconf has its own magic for compiler autodetection 1510 AC_PROG_CC dnl Autoconf has its own magic for compiler autodetection
1473 1511
1474 dnl Retry using random guesswork if AC_PROG_CC got it wrong... 1512 dnl Retry using random guesswork if AC_PROG_CC got it wrong...
1501 ******* ======= ******** &&&&&&&& 1539 ******* ======= ******** &&&&&&&&
1502 #endif 1540 #endif
1503 ], have_glibc=yes, have_glibc=no) 1541 ], have_glibc=yes, have_glibc=no)
1504 AC_MSG_RESULT($have_glibc) 1542 AC_MSG_RESULT($have_glibc)
1505 dnl I'm tired of pop being broken with GLIBC -slb 1543 dnl I'm tired of pop being broken with GLIBC -slb
1506 dnl test "$have_glibc" = "yes" && AC_DEFINE(_GNU_SOURCE) 1544 dnl Well. then why not fix fucking pop?
1545 test "$have_glibc" = "yes" && AC_DEFINE(_GNU_SOURCE)
1507 1546
1508 AC_MSG_CHECKING(whether we are using SunPro C) 1547 AC_MSG_CHECKING(whether we are using SunPro C)
1509 AC_TRY_COMPILE([],[#ifndef __SUNPRO_C 1548 AC_TRY_COMPILE([],[#ifndef __SUNPRO_C
1510 #error Not a SunPro compiler :-( 1549 #error Not a SunPro compiler :-(
1511 ******* ======= ******** &&&&&&&& 1550 ******* ======= ******** &&&&&&&&
1613 CPP_boolean_to_sh(SYSTEM_MALLOC, system_malloc) 1652 CPP_boolean_to_sh(SYSTEM_MALLOC, system_malloc)
1614 CPP_boolean_to_sh(TERMINFO, have_terminfo) 1653 CPP_boolean_to_sh(TERMINFO, have_terminfo)
1615 CPP_boolean_to_sh(MAIL_USE_FLOCK, mail_use_flock) 1654 CPP_boolean_to_sh(MAIL_USE_FLOCK, mail_use_flock)
1616 CPP_boolean_to_sh(MAIL_USE_LOCKF, mail_use_lockf) 1655 CPP_boolean_to_sh(MAIL_USE_LOCKF, mail_use_lockf)
1617 1656
1618 #if 0
1619 #ifdef THIS_IS_CONFIGURE
1620
1621 /* Get the CFLAGS for tests in configure. */
1622 CPP_to_sh(C_DEBUG_SWITCH, c_debug_switch, -g)
1623 CPP_to_sh(C_OPTIMIZE_SWITCH, c_optimize_switch, -O)
1624 #ifdef __GNUC__
1625 configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '$SPECIFIED_CFLAGS'
1626 #else
1627 configure___ CFLAGS=C_DEBUG_SWITCH '$SPECIFIED_CFLAGS'
1628 #endif
1629
1630 #else /* not THIS_IS_CONFIGURE */
1631
1632 /* Get the CFLAGS for real compilation. */
1633 #ifdef __GNUC__
1634 configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '$SPECIFIED_CFLAGS'
1635 #else
1636 configure___ REAL_CFLAGS=C_DEBUG_SWITCH '$SPECIFIED_CFLAGS'
1637 #endif
1638
1639 #endif /* not THIS_IS_CONFIGURE */
1640 #endif /* 0 */
1641 ' > $tempcname 1657 ' > $tempcname
1642 dnl The value of CPP is a quoted variable reference, so we need to do this 1658 dnl The value of CPP is a quoted variable reference, so we need to do this
1643 dnl to get its actual value... 1659 dnl to get its actual value...
1644 CPP=`eval "echo $CPP"` 1660 CPP=`eval "echo $CPP"`
1645 define(TAB, [ ])dnl 1661 define(TAB, [ ])dnl
1646 changequote(, )dnl 1662 changequote(, )dnl
1647 eval `$CPP -Isrc $tempcname \ 1663 eval `$CPP -Isrc $tempcname \
1648 | sed -n -e "s/[ TAB]*=[ TAB\"]*/='/" -e "s/[ TAB\"]*\$/'/" -e "s/^configure___//p"` 1664 | sed -n -e "s/[ TAB]*=[ TAB\"]*/='/" -e "s/[ TAB\"]*\$/'/" -e "s/^configure___//p"`
1649 changequote([, ])dnl 1665 changequote([, ])dnl
1650 dnl if test -z "$SPECIFIED_CFLAGS"; then
1651 dnl eval `$CPP -Isrc -DTHIS_IS_CONFIGURE $tempcname \
1652 dnl | sed -n -e "s/ *=[[ \"]]*/='/" -e "s/[[ \"]]*\$/'/" -e "s/^configure___//p"`
1653 dnl else
1654 dnl REAL_CFLAGS="$CFLAGS"
1655 dnl fi
1656 1666
1657 rm $tempcname 1667 rm $tempcname
1658 1668
1659 dnl For debugging... 1669 dnl For debugging...
1660 test "$extra_verbose" = "yes" && \ 1670 test "$extra_verbose" = "yes" && \
1667 dnl Non-ordinary link usually requires -lc 1677 dnl Non-ordinary link usually requires -lc
1668 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc" 1678 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
1669 1679
1670 dnl Calculalate value of CFLAGS: 1680 dnl Calculalate value of CFLAGS:
1671 dnl Use either command line flag, environment var, or autodetection 1681 dnl Use either command line flag, environment var, or autodetection
1672 if test -z "$CFLAGS"; then 1682 if test "$cflags_specified" = "no"; then
1673 dnl Following values of CFLAGS are known to work well. 1683 dnl Following values of CFLAGS are known to work well.
1674 dnl Should we take debugging options into consideration? 1684 dnl Should we take debugging options into consideration?
1675 if test "$GCC" = "yes"; then 1685 if test "$GCC" = "yes"; then
1676 CFLAGS="-g -O2 -Wall -Wno-switch" 1686 CFLAGS="-g -O2 -Wall -Wno-switch"
1677 dnl I'm not convinced this is a good idea any more. -sb 1687 dnl I'm not convinced this is a good idea any more. -sb
1683 sunos4* ) CFLAGS="-xO2";; 1693 sunos4* ) CFLAGS="-xO2";;
1684 esac 1694 esac
1685 elif test "$CC" = "xlc"; then 1695 elif test "$CC" = "xlc"; then
1686 CFLAGS="-O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000" 1696 CFLAGS="-O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
1687 else 1697 else
1698 dnl ### Add tests for other compilers here...
1688 CFLAGS="-O" ;dnl The only POSIX-approved flag 1699 CFLAGS="-O" ;dnl The only POSIX-approved flag
1689 fi 1700 fi
1690 fi 1701 fi
1691 1702
1692 dnl Make sure linker flags not understood by GCC are properly wrapped. 1703 dnl Inform compiler that certain flags are meant for the linker
1704 dnl XE_PROTECT_LINKER_FLAGS(shell_var)
1705 define([XE_PROTECT_LINKER_FLAGS], [
1693 if test "$GCC" = "yes"; then 1706 if test "$GCC" = "yes"; then
1694 define([XE_GCC_WRAP_LDFLAGS], 1707 set x $[$1]; shift; [$1]=""
1695 [[$1_tmp]="$[$1]"; [$1]="" 1708 while test -n "[$]1"; do
1696 for arg in $[$1_tmp]; do 1709 case [$]1 in
1697 case "$arg" in 1710 -L | -l | -u ) [$1]="$[$1] [$]1 [$]2"; shift ;;
1698 -L* | -l* | -R* | -u* | -Wl* | -f*) [$1]="$[$1] $arg" ;; 1711 -L* | -l* | -u* | -Wl* ) [$1]="$[$1] [$]1" ;;
1699 -Xlinker* ) ;; 1712 -Xlinker* ) ;;
1700 * ) [$1]="$[$1] -Xlinker $arg" ;; 1713 * ) [$1]="$[$1] -Xlinker [$]1" ;;
1701 esac 1714 esac
1702 done])dnl 1715 shift
1703 XE_GCC_WRAP_LDFLAGS(ld_switch_system) 1716 done
1704 XE_GCC_WRAP_LDFLAGS(ld_switch_machine) 1717 fi])dnl
1705 XE_GCC_WRAP_LDFLAGS(LDFLAGS) 1718 XE_PROTECT_LINKER_FLAGS(ld_switch_system)
1706 XE_GCC_WRAP_LDFLAGS(ld_call_shared) 1719 XE_PROTECT_LINKER_FLAGS(ld_switch_machine)
1707 fi 1720 XE_PROTECT_LINKER_FLAGS(LDFLAGS)
1721 XE_PROTECT_LINKER_FLAGS(ld_call_shared)
1708 1722
1709 dnl Add s&m-determined objects (including unexec) to link line 1723 dnl Add s&m-determined objects (including unexec) to link line
1710 test -n "$objects_machine" && XE_ADD_OBJS($objects_machine) 1724 test -n "$objects_machine" && XE_ADD_OBJS($objects_machine)
1711 test -n "$objects_system" && XE_ADD_OBJS($objects_system) 1725 test -n "$objects_system" && XE_ADD_OBJS($objects_system)
1712 test -n "$unexec" && XE_ADD_OBJS($unexec) 1726 test -n "$unexec" && XE_ADD_OBJS($unexec)
1729 test "$GCC" = "yes" && XE_APPEND(-fno-gnu-linker, ld_switch_site) 1743 test "$GCC" = "yes" && XE_APPEND(-fno-gnu-linker, ld_switch_site)
1730 fi 1744 fi
1731 1745
1732 dnl Feed s&m crud to src/Makefile 1746 dnl Feed s&m crud to src/Makefile
1733 1747
1748 dnl Linux/powerpc needs the following magic for some reason
1749 test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/ppc.ldscript"
1750
1734 if test "$unexec" = "unexaix.o"; then 1751 if test "$unexec" = "unexaix.o"; then
1735 dnl AIX needs various hacks to make static linking work. 1752 dnl AIX needs various hacks to make static linking work.
1736 dnl This can go away if we ever figure out how to get dynamic linking on AIX.
1737 if test "$dynamic" = "no"; then 1753 if test "$dynamic" = "no"; then
1738 start_flags="-Wl,-bnso,-bnodelcsect" 1754 start_flags="-Wl,-bnso,-bnodelcsect"
1739 test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}" 1755 test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}"
1740 for f in "/lib/syscalls.exp" "$srcdir/src/m/ibmrs6000.inp"; do 1756 for f in "/lib/syscalls.exp" "/lib/threads.exp"; do
1741 if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi 1757 if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi
1742 done 1758 done
1743 for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do 1759 for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do
1744 if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi 1760 if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi
1745 done 1761 done
1746 dnl elif
1747 dnl Put any AIX/gcc/dynamic flags here - xlc needs none added
1748 fi 1762 fi
1749 elif test -n "$ld_text_start_addr"; then 1763 elif test -n "$ld_text_start_addr"; then
1750 start_flags="-T $ld_text_start_addr -e __start" 1764 start_flags="-T $ld_text_start_addr -e __start"
1751 fi 1765 fi
1752 AC_SUBST(start_flags) 1766 AC_SUBST(start_flags)
1771 dnl site-includes and site-libraries. 1785 dnl site-includes and site-libraries.
1772 1786
1773 dnl --site-prefixes (multiple dirs) 1787 dnl --site-prefixes (multiple dirs)
1774 if test -n "$site_prefixes"; then 1788 if test -n "$site_prefixes"; then
1775 for arg in $site_prefixes; do 1789 for arg in $site_prefixes; do
1776 case "$arg" in 1790 case "$arg" in
1777 -* ) ;; 1791 -* ) ;;
1778 * ) argi="-I${arg}/include" ; argl="-L${arg}/lib" ;; 1792 * ) argi="-I${arg}/include" ; argl="-L${arg}/lib" ;;
1779 esac 1793 esac
1780 XE_APPEND($argi, c_switch_site) 1794 XE_APPEND($argi, c_switch_site)
1781 XE_APPEND($argl, ld_switch_site) 1795 XE_APPEND($argl, ld_switch_site)
1782 done 1796 done
1783 fi 1797 fi
1789 XE_APPEND($arg, ld_switch_site) 1803 XE_APPEND($arg, ld_switch_site)
1790 done 1804 done
1791 fi 1805 fi
1792 1806
1793 dnl --site-includes (multiple dirs) 1807 dnl --site-includes (multiple dirs)
1794 if test -n "$site_includes" ; then 1808 if test -n "$site_includes"; then
1795 for arg in $site_includes; do 1809 for arg in $site_includes; do
1796 case "$arg" in -* ) ;; * ) arg="-I${arg}" ;; esac 1810 case "$arg" in -* ) ;; * ) arg="-I${arg}" ;; esac
1797 XE_APPEND($arg, c_switch_site) 1811 XE_APPEND($arg, c_switch_site)
1798 done 1812 done
1799 fi 1813 fi
1808 for dir in "/usr/ccs/lib"; do 1822 for dir in "/usr/ccs/lib"; do
1809 test -d "$dir" && XE_APPEND(-L${dir}, ld_switch_site) 1823 test -d "$dir" && XE_APPEND(-L${dir}, ld_switch_site)
1810 done 1824 done
1811 1825
1812 dnl --site-runtime-libraries (multiple dirs) 1826 dnl --site-runtime-libraries (multiple dirs)
1813 if test -n "$site_runtime_libraries" ; then 1827 if test -n "$site_runtime_libraries"; then
1814 LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/ */:/g'`" 1828 LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/ */:/g'`"
1815 export LD_RUN_PATH 1829 export LD_RUN_PATH
1816 fi 1830 fi
1817 1831
1818 dnl ------------------------------------- 1832 dnl -------------------------------------
1832 dnl and whether it works (or at least does no harm) 1846 dnl and whether it works (or at least does no harm)
1833 AC_MSG_CHECKING("for runtime libraries flag") 1847 AC_MSG_CHECKING("for runtime libraries flag")
1834 dash_r="" 1848 dash_r=""
1835 for try_dash_r in "-R" "-R " "-rpath "; do 1849 for try_dash_r in "-R" "-R " "-rpath "; do
1836 xe_check_libs="${try_dash_r}/no/such/file-or-directory" 1850 xe_check_libs="${try_dash_r}/no/such/file-or-directory"
1851 XE_PROTECT_LINKER_FLAGS(xe_check_libs)
1837 AC_TRY_LINK(, , dash_r="$try_dash_r") 1852 AC_TRY_LINK(, , dash_r="$try_dash_r")
1838 xe_check_libs="" 1853 xe_check_libs=""
1839 test -n "$dash_r" && break 1854 test -n "$dash_r" && break
1840 done 1855 done
1841 if test -n "$dash_r"; 1856 if test -n "$dash_r";
1906 fi 1921 fi
1907 fi dnl Compute $runpath 1922 fi dnl Compute $runpath
1908 1923
1909 if test -n "$runpath"; then 1924 if test -n "$runpath"; then
1910 ld_switch_run="${dash_r}${runpath}" 1925 ld_switch_run="${dash_r}${runpath}"
1926 XE_PROTECT_LINKER_FLAGS(ld_switch_run)
1911 test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath" 1927 test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
1912 fi 1928 fi
1913 fi 1929 fi
1914 ])dnl 1930 ])dnl
1915 XE_COMPUTE_RUNPATH() 1931 XE_COMPUTE_RUNPATH()
1952 if test "$GNU_MALLOC" = yes ; then 1968 if test "$GNU_MALLOC" = yes ; then
1953 GNU_MALLOC_reason=" 1969 GNU_MALLOC_reason="
1954 (Using Doug Lea's new malloc from the GNU C Library.)" 1970 (Using Doug Lea's new malloc from the GNU C Library.)"
1955 fi 1971 fi
1956 AC_DEFINE(DOUG_LEA_MALLOC) 1972 AC_DEFINE(DOUG_LEA_MALLOC)
1957 AC_DEFINE(USE_MINIMAL_TAGBITS)
1958 if test "$after_morecore_hook_exists" = "no" ; then 1973 if test "$after_morecore_hook_exists" = "no" ; then
1959 GNU_MALLOC_reason=" 1974 GNU_MALLOC_reason="
1960 (Using Doug Lea's new malloc from the Linux C Library.)" 1975 (Using Doug Lea's new malloc from the Linux C Library.)"
1961 AC_DEFINE(_NO_MALLOC_WARNING_) 1976 AC_DEFINE(_NO_MALLOC_WARNING_)
1962 fi 1977 fi
1963 with_minimal_tagbits=yes 1978 use_minimal_tagbits=yes
1964 fi 1979 fi
1965 1980
1966 dnl #### mcheck is broken in all versions of Linux libc and glibc. 1981 dnl #### mcheck is broken in all versions of Linux libc and glibc.
1967 dnl Try this again when 2.1 hits the streets. 1982 dnl Try this again when 2.1 hits the streets.
1968 dnl Avoid using free-hook.c if support exists for malloc debugging in libc 1983 dnl Avoid using free-hook.c if support exists for malloc debugging in libc
2128 if test "$with_x11" != "no"; then 2143 if test "$with_x11" != "no"; then
2129 dnl User-specified --x-includes or --x-libraries implies --with-x11. 2144 dnl User-specified --x-includes or --x-libraries implies --with-x11.
2130 test "$x_includes $x_libraries" != "NONE NONE" && \ 2145 test "$x_includes $x_libraries" != "NONE NONE" && \
2131 window_system=x11 with_x11=yes 2146 window_system=x11 with_x11=yes
2132 2147
2148 dnl Autodetection of X11 libraries and includes
2149 dnl -------------------------------------------
2150 dnl AC_PATH_XTRA thinks it can find our X headers and includes, but
2151 dnl it often gets it wrong, so we only use it as a last resort.
2152
2133 dnl $OPENWINHOME implies --x-includes and --x-libraries 2153 dnl $OPENWINHOME implies --x-includes and --x-libraries
2134 dnl Not (yet) handled by autoconf2 2154 dnl Not (yet) handled by autoconf2
2135 if test "$x_includes $x_libraries" = "NONE NONE"; then 2155 if test "$x_includes $x_libraries" = "NONE NONE" \
2136 if test -n "$OPENWINHOME" \ 2156 -a -n "$OPENWINHOME" \
2137 -a "$OPENWINHOME" != "/usr/openwin" \ 2157 -a "$OPENWINHOME" != "/usr/openwin" \
2138 -a -d "$OPENWINHOME"; then 2158 -a -d "$OPENWINHOME"; then
2139 test -d "$OPENWINHOME/lib" && x_libraries="$OPENWINHOME/lib" 2159 test -d "$OPENWINHOME/lib" && x_libraries="$OPENWINHOME/lib"
2140 test -d "$OPENWINHOME/include" && x_includes="$OPENWINHOME/include" 2160 test -d "$OPENWINHOME/include" && x_includes="$OPENWINHOME/include"
2141 test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include" 2161 test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include"
2142 else 2162 fi
2143 dnl AC_PATH_XTRA often guesses /usr/include, when some other 2163
2144 dnl include directory is a MUCH better guess (Linux, HP-UX 10.20). 2164 if test "$x_includes" = "NONE"; then
2145 dnl This is a workaround for idiot (esp. HP) system packagers. 2165 dnl AC_PATH_XTRA often guesses /usr/include, when some other
2146 for dir in "/usr/X11R6/include" "/usr/include/X11R6"; do 2166 dnl include directory is a MUCH better guess (Linux, HP-UX 10.20).
2147 if test -d "$dir/X11"; then x_includes="$dir"; break; fi 2167 dnl This is a workaround for idiot (esp. HP) system vendors, who
2148 done 2168 dnl provide a /usr/include/X11, but DON'T FULLY POPULATE IT.
2149 if test "$x_includes" != "NONE"; then 2169 for dir in "/usr/X11" "/usr/X11R6"; do
2150 for dir in "/usr/X11R6/lib" "/usr/lib/X11R6"; do 2170 if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi
2151 if test -d "$dir"; then x_libraries="$dir"; break; fi 2171 done
2152 done 2172 fi
2153 fi 2173
2154 fi 2174 if test "$x_libraries" = "NONE"; then
2175 for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do
2176 if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi
2177 done
2155 fi 2178 fi
2156 2179
2157 AC_PATH_XTRA # Autoconf claims to find X library and include dirs for us. 2180 AC_PATH_XTRA # Autoconf claims to find X library and include dirs for us.
2158 if test "$no_x" = "yes" 2181 if test "$no_x" = "yes"
2159 then with_x11=no window_system=none HAVE_X_WINDOWS=no 2182 then with_x11=no window_system=none HAVE_X_WINDOWS=no
2280 AC_CHECK_LIB(Xt, XtOpenDisplay, XE_PREPEND(-lXt, libs_x), 2303 AC_CHECK_LIB(Xt, XtOpenDisplay, XE_PREPEND(-lXt, libs_x),
2281 AC_MSG_ERROR("Unable to find X11 libraries.")) 2304 AC_MSG_ERROR("Unable to find X11 libraries."))
2282 2305
2283 AC_MSG_CHECKING(the version of X11 being used) 2306 AC_MSG_CHECKING(the version of X11 being used)
2284 AC_TRY_RUN([#include <X11/Intrinsic.h> 2307 AC_TRY_RUN([#include <X11/Intrinsic.h>
2285 main(int c, char* v[]) { return c>1 ? XlibSpecificationRelease : 0; }], 2308 int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }],
2286 [./conftest foobar; x11_release=$?],[x11_release=4],[x11_release=4]) 2309 [./conftest foobar; x11_release=$?],[x11_release=4],[x11_release=4])
2287 AC_MSG_RESULT(R${x11_release}) 2310 AC_MSG_RESULT(R${x11_release})
2288 AC_DEFINE_UNQUOTED(THIS_IS_X11R${x11_release}) 2311 AC_DEFINE_UNQUOTED(THIS_IS_X11R${x11_release})
2289 2312
2290 AC_CHECK_HEADERS(X11/Xlocale.h) 2313 AC_CHECK_HEADERS(X11/Xlocale.h)
2315 dnl #### Someone, please add a better function than main 2338 dnl #### Someone, please add a better function than main
2316 AC_CHECK_LIB(Xbsd, main, XE_PREPEND(-lXbsd, libs_x)) 2339 AC_CHECK_LIB(Xbsd, main, XE_PREPEND(-lXbsd, libs_x))
2317 2340
2318 dnl Problem with the MIT distribution of X on AIX 2341 dnl Problem with the MIT distribution of X on AIX
2319 if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then 2342 if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then
2320 XE_APPEND(-lc_r, libs_x) 2343 dnl X11R6 requires thread-safe code on AIX for some reason
2344 case "$CC" in
2345 "xlc" ) CC="xlc_r" ;;
2346 "xlC" ) CC="xlC_r" ;;
2347 "cc" ) CC="cc_r" ;;
2348 "gcc" )
2349 XE_PREPEND(-mthreads, X_CFLAGS)
2350 XE_PREPEND(-mthreads, libs_x)
2351 ;;
2352 esac
2321 fi 2353 fi
2322 2354
2323 fi dnl $with_x11 = yes 2355 fi dnl $with_x11 = yes
2324 2356
2325 if test "$with_msw" != "no"; then 2357 if test "$with_msw" != "no"; then
2346 fi 2378 fi
2347 fi 2379 fi
2348 2380
2349 test -z "$window_system" && window_system="none" 2381 test -z "$window_system" && window_system="none"
2350 2382
2351 if test "$window_system" = "none" ; then 2383 dnl Test for features that require a window system - ANY window system
2352 if test "$with_tty" = "no" ; then 2384 if test "$window_system" = "none"; then
2353 AC_MSG_ERROR([No window system support and no TTY support - Unable to proceed.]) 2385 for feature in menubars scrollbars toolbars dialogs
2354 fi 2386 do
2355 for feature in tooltalk cde offix session \ 2387 if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
2356 menubars scrollbars toolbars dialogs xim xmu \ 2388 AC_MSG_WARN([--with-$feature ignored: Not valid without window system support])
2389 fi
2390 eval "with_${feature}=no"
2391 done
2392 else
2393 test -z "$with_toolbars" && with_toolbars=yes
2394 fi
2395
2396 dnl ### Test for features that require mswindows support - currently none
2397 dnl ### MS-Windows folks: add code here..... (martin)
2398 if test "$with_msw" != "yes"; then
2399 for feature in MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES
2400 do
2401 if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
2402 AC_MSG_WARN([--with-$feature ignored: Not valid without MS-Windows support])
2403 fi
2404 eval "with_${feature}=no"
2405 done
2406 else
2407 :
2408 fi
2409
2410 dnl Test for features that require X11 support
2411 if test "$with_x11" != "yes"; then
2412 dnl It ought to be reasonable to have no output device at all, and only use
2413 dnl XEmacs in --batch mode.
2414 dnl if test "$with_tty" = "no" ; then
2415 dnl AC_MSG_ERROR([No window system support and no TTY support - Unable to proceed.])
2416 dnl fi
2417 for feature in tooltalk cde offix session xim xmu \
2357 tiff png jpeg gif xface xpm 2418 tiff png jpeg gif xface xpm
2358 do 2419 do
2359 if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then 2420 if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
2360 AC_MSG_WARN([--with-$feature ignored: Not valid without X support]) 2421 AC_MSG_WARN([--with-$feature ignored: Not valid without X support])
2361 fi 2422 fi
2362 eval "with_${feature}=no" 2423 eval "with_${feature}=no"
2363 done 2424 done
2364 else
2365 test -z "$with_toolbars" && with_toolbars=yes
2366 fi 2425 fi
2367 2426
2368 dnl FSF 19.29 has some bitmapdir stuff here. 2427 dnl FSF 19.29 has some bitmapdir stuff here.
2369 bitmapdir= 2428 bitmapdir=
2370 2429
2371 case "$window_system" in 2430 case "$window_system" in
2372 x11 ) HAVE_X_WINDOWS=yes; echo " Using X11." ;; 2431 x11 ) HAVE_X_WINDOWS=yes; echo " Using X11." ;;
2373 msw ) HAVE_X_WINDOWS=no; echo " Using MS-Windows." ;; 2432 msw ) HAVE_X_WINDOWS=no ; echo " Using MS-Windows." ;;
2374 none ) HAVE_X_WINDOWS=no ; echo " Using no window system." ;; 2433 none ) HAVE_X_WINDOWS=no ; echo " Using no window system." ;;
2375 esac 2434 esac
2376 2435
2377 case "$x_libraries" in *X11R4* ) 2436 case "$x_libraries" in *X11R4* )
2378 test "$opsys" = "hpux9" && opsysfile="s/hpux9-x11r4.h" 2437 test "$opsys" = "hpux9" && opsysfile="s/hpux9-x11r4.h"
2396 AC_DEFINE(HAVE_XAUTH) 2455 AC_DEFINE(HAVE_XAUTH)
2397 XE_SPACE(libs_xauth, $X_EXTRA_LIBS -lXau $libs_x $X_PRE_LIBS) 2456 XE_SPACE(libs_xauth, $X_EXTRA_LIBS -lXau $libs_x $X_PRE_LIBS)
2398 fi 2457 fi
2399 AC_SUBST(libs_xauth) 2458 AC_SUBST(libs_xauth)
2400 2459
2401 dnl Always compile OffiX except --without-offix is given or no 2460 dnl Always compile OffiX unless --without-offix is given or no
2402 dnl x11 support is compiled in or no standard Xmu. 2461 dnl X11 support is compiled in or no standard Xmu.
2403 OFFIX_O=""
2404 test "$window_system" != "x11" && with_offix=no 2462 test "$window_system" != "x11" && with_offix=no
2405 if test "$with_xmu" != yes -a "$with_x11" = yes; then 2463 if test "$with_xmu" != yes -a "$with_x11" = yes; then
2406 AC_MSG_WARN([No OffiX without real Xmu support]) 2464 AC_MSG_WARN([No OffiX without real Xmu support])
2407 with_offix=no 2465 with_offix=no
2408 fi 2466 fi
2409 test -z "$with_offix" && with_offix=yes 2467 test -z "$with_offix" && with_offix=yes
2410 if test "$with_offix" = "yes"; then 2468 if test "$with_offix" = "yes"; then
2411 AC_DEFINE(HAVE_OFFIX_DND) 2469 AC_DEFINE(HAVE_OFFIX_DND)
2412 OFFIX_O="offix.o" 2470 XE_ADD_OBJS(offix.o)
2413 fi 2471 fi
2414 AC_SUBST(OFFIX_O)
2415 2472
2416 dnl Autodetect tooltalk 2473 dnl Autodetect tooltalk
2417 test "$with_cde" = "yes" && with_tooltalk=yes # CDE requires tooltalk 2474 test "$with_cde" = "yes" && with_tooltalk=yes # CDE requires tooltalk
2418 if test "$with_tooltalk" != "no" ; then 2475 if test "$with_tooltalk" != "no" ; then
2419 dnl autodetect the location of tt_c.h 2476 dnl autodetect the location of tt_c.h
2448 need_motif=yes # CDE requires Motif 2505 need_motif=yes # CDE requires Motif
2449 fi 2506 fi
2450 2507
2451 dnl Autodetect LDAP 2508 dnl Autodetect LDAP
2452 AC_CHECKING(for LDAP) 2509 AC_CHECKING(for LDAP)
2453 test -z "$with_ldap" && { AC_CHECK_HEADER(ldap.h, ,with_ldap=no) } 2510 test -z "$with_ldap" && { AC_CHECK_HEADER(ldap.h, ,with_ldap=no) }
2454 test -z "$with_ldap" && { AC_CHECK_HEADER(lber.h, ,with_ldap=no) } 2511 test -z "$with_ldap" && { AC_CHECK_HEADER(lber.h, ,with_ldap=no) }
2455 test -z "$with_ldap" -o "$with_ldap" = "yes" && { AC_CHECK_LIB(ldap, ldap_open, with_umich_ldap=yes, with_umich_ldap=no, -llber) } 2512 if test "$with_ldap" != "no"; then
2456 test \( -z "$with_ldap" -o "$with_ldap" = "yes" \) -a "$with_umich_ldap" = "no" && { AC_CHECK_LIB(ldap10, ldap_set_option, with_ns_ldap=yes, with_ns_ldap=no) } 2513 test -z "$with_umich_ldap" && { AC_CHECK_LIB(ldap, ldap_open, with_umich_ldap=yes, with_umich_ldap=no, -llber) }
2457 test -z "$with_ldap" -a \( "$with_umich_ldap" = "yes" -o "$with_ns_ldap" = "yes" \) && with_ldap=yes 2514 test "$with_umich_ldap" = "no" && { AC_CHECK_LIB(ldap10, ldap_set_option, with_ns_ldap=yes, with_ns_ldap=no) }
2458 if test "$with_ldap" = "yes" -a "$with_umich_ldap" = "yes" ; then 2515 test -z "$with_ldap" -a \( "$with_umich_ldap" = "yes" -o "$with_ns_ldap" = "yes" \) && with_ldap=yes
2516 fi
2517 if test "$with_ldap" = "yes"; then
2459 AC_DEFINE(HAVE_LDAP) 2518 AC_DEFINE(HAVE_LDAP)
2460 AC_DEFINE(HAVE_UMICH_LDAP)
2461 XE_PREPEND(-llber, LIBS)
2462 XE_PREPEND(-lldap, LIBS)
2463 XE_ADD_OBJS(eldap.o) 2519 XE_ADD_OBJS(eldap.o)
2464 elif test "$with_ldap" = "yes" -a "$with_ns_ldap" = "yes" ; then 2520 if test "$with_umich_ldap" = "yes" ; then
2465 AC_DEFINE(HAVE_LDAP) 2521 AC_DEFINE(HAVE_UMICH_LDAP)
2466 AC_DEFINE(HAVE_NS_LDAP) 2522 XE_PREPEND(-llber, LIBS)
2467 XE_PREPEND(-lldap10, LIBS) 2523 XE_PREPEND(-lldap, LIBS)
2468 XE_ADD_OBJS(eldap.o) 2524 elif test "$with_ldap" = "yes" -a "$with_ns_ldap" = "yes" ; then
2469 elif test "$with_ldap" = "yes" ; then 2525 AC_DEFINE(HAVE_NS_LDAP)
2470 AC_DEFINE(HAVE_LDAP) 2526 XE_PREPEND(-lldap10, LIBS)
2471 XE_PREPEND(-lldap, LIBS) 2527 elif test "$with_ldap" = "yes" ; then
2472 XE_ADD_OBJS(eldap.o) 2528 XE_PREPEND(-lldap, LIBS)
2529 fi
2473 fi 2530 fi
2474 2531
2475 dnl ---------------------- 2532 dnl ----------------------
2476 dnl X11 Graphics libraries 2533 dnl X11 Graphics libraries
2477 dnl ---------------------- 2534 dnl ----------------------
2478 2535
2479 if test "$with_x11" = "yes"; then 2536 if test "$with_x11" = "yes"; then
2480 2537
2481 AC_CHECKING(for X11 graphics libraries) 2538 AC_CHECKING(for X11 graphics libraries)
2482 2539
2540 dnl Too many stupid linkers can't detect cascaded lib dependencies until runtime
2541 dnl So we always search for libz compression support.
2542 if test "$with_png $with_tiff" != "no no"; then
2543 AC_CHECK_LIB(c, inflate, [:], [
2544 AC_CHECK_LIB(z, inflate, [XE_PREPEND(-lz, libs_x)],[
2545 AC_CHECK_LIB(gz, inflate, [XE_PREPEND(-lgz, libs_x)])])])
2546 fi
2547
2483 dnl Autodetect Xpm 2548 dnl Autodetect Xpm
2484 AC_MSG_CHECKING(for Xpm - no older than 3.4f) 2549 if test -z "$with_xpm"; then
2485 xe_check_libs=-lXpm 2550 AC_MSG_CHECKING(for Xpm - no older than 3.4f)
2486 test -z "$with_xpm" && { AC_TRY_RUN([#include <X11/xpm.h> 2551 xe_check_libs=-lXpm
2487 int main(int c, char **v) { 2552 AC_TRY_RUN([#include <X11/xpm.h>
2488 return c == 1 ? 0 : 2553 int main(int c, char **v) {
2489 XpmIncludeVersion != XpmLibraryVersion() ? 1 : 2554 return c == 1 ? 0 :
2490 XpmIncludeVersion < 30406 ? 2 : 2555 XpmIncludeVersion != XpmLibraryVersion() ? 1 :
2491 0 ; 2556 XpmIncludeVersion < 30406 ? 2 : 0 ;}],
2492 }], [./conftest foobar; xpm_status=$?; 2557 [./conftest dummy_arg; xpm_status=$?;
2493 if test "$xpm_status" = "0"; then with_xpm=yes; else with_xpm=no; fi;], 2558 if test "$?" = "0"; then
2494 with_xpm=no, with_xpm=no) 2559 with_xpm=yes;
2495 } 2560 else
2496 xe_check_libs= 2561 with_xpm=no;
2497 AC_MSG_RESULT($with_xpm) 2562 if test "$?" = "1"; then
2498 if test "$xpm_status" = "1" -o "$xpm_status" = "2"; then 2563 xpm_problem="Xpm library version and header file version don't match!"
2499 test "$xpm_status" = "1" && problem="Xpm library version and header file version don't match!" 2564 elif test "$?" = "2"; then
2500 test "$xpm_status" = "2" && problem="Xpm library version is too old!" 2565 xpm_problem="Xpm library version is too old!"
2501 echo " 2566 else
2567 xpm_problem="Internal xpm detection logic error!"
2568 fi
2569 echo "
2502 *** WARNING *** $problem 2570 *** WARNING *** $problem
2503 I'm not touching that with a 10-foot pole! 2571 I'm not touching that with a 10-foot pole!
2504 If you really want to use the installed version of Xpm, rerun 2572 If you really want to use the installed version of Xpm, rerun
2505 configure --with-xpm=yes, but don't blame me if XEmacs crashes! 2573 configure --with-xpm=yes, but don't blame me if XEmacs crashes!"
2506 " 2574 fi],
2575 [with_xpm=no])
2576 xe_check_libs=
2577 AC_MSG_RESULT($with_xpm)
2507 fi 2578 fi
2508 if test "$with_xpm" = "yes"; then 2579 if test "$with_xpm" = "yes"; then
2509 AC_DEFINE(HAVE_XPM) 2580 AC_DEFINE(HAVE_XPM)
2510 XE_PREPEND(-lXpm, libs_x) 2581 XE_PREPEND(-lXpm, libs_x)
2511 fi 2582 fi
2537 AC_DEFINE(HAVE_JPEG) 2608 AC_DEFINE(HAVE_JPEG)
2538 XE_PREPEND(-ljpeg, libs_x) 2609 XE_PREPEND(-ljpeg, libs_x)
2539 fi 2610 fi
2540 2611
2541 dnl autodetect PNG 2612 dnl autodetect PNG
2542 test -z "$with_png" && { AC_CHECK_HEADER(png.h, , with_png=no) } 2613 if test -z "$with_png"; then
2543 test -z "$with_png" && { AC_CHECK_FUNC(pow, , with_png=no) } 2614 AC_MSG_CHECKING(for png.h - no older than 0.96)
2544 if test "$with_png" != "no"; then 2615 AC_EGREP_CPP(yes,
2545 for extra_libs in "" "-lz" "-lgz"; do 2616 [#include <png.h>
2546 AC_CHECK_LIB(png, png_set_strip_alpha, 2617 #if PNG_LIBPNG_VER >= 96
2547 png_libs="-lpng $extra_libs" with_png=yes; break,[:],$extra_libs) 2618 yes
2548 done 2619 #endif
2549 fi 2620 ], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); have_png=no])
2550 test -z "$with_png" && with_png=no 2621 fi
2622 test -z "$with_png" && { AC_CHECK_FUNC(pow, ,with_png=no) }
2623 test -z "$with_png" && { AC_CHECK_LIB(png, png_read_image,[:],with_png=no) }
2624 test -z "$with_png" && with_png=yes
2551 if test "$with_png" = "yes"; then 2625 if test "$with_png" = "yes"; then
2552 AC_DEFINE(HAVE_PNG) 2626 AC_DEFINE(HAVE_PNG)
2553 XE_PREPEND($png_libs, libs_x) 2627 XE_PREPEND(-lpng, libs_x)
2554 fi 2628 fi
2555 2629
2556 dnl autodetect TIFF 2630 dnl autodetect TIFF
2557 if test "$with_tiff" != no; then 2631 test -z "$with_tiff" && { AC_CHECK_HEADER(tiffio.h, ,with_tiff=no) }
2558 for extra_libs in "" "-lz" "-lgz"; do 2632 test -z "$with_tiff" && { AC_CHECK_LIB(tiff, TIFFReadScanline,[:],with_tiff=no) }
2559 AC_CHECK_LIB(tiff, TIFFReadScanline, 2633 test -z "$with_tiff" && with_tiff=yes
2560 tiff_libs="-ltiff $extra_libs" with_tiff=yes; break, [:], $extra_libs)
2561 done
2562 fi
2563 test -z "$with_tiff" && with_tiff=no
2564 if test "$with_tiff" = "yes"; then 2634 if test "$with_tiff" = "yes"; then
2565 AC_DEFINE(HAVE_TIFF) 2635 AC_DEFINE(HAVE_TIFF)
2566 XE_PREPEND($tiff_libs, libs_x) 2636 XE_PREPEND(-ltiff, libs_x)
2567 fi 2637 fi
2568 2638
2569 dnl Autodetect -lXaw 2639 dnl Autodetect -lXaw
2570 AC_CHECK_LIB(Xaw, XawScrollbarSetThumb, have_xaw=yes, have_xaw=no) 2640 AC_CHECK_LIB(Xaw, XawScrollbarSetThumb, have_xaw=yes, have_xaw=no)
2571 dnl if test "$have_xaw" = "yes"; then 2641 dnl if test "$have_xaw" = "yes"; then
2572 dnl AC_CHECK_HEADER(X11/Xaw/Reports.h, [ 2642 dnl AC_CHECK_HEADER(X11/Xaw/Reports.h, [
2573 dnl XE_APPEND(pkg-src/tree-x, MAKE_SUBDIR) 2643 dnl XE_APPEND(pkg-src/tree-x, MAKE_SUBDIR)
2576 2646
2577 dnl autodetect Motif - but only add to libs_x later (if necessary) 2647 dnl autodetect Motif - but only add to libs_x later (if necessary)
2578 AC_CHECK_HEADER(Xm/Xm.h, 2648 AC_CHECK_HEADER(Xm/Xm.h,
2579 [AC_CHECK_LIB(Xm, XmStringFree, have_motif=yes, have_motif=no)], 2649 [AC_CHECK_LIB(Xm, XmStringFree, have_motif=yes, have_motif=no)],
2580 have_motif=no) 2650 have_motif=no)
2651
2652 if test "$have_motif" = "yes"; then
2653 dnl autodetect lesstif
2654 AC_MSG_CHECKING(for Lesstif)
2655 AC_EGREP_CPP(yes,
2656 [#include <Xm/Xm.h>
2657 #ifdef LESSTIF_VERSION
2658 yes
2659 #endif
2660 ], have_lesstif=yes, have_lesstif=no)
2661 AC_MSG_RESULT($have_lesstif)
2662 fi
2581 2663
2582 fi dnl "$with_x11" = "yes" 2664 fi dnl "$with_x11" = "yes"
2583 2665
2584 dnl Finish ensuring that we have values for the various toolkit items. 2666 dnl Finish ensuring that we have values for the various toolkit items.
2585 dnl Not all toolkits support all widgets 2667 dnl Not all toolkits support all widgets
2659 echo "Please remove NAS configuration or build with X" 2741 echo "Please remove NAS configuration or build with X"
2660 exit 1 2742 exit 1
2661 fi 2743 fi
2662 fi 2744 fi
2663 2745
2664 if test "$with_gung" != "no"; then 2746 test "$use_minimal_tagbits" = "yes" && AC_DEFINE(USE_MINIMAL_TAGBITS)
2665 test "$with_minimal_tagbits" = "no" && AC_DEFINE(USE_MINIMAL_TAGBITS) 2747 test "$use_indexed_lrecord_implementation" = "yes" && \
2666 AC_DEFINE(USE_INDEXED_LRECORD_IMPLEMENTATION) 2748 AC_DEFINE(USE_INDEXED_LRECORD_IMPLEMENTATION)
2667 fi
2668 2749
2669 dnl ---------------------- 2750 dnl ----------------------
2670 dnl Mule-dependent options 2751 dnl Mule-dependent options
2671 dnl ---------------------- 2752 dnl ----------------------
2672 2753
2673 test -z "$with_mule" && with_mule=no 2754 test -z "$with_mule" && with_mule=no
2674 test -z "$with_file_coding" && with_file_coding=no 2755 test -z "$with_file_coding" && with_file_coding=no
2675 2756
2676 dnl if test "$with_mule" = "yes" && test ! -d "$srcdir/lisp/mule"; then 2757 dnl if test "$with_mule" = "yes" && test ! -d "$srcdir/lisp/mule"; then
2677 dnl echo "Attempt to Build with Mule without Mule/Lisp" 2758 dnl echo "Attempt to Build with Mule without Mule/Lisp"
2678 dnl echo "Please install the XEmacs/Mule tarball or" 2759 dnl echo "Please install the XEmacs/Mule tarball or"
2696 AC_CHECK_LIB(intl, strerror) 2777 AC_CHECK_LIB(intl, strerror)
2697 2778
2698 AC_CHECKING(for Mule input methods) 2779 AC_CHECKING(for Mule input methods)
2699 dnl Do we have the XmIm* routines? And if so, do we want to use them? 2780 dnl Do we have the XmIm* routines? And if so, do we want to use them?
2700 dnl XIM seems to be flaky except on Solaris... 2781 dnl XIM seems to be flaky except on Solaris...
2701 test -z "$with_xim" -a "$opsys" != "sol2" && with_xim=no 2782 dnl test -z "$with_xim" -a "$opsys" != "sol2" && with_xim=no
2702 case "$with_xim" in "" | "yes" ) 2783 case "$with_xim" in "" | "yes" )
2703 AC_CHECKING(for XIM) 2784 AC_CHECKING(for XIM)
2704 AC_CHECK_LIB(Xm, XmImMbLookupString, with_xim=motif, with_xim=xlib) 2785 dnl XIM + Lesstif is not (yet?) usable
2786 if test "$have_lesstif" = "yes"; then with_xim=xlib
2787 else AC_CHECK_LIB(Xm, XmImMbLookupString, with_xim=motif, with_xim=xlib)
2788 fi
2705 esac 2789 esac
2706 if test "$with_xim" != "no" ; then 2790 if test "$with_xim" != "no"; then
2707 AC_DEFINE(HAVE_XIM) 2791 AC_DEFINE(HAVE_XIM)
2708 if test "$with_xim" = "xlib"; then 2792 if test "$with_xim" = "xlib"; then
2709 AC_DEFINE(XIM_XLIB) 2793 AC_DEFINE(XIM_XLIB)
2710 XE_ADD_OBJS(input-method-xlib.o) 2794 XE_ADD_OBJS(input-method-xlib.o)
2711 fi 2795 fi
2871 if test $emacs_cv_localtime_cache = yes; then 2955 if test $emacs_cv_localtime_cache = yes; then
2872 AC_DEFINE(LOCALTIME_CACHE) 2956 AC_DEFINE(LOCALTIME_CACHE)
2873 fi 2957 fi
2874 2958
2875 if test "$HAVE_TIMEVAL" = "yes"; then 2959 if test "$HAVE_TIMEVAL" = "yes"; then
2876 AC_MSG_CHECKING(whether gettimeofday cannot accept two arguments) 2960 AC_MSG_CHECKING(whether gettimeofday accepts one or two arguments)
2877 AC_TRY_LINK([ 2961 AC_TRY_LINK([
2878 #ifdef TIME_WITH_SYS_TIME 2962 #ifdef TIME_WITH_SYS_TIME
2879 #include <sys/time.h> 2963 #include <sys/time.h>
2880 #include <time.h> 2964 #include <time.h>
2881 #else 2965 #else
2889 [ 2973 [
2890 struct timeval time; 2974 struct timeval time;
2891 struct timezone dummy; 2975 struct timezone dummy;
2892 gettimeofday (&time, &dummy); 2976 gettimeofday (&time, &dummy);
2893 ], 2977 ],
2894 [AC_MSG_RESULT(no)], 2978 [AC_MSG_RESULT(two)],
2895 [AC_MSG_RESULT(yes) 2979 [AC_MSG_RESULT(one)
2896 AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT)]) 2980 AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT)])
2897 fi 2981 fi
2898 2982
2899 2983
2900 AC_C_INLINE 2984 AC_C_INLINE
3260 test "$need_libdb" = "yes" && XE_PREPEND(-ldb, LIBS) 3344 test "$need_libdb" = "yes" && XE_PREPEND(-ldb, LIBS)
3261 else with_database_berkdb=no 3345 else with_database_berkdb=no
3262 fi 3346 fi
3263 fi 3347 fi
3264 3348
3265 if test "$with_database_gnudbm" = "yes" -o \ 3349 if test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
3266 "$with_database_dbm" = "yes" -o \ 3350 != "no no no"; then
3267 "$with_database_berkdb" = "yes"; then
3268 AC_DEFINE(HAVE_DATABASE) 3351 AC_DEFINE(HAVE_DATABASE)
3269 XE_ADD_OBJS(database.o) 3352 XE_ADD_OBJS(database.o)
3270 fi 3353 fi
3271 3354
3272 dnl Socks support 3355 dnl Socks support
3300 hpux*) ld_dynamic_link_flags="-Wl,-E" ;; 3383 hpux*) ld_dynamic_link_flags="-Wl,-E" ;;
3301 linux*) ld_dynamic_link_flags="-rdynamic" ;; 3384 linux*) ld_dynamic_link_flags="-rdynamic" ;;
3302 *) ;; 3385 *) ;;
3303 esac 3386 esac
3304 fi 3387 fi
3388
3389 dnl Unfortunately, just because we can link doesn't mean we can run.
3390 dnl One of the above link tests may have succeeded but caused resulting
3391 dnl executables to fail to run. Also any tests using AC_TRY_RUN will
3392 dnl have reported incorrect results.
3393 AC_TRY_RUN([int main(int c,char *v[]){return 0;}],[:],[
3394 echo ""
3395 echo "*** PANIC *** The C compiler can no longer build working executables."
3396 echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
3397 echo "*** PANIC *** The most likely reason for this problem is that configure"
3398 echo "*** PANIC *** links with shared libraries, but those libraries cannot be"
3399 echo "*** PANIC *** found at run time."
3400 echo "*** PANIC ***"
3401 echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig."
3402 echo "*** PANIC *** On other systems, try telling configure where to find the"
3403 echo "*** PANIC *** shared libraries using the --site-runtime-libraries option"
3404 echo "*** PANIC ***"
3405 echo "*** PANIC *** Another way to shoot yourself in the foot is to specify"
3406 echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed"
3407 echo "*** PANIC *** on your system. Don't do that."
3408 exit 1])
3305 3409
3306 dnl Process support (hardcoded) 3410 dnl Process support (hardcoded)
3307 dnl every system that supports this runs configure, the others don't 3411 dnl every system that supports this runs configure, the others don't
3308 3412
3309 dnl We're not ready for this yet. 3413 dnl We're not ready for this yet.
3485 test "$with_i18n3" = "yes" && AC_DEFINE(I18N3) 3589 test "$with_i18n3" = "yes" && AC_DEFINE(I18N3)
3486 test "$GCC" = "yes" && AC_DEFINE(USE_GCC) 3590 test "$GCC" = "yes" && AC_DEFINE(USE_GCC)
3487 test "$external_widget" = "yes" && AC_DEFINE(EXTERNAL_WIDGET) 3591 test "$external_widget" = "yes" && AC_DEFINE(EXTERNAL_WIDGET)
3488 test "$with_gnu_make" = "yes" && AC_DEFINE(USE_GNU_MAKE) 3592 test "$with_gnu_make" = "yes" && AC_DEFINE(USE_GNU_MAKE)
3489 test "$no_doc_file" = "yes" && AC_DEFINE(NO_DOC_FILE) 3593 test "$no_doc_file" = "yes" && AC_DEFINE(NO_DOC_FILE)
3490 test "$const_is_losing" = "yes" && AC_DEFINE(CONST_IS_LOSING) 3594 dnl test "$const_is_losing" = "yes" && AC_DEFINE(CONST_IS_LOSING)
3491 test "$with_quantify" = "yes" && AC_DEFINE(QUANTIFY) 3595 test "$with_quantify" = "yes" && AC_DEFINE(QUANTIFY)
3492 test "$with_pop" = "yes" && AC_DEFINE(MAIL_USE_POP) 3596 test "$with_pop" = "yes" && AC_DEFINE(MAIL_USE_POP)
3493 test "$with_kerberos" = "yes" && AC_DEFINE(KERBEROS) 3597 test "$with_kerberos" = "yes" && AC_DEFINE(KERBEROS)
3494 test "$with_hesiod" = "yes" && AC_DEFINE(HESIOD) 3598 test "$with_hesiod" = "yes" && AC_DEFINE(HESIOD)
3495 test "$use_union_type" != yes && AC_DEFINE(NO_UNION_TYPE) 3599 test "$use_union_type" = "yes" && AC_DEFINE(USE_UNION_TYPE)
3496 3600
3497 dnl ------------------------------- 3601 dnl -------------------------------
3498 dnl Report on what we decided to do 3602 dnl Report on what we decided to do
3499 dnl ------------------------------- 3603 dnl -------------------------------
3500 3604
3622 echo " Clash detection will use \"$lockdir\" for locking files." 3726 echo " Clash detection will use \"$lockdir\" for locking files."
3623 echo " movemail will use \"$mail_locking\" for locking mail spool files." 3727 echo " movemail will use \"$mail_locking\" for locking mail spool files."
3624 test "$with_pop" = yes && echo " Using POP for mail access" 3728 test "$with_pop" = yes && echo " Using POP for mail access"
3625 test "$with_kerberos" = yes && echo " Using Kerberos for POP authentication" 3729 test "$with_kerberos" = yes && echo " Using Kerberos for POP authentication"
3626 test "$with_hesiod" = yes && echo " Using Hesiod to get POP server host" 3730 test "$with_hesiod" = yes && echo " Using Hesiod to get POP server host"
3627 test "$use_union_type" = yes && echo " Using the union type for Lisp_Objects." 3731 test "$use_union_type" = yes && echo " Using the union type for Lisp_Objects."
3628 test "$with_minimal_tagbits" != "no" -o "$with_gung" != "no" && \ 3732 test "$use_minimal_tagbits" = yes && echo " Using Lisp_Objects with minimal tagbits."
3629 echo " Using Lisp_Objects with minimal tagbits." 3733 test "$use_indexed_lrecord_implementation" = yes && echo " Using indexed lrecord implementation."
3630 test "$with_gung" != "no" && echo " Using indexed lrecord implementation."
3631 test "$debug" = yes && echo " Compiling in extra code for debugging." 3734 test "$debug" = yes && echo " Compiling in extra code for debugging."
3632 test "$memory_usage_stats" = yes && echo " Compiling in code for checking XEmacs memory usage." 3735 test "$memory_usage_stats" = yes && echo " Compiling in code for checking XEmacs memory usage."
3633 test "$usage_tracking" = yes && echo " Compiling with usage tracking active (Sun internal)." 3736 test "$usage_tracking" = yes && echo " Compiling with usage tracking active (Sun internal)."
3634 if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \ 3737 if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \
3635 != "no no no no no"; then 3738 != "no no no no no"; then
3662 exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([[^/]]\)/*$,\1,'` 3765 exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([[^/]]\)/*$,\1,'`
3663 3766
3664 dnl Build Makefile.in's from Makefile.in.in's 3767 dnl Build Makefile.in's from Makefile.in.in's
3665 dnl except ./Makefile from $srcdir/Makefile.in 3768 dnl except ./Makefile from $srcdir/Makefile.in
3666 3769
3667 AC_OUTPUT($internal_makefile_list lib-src/config.values,[ 3770 for file in $internal_makefile_list; do
3668 for dir in $MAKE_SUBDIR; do 3771 test "$file" = src/Makefile.in && \
3772 file="src/Makefile.in:src/Makefile.in.in:src/depend"
3773 ac_output_files="${ac_output_files+$ac_output_files }$file"
3774 done
3775 ac_output_files="$ac_output_files lib-src/config.values"
3776
3777 AC_OUTPUT($ac_output_files,
3778 [for dir in $MAKE_SUBDIR; do
3669 echo creating $dir/Makefile 3779 echo creating $dir/Makefile
3670 ( 3780 (
3671 changequote(<<, >>)dnl 3781 changequote(<<, >>)dnl
3672 cd $dir 3782 cd $dir
3673 rm -f junk.c 3783 rm -f junk.c
3690 -e 's/^[ TAB][ TAB]*$//' \ 3800 -e 's/^[ TAB][ TAB]*$//' \
3691 -e 's/^ /TAB/' \ 3801 -e 's/^ /TAB/' \
3692 | sed -n -e '/^..*$/p' \ 3802 | sed -n -e '/^..*$/p' \
3693 | sed '/^"/ { 3803 | sed '/^"/ {
3694 s/\\\([\"]\)/\1/g 3804 s/\\\([\"]\)/\1/g
3695 s/^"// 3805 s/^[ TAB]*"//
3696 s/"$// 3806 s/"[ TAB]*$//
3697 }' > Makefile.new 3807 }' > Makefile.new
3698 chmod 444 Makefile.new 3808 chmod 444 Makefile.new
3699 mv -f Makefile.new Makefile 3809 mv -f Makefile.new Makefile
3700 rm -f junk.c junk.cpp 3810 rm -f junk.c junk.cpp
3701 changequote([, ])dnl 3811 changequote([, ])dnl