source: trunk/essentials/sys-libs/ncurses/test/configure.in

Last change on this file was 2621, checked in by bird, 19 years ago

GNU ncurses 5.5

File size: 6.8 KB
Line 
1dnl***************************************************************************
2dnl Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. *
3dnl *
4dnl Permission is hereby granted, free of charge, to any person obtaining a *
5dnl copy of this software and associated documentation files (the *
6dnl "Software"), to deal in the Software without restriction, including *
7dnl without limitation the rights to use, copy, modify, merge, publish, *
8dnl distribute, distribute with modifications, sublicense, and/or sell *
9dnl copies of the Software, and to permit persons to whom the Software is *
10dnl furnished to do so, subject to the following conditions: *
11dnl *
12dnl The above copyright notice and this permission notice shall be included *
13dnl in all copies or substantial portions of the Software. *
14dnl *
15dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
16dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
17dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
18dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
19dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
20dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
21dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
22dnl *
23dnl Except as contained in this notice, the name(s) of the above copyright *
24dnl holders shall not be used in advertising or otherwise to promote the *
25dnl sale, use or other dealings in this Software without prior written *
26dnl authorization. *
27dnl***************************************************************************
28dnl
29dnl Author: Thomas E. Dickey 1996, etc.
30dnl
31dnl $Id: configure.in,v 1.51 2005/02/26 23:58:27 tom Exp $
32dnl This is a simple configuration-script for the ncurses test programs that
33dnl allows the test-directory to be separately configured against a reference
34dnl system (i.e., sysvr4 curses)
35dnl
36dnl If you're configuring ncurses, you shouldn't need to use this script.
37dnl It's only for testing purposes.
38dnl
39dnl See http://invisible-island.net/autoconf/ for additional information.
40dnl ---------------------------------------------------------------------------
41AC_PREREQ(2.13.20020210)
42AC_INIT(ncurses.c)
43AC_CONFIG_HEADER(ncurses_cfg.h:ncurses_tst.hin)
44
45CF_INHERIT_SCRIPT(config.guess)
46CF_INHERIT_SCRIPT(config.sub)
47CF_CHECK_CACHE
48
49AC_PROG_MAKE_SET
50AC_PROG_CC
51AC_PROG_CPP
52
53dnl Things that we don't need (or must override) if we're not building ncurses
54CC_G_OPT="-g" AC_SUBST(CC_G_OPT)
55CC_SHARED_OPTS=unknown AC_SUBST(CC_SHARED_OPTS)
56CPPFLAGS="$CPPFLAGS" AC_SUBST(CPPFLAGS)
57DFT_DEP_SUFFIX="" AC_SUBST(DFT_DEP_SUFFIX)
58DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'` AC_SUBST(DFT_OBJ_SUBDIR)
59DFT_UPR_MODEL="NORMAL" AC_SUBST(DFT_UPR_MODEL)
60ECHO_LINK='@ echo linking $@ ... ;' AC_SUBST(ECHO_LINK)
61LD="ld" AC_SUBST(LD)
62LDFLAGS_SHARED="" AC_SUBST(LDFLAGS_SHARED)
63LD_MODEL="" AC_SUBST(LD_MODEL)
64LD_SHARED_OPTS="" AC_SUBST(LD_SHARED_OPTS)
65LIBTOOL="" AC_SUBST(LIBTOOL)
66LIB_CLEAN="" AC_SUBST(LIB_CLEAN)
67LIB_COMPILE="" AC_SUBST(LIB_COMPILE)
68LIB_LINK="" AC_SUBST(LIB_LINK)
69LIB_NAME=curses AC_SUBST(LIB_NAME)
70LIB_PREFIX="-l" AC_SUBST(LIB_PREFIX)
71LINK_TESTS="" AC_SUBST(LINK_TESTS)
72LINT=lint AC_SUBST(LINT)
73LINT_OPTS="" AC_SUBST(LINT_OPTS)
74LOCAL_LDFLAGS="" AC_SUBST(LOCAL_LDFLAGS)
75MATH_LIB="-lm" AC_SUBST(MATH_LIB)
76TEST_ARGS="" AC_SUBST(TEST_ARGS)
77TEST_DEPS="" AC_SUBST(TEST_DEPS)
78TINFO_ARGS='$(LIBS_CURSES)' AC_SUBST(TINFO_ARGS)
79cf_cv_abi_version="" AC_SUBST(cf_cv_abi_version)
80cf_cv_rel_version="" AC_SUBST(cf_cv_rel_version)
81
82cf_cv_screen=curses
83cf_cv_libtype=
84
85AC_EXEEXT
86AC_OBJEXT
87
88CF_ANSI_CC_REQD
89CF_XOPEN_SOURCE
90
91CF_WITH_CURSES_DIR
92
93dnl SunOS 4.x
94AC_ARG_WITH(5lib,
95 [ --with-5lib use SunOS sysv-libraries],
96 [LIBS="-L/usr/5lib $LIBS"
97 CPPFLAGS="$CPPFLAGS -I/usr/5include"])
98
99dnl ---------------------------------------------------------------------------
100dnl NcursesW, installed in conventional location
101AC_ARG_WITH(ncursesw,
102 [ --with-ncursesw use wide ncurses-libraries (installed)],
103 [cf_cv_screen=ncursesw])
104
105dnl Ncurses, installed in conventional location
106AC_ARG_WITH(ncurses,
107 [ --with-ncurses use ncurses-libraries (installed)],
108 [cf_cv_screen=ncurses])
109
110case $cf_cv_screen in
111curses)
112 CF_CURSES_CPPFLAGS
113 CF_NCURSES_VERSION
114 CF_CURSES_LIBS
115 ;;
116ncurses)
117 CF_NCURSES_CPPFLAGS
118 CF_NCURSES_LIBS
119 LIB_NAME=ncurses
120 ;;
121ncursesw)
122 cf_cv_libtype=w
123 CF_UTF8_LIB
124 CF_NCURSES_CPPFLAGS(ncursesw)
125 CF_NCURSES_LIBS(ncursesw)
126 LIB_NAME=ncursesw
127 ;;
128esac
129
130dnl If we've not specified a library, assume we're using sysvr4 libraries
131dnl installed conventionally (e.g., SunOS 5.x - solaris).
132
133dnl Autoconf builds up the $LIBS in reverse order
134
135AC_CHECK_LIB(panel$cf_cv_libtype,new_panel)
136AC_CHECK_LIB(menu$cf_cv_libtype,menu_driver)
137AC_CHECK_LIB(form$cf_cv_libtype,form_driver)
138
139AC_TYPE_SIGNAL
140
141AC_STDC_HEADERS
142AC_HEADER_TIME
143AC_CHECK_HEADERS( \
144form.h \
145getopt.h \
146locale.h \
147menu.h \
148nc_alloc.h \
149nomacros.h \
150panel.h \
151sys/ioctl.h \
152sys/select.h \
153sys/time.h \
154termios.h \
155unistd.h \
156)
157
158AC_CHECK_FUNCS( \
159color_set \
160getnstr \
161gettimeofday \
162napms \
163resize_term \
164resizeterm \
165slk_color \
166strdup \
167use_default_colors \
168vsscanf \
169wchgat \
170wresize \
171)
172
173AC_TRY_LINK([
174#include <${cf_cv_ncurses_header-curses.h}>],
175[
176 (void) assume_default_colors (0, 0);
177 (void) curses_version ();
178 (void) define_key (0, 0);
179 (void) is_term_resized (0, 0);
180 (void) key_defined (0);
181 (void) keybound (0, 0);
182 (void) keyok (0, 0);
183 (void) resize_term (0, 0);
184 (void) resizeterm (0, 0);
185 (void) use_default_colors ();
186 (void) use_extended_names (0);
187 (void) wresize (0, 0, 0);
188 ],[AC_DEFINE(NCURSES_EXT_FUNCS)])
189
190CF_SYS_TIME_SELECT
191CF_FUNC_CURSES_VERSION
192CF_CURSES_ACS_MAP
193CF_CURSES_WACS_MAP
194CF_CURSES_CHECK_TYPE(attr_t,long)
195CF_CURSES_CHECK_TYPE(mbstate_t,long)
196
197TEST_ARGS="$LIBS"
198LIBS=
199
200dnl ---------------------------------------------------------------------------
201
202AC_OUTPUT(Makefile,[
203 cat >>Makefile <<TEST_EOF
204
205# These rules are generated so we do not rely on suffix rules, which do not
206# work consistently for different make-programs (the '\$(MODEL)/' confuses
207# some, and the '\$x' confuses others).
208TEST_EOF
209LIST=`sed -e 's/[[ ]].*//' -e '/^[[#@]]/d' $srcdir/modules`
210for N in $LIST
211do
212 cat >>Makefile <<TEST_EOF
213
214\$(MODEL)/$N.o : $N.c \\
215 test.priv.h \\
216 ncurses_cfg.h
217 @echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) $N.c
218TEST_EOF
219done
220],[],sort)
Note: See TracBrowser for help on using the repository browser.