1# Copyright 1999-2003 Alla Bezroutchko <alla@inetcat.org>
2# Copyright 2019-2021 Joao Eriberto Mota Filho <eriberto@eriberto.pro.br>
3#
4# This program is free software; you can redistribute it and/or
5# modify it under the terms of the GNU General Public License
6# as published by the Free Software Foundation; either version 2
7# of the License, or (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program; if not, write to the Free Software
16# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17
18dnl Process this file with autoconf to produce a configure script.
19AC_PREREQ([2.69])
20AC_INIT([nbtscan],[1.7.1],[https://github.com/resurrecting-open-source-projects/nbtscan/issues])
21AC_CANONICAL_TARGET
22AM_INIT_AUTOMAKE
23AC_CONFIG_SRCDIR([src/statusq.c])
24
25dnl Checks for programs.
26AC_PROG_CC
27AC_PROG_INSTALL
28
29dnl Checks for libraries.
30AC_CHECK_LIB(xnet, socket)
31AC_CHECK_LIB(socket, socket)
32AC_CHECK_LIB(resolv, inet_aton)
33
34dnl Checks for header files.
35AC_PROG_EGREP
36
37AC_CHECK_HEADERS(sys/time.h)
38AC_CHECK_HEADERS(stdint.h)
39
40dnl Checks for typedefs, structures, and compiler characteristics.
41AC_CHECK_TYPE(uint8_t, [AC_DEFINE(my_uint8_t, uint8_t)], [AC_CHECK_TYPE(u_int8_t, [AC_DEFINE(my_uint8_t, u_int8_t)])])
42AC_CHECK_TYPE(uint16_t, [AC_DEFINE(my_uint16_t, uint16_t)], [AC_CHECK_TYPE(u_int16_t, [AC_DEFINE(my_uint16_t, u_int16_t)])])
43AC_CHECK_TYPE(uint32_t, [AC_DEFINE(my_uint32_t, uint32_t)], [AC_CHECK_TYPE(u_int32_t, [AC_DEFINE(my_uint32_t, u_int32_t)])])
44
45AC_C_CONST
46
47dnl Checks for library functions.
48AC_CHECK_FUNCS(snprintf inet_aton socket)
49
50if test "$target_os" = cygwin; then
51AC_DEFINE(WINDOWS)
52BINDIR=c:
53TARGET=nbtscan.exe
54else
55AC_DEFINE(UNIX)
56BINDIR=$prefix/bin
57TARGET=nbtscan
58fi
59
60AC_SUBST(TARGET)
61AC_SUBST(BINDIR)
62
63AC_CONFIG_FILES([Makefile src/Makefile])
64AC_OUTPUT
65