1 dnl***************************************************************************
2 dnl Copyright (c) 1998,1999 Free Software Foundation, Inc. *
4 dnl Permission is hereby granted, free of charge, to any person obtaining a *
5 dnl copy of this software and associated documentation files (the *
6 dnl "Software"), to deal in the Software without restriction, including *
7 dnl without limitation the rights to use, copy, modify, merge, publish, *
8 dnl distribute, distribute with modifications, sublicense, and/or sell *
9 dnl copies of the Software, and to permit persons to whom the Software is *
10 dnl furnished to do so, subject to the following conditions: *
12 dnl The above copyright notice and this permission notice shall be included *
13 dnl in all copies or substantial portions of the Software. *
15 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
16 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
17 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
18 dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
19 dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
20 dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
21 dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23 dnl Except as contained in this notice, the name(s) of the above copyright *
24 dnl holders shall not be used in advertising or otherwise to promote the *
25 dnl sale, use or other dealings in this Software without prior written *
27 dnl***************************************************************************
29 dnl Author: Thomas E. Dickey <dickey@clark.net> 1996,1997,1998
31 dnl $Id: configure.in,v 1.27 1999/10/23 20:01:42 tom Exp $
32 dnl This is a simple configuration-script for the ncurses test programs that
33 dnl allows the test-directory to be separately configured against a reference
34 dnl system (i.e., sysvr4 curses)
36 dnl If you're configuring ncurses, you shouldn't need to use this script.
37 dnl It's only for testing purposes.
39 dnl dickey@clark.net (Thomas Dickey)
42 AC_CONFIG_HEADER(ncurses_cfg.h:ncurses_tst.hin)
46 dnl Things that we don't need (or must override) if we're not building ncurses
47 CC_G_OPT="-g" AC_SUBST(CC_G_OPT)
48 CC_SHARED_OPTS=unknown AC_SUBST(CC_SHARED_OPTS)
49 CPPFLAGS="$CPPFLAGS" AC_SUBST(CPPFLAGS)
50 DFT_DEP_SUFFIX="" AC_SUBST(DFT_DEP_SUFFIX)
51 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'` AC_SUBST(DFT_OBJ_SUBDIR)
52 DFT_UPR_MODEL="NORMAL" AC_SUBST(DFT_UPR_MODEL)
53 ECHO_LINK='@ echo linking $@ ... ;' AC_SUBST(ECHO_LINK)
54 EXTRA_LIBS="" AC_SUBST(EXTRA_LIBS)
56 LDFLAGS_SHARED="" AC_SUBST(LDFLAGS_SHARED)
57 LD_MODEL="" AC_SUBST(LD_MODEL)
58 LD_SHARED_OPTS="" AC_SUBST(LD_SHARED_OPTS)
59 LIB_NAME=curses AC_SUBST(LIB_NAME)
60 LIB_PREFIX="-l" AC_SUBST(LIB_PREFIX)
61 LINK_TESTS="" AC_SUBST(LINK_TESTS)
62 LINT=lint AC_SUBST(LINT)
63 LINT_OPTS="" AC_SUBST(LINT_OPTS)
64 LOCAL_LDFLAGS="" AC_SUBST(LOCAL_LDFLAGS)
65 MATH_LIB="-lm" AC_SUBST(MATH_LIB)
66 PROG_EXT="" AC_SUBST(PROG_EXT)
67 TEST_ARGS="" AC_SUBST(TEST_ARGS)
68 TEST_DEPS="" AC_SUBST(TEST_DEPS)
69 cf_cv_abi_version="" AC_SUBST(cf_cv_abi_version)
70 cf_cv_rel_version="" AC_SUBST(cf_cv_rel_version)
74 [ --with-5lib use SunOS sysv-libraries],
75 [LIBS="-L/usr/5lib $LIBS"
76 CPPFLAGS="$CPPFLAGS -I/usr/5include"])
78 dnl Ncurses, installed in conventional location
80 [ --with-ncurses use ncurses-libraries (installed)],
81 [AC_CHECK_FUNC(initscr,,[
82 AC_CHECK_LIB(gpm,Gpm_Open)
84 for p in $HOME /usr/local /usr
86 if test -f $p/include/ncurses/curses.h
88 CPPFLAGS="$CPPFLAGS -I$p/include/ncurses"
89 test $p != /usr && LIBS="-L$p/lib $LIBS"
93 if test -f $p/include/curses.h
95 CPPFLAGS="$CPPFLAGS -I$p/include"
101 ],[test -d /usr/ccs/lib && LIBS="-L/usr/ccs/lib $LIBS"])])
103 dnl If we've not specified a library, assume we're using sysvr4 libraries
104 dnl installed conventionally (e.g., SunOS 5.x - solaris).
106 dnl Autoconf builds up the $LIBS in reverse order
108 AC_CHECK_FUNC(initscr,,[
109 AC_CHECK_LIB($LIB_NAME,initscr)])
110 AC_CHECK_LIB(form,form_driver)
111 AC_CHECK_LIB(menu,menu_driver)
112 AC_CHECK_LIB(panel,new_panel)
140 dnl ---------------------------------------------------------------------------
141 dnl [CF_SYS_TIME_SELECT]
142 AC_MSG_CHECKING(if sys/time.h conflicts with sys/select.h)
143 AC_CACHE_VAL(cf_cv_sys_time_select,[
146 #include <sys/time.h>
148 #if HAVE_SYS_SELECT_H
149 #include <sys/select.h>
151 ],[],[cf_cv_sys_time_select=yes],
152 [cf_cv_sys_time_select=no])
154 AC_MSG_RESULT($cf_cv_sys_time_select)
155 test $cf_cv_sys_time_select = yes && AC_DEFINE(HAVE_SYS_TIME_SELECT)
156 dnl ---------------------------------------------------------------------------
159 cat >>Makefile <<TEST_EOF
161 # These rules are generated so we do not rely on suffix rules, which do not
162 # work consistently for different make-programs (the '\$(MODEL)/' confuses
163 # some, and the '\$x' confuses others).
165 LIST=`make echo_tests`
166 LAST=`make echo_suffix`
169 N=`echo $n | sed -e s/${LAST}\$//`
170 cat >>Makefile <<TEST_EOF
172 \$(MODEL)/$N.o : $N.c \\
175 @echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) $N.c