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