3 dnl $Id: configure.in,v 1.2 1999/06/04 13:56:36 mdw Exp $
5 dnl Configuration for sw-tools
10 dnl ----- Licensing notice --------------------------------------------------
12 dnl This file is part of sw-tools.
14 dnl sw-tools is free software; you can redistribute it and/or modify
15 dnl it under the terms of the GNU General Public License as published by
16 dnl the Free Software Foundation; either version 2 of the License, or
17 dnl (at your option) any later version.
19 dnl sw-tools is distributed in the hope that it will be useful,
20 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
21 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 dnl GNU General Public License for more details.
24 dnl You should have received a copy of the GNU General Public License
25 dnl along with sw-tools; if not, write to the Free Software Foundation,
26 dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 dnl ----- Revision history --------------------------------------------------
30 dnl $Log: configure.in,v $
31 dnl Revision 1.2 1999/06/04 13:56:36 mdw
34 dnl Revision 1.1.1.1 1999/06/02 16:53:33 mdw
38 dnl --- Boring boilerplate ---
41 AM_INIT_AUTOMAKE(sw-tools, 1.0.0pre4)
42 AM_CONFIG_HEADER(config.h)
44 dnl --- Work out the architecture name ---
46 AC_MSG_CHECKING([architecture name])
47 arch=`$srcdir/sw.in --archname`
49 AC_DEFINE_UNQUOTED(ARCH, "$arch")
52 dnl --- Set up the C compiler ---
57 dnl --- Check for <unistd.h> ---
59 AC_CHECK_HEADERS(unistd.h)
61 dnl --- Find an appropriate remote shell program ---
64 [ --with-rsh=PROGRAM use PROGRAM to start remote shells],
66 AC_PATH_PROGS(RSH, $RSH remsh rsh ssh, rsh)
67 AC_DEFINE_UNQUOTED(RSH, "$RSH")
69 dnl --- Find out whether I have `strsignal' or `sys_siglist' ---
71 AC_CHECK_FUNCS(strsignal _sys_siglist, break)
73 dnl --- Decide whether to declare `environ' ---
75 AC_CACHE_CHECK([for declaration of \`environ'], sw_cv_environ,
76 [AC_EGREP_CPP(environ,
77 [#include <sys/types.h>
84 #endif], [sw_cv_environ=yes], [sw_cv_environ=no])])
85 if test $sw_cv_environ = yes; then
86 AC_DEFINE(DECL_ENVIRON)
89 dnl --- Find a curses library ---
91 dnl Try to find one which knows how to resize a terminal.
93 mdw_CHECK_MANYLIBS(newwin, ncurses curses, AC_DEFINE(HAVE_CURSES))
95 if test $mdw_cv_lib_newwin != no; then
96 AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h curses.h], [break])
98 if test "$ac_cv_header_ncurses_h" = "no" &&
99 test "$ac_cv_header_ncurses_ncurses_h" = "no" &&
100 test "$ac_cv_header_curses_h" = "no"; then
101 AC_MSG_WARN([couldn't find a \`curses' header. Assuming \`curses.h'.])
102 AC_DEFINE(HAVE_CURSES_H)
105 AC_CHECK_FUNCS(wresize)
109 dnl --- Other handy libraries ---
111 mdw_CHECK_MANYLIBS(socketpair, socket)
113 dnl --- Various standard types ---
119 AC_CACHE_CHECK(for ssize_t, sw_cv_ssize_t,
120 [AC_EGREP_CPP(ssize_t,
121 [#include <sys/types.h>
129 [sw_cv_ssize_t=yes], [sw_cv_ssize_t=no])])
131 if test $sw_cv_ssize_t = no; then
132 AC_DEFINE(ssize_t, int)
135 dnl --- Write in some useful paths ---
137 mdw_prefix=$prefix mdw_exec_prefix=$exec_prefix
138 transform=`echo "$program_transform_name"|sed 's,\\\\\\\\,\\\\,g; s,\\$\\$,$,g'`
139 test "$prefix" = "NONE" && prefix=$ac_default_prefix
140 test "$exec_prefix" = "NONE" && exec_prefix=$prefix
141 SW=`echo sw|sed "$transform"`
143 AC_DEFINE_UNQUOTED(PREFIX, "$mdw_prefix")
144 AC_DEFINE_UNQUOTED(BINDIR, "`eval echo $bindir`")
145 AC_DEFINE_UNQUOTED(DATADIR, "`eval echo $datadir`")
146 AC_DEFINE_UNQUOTED(SW, "$SW")
147 prefix=$mdw_prefix exec_prefix=$mdw_exec_prefix
149 dnl --- Output the configuration ---
151 AC_CONFIG_SUBDIRS(mLib)
152 AC_OUTPUT(Makefile src/Makefile sw)
154 dnl ----- That's all, folks -------------------------------------------------