1 dnl***************************************************************************
2 dnl Copyright (c) 2007 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 2007
31 dnl $Id: configure.in,v 1.2 2007/01/14 00:02:41 tom Exp $
32 dnl This is a simple configuration-script for tack which makes it simpler to
33 dnl build outside the ncurses tree (provided that ncurses was configured using
34 dnl the --with-ticlib option).
36 dnl See http://invisible-island.net/autoconf/ for additional information.
37 dnl ---------------------------------------------------------------------------
38 AC_PREREQ(2.13.20020210)
40 AC_CONFIG_HEADER(ncurses_cfg.h:ncurses_tst.hin)
42 CF_INHERIT_SCRIPT(config.guess)
43 CF_INHERIT_SCRIPT(config.sub)
54 dnl Things that we don't need (or must override) if we're not building ncurses
55 CC_G_OPT="-g" AC_SUBST(CC_G_OPT)
56 CC_SHARED_OPTS=unknown AC_SUBST(CC_SHARED_OPTS)
57 CPPFLAGS="$CPPFLAGS" AC_SUBST(CPPFLAGS)
58 DESTDIR="" AC_SUBST(DESTDIR)
59 DFT_DEP_SUFFIX="" AC_SUBST(DFT_DEP_SUFFIX)
60 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'` AC_SUBST(DFT_OBJ_SUBDIR)
61 DFT_UPR_MODEL="NORMAL" AC_SUBST(DFT_UPR_MODEL)
62 ECHO_LINK='@ echo linking $@ ... ;' AC_SUBST(ECHO_LINK)
63 EXTRA_LDFLAGS="" AC_SUBST(EXTRA_LDFLAGS)
65 LDFLAGS_SHARED="" AC_SUBST(LDFLAGS_SHARED)
66 LD_MODEL="" AC_SUBST(LD_MODEL)
67 LD_SHARED_OPTS="" AC_SUBST(LD_SHARED_OPTS)
68 LIBTOOL="" AC_SUBST(LIBTOOL)
69 LIB_CLEAN="" AC_SUBST(LIB_CLEAN)
70 LIB_COMPILE="" AC_SUBST(LIB_COMPILE)
71 LIB_INSTALL="" AC_SUBST(LIB_INSTALL)
72 LIB_LINK="" AC_SUBST(LIB_LINK)
73 LIB_SUFFIX="" AC_SUBST(LIB_SUFFIX)
74 LIB_UNINSTALL="" AC_SUBST(LIB_UNINSTALL)
75 LINK_PROGS="" AC_SUBST(LINK_PROGS)
76 LINT=lint AC_SUBST(LINT)
77 LINT_OPTS="" AC_SUBST(LINT_OPTS)
78 LOCAL_LDFLAGS="" AC_SUBST(LOCAL_LDFLAGS)
79 MATH_LIB="-lm" AC_SUBST(MATH_LIB)
80 TICS_ARGS="" AC_SUBST(TICS_ARGS)
81 TINFO_ARGS='$(LIBS_CURSES)' AC_SUBST(TINFO_ARGS)
82 cf_cv_abi_version="" AC_SUBST(cf_cv_abi_version)
83 cf_cv_rel_version="" AC_SUBST(cf_cv_rel_version)
86 AC_SUBST(NCURSES_TREE)
103 [ --with-5lib use SunOS sysv-libraries],
104 [LIBS="-L/usr/5lib $LIBS"
105 CPPFLAGS="$CPPFLAGS -I/usr/5include"])
107 dnl ---------------------------------------------------------------------------
108 dnl NcursesW, installed in conventional location
109 AC_ARG_WITH(ncursesw,
110 [ --with-ncursesw use wide ncurses-libraries (installed)],
111 [cf_cv_screen=ncursesw],[
113 dnl Ncurses, installed in conventional location
115 [ --with-ncurses use ncurses-libraries (installed)],
116 [cf_cv_screen=ncurses],[
118 AC_ARG_WITH(pdcurses,
119 [ --with-pdcurses compile/link with pdcurses X11 library],
120 [cf_cv_screen=pdcurses])])])
122 case $cf_cv_screen in
134 CF_NCURSES_CPPFLAGS(ncursesw)
135 CF_NCURSES_LIBS(ncursesw)
139 dnl If we've not specified a library, assume we're using sysvr4 libraries
140 dnl installed conventionally (e.g., SunOS 5.x - solaris).
142 dnl Autoconf builds up the $LIBS in reverse order
144 # look for curses-related headers
177 dnl ---------------------------------------------------------------------------
180 CF_PRG_RULES([$srcdir/mk-test.awk ECHO_LINK="$ECHO_LINK"], .)
181 cat >>Makefile <<TEST_EOF
183 # These rules are generated so we do not rely on suffix rules, which do not
184 # work consistently for different make-programs (the '\$(MODEL)/' confuses
185 # some, and the '\$x' confuses others).
187 LIST=`sed -e 's/[[ ]].*//' -e '/^[[#@]]/d' $srcdir/modules`
190 cat >>Makefile <<TEST_EOF
192 \$(MODEL)/$N.o : $N.c \\
195 @echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) $N.c