First proper release version.
[sw-tools] / configure.in
1 dnl -*-fundamental-*-
2 dnl
3 dnl $Id: configure.in,v 1.5 1999/07/16 12:46:04 mdw Exp $
4 dnl
5 dnl Configuration for sw-tools
6 dnl
7 dnl (c) 1999 EBI
8 dnl
9
10 dnl ----- Licensing notice --------------------------------------------------
11 dnl
12 dnl This file is part of sw-tools.
13 dnl
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.
18 dnl
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.
23 dnl
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.
27
28 dnl ----- Revision history --------------------------------------------------
29 dnl
30 dnl $Log: configure.in,v $
31 dnl Revision 1.5 1999/07/16 12:46:04 mdw
32 dnl First proper release version.
33 dnl
34 dnl Revision 1.4 1999/06/24 15:53:11 mdw
35 dnl Bump the version number again.
36 dnl
37 dnl Revision 1.3 1999/06/18 18:59:39 mdw
38 dnl Preliminary work for Perl scripts.
39 dnl
40 dnl Revision 1.2 1999/06/04 13:56:36 mdw
41 dnl Bump version.
42 dnl
43 dnl Revision 1.1.1.1 1999/06/02 16:53:33 mdw
44 dnl Initial import.
45 dnl
46
47 dnl --- Boring boilerplate ---
48
49 AC_INIT(src/sw.c)
50 AM_INIT_AUTOMAKE(sw-tools, 1.0.0)
51 AM_CONFIG_HEADER(config.h)
52
53 dnl --- Work out the architecture name ---
54
55 AC_MSG_CHECKING([architecture name])
56 arch=`$srcdir/sw.in --archname`
57 AC_MSG_RESULT($arch)
58 AC_DEFINE_UNQUOTED(ARCH, "$arch")
59 AC_SUBST(arch)
60
61 dnl --- Set up the C compiler ---
62
63 AC_PROG_CC
64 mdw_GCC_FLAGS
65
66 dnl --- Find a Perl ---
67
68 mdw_PROG_PERL(5.003)
69 mdw_CHECK_PERL(5.003)
70
71 dnl --- Check for <unistd.h> ---
72
73 AC_CHECK_HEADERS(unistd.h)
74
75 dnl --- Find an appropriate remote shell program ---
76
77 AC_ARG_WITH(rsh,
78 [ --with-rsh=PROGRAM use PROGRAM to start remote shells],
79 [RSH=$withval])
80 AC_PATH_PROGS(RSH, $RSH remsh rsh ssh, rsh)
81 AC_DEFINE_UNQUOTED(RSH, "$RSH")
82
83 dnl --- Find out whether I have `strsignal' or `sys_siglist' ---
84
85 AC_CHECK_FUNCS(strsignal _sys_siglist, break)
86
87 dnl --- Decide whether to declare `environ' ---
88
89 AC_CACHE_CHECK([for declaration of \`environ'], sw_cv_environ,
90 [AC_EGREP_CPP(environ,
91 [#include <sys/types.h>
92 #if HAVE_UNISTD_H
93 #include <unistd.h>
94 #endif
95 #if STDC_HEADERS
96 #include <stdlib.h>
97 #include <stddef.h>
98 #endif], [sw_cv_environ=yes], [sw_cv_environ=no])])
99 if test $sw_cv_environ = yes; then
100 AC_DEFINE(DECL_ENVIRON)
101 fi
102
103 dnl --- Find a curses library ---
104 dnl
105 dnl Try to find one which knows how to resize a terminal.
106
107 mdw_CHECK_MANYLIBS(newwin, ncurses curses, AC_DEFINE(HAVE_CURSES))
108
109 if test $mdw_cv_lib_newwin != no; then
110 AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h curses.h], [break])
111
112 if test "$ac_cv_header_ncurses_h" = "no" &&
113 test "$ac_cv_header_ncurses_ncurses_h" = "no" &&
114 test "$ac_cv_header_curses_h" = "no"; then
115 AC_MSG_WARN([couldn't find a \`curses' header. Assuming \`curses.h'.])
116 AC_DEFINE(HAVE_CURSES_H)
117 fi
118
119 AC_CHECK_FUNCS(wresize)
120 fi
121
122 dnl --- Other handy libraries ---
123
124 mdw_CHECK_MANYLIBS(socketpair, socket)
125
126 dnl --- Various standard types ---
127
128 AC_TYPE_PID_T
129 AC_TYPE_SIZE_T
130 AC_TYPE_UID_T
131
132 AC_CACHE_CHECK(for ssize_t, sw_cv_ssize_t,
133 [AC_EGREP_CPP(ssize_t,
134 [#include <sys/types.h>
135 #if HAVE_UNISTD_H
136 #include <unistd.h>
137 #endif
138 #if STDC_HEADERS
139 #include <stdlib.h>
140 #include <stddef.h>
141 #endif],
142 [sw_cv_ssize_t=yes], [sw_cv_ssize_t=no])])
143
144 if test $sw_cv_ssize_t = no; then
145 AC_DEFINE(ssize_t, int)
146 fi
147
148 dnl --- Write in some useful paths ---
149
150 mdw_prefix=$prefix mdw_exec_prefix=$exec_prefix
151 transform=`echo "$program_transform_name"|sed 's,\\\\\\\\,\\\\,g; s,\\$\\$,$,g'`
152 test "$prefix" = "NONE" && prefix=$ac_default_prefix
153 test "$exec_prefix" = "NONE" && exec_prefix=$prefix
154 SW=`echo sw|sed "$transform"`
155 AC_SUBST(SW)
156 AC_DEFINE_UNQUOTED(PREFIX, "$mdw_prefix")
157 AC_DEFINE_UNQUOTED(BINDIR, "`eval echo $bindir`")
158 AC_DEFINE_UNQUOTED(DATADIR, "`eval echo $datadir`")
159 AC_DEFINE_UNQUOTED(SW, "$SW")
160 pkgdatadir="`eval echo $datadir/sw`"
161 AC_SUBST(pkgdatadir)
162 prefix=$mdw_prefix exec_prefix=$mdw_exec_prefix
163
164 dnl --- Output the configuration ---
165
166 AC_CONFIG_SUBDIRS(mLib)
167 AC_OUTPUT(Makefile src/Makefile sw sw-share)
168
169 dnl ----- That's all, folks -------------------------------------------------