Initial revision
[sw-tools] / configure.in
CommitLineData
3315e8b3 1dnl -*-fundamental-*-
2dnl
3dnl $Id: configure.in,v 1.1 1999/06/02 16:53:33 mdw Exp $
4dnl
5dnl Configuration for sw-tools
6dnl
7dnl (c) 1999 EBI
8dnl
9
10dnl ----- Licensing notice --------------------------------------------------
11dnl
12dnl This file is part of sw-tools.
13dnl
14dnl sw-tools is free software; you can redistribute it and/or modify
15dnl it under the terms of the GNU General Public License as published by
16dnl the Free Software Foundation; either version 2 of the License, or
17dnl (at your option) any later version.
18dnl
19dnl sw-tools is distributed in the hope that it will be useful,
20dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
21dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22dnl GNU General Public License for more details.
23dnl
24dnl You should have received a copy of the GNU General Public License
25dnl along with sw-tools; if not, write to the Free Software Foundation,
26dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27
28dnl ----- Revision history --------------------------------------------------
29dnl
30dnl $Log: configure.in,v $
31dnl Revision 1.1 1999/06/02 16:53:33 mdw
32dnl Initial revision
33dnl
34
35dnl --- Boring boilerplate ---
36
37AC_INIT(src/sw.c)
38AM_INIT_AUTOMAKE(sw-tools, 1.0.0pre3)
39AM_CONFIG_HEADER(config.h)
40
41dnl --- Work out the architecture name ---
42
43AC_MSG_CHECKING([architecture name])
44arch=`$srcdir/sw.in --archname`
45AC_MSG_RESULT($arch)
46AC_DEFINE_UNQUOTED(ARCH, "$arch")
47AC_SUBST(arch)
48
49dnl --- Set up the C compiler ---
50
51AC_PROG_CC
52mdw_GCC_FLAGS
53
54dnl --- Check for <unistd.h> ---
55
56AC_CHECK_HEADERS(unistd.h)
57
58dnl --- Find an appropriate remote shell program ---
59
60AC_ARG_WITH(rsh,
61[ --with-rsh=PROGRAM use PROGRAM to start remote shells],
62[RSH=$withval])
63AC_PATH_PROGS(RSH, $RSH remsh rsh ssh, rsh)
64AC_DEFINE_UNQUOTED(RSH, "$RSH")
65
66dnl --- Find out whether I have `strsignal' or `sys_siglist' ---
67
68AC_CHECK_FUNCS(strsignal _sys_siglist, break)
69
70dnl --- Decide whether to declare `environ' ---
71
72AC_CACHE_CHECK([for declaration of \`environ'], sw_cv_environ,
73[AC_EGREP_CPP(environ,
74[#include <sys/types.h>
75#if HAVE_UNISTD_H
76#include <unistd.h>
77#endif
78#if STDC_HEADERS
79#include <stdlib.h>
80#include <stddef.h>
81#endif], [sw_cv_environ=yes], [sw_cv_environ=no])])
82if test $sw_cv_environ = yes; then
83 AC_DEFINE(DECL_ENVIRON)
84fi
85
86dnl --- Find a curses library ---
87dnl
88dnl Try to find one which knows how to resize a terminal.
89
90mdw_CHECK_MANYLIBS(newwin, ncurses curses, AC_DEFINE(HAVE_CURSES))
91
92if test $mdw_cv_lib_newwin != no; then
93AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h curses.h], [break])
94
95if test "$ac_cv_header_ncurses_h" = "no" &&
96 test "$ac_cv_header_ncurses_ncurses_h" = "no" &&
97 test "$ac_cv_header_curses_h" = "no"; then
98 AC_MSG_WARN([couldn't find a \`curses' header. Assuming \`curses.h'.])
99 AC_DEFINE(HAVE_CURSES_H)
100fi
101
102AC_CHECK_FUNCS(wresize)
103fi
104
105
106dnl --- Other handy libraries ---
107
108mdw_CHECK_MANYLIBS(socketpair, socket)
109
110dnl --- Various standard types ---
111
112AC_TYPE_PID_T
113AC_TYPE_SIZE_T
114AC_TYPE_UID_T
115
116AC_CACHE_CHECK(for ssize_t, sw_cv_ssize_t,
117[AC_EGREP_CPP(ssize_t,
118[#include <sys/types.h>
119#if HAVE_UNISTD_H
120#include <unistd.h>
121#endif
122#if STDC_HEADERS
123#include <stdlib.h>
124#include <stddef.h>
125#endif],
126[sw_cv_ssize_t=yes], [sw_cv_ssize_t=no])])
127
128if test $sw_cv_ssize_t = no; then
129 AC_DEFINE(ssize_t, int)
130fi
131
132dnl --- Write in some useful paths ---
133
134mdw_prefix=$prefix mdw_exec_prefix=$exec_prefix
135transform=`echo "$program_transform_name"|sed 's,\\\\\\\\,\\\\,g; s,\\$\\$,$,g'`
136test "$prefix" = "NONE" && prefix=$ac_default_prefix
137test "$exec_prefix" = "NONE" && exec_prefix=$prefix
138SW=`echo sw|sed "$transform"`
139AC_SUBST(SW)
140AC_DEFINE_UNQUOTED(PREFIX, "$mdw_prefix")
141AC_DEFINE_UNQUOTED(BINDIR, "`eval echo $bindir`")
142AC_DEFINE_UNQUOTED(DATADIR, "`eval echo $datadir`")
143AC_DEFINE_UNQUOTED(SW, "$SW")
144prefix=$mdw_prefix exec_prefix=$mdw_exec_prefix
145
146dnl --- Output the configuration ---
147
148AC_CONFIG_SUBDIRS(mLib)
149AC_OUTPUT(Makefile src/Makefile sw)
150
151dnl ----- That's all, folks -------------------------------------------------