-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
133 lines (105 loc) · 2.75 KB
/
configure.ac
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
dnl configure script for the stormav project
dnl Copyright (C) 2007 The StormAV Project
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library; if not, write to the Free Software
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
AC_INIT([check_ice2], [1.0.5])
AC_CONFIG_SRCDIR([src/main.c])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS(src/include/config.h)
AC_PROG_CC
AM_PROG_CC_C_O
AC_C_INLINE
AC_DEFUN([AC_PROG_CXX], [])
AC_DEFUN([AC_PROG_F77], [])
dnl
dnl flags
dnl Add -Wall and friends if we are using GCC.
dnl
AC_SUBST(AM_CFLAGS)
AC_SUBST(CPPFLAGS)
AC_C_CONST
dnl
dnl types check
dnl
AC_TYPE_SSIZE_T
AC_CHECK_TYPE(u_char, unsigned char)
dnl
dnl headers check
dnl
AC_HEADER_STDC
AC_HEADER_TIME
AC_CHECK_HEADERS([arpa/inet.h])
AC_CHECK_HEADERS([netdb.h])
AC_CHECK_HEADERS([netinet/in.h])
AC_CHECK_HEADERS([sys/ioctl.h])
AC_CHECK_HEADERS([sys/socket.h])
dnl
dnl fonctions check
dnl
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset])
AC_CHECK_FUNCS([socket])
AC_CHECK_FUNCS([strerror])
dnl
dnl paths
dnl
libexecdir='${exec_prefix}/libexec/iyell'
dnl strtok_r specific checks
AC_CHECK_FUNC(strtok_r, [
AC_DEFINE(HAVE_STRTOK_R, [], ["Define to 1 if you have the `strtok_r' function."])
ac_found_strtok_r=yes
], [
HAVE_STRTOK_R="# "
])
AC_SUBST(HAVE_STRTOK_R)
if test "$ac_found_strtok_r" = "yes"; then
AC_MSG_CHECKING(if strtok_r declaration requires -D__EXTENSIONS__)
AC_EGREP_HEADER(strtok_r, string.h, [
AC_MSG_RESULT(no)
], [
ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$ac_save_cppflags -D__EXTENSIONS__"
AC_EGREP_HEADER(strtok_r, string.h, [
ac_save_cppflags=
AC_MSG_RESULT(yes)
], [
CPPFLAGS="$ac_save_cppflags"
AC_MSG_RESULT(still can't find it)
])
])
fi
dnl
dnl structures checks
dnl
AC_STRUCT_TM
dnl
dnl enable / disable debug
dnl
AC_ARG_ENABLE(debug,
[ --enable-debug specify you are building with debugging on],
AM_CFLAGS="-W -Wall -std=c99 -pedantic -g3" ,
AM_CFLAGS="-W -Wall -std=c99 -pedantic -DNDEBUG"
)
AC_SUBST(AM_CFLAGS)
dnl solaris needs -lsocket -lnsl
AC_SEARCH_LIBS(socket,socket)
AC_SEARCH_LIBS(getnameinfo,nsl socket)
AC_SEARCH_LIBS(inet_ntoa,nsl socket)
dnl
dnl Create Makefiles
dnl
AC_OUTPUT([Makefile\
src/Makefile]
)