]> git.decadent.org.uk Git - ap-utils.git/blob - configure.in
Imported Upstream version 1.5~pre3~a
[ap-utils.git] / configure.in
1 #
2 #      configure.in from Wireless Access Point Utilites for Unix
3 #
4 #  Copyright (c) 2002 Roman Festchook <roma at polesye dot net>
5 #
6 #  This program is free software; you can redistribute it and/or modify
7 #  it under the terms of the GNU General Public License Version 2 from
8 #  June 1991 as published by the Free Software Foundation.
9 #
10 #  This program is distributed in the hope that it will be useful, but
11 #  WITHOUT ANY WARRANTY; without even the implied warranty of
12 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 #  GNU General Public License for more details.
14 #
15 #  You should have received a copy of the GNU General Public License along
16 #  with this program; if not, write to the Free Software Foundation, Inc.,
17 #  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #
19 AC_INIT([lib/snmp.c])
20 AC_CONFIG_AUX_DIR(config)
21 AM_INIT_AUTOMAKE(ap-utils, 1.5pre3a)
22 AM_CONFIG_HEADER(config.h)
23
24 ac_aux_dir=config
25 ac_config_guess=config/config.guess
26 ac_config_sub=config/config.sub
27
28 # Checks for programs.
29 AC_PROG_CC
30 AC_PROG_RANLIB
31
32 # Checks for header files.
33 AC_HEADER_STDC
34 AC_HEADER_SYS_WAIT
35 AC_CHECK_HEADERS([arpa/inet.h fcntl.h malloc.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h syslog.h unistd.h])
36
37 # Checks for typedefs, structures, and compiler characteristics.
38 AC_C_CONST
39 AC_TYPE_PID_T
40 AC_TYPE_SIZE_T
41 AC_CHECK_MEMBER(struct sockaddr.sa_len,
42                 AC_DEFINE(HAVE_SA_LEN, 1,
43                     Define if your (struct sockadr) has an sa_len member),,
44                 [
45 #include <sys/types.h>
46 #include <sys/socket.h>
47 ])
48
49 # Checks for library functions.
50 AC_FUNC_MEMCMP
51 AC_TYPE_SIGNAL
52 AC_CHECK_FUNCS([alarm inet_ntoa socket strtol sysinfo fork malloc free])
53
54 ALL_LINGUAS="uk fr pl ro nl tr"
55
56 AM_GNU_GETTEXT
57
58 aputils_save_LIBS="$LIBS"
59 AC_CHECK_LIB(ncurses, initscr, CURSESLIBS="-lncurses", NOCURSES=yes)
60 if test "$NOCURSES" = yes; then
61         AC_CHECK_LIB(curses, initscr, CURSESLIBS="-lcurses", AC_MSG_ERROR([ap-utils requires installed ncurses or Sys V curses to build]))
62 fi
63 LIBS="$aputils_save_LIBS"
64
65 # Check for OS and make OS define OS specific variables
66 case "$host_os" in
67  *bsd*|*darwin* )
68         AC_DEFINE(OS_BSD, 1, Define if target OS is BSD)
69         case "$host_os" in
70          netbsd* )
71             ap_config_LDADD="-lncurses"
72             CC="$CC -R/usr/pkg/lib -L/usr/pkg/lib -I/usr/pkg/include"
73             ;;
74          openbsd* )
75             ;;
76          *darwin* )
77             AC_DEFINE(OS_X, 1, Define if target OS is MacOS X)
78             ;;
79         esac
80         ;;
81  *qnx )
82         LIBS="$LIBS -lsocket"
83         INSTALL="config/install-sh"
84         ;;
85  aix4* )
86     case "$CC" in
87      cc* | xlc* )
88         CC="$CC -qcpluscmt -qmaxmem=16384"
89     esac
90     ;;
91  solaris* )
92         AC_DEFINE(OS_SOLARIS, 1, Define if target OS is Solaris)
93         LIBS="$LIBS -lresolv -lnls"
94     ;;
95  gnu*|*linux* )
96         AC_DEFINE(OS_LINUX, 1, Define if target OS is Linux)
97         CFLAGS="$CFLAGS -Wall -W"
98     ;;
99 esac
100
101 AC_C_BIGENDIAN
102
103 AC_ARG_ENABLE(regdomain, [ --disable-regdomain     disable regulation domain channel restrictions],
104   [ case "$enableval" in
105 no)
106      AC_DEFINE(NO_REG_DOMAIN, 1, Define for no regulation domain restrictions)
107  ;;
108  esac     
109 ])
110
111 AC_SUBST(CURSESLIBS)
112
113 AC_OUTPUT([Makefile src/Makefile ap-gl/Makefile lib/Makefile po/Makefile.in intl/Makefile Documentation/Makefile])
114
115 echo "
116
117         Thank you for using ap-utils.
118
119 "