~ubuntu-branches/ubuntu/hardy/php5/hardy-updates

« back to all changes in this revision

Viewing changes to ext/ncurses/config.m4

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-10-09 03:14:32 UTC
  • Revision ID: james.westby@ubuntu.com-20051009031432-kspik3lobxstafv9
Tags: upstream-5.0.5
ImportĀ upstreamĀ versionĀ 5.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl
 
2
dnl $Id: config.m4,v 1.17 2003/12/09 20:33:08 sniper Exp $
 
3
dnl
 
4
 
 
5
PHP_ARG_WITH(ncurses, for ncurses support,
 
6
[  --with-ncurses[=DIR]    Include ncurses support (CLI/CGI only).])
 
7
 
 
8
if test "$PHP_NCURSES" != "no"; then
 
9
 
 
10
   SEARCH_PATH="$PHP_NCURSES /usr/local /usr"     
 
11
 
 
12
   for dir in $SEARCH_PATH; do
 
13
    for subdir in include/ncurses include; do
 
14
     if test -d $dir/$subdir; then
 
15
       if test -r $dir/$subdir/ncurses.h; then
 
16
         NCURSES_DIR=$dir
 
17
         NCURSES_INCDIR=$dir/$subdir
 
18
         AC_DEFINE(HAVE_NCURSES_H,1,[ ])
 
19
         break 2
 
20
       elif test -r $dir/$subdir/curses.h; then
 
21
         NCURSES_DIR=$dir
 
22
         NCURSES_INCDIR=$dir/$subdir
 
23
         break 2
 
24
       fi
 
25
     fi
 
26
    done
 
27
   done
 
28
  
 
29
   if test -z "$NCURSES_DIR"; then
 
30
     AC_MSG_RESULT(not found)
 
31
     AC_MSG_ERROR(Please reinstall the ncurses distribution)
 
32
   fi
 
33
 
 
34
   # --with-ncurses -> add include path
 
35
   PHP_ADD_INCLUDE($NCURSES_INCDIR)
 
36
 
 
37
   # --with-ncurses -> chech for lib and symbol presence
 
38
   LIBNAME=ncurses 
 
39
   LIBSYMBOL=initscr 
 
40
 
 
41
   PHP_CHECK_LIBRARY($LIBNAME, $LIBSYMBOL, [
 
42
     AC_DEFINE(HAVE_NCURSESLIB,1,[ ])
 
43
     PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $NCURSES_DIR/lib, NCURSES_SHARED_LIBADD)
 
44
 
 
45
     PHP_CHECK_LIBRARY(panel, new_panel, [
 
46
       AC_DEFINE(HAVE_NCURSES_PANEL,1,[ ])
 
47
       PHP_ADD_LIBRARY_WITH_PATH(panel, $NCURSES_DIR/lib, NCURSES_SHARED_LIBADD)
 
48
     ], [], [ 
 
49
       -L$NCURSES_DIR/lib -l$LIBNAME -lm
 
50
     ])
 
51
   ], [
 
52
     AC_MSG_ERROR(Wrong ncurses lib version or lib not found)
 
53
   ], [
 
54
     -L$NCURSES_DIR/lib -lm
 
55
   ])
 
56
 
 
57
   AC_CHECK_LIB($LIBNAME, color_set,   [AC_DEFINE(HAVE_NCURSES_COLOR_SET,  1, [ ])])
 
58
   AC_CHECK_LIB($LIBNAME, slk_color,   [AC_DEFINE(HAVE_NCURSES_SLK_COLOR,  1, [ ])])
 
59
   AC_CHECK_LIB($LIBNAME, assume_default_colors,   [AC_DEFINE(HAVE_NCURSES_ASSUME_DEFAULT_COLORS,  1, [ ])])
 
60
   AC_CHECK_LIB($LIBNAME, use_extended_names,   [AC_DEFINE(HAVE_NCURSES_USE_EXTENDED_NAMES,  1, [ ])])
 
61
 
 
62
   PHP_NEW_EXTENSION(ncurses, ncurses.c ncurses_fe.c ncurses_functions.c, $ext_shared, cli)
 
63
   PHP_SUBST(NCURSES_SHARED_LIBADD)
 
64
 
 
65
fi