forked from ioccc-src/winner
-
Notifications
You must be signed in to change notification settings - Fork 6
/
configure.in
77 lines (59 loc) · 2.35 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#######################################################################
# Thus it begins...
#######################################################################
AC_PREREQ(2.59)
AC_INIT(mynx, 1.0, [Public Domain 2005 by Anthony Howe.])
platform=`uname -s|sed -e 's/^\([[a-zA-Z0-9]]*\)[[^a-zA-Z0-9]].*/\1/'`
echo "platform is... $platform"
my_configure_command="$[]0 $[]@"
AC_CHECK_TOOL(autoconf_tool, autoconf)
if test ${autoconf_tool:-no} != 'no' -a \( aclocal.m4 -nt configure -o configure.in -nt configure \); then
echo 'Rebuilding the configure script first...'
autoconf -f
echo 'Restarting configure script...'
echo $my_configure_command
exec $my_configure_command
fi
AC_SUBST(platform, $platform)
#######################################################################
# Auxliary files to be modified later
#######################################################################
AC_CONFIG_SRCDIR($PACKAGE_NAME.c)
AC_CONFIG_FILES(makefile)
#######################################################################
# Configuration options
#######################################################################
AC_ARG_ENABLE(w32,
[AC_HELP_STRING([--disable-w32],[generate Cygwin binary in Cygwin environment])]
)
#######################################################################
# Setup defaults
#######################################################################
if test $platform = 'CYGWIN' -a ${enable_w32:-yes} != 'no' ; then
CFLAGS="-mno-cygwin ${CFLAGS}"
LIBS="-lws2_32 ${LIBS}"
fi
#######################################################################
# We find things...
#######################################################################
AC_PROG_CC
AC_HEADER_STDC
AC_SEARCH_LIBS(socket, [socket nsl],[AC_DEFINE_UNQUOTED([AS_TR_CPP([HAVE_SOCKET])])])
AC_CHECK_HEADERS(
[arpa/inet.h netdb.h netinet/in.h sys/socket.h sys/ioctl.h],
[], [AC_MSG_FAILURE([Missing required network I/O header.], 1)]
)
AC_CHECK_HEADERS([windows.h winsock2.h])
#######################################################################
# Generate output.
#######################################################################
AC_OUTPUT()
echo
echo $PACKAGE_STRING
echo
AC_MSG_RESULT([ platform...: $platform])
AC_MSG_RESULT([ prefix.....: $prefix])
AC_MSG_RESULT([ CFLAGS.....: $CFLAGS])
AC_MSG_RESULT([ LDFLAGS....: $LDFLAGS])
AC_MSG_RESULT([ LIBS.......: $LIBS])
echo