1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
$NetBSD: patch-aj,v 1.2 1999/08/29 15:29:41 jlam Exp $
--- configure.in.orig Fri Jul 9 00:16:31 1999
+++ configure.in Sun Aug 29 10:25:46 1999
@@ -9,10 +9,10 @@
AC_DEFUN(CDK_FIND_LIB, [
eval "cdk_$2_lib=no"
- for dir in /usr/local/lib/ /usr/lib/ /usr/5lib/ /usr/ccs/lib/ /opt/lib/; do
+ for dir in ${LOCALBASE}/lib /usr/local/lib/ /usr/lib/ /usr/5lib/ /usr/ccs/lib/ /opt/lib/; do
if test -f ${dir}/$1; then
LDFLAGS="$LDFLAGS -L$dir"
- eval "cdk_$2_lib=no"
+ eval "cdk_$2_lib=yes"
fi
done])
@@ -29,7 +29,7 @@
value=$3
fi
- for dir in /usr/include /usr/local/include /opt/include; do
+ for dir in /usr/include ${LOCALBASE}/include /usr/local/include /opt/include; do
if test -f ${dir}/$1; then
count=`grep '$2;$' ${dir}/$1 | grep -c '^typedef'`
fi
@@ -38,7 +38,6 @@
if test $count -ne 0; then
AC_MSG_RESULT("yes")
eval "cdk_$2_type=yes"
- CFLAGS="$CFLAGS -DHAVE_CHTYPE=$value"
else
AC_MSG_RESULT("no")
eval "cdk_$2_type=no"
@@ -62,14 +61,32 @@
fi
dnl
+dnl Set the LDPATH values depending where the
+dnl library is installed. If we found ncurses,
+dnl look for ncurses.
+dnl
+CDK_FIND_LIB(libncurses.a, ncurses)
+if test "$cdk_ncurses_lib" != "no"; then
+ LIBS="$LIBS -lncurses"
+ CFLAGS="$CFLAGS -DHAVE_LIBNCURSES=1"
+fi
+CDK_FIND_LIB(libcurses.a, curses)
+if test "$cdk_curses_lib" != "no"; then
+ if test "$cdk_ncurses_lib" = "no"; then
+ LIBS="$LIBS -lcurses"
+ CFLAGS="$CFLAGS -DHAVE_LIBNCURSES=0"
+ fi
+fi
+
+dnl
dnl Checks for libraries. If we have start_color
dnl set the HAVE_COLOR define.
dnl
-AC_CHECK_LIB(m,sin)
-AC_CHECK_LIB(termcap,waddstr)
+AC_CHECK_LIB(m, sin)
+AC_CHECK_LIB(termcap, waddstr)
AC_CHECK_LIB(ncurses, start_color)
if test "$ac_cv_lib_ncurses_start_color" != yes; then
- AC_CHECK_LIB(curses,initscr)
+ AC_CHECK_LIB(curses, initscr)
else
AC_DEFINE(HAVE_COLOR)
fi
@@ -86,7 +103,11 @@
dnl
AC_TYPE_MODE_T
AC_STRUCT_TM
-CDK_FIND_TYPE(curses.h, chtype)
+CDK_FIND_TYPE(ncurses.h, chtype)
+if test "$cdk_chtype_type" != "no"; then
+ CFLAGS="$CFLAGS -DHAVE_CHTYPE=$value"
+fi
+
dnl
dnl Checks for library functions.
@@ -98,19 +119,5 @@
dnl Set pre-processor compile time variables.
dnl
AC_CHECK_FUNC(XCursesExit, AC_DEFINE(HAVE_XCURSES))
-
-dnl
-dnl Set the LDPATH values depending where the
-dnl library is installed. If we found ncurses,
-dnl look for ncurses.
-dnl
-CDK_FIND_LIB(libncurses.a, cdk_ncurses_lib)
-if test "$cdk_ncurses_lib" != "no"; then
- LIBS="$LIBS -lncurses"
- CFLAGS="$CFLAGS -DHAVE_LIBNCURSES=1"
-else
- LIBS="$LIBS -lcurses"
- CFLAGS="$CFLAGS -DHAVE_LIBNCURSES=0"
-fi
AC_OUTPUT(Makefile examples/Makefile demos/Makefile)
|