comparison configure.in @ 155:43dd3413c7c7 r20-3b4

Import from CVS: tag r20-3b4
author cvs
date Mon, 13 Aug 2007 09:39:39 +0200
parents 25f70ba0133c
children 6b37e6ddd302
comparison
equal deleted inserted replaced
154:94141801dd7e 155:43dd3413c7c7
57 dnl - suport for extra-verbosity 57 dnl - suport for extra-verbosity
58 dnl - ordinary libs are handled separately from X libs (might be a mistake) 58 dnl - ordinary libs are handled separately from X libs (might be a mistake)
59 dnl - various random kludges (e.g. -with-dnet=no 59 dnl - various random kludges (e.g. -with-dnet=no
60 60
61 dnl PRINT_VAR(var, var, ...) prints values of shell variables 61 dnl PRINT_VAR(var, var, ...) prints values of shell variables
62 define([PRINT_VAR],[ifelse([$#] ,0, , [$#], 1, echo "[$1]=\"$[$1]\"", echo "[$1] = $[$1]" 62 define([PRINT_VAR],[ifelse([$#] ,0, , [$#], 1, echo "[$1] = \"$[$1]\"", echo "[$1] = \"$[$1]\""
63 [PRINT_VAR(builtin([shift],$@))])]) 63 [PRINT_VAR(builtin([shift],$@))])])
64 64
65 dnl Disable cache files: 65 dnl Disable cache files:
66 dnl This is controversial, but I am convinced this is the right way to go, 66 dnl This is controversial, but I am convinced this is the right way to go,
67 dnl at least by default. Otherwise there are too many surprises. 67 dnl at least by default. Otherwise there are too many surprises.
204 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&AC_FD_CC' 204 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&AC_FD_CC'
205 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&AC_FD_CC' 205 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&AC_FD_CC'
206 cross_compiling=no 206 cross_compiling=no
207 ]) 207 ])
208 208
209 dnl The construct foo=`echo $w1 $w2 $w3` fails on some systems if $w1 = -e or -n
210 dnl So we use the following instead.
211 dnl XE_SPACE(var, words)
212 define([XE_SPACE],[
213 T=""
214 for W in $2; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
215 $1="$T"
216 ])dnl
209 217
210 dnl XE_ADD_OBJS(foo.o ...) 218 dnl XE_ADD_OBJS(foo.o ...)
211 define([XE_ADD_OBJS], 219 define([XE_ADD_OBJS],
212 [extra_objs="$extra_objs [$1]" && dnl 220 [extra_objs="$extra_objs [$1]" && dnl
213 if test "$extra_verbose" = "yes"; then 221 if test "$extra_verbose" = "yes"; then
248 srcdir= 256 srcdir=
249 target=NONE 257 target=NONE
250 verbose= 258 verbose=
251 x_includes=NONE 259 x_includes=NONE
252 x_libraries=NONE 260 x_libraries=NONE
261 CDPATH=.; export CDPATH
253 262
254 dnl Allow this script to work with zsh, by setting sh emulation options 263 dnl Allow this script to work with zsh, by setting sh emulation options
255 if test -n "$ZSH_VERSION"; then 264 if test -n "$ZSH_VERSION"; then
256 setopt NO_BAD_PATTERN NO_BANG_HIST NO_BG_NICE NO_EQUALS NO_FUNCTION_ARGZERO 265 setopt NO_BAD_PATTERN NO_BANG_HIST NO_BG_NICE NO_EQUALS NO_FUNCTION_ARGZERO
257 setopt GLOB_SUBST NO_HUP INTERACTIVE_COMMENTS KSH_ARRAYS NO_MULTIOS NO_NOMATCH 266 setopt GLOB_SUBST NO_HUP INTERACTIVE_COMMENTS KSH_ARRAYS NO_MULTIOS NO_NOMATCH
850 dnl testers, at large sites, have said they have their X files 859 dnl testers, at large sites, have said they have their X files
851 dnl installed in odd places. 860 dnl installed in odd places.
852 861
853 dnl Has the user specified one of the path options? 862 dnl Has the user specified one of the path options?
854 prefix | exec_prefix | bindir | datadir | statedir | libdir | \ 863 prefix | exec_prefix | bindir | datadir | statedir | libdir | \
855 mandir | infodir | lispdir | etcdir | lockdir | archlibdir | \ 864 mandir | infodir | lispdir | etcdir | lockdir | pkgdir | archlibdir | \
856 sitelispdir | docdir ) 865 sitelispdir | docdir )
857 dnl If the value was omitted, get it from the next argument. 866 dnl If the value was omitted, get it from the next argument.
858 if test "$valomitted" = "yes"; then 867 if test "$valomitted" = "yes"; then
859 if test "$#" = 0; then 868 if test "$#" = 0; then
860 USAGE_ERROR("The \`--$optname' option requires a value."); 869 USAGE_ERROR("The \`--$optname' option requires a value.");
1708 ' > $tempcname 1717 ' > $tempcname
1709 dnl The value of CPP is a quoted variable reference, so we need to do this 1718 dnl The value of CPP is a quoted variable reference, so we need to do this
1710 dnl to get its actual value... 1719 dnl to get its actual value...
1711 CPP=`eval "echo $CPP"` 1720 CPP=`eval "echo $CPP"`
1712 eval `$CPP -Isrc $tempcname \ 1721 eval `$CPP -Isrc $tempcname \
1713 | grep 'configure___' \ 1722 | sed -n -e "s/ *= */='/" -e "s/ *\$/'/" -e "s/^configure___//p"`
1714 | sed -n -e 's/^configure___ \([[^= ]]* *=\)\(.*\)$/\1\`echo \2\`/p'`
1715 if test -z "$SPECIFIED_CFLAGS"; then 1723 if test -z "$SPECIFIED_CFLAGS"; then
1716 eval `$CPP -Isrc -DTHIS_IS_CONFIGURE $tempcname \ 1724 eval `$CPP -Isrc -DTHIS_IS_CONFIGURE $tempcname \
1717 | grep 'configure___' \ 1725 | sed -n -e "s/ *= */='/" -e "s/ *\$/'/" -e "s/^configure___//p"`
1718 | sed -n -e 's/^configure___ \([[^= ]]* *=\)\(.*\)$/\1\`echo \2\`/p'`
1719 else 1726 else
1720 REAL_CFLAGS="$CFLAGS" 1727 REAL_CFLAGS="$CFLAGS"
1721 fi 1728 fi
1722 1729
1723 rm $tempcname 1730 rm $tempcname
1789 then AC_MSG_RESULT("\"${dash_r}\"") 1796 then AC_MSG_RESULT("\"${dash_r}\"")
1790 else AC_MSG_RESULT(NONE) 1797 else AC_MSG_RESULT(NONE)
1791 fi 1798 fi
1792 fi 1799 fi
1793 1800
1801 dnl XE_ADD_RUNPATH_DIR(directory)
1802 define([XE_ADD_RUNPATH_DIR],[
1803 xe_runpath_dir=$1
1804 if test "$xe_runpath_dir" != "/lib" -a \
1805 "$xe_runpath_dir" != "/usr/lib" -a \
1806 -n "`ls ${xe_runpath_dir}/*.s[[ol]] 2>/dev/null`"; then
1807 test -n "$runpath" && runpath="${runpath}:"
1808 runpath="${runpath}${xe_runpath_dir}"
1809 fi
1810 ])dnl
1811
1812 dnl XE_COMPUTE_RUNPATH()
1794 define([XE_COMPUTE_RUNPATH],[ 1813 define([XE_COMPUTE_RUNPATH],[
1795 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then 1814 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
1796 dnl Remove runtime paths from current ld switches 1815 dnl Remove runtime paths from current ld switches
1797 ld_switch_site="`echo $ld_switch_site | sed \"s/${dash_r}[[^ ]]*//\"`" 1816 ld_switch_site="`echo $ld_switch_site | sed \"s/${dash_r}[[^ ]]*//\"`"
1798 ld_switch_x_site="`echo $ld_switch_x_site | sed \"s/${dash_r}[[^ ]]*//\"`" 1817 ld_switch_x_site="`echo $ld_switch_x_site | sed \"s/${dash_r}[[^ ]]*//\"`"
1799 dnl PRINT_VAR(ld_switch_site, ld_switch_x_site) 1818 dnl PRINT_VAR(ld_switch_site, ld_switch_x_site)
1800 1819
1801 dnl Fix up Runtime path 1820 dnl Fix up Runtime path
1802 dnl If LD_RUN_PATH is set in environment, use that. 1821 dnl If LD_RUN_PATH is set in environment, use that.
1803 dnl In this case, assume user has set the right value. 1822 dnl In this case, assume user has set the right value.
1823 runpath=""
1804 if test -n "$LD_RUN_PATH"; then 1824 if test -n "$LD_RUN_PATH"; then
1805 runpath="$LD_RUN_PATH" 1825 runpath="$LD_RUN_PATH"
1826 elif test "$GCC" = "yes"; then
1827 dnl Compute runpath from gcc's -v output
1828 echo "int main(int argc, char *argv[[]]) {return 0;}" > conftest.c
1829 xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
1830 for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
1831 case "$arg" in P,* | -L* | -R* )
1832 for dir in `echo "$arg" | sed -e 's/^..//' -e 'y/:/ /'`; do
1833 XE_ADD_RUNPATH_DIR("$dir")
1834 done ;;
1835 esac
1836 done
1837 rm -f conftest*
1806 else 1838 else
1807 dnl Add all directories with .so files to runpath 1839 dnl Add all directories with .so files to runpath
1808 runpath=""
1809 for arg in $ld_switch_site $ld_switch_x_site; do 1840 for arg in $ld_switch_site $ld_switch_x_site; do
1810 case "$arg" in -L* ) 1841 case "$arg" in -L*) XE_ADD_RUNPATH_DIR(`echo "$arg" | sed 's/^-L//'`);; esac
1811 dir=`echo "$arg" | sed 's/^-L//'`
1812 if test -n "`ls ${dir}/*.s[[ol]] 2>/dev/null`"; then
1813 test -n "$runpath" && runpath="${runpath}:"
1814 runpath="${runpath}${dir}"
1815 fi
1816 ;;
1817 esac
1818 done 1842 done
1819 dnl Sometimes /opt/SUNWdt/lib is the only installed Motif available 1843 dnl Sometimes /opt/SUNWdt/lib is the only installed Motif available
1820 case "$canonical" in *-solaris2.[[1-4]]* ) 1844 case "$canonical" in *-solaris2.[[1-4]]* )
1821 test "$need_motif" = "yes" && runpath="${runpath}:/opt/SUNWdt/lib" ;; 1845 test "$need_motif" = "yes" && runpath="${runpath}:/opt/SUNWdt/lib" ;;
1822 esac 1846 esac
1823 fi 1847 fi dnl Compute $runpath
1824 1848
1825 if test -n "$runpath"; then 1849 if test -n "$runpath"; then
1826 ld_switch_run="${dash_r}${runpath}" 1850 ld_switch_run="${dash_r}${runpath}"
1827 test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath" 1851 test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
1828 fi 1852 fi
1858 dnl checks for UNIX variants 1882 dnl checks for UNIX variants
1859 AC_AIX 1883 AC_AIX
1860 1884
1861 dnl checks for header files 1885 dnl checks for header files
1862 AC_CHECK_HEADERS(mach/mach.h sys/stropts.h sys/timeb.h sys/time.h unistd.h) 1886 AC_CHECK_HEADERS(mach/mach.h sys/stropts.h sys/timeb.h sys/time.h unistd.h)
1863 AC_CHECK_HEADERS(utime.h sys/wait.h libintl.h locale.h libgen.h) 1887 AC_CHECK_HEADERS(utime.h locale.h libgen.h)
1864 AC_CHECK_HEADERS(linux/version.h kstat.h sys/pstat.h inttypes.h) 1888 AC_CHECK_HEADERS(linux/version.h kstat.h sys/pstat.h inttypes.h)
1889 AC_HEADER_SYS_WAIT
1865 AC_HEADER_STDC 1890 AC_HEADER_STDC
1866 AC_HEADER_TIME 1891 AC_HEADER_TIME
1867 AC_DECL_SYS_SIGLIST 1892 AC_DECL_SYS_SIGLIST
1868 1893
1869 dnl Some systems have utime.h but do not declare the struct anyplace. 1894 dnl Some systems have utime.h but do not declare the struct anyplace.
1962 else AC_MSG_RESULT(no) 1987 else AC_MSG_RESULT(no)
1963 fi 1988 fi
1964 1989
1965 dnl Dynodump (Solaris 2.x, x<6) 1990 dnl Dynodump (Solaris 2.x, x<6)
1966 AC_MSG_CHECKING(for dynodump) 1991 AC_MSG_CHECKING(for dynodump)
1967 case "$canonical" in *-solaris2.[[0-5]]* ) 1992 case "$opsys" in sol2* )
1968 AC_MSG_RESULT(yes) 1993 AC_MSG_RESULT(yes)
1969 AC_DEFINE(DYNODUMP) 1994 AC_DEFINE(DYNODUMP)
1970 XE_APPEND(dynodump, MAKE_SUBDIR) 1995 XE_APPEND(dynodump, MAKE_SUBDIR)
1971 case "$canonical" in 1996 case "$machine" in
1972 sparc* ) dynodump_arch=sparc ;; 1997 sparc ) dynodump_arch=sparc ;;
1973 powerpc* ) dynodump_arch=ppc ;; 1998 *86* ) dynodump_arch=i386 ;;
1974 i*86* ) dynodump_arch=i386 ;; 1999 powerpc ) dynodump_arch=ppc ;;
1975 esac 2000 esac
1976 dnl Dynodump requires the system linker 2001 dnl Dynodump requires the system linker
1977 test "$GCC" = "yes" && XE_APPEND(-fno-gnu-linker, ld_switch_site) ;; 2002 test "$GCC" = "yes" && XE_APPEND(-fno-gnu-linker, ld_switch_site) ;;
1978 *) AC_MSG_RESULT(no) ;; 2003 *) AC_MSG_RESULT(no) ;;
2004 esac
2005
2006 dnl Link with "-z ignore" on Solaris if supported
2007 case "$opsys" in sol2-[[6-9]]* )
2008 AC_MSG_CHECKING(for \"-z ignore\" linker flag)
2009 case "`ld -h 2>&1`" in
2010 *-z\ ignore\|record* ) AC_MSG_RESULT(yes)
2011 XE_PREPEND(-z ignore, ld_switch_site) ;;
2012 *) AC_MSG_RESULT(no) ;;
2013 esac ;;
1979 esac 2014 esac
1980 2015
1981 dnl ---------------------- 2016 dnl ----------------------
1982 dnl Choose a window system 2017 dnl Choose a window system
1983 dnl ---------------------- 2018 dnl ----------------------
2146 done 2181 done
2147 else 2182 else
2148 test -z "$with_toolbars" && with_toolbars=yes 2183 test -z "$with_toolbars" && with_toolbars=yes
2149 fi 2184 fi
2150 2185
2151 if false; then # obsolete
2152 runtime_arg="-R${dash_r_space}"
2153
2154 case "$canonical" in
2155 *-sun-solaris* | *-sun-sunos5* )
2156 add_runtime_flag=yes ;;
2157 *-sgi-irix5.* )
2158 dnl In the IRIX 5.3 ld, only the last -rpath arg has any effect. This is
2159 dnl fundamentaly incompatible with having separate LD_SWITCH_X_SITE
2160 dnl and LD_SWITCH_SITE variables. Fortunately, SGI fixed this by 6.2.
2161 if test -n "$x_libraries" || test -n "$site_runtime_libraries" ; then
2162 (echo "WARNING: The IRIX 5 ld ignores all but the last -rpath argument,";
2163 echo " so if you need to specify more than one additional";
2164 echo " runtime library directory, you will have to do so";
2165 echo " manually by setting the environment variable";
2166 echo " LD_SWITCH_SITE to '-rpath <path>' before running";
2167 echo " configure. If you have only one additional directory,"
2168 echo " you can specify it with --site-runtime-libraries.") >&2
2169 fi
2170 runtime_arg="-rpath " ;;
2171 *-sgi-irix* )
2172 dnl Note that IRIX gcc (as of 2.7.2) does not accept -rpath, so
2173 dnl using it can cause trouble. Specifying --use-gcc=no will work
2174 dnl around this, but the real problem is that configure uses $LDFLAGS
2175 dnl as arguments to $(CC), instead of using prefix-args like the
2176 dnl src/Makefile does.
2177 add_runtime_flag=yes;
2178 runtime_arg="-rpath " ;;
2179 esac
2180 fi
2181
2182
2183 dnl FSF 19.29 has some bitmapdir stuff here. 2186 dnl FSF 19.29 has some bitmapdir stuff here.
2184 bitmapdir= 2187 bitmapdir=
2185 2188
2186 case "$window_system" in 2189 case "$window_system" in
2187 x11 ) HAVE_X_WINDOWS=yes; echo " Using X11." ;; 2190 x11 ) HAVE_X_WINDOWS=yes; echo " Using X11." ;;
2279 AC_DEFINE(HAVE_GIF) 2282 AC_DEFINE(HAVE_GIF)
2280 XE_ADD_OBJS(dgif_lib.o gif_err.o gifalloc.o) 2283 XE_ADD_OBJS(dgif_lib.o gif_err.o gifalloc.o)
2281 fi 2284 fi
2282 2285
2283 dnl Autodetect Xpm 2286 dnl Autodetect Xpm
2284 test -z "$with_xpm" && { AC_CHECK_HEADER(X11/xpm.h, ,with_xpm=no) } 2287 test -z "$with_xpm" && { AC_CHECK_HEADER(X11/xpm.h, ,with_xpm=no) }
2285 test -z "$with_xpm" && { AC_CHECK_LIB(Xpm, XpmReadFileToData,[:],with_xpm=no) } 2288 test -z "$with_xpm" && { AC_CHECK_LIB(Xpm, XpmFree,[:],with_xpm=no) }
2286 test -z "$with_xpm" && with_xpm=yes 2289 test -z "$with_xpm" && with_xpm=yes
2287 if test "$with_xpm" = "yes"; then 2290 if test "$with_xpm" = "yes"; then
2288 AC_DEFINE(HAVE_XPM) 2291 AC_DEFINE(HAVE_XPM)
2289 XE_PREPEND(-lXpm, libs_x) 2292 XE_PREPEND(-lXpm, libs_x)
2290 fi 2293 fi
2403 AC_CHECKING(for Mule-related features) 2406 AC_CHECKING(for Mule-related features)
2404 AC_DEFINE(MULE) 2407 AC_DEFINE(MULE)
2405 XE_ADD_OBJS(mule.o mule-ccl.o mule-charset.o mule-coding.o) 2408 XE_ADD_OBJS(mule.o mule-ccl.o mule-charset.o mule-coding.o)
2406 2409
2407 dnl Use -lintl to get internationalized strerror for Mule 2410 dnl Use -lintl to get internationalized strerror for Mule
2411 AC_CHECK_HEADERS(libintl.h)
2408 AC_CHECK_LIB(intl, strerror) 2412 AC_CHECK_LIB(intl, strerror)
2409 2413
2410 AC_CHECKING(for Mule input methods) 2414 AC_CHECKING(for Mule input methods)
2411 dnl Do we have the XmIm* routines? And if so, do we want to use them? 2415 dnl Do we have the XmIm* routines? And if so, do we want to use them?
2412 dnl XIM seems to be flaky except on Solaris... 2416 dnl XIM seems to be flaky except on Solaris...
2429 fi dnl with_xim 2433 fi dnl with_xim
2430 2434
2431 dnl Autodetect WNN 2435 dnl Autodetect WNN
2432 test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support 2436 test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
2433 test -z "$with_wnn" && { AC_CHECK_HEADER(wnn/jllib.h, ,with_wnn=no) } 2437 test -z "$with_wnn" && { AC_CHECK_HEADER(wnn/jllib.h, ,with_wnn=no) }
2434 test -z "$with_wnn" && { AC_CHECK_LIB(wnn,jl_dic_list,[:],with_wnn=no) } 2438 test -z "$with_wnn" && { AC_CHECK_LIB(wnn,jl_dic_list_e, ,with_wnn=no) }
2435 test -z "$with_wnn" && with_wnn=yes 2439 test -z "$with_wnn" && with_wnn=yes
2436 if test "$with_wnn" = "yes"; then 2440 if test "$with_wnn" = "yes"; then
2437 AC_DEFINE(HAVE_WNN) 2441 AC_DEFINE(HAVE_WNN)
2438 XE_PREPEND(-lwnn, libs_x) 2442 XE_PREPEND(-lwnn, libs_x)
2439 XE_ADD_OBJS(mule-wnnfns.o) 2443 XE_ADD_OBJS(mule-wnnfns.o)
2449 if test "$with_canna" = "yes"; then 2453 if test "$with_canna" = "yes"; then
2450 AC_DEFINE(HAVE_CANNA) 2454 AC_DEFINE(HAVE_CANNA)
2451 XE_PREPEND(-lcanna -lRKC, libs_x) 2455 XE_PREPEND(-lcanna -lRKC, libs_x)
2452 XE_ADD_OBJS(mule-canna.o) 2456 XE_ADD_OBJS(mule-canna.o)
2453 fi 2457 fi
2458
2454 else dnl "$with_mule" = "no" 2459 else dnl "$with_mule" = "no"
2455 for feature in xim canna wnn; do 2460 for feature in xim canna wnn; do
2456 if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then 2461 if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
2457 AC_MSG_WARN("--with-${feature} ignored: Not valid without Mule support") 2462 AC_MSG_WARN("--with-${feature} ignored: Not valid without Mule support")
2458 fi 2463 fi
2567 AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT)]) 2572 AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT)])
2568 fi 2573 fi
2569 2574
2570 2575
2571 AC_C_INLINE 2576 AC_C_INLINE
2572 test "$ac_cv_c_inline" != "no" && AC_DEFINE(HAVE_INLINE) 2577 if test "$ac_cv_c_inline" != "no"; then
2578 AC_DEFINE(HAVE_INLINE)
2579 test "$GCC" = "yes" && XE_ADD_OBJS(inline.o)
2580 fi
2573 2581
2574 2582
2575 AC_FUNC_ALLOCA 2583 AC_FUNC_ALLOCA
2576 test -n "$ALLOCA" && XE_ADD_OBJS($ALLOCA) 2584 test -n "$ALLOCA" && XE_ADD_OBJS($ALLOCA)
2577 2585
2585 AC_FUNC_STRCOLL 2593 AC_FUNC_STRCOLL
2586 2594
2587 dnl We used to call AC_FUNC_MMAP here 2595 dnl We used to call AC_FUNC_MMAP here
2588 dnl Instead we now use following, suggested by Neal Becker 2596 dnl Instead we now use following, suggested by Neal Becker
2589 AC_MSG_CHECKING(for working mmap) 2597 AC_MSG_CHECKING(for working mmap)
2598 case "$opsys" in ultrix* ) have_mmap=no ;; *)
2590 AC_TRY_RUN([#include <stdio.h> 2599 AC_TRY_RUN([#include <stdio.h>
2591 #include <unistd.h> 2600 #include <unistd.h>
2592 #include <fcntl.h> 2601 #include <fcntl.h>
2593 #include <sys/mman.h> 2602 #include <sys/mman.h>
2594 2603
2614 MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS, 2623 MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS,
2615 fd, 0) != (void *) MAP_FAILED) 2624 fd, 0) != (void *) MAP_FAILED)
2616 return 0; 2625 return 0;
2617 perror ("conftest: mmap failed"); 2626 perror ("conftest: mmap failed");
2618 return 1; 2627 return 1;
2619 }], have_mmap=yes, have_mmap=no) 2628 }], have_mmap=yes, have_mmap=no) ;;
2629 esac
2620 AC_MSG_RESULT($have_mmap) 2630 AC_MSG_RESULT($have_mmap)
2621 test "$have_mmap" = "yes" && AC_DEFINE(HAVE_MMAP) 2631 test "$have_mmap" = "yes" && AC_DEFINE(HAVE_MMAP)
2622 2632
2623 dnl rel_alloc requires either GNU malloc or system malloc with mmap 2633 dnl rel_alloc requires either GNU malloc or system malloc with mmap
2624 dnl We only turn rel_alloc on by default if mmap is available. 2634 dnl We only turn rel_alloc on by default if mmap is available.
2682 AC_CHECKING("for sound support") 2692 AC_CHECKING("for sound support")
2683 case "$with_sound" in 2693 case "$with_sound" in
2684 native | both ) with_native_sound=yes;; 2694 native | both ) with_native_sound=yes;;
2685 nas | no ) with_native_sound=no;; 2695 nas | no ) with_native_sound=no;;
2686 esac 2696 esac
2697 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes
2698
2687 if test "$with_native_sound" != "no"; then 2699 if test "$with_native_sound" != "no"; then
2700 dnl Maybe sound is already on include path...
2701 if test -n "$native_sound_lib"; then
2702 AC_CHECK_HEADER(multimedia/audio_device.h,
2703 [sound_found=yes sound_cflags=""
2704 XE_ADD_OBJS(sunplay.o)])
2705 fi
2706
2688 dnl Autodetect Sun native sound from SUNWaudmo package 2707 dnl Autodetect Sun native sound from SUNWaudmo package
2689 if test -d "/usr/demo/SOUND"; then 2708 if test -z "$sound_found" -a -d "/usr/demo/SOUND"; then
2690 sound_found="yes" 2709 sound_found=yes
2691 XE_ADD_OBJS(sunplay.o) 2710 XE_ADD_OBJS(sunplay.o)
2692 if test -d "/usr/demo/SOUND/include" 2711 if test -d "/usr/demo/SOUND/include"
2693 then sound_cflags="-I/usr/demo/SOUND/include" 2712 then sound_cflags="-I/usr/demo/SOUND/include"
2694 else sound_cflags="-I/usr/demo/SOUND" 2713 else sound_cflags="-I/usr/demo/SOUND"
2695 fi 2714 fi
2697 if test -r "/usr/demo/SOUND/lib/libaudio.a" 2716 if test -r "/usr/demo/SOUND/lib/libaudio.a"
2698 then native_sound_lib="/usr/demo/SOUND/lib/libaudio.a" 2717 then native_sound_lib="/usr/demo/SOUND/lib/libaudio.a"
2699 else native_sound_lib="/usr/demo/SOUND/libaudio.a" 2718 else native_sound_lib="/usr/demo/SOUND/libaudio.a"
2700 fi 2719 fi
2701 fi 2720 fi
2702 else 2721 fi
2703 case "$canonical" in \ 2722
2723 dnl Check for SGI and HP native sound libs
2724 if test -z "$sound_found"; then
2725 case "$canonical" in
2704 *-sgi-* ) 2726 *-sgi-* )
2705 AC_CHECK_LIB(audio, ALopenport, native_sound_lib="-laudio") 2727 if test -z "$native_sound_lib"; then
2706 if test "$native_sound_lib" = "-laudio"; then 2728 AC_CHECK_LIB(audio, ALopenport, native_sound_lib="-laudio")
2707 sound_found="yes" sound_cflags="" 2729 fi
2730 if test -n "$native_sound_lib"; then
2731 sound_found=yes sound_cflags=""
2708 XE_ADD_OBJS(sgiplay.o) 2732 XE_ADD_OBJS(sgiplay.o)
2709 fi ;; 2733 fi ;;
2710 hppa*-hp-hpux* ) 2734 hppa*-hp-hpux* )
2711 AC_CHECK_LIB(Alib, AOpenAudio, native_sound_lib="-lAlib") 2735 if test -z "$native_sound_lib"; then
2712 if test "$native_sound_lib" = "-lAlib"; then 2736 AC_CHECK_LIB(Alib, AOpenAudio, native_sound_lib="-lAlib")
2713 sound_found="yes" 2737 fi
2738 if test -n "$native_sound_lib"; then
2739 sound_found=yes
2714 XE_ADD_OBJS(hpplay.o) 2740 XE_ADD_OBJS(hpplay.o)
2715 if test "$with_gcc" = "yes" # Kludge city 2741 if test "$with_gcc" = "yes" # Kludge city
2716 then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples" 2742 then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples"
2717 else sound_cflags="+e -I/usr/audio/examples" 2743 else sound_cflags="+e -I/usr/audio/examples"
2718 fi 2744 fi
2719 fi ;; 2745 fi ;;
2720 esac 2746 esac
2721 fi 2747 fi
2722 2748
2749 dnl Check for Linux/BSD native sound
2723 if test -z "$sound_found"; then 2750 if test -z "$sound_found"; then
2724 for dir in "machine" "sys" "linux"; do 2751 for dir in "machine" "sys" "linux"; do
2725 AC_CHECK_HEADER(${dir}/soundcard.h, 2752 AC_CHECK_HEADER(${dir}/soundcard.h,
2726 sound_found=yes 2753 sound_found=yes
2727 XE_ADD_OBJS(linuxplay.o) 2754 XE_ADD_OBJS(linuxplay.o)
2766 2793
2767 dnl Check for terminal I/O variants 2794 dnl Check for terminal I/O variants
2768 dnl TERMIOS systems may have termio.h, but not vice-versa, I think. 2795 dnl TERMIOS systems may have termio.h, but not vice-versa, I think.
2769 AC_CHECK_HEADER(termios.h, [AC_DEFINE(HAVE_TERMIOS)], 2796 AC_CHECK_HEADER(termios.h, [AC_DEFINE(HAVE_TERMIOS)],
2770 [AC_CHECK_HEADER(termio.h, [AC_DEFINE(HAVE_TERMIO)])]) 2797 [AC_CHECK_HEADER(termio.h, [AC_DEFINE(HAVE_TERMIO)])])
2771
2772 dnl Autodetect gpm
2773 test -z "$with_gpm" && { AC_CHECK_HEADER(gpm.h, , with_gpm=no) }
2774 test -z "$with_gpm" && { AC_CHECK_LIB(gpm, Gpm_Open, with_gpm=yes, with_gpm=no) }
2775 if test "$with_gpm" = "yes"; then
2776 AC_DEFINE(HAVE_GPM)
2777 XE_ADD_OBJS(gpmevent.o)
2778 XE_PREPEND(-lgpm, LIBS)
2779 fi
2780 2798
2781 dnl Autodetect ncurses. 2799 dnl Autodetect ncurses.
2782 if test -z "$with_ncurses"; then 2800 if test -z "$with_ncurses"; then
2783 AC_CHECK_LIB(ncurses, tgetent, with_ncurses=yes, with_ncurses=no) 2801 AC_CHECK_LIB(ncurses, tgetent, with_ncurses=yes, with_ncurses=no)
2784 fi 2802 fi
2827 fi 2845 fi
2828 fi 2846 fi
2829 fi 2847 fi
2830 AC_DEFINE_UNQUOTED(CURSES_H_PATH, "${curses_h_path-curses.h}") 2848 AC_DEFINE_UNQUOTED(CURSES_H_PATH, "${curses_h_path-curses.h}")
2831 AC_DEFINE_UNQUOTED(TERM_H_PATH, "${term_h_path-term.h}") 2849 AC_DEFINE_UNQUOTED(TERM_H_PATH, "${term_h_path-term.h}")
2850
2851 dnl Autodetect gpm
2852 test -z "$with_gpm" && { AC_CHECK_HEADER(gpm.h, , with_gpm=no) }
2853 test -z "$with_gpm" && { AC_CHECK_LIB(gpm, Gpm_Open, with_gpm=yes, with_gpm=no) }
2854 if test "$with_gpm" = "yes"; then
2855 AC_DEFINE(HAVE_GPM)
2856 XE_ADD_OBJS(gpmevent.o)
2857 XE_PREPEND(-lgpm, LIBS)
2858 fi
2859
2832 else dnl "$with_tty" = "no" 2860 else dnl "$with_tty" = "no"
2833 for feature in ncurses gpm; do 2861 for feature in ncurses gpm; do
2834 if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then 2862 if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
2835 AC_MSG_WARN("--with-${feature} ignored: Not valid without TTY support") 2863 AC_MSG_WARN("--with-${feature} ignored: Not valid without TTY support")
2836 fi 2864 fi
2925 fi 2953 fi
2926 2954
2927 dnl -------------------------------- 2955 dnl --------------------------------
2928 dnl Compute SUBST-itutable variables 2956 dnl Compute SUBST-itutable variables
2929 dnl -------------------------------- 2957 dnl --------------------------------
2958
2930 dnl We ignore (C|LD)_SWITCH_X_(MACHINE|SYSTEM) 2959 dnl We ignore (C|LD)_SWITCH_X_(MACHINE|SYSTEM)
2931 dnl Use `echo ...` to remove extraneous blanks 2960 dnl Use XE_SPACE instead of plain assignment statements to remove extraneous blanks
2932 c_switch_general=`echo -DHAVE_CONFIG_H $c_switch_site $c_switch_machine $c_switch_system` 2961 XE_SPACE(extra_objs, $extra_objs)
2933 c_switch_window_system=`echo $c_switch_x_site $X_CFLAGS` 2962 XE_SPACE(c_switch_general, -DHAVE_CONFIG_H $c_switch_site $c_switch_machine $c_switch_system)
2934 c_switch_all=`echo $c_switch_general $c_switch_window_system` 2963 XE_SPACE(c_switch_window_system, $c_switch_x_site $X_CFLAGS)
2935 ld_switch_general=`echo $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_run` 2964 XE_SPACE(c_switch_all, $c_switch_general $c_switch_window_system)
2936 ld_switch_window_system=`echo $ld_switch_x_site` 2965 XE_SPACE(ld_switch_general, $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_run)
2937 ld_switch_all=`echo $ld_switch_general $ld_switch_window_system` 2966 XE_SPACE(ld_switch_window_system, $ld_switch_x_site)
2938 ld_libs_general=`echo $LIBS $libs_machine $libs_system $libs_standard` 2967 XE_SPACE(ld_switch_all, $ld_switch_general $ld_switch_window_system)
2939 ld_libs_window_system=`echo $X_EXTRA_LIBS $libs_x $X_PRE_LIBS` 2968 XE_SPACE(ld_libs_general, $LIBS $libs_machine $libs_system $libs_standard)
2940 ld_libs_all=`echo $ld_libs_window_system $ld_libs_general` 2969 XE_SPACE(ld_libs_window_system, $X_EXTRA_LIBS $libs_x $X_PRE_LIBS)
2970 XE_SPACE(ld_libs_all, $ld_libs_window_system $ld_libs_general)
2941 2971
2942 dnl Compute lists of Makefiles and subdirs 2972 dnl Compute lists of Makefiles and subdirs
2943 SRC_SUBDIR_DEPS="$MAKE_SUBDIR" 2973 SRC_SUBDIR_DEPS="$MAKE_SUBDIR"
2944 AC_SUBST(SRC_SUBDIR_DEPS) 2974 AC_SUBST(SRC_SUBDIR_DEPS)
2945 XE_APPEND(src, MAKE_SUBDIR) 2975 XE_APPEND(src, MAKE_SUBDIR)
2946 internal_makefile_list="Makefile" 2976 internal_makefile_list="Makefile"
2947 SUBDIR_MAKEFILES='' 2977 SUBDIR_MAKEFILES=''
2948 test -d lock || mkdir lock 2978 test -d lock || mkdir lock
2949 for dir in $MAKE_SUBDIR; do 2979 for dir in $MAKE_SUBDIR; do
2950 test -d "$dir" || mkdir "$dir" 2980 test -d "$dir" || mkdir "$dir"
2951 SUBDIR_MAKEFILES=`echo $SUBDIR_MAKEFILES $dir/Makefile` 2981 XE_SPACE(SUBDIR_MAKEFILES, $SUBDIR_MAKEFILES $dir/Makefile)
2952 internal_makefile_list=`echo $internal_makefile_list $dir/Makefile.in` 2982 XE_SPACE(internal_makefile_list, $internal_makefile_list $dir/Makefile.in)
2953 done 2983 done
2954 AC_SUBST(MAKE_SUBDIR) 2984 AC_SUBST(MAKE_SUBDIR)
2955 AC_SUBST(SUBDIR_MAKEFILES) 2985 AC_SUBST(SUBDIR_MAKEFILES)
2956 2986
2957 if test "$extra_verbose" = "yes"; then 2987 if test "$extra_verbose" = "yes"; then
2996 AC_SUBST(srcdir) 3026 AC_SUBST(srcdir)
2997 AC_SUBST(prefix) 3027 AC_SUBST(prefix)
2998 AC_SUBST(exec_prefix) 3028 AC_SUBST(exec_prefix)
2999 AC_SUBST(bindir) 3029 AC_SUBST(bindir)
3000 AC_SUBST(datadir) 3030 AC_SUBST(datadir)
3031 AC_SUBST(pkgdir)
3001 AC_SUBST(statedir) 3032 AC_SUBST(statedir)
3002 AC_SUBST(libdir) 3033 AC_SUBST(libdir)
3003 AC_SUBST(mandir) 3034 AC_SUBST(mandir)
3004 AC_SUBST(infodir) 3035 AC_SUBST(infodir)
3005 AC_SUBST(infodir_user_defined) 3036 AC_SUBST(infodir_user_defined)