|
| 1 | +dnl Determine the default configuration into which we'll install ncurses. This |
| 2 | +dnl can be overridden by the user's command-line options. There's two items to |
| 3 | +dnl look for: |
| 4 | +dnl 1. the prefix (e.g., /usr) |
| 5 | +dnl 2. the header files (e.g., /usr/include/ncurses) |
| 6 | +dnl We'll look for a previous installation of ncurses and use the same defaults. |
| 7 | +dnl |
| 8 | +dnl We don't use AC_PREFIX_DEFAULT, because it gets evaluated too soon, and |
| 9 | +dnl we don't use AC_PREFIX_PROGRAM, because we cannot distinguish ncurses's |
| 10 | +dnl programs from a vendor's. |
| 11 | +AC_DEFUN([CF_CFG_DEFAULTS], |
| 12 | +[ |
| 13 | +AC_MSG_CHECKING(for prefix) |
| 14 | +if test "x$prefix" = "xNONE" ; then |
| 15 | + case "$cf_cv_systype" in |
| 16 | + # non-vendor systems don't have a conflict |
| 17 | + OpenBSD|NetBSD|FreeBSD|Linux) prefix=/usr |
| 18 | + ;; |
| 19 | + *) prefix=$ac_default_prefix |
| 20 | + ;; |
| 21 | + esac |
| 22 | +fi |
| 23 | +AC_MSG_RESULT($prefix) |
| 24 | +if test "x$prefix" = "xNONE" ; then |
| 25 | +AC_MSG_CHECKING(for default include-directory) |
| 26 | +test -n "$verbose" && echo 1>&6 |
| 27 | +for cf_symbol in \ |
| 28 | + $includedir \ |
| 29 | + $includedir/ncurses \ |
| 30 | + $prefix/include \ |
| 31 | + $prefix/include/ncurses \ |
| 32 | + /usr/local/include \ |
| 33 | + /usr/local/include/ncurses \ |
| 34 | + /usr/include \ |
| 35 | + /usr/include/ncurses |
| 36 | +do |
| 37 | + cf_dir=`eval echo $cf_symbol` |
| 38 | + if test -f $cf_dir/curses.h ; then |
| 39 | + if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then |
| 40 | + includedir="$cf_symbol" |
| 41 | + test -n "$verbose" && echo $ac_n " found " 1>&6 |
| 42 | + break |
| 43 | + fi |
| 44 | + fi |
| 45 | + test -n "$verbose" && echo " tested $cf_dir" 1>&6 |
| 46 | +done |
| 47 | +AC_MSG_RESULT($includedir) |
| 48 | +fi |
| 49 | +])dnl |
0 commit comments