1 dnl*****************************************************************************
2 dnl Copyright 1996,1997 by Thomas E. Dickey <dickey@clark.net> *
3 dnl All Rights Reserved. *
5 dnl Permission to use, copy, modify, and distribute this software and its *
6 dnl documentation for any purpose and without fee is hereby granted, provided *
7 dnl that the above copyright notice appear in all copies and that both that *
8 dnl copyright notice and this permission notice appear in supporting *
9 dnl documentation, and that the name of the above listed copyright holder(s) *
10 dnl not be used in advertising or publicity pertaining to distribution of the *
11 dnl software without specific, written prior permission. THE ABOVE LISTED *
12 dnl COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *
13 dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO *
14 dnl EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY *
15 dnl SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER *
16 dnl RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF *
17 dnl CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN *
18 dnl CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
19 dnl*****************************************************************************
20 dnl $Id: configure.in,v 1.15 1997/05/06 00:36:02 tom Exp $
21 dnl This is a simple configuration-script for the ncurses test programs that
22 dnl allows the test-directory to be separately configured against a reference
23 dnl system (i.e., sysvr4 curses)
25 dnl If you're configuring ncurses, you shouldn't need to use this script.
26 dnl It's only for testing purposes.
28 dnl dickey@clark.net (Thomas Dickey)
34 CC_G_OPT="-g" AC_SUBST(CC_G_OPT)
35 CC_SHARED_OPTS=unknown AC_SUBST(CC_SHARED_OPTS)
36 CPPFLAGS="$CPPFLAGS" AC_SUBST(CPPFLAGS)
37 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'` AC_SUBST(DFT_OBJ_SUBDIR)
38 DFT_UPR_MODEL="NORMAL" AC_SUBST(DFT_UPR_MODEL)
39 EXTRA_LIBS="" AC_SUBST(EXTRA_LIBS)
40 LIB_NAME=curses AC_SUBST(LIB_NAME)
41 LINT=lint AC_SUBST(LINT)
42 LINT_OPTS="" AC_SUBST(LINT_OPTS)
43 TEST_ARGS="" AC_SUBST(TEST_ARGS)
47 [ --with-5lib use SunOS sysv-libraries],
48 [LIBS="-L/usr/5lib $LIBS"
49 CPPFLAGS="$CPPFLAGS -I/usr/5include"])
51 dnl Ncurses, installed in conventional location
53 [ --with-ncurses use ncurses-libraries (installed)],
54 [AC_CHECK_LIB(gpm,Gpm_Open)
56 for p in $HOME /usr/local /usr
58 if test -f $p/include/ncurses/curses.h
60 CPPFLAGS="$CPPFLAGS -I$p/include/ncurses"
61 test $p != /usr && LIBS="-L$p/lib $LIBS"
65 if test -f $p/include/curses.h
67 CPPFLAGS="$CPPFLAGS -I$p/include"
73 ],[test -d /usr/ccs/lib && LIBS="-L/usr/ccs/lib $LIBS"])
75 dnl If we've not specified a library, assume we're using sysvr4 libraries
76 dnl installed conventionally (e.g., SunOS 5.x - solaris).
78 dnl Autoconf builds up the $LIBS in reverse order
80 AC_CHECK_LIB($LIB_NAME,initscr)
81 AC_CHECK_LIB(form,form_driver,,,-lcurses)
82 AC_CHECK_LIB(menu,menu_driver,,,-lcurses)
83 AC_CHECK_LIB(panel,new_panel,,,-lcurses)
110 AC_CHECKING([for SCO by checking on /usr/bin/scosh])
111 AC_PROGRAM_CHECK(COULD_BE_SCO, [scosh], maybe, maybenot)
112 if test "$COULD_BE_SCO" = "maybe"
114 AC_DEFINE(SYSTEM_LOOKS_LIKE_SCO)
117 dnl Things that we don't need (or must override) if we're not building ncurses
118 ECHO_LINK='@ echo linking $@ ... ;'
125 AC_SUBST(LOCAL_LDFLAGS)
128 AC_SUBST(nc_cv_abi_version)
137 AC_SUBST(DFT_DEP_SUFFIX)
140 echo '@DEFS@' >config_h.in
143 AC_OUTPUT(config_h Makefile,{
145 ### Special editing. We generate ncurses_cfg.h directly to allow all filenames
146 ### to be MSDOS-compatible, as well as to make the list of definitions be
147 ### dynamically determined by the configuration script -- a consideration when
148 ### doing type-clean development testing.
150 echo creating ncurses_cfg.h
152 echo "/* generated by configure-script
156 #define NC_CONFIG_H" >ncurses_cfg.h
160 -e 's/\(#define [A-Za-z_][A-Za-z0-9_]*\)=/\1 /g' \
162 config_h | sort >>ncurses_cfg.h
164 /* The C compiler may not treat these properly, but C++ has to */
170 #endif /* NC_CONFIG_H */" >> ncurses_cfg.h
171 echo removing config_h
174 ### Special initialization commands, used to pass information from the
175 ### configuration-run into config.status
177 SYS_NAME="`(uname -a || hostname) 2>/dev/null | sed 1q`"
178 if test -z "\$SYS_NAME"; then SYS_NAME=unknown;fi