-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
374 lines (336 loc) · 12.1 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
dnl/*
dnl Copyright (C) 2009, 2010, 2011, 2013, 2014,2017
dnl Markus Gothe <[email protected]>
dnl
dnl This program is free software: you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as
dnl published by the Free Software Foundation, either version 3 of the
dnl License, or (at your option) any later version.
dnl
dnl This program 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
dnl */
dnl $Id: configure.ac 97 2017-04-05 21:10:58Z nihilus $
dnl Process this file with autoconf to produce a configure script.
dnl init autoconf
AC_REQ(2.63)
AC_INIT([acct],[6.6.4],[[email protected]])
dnl AH_HEADER
AC_CONFIG_HEADERS([config.h:config.h.in])
AC_CONFIG_SRCDIR([ac.c])
AC_CONFIG_AUX_DIR([.])
AC_REQUIRE_AUX_FILE([install-sh])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
dnl macros for automake
AM_INIT_AUTOMAKE([gnu 1.11 check-news dist-bzip2 std-options subdir-objects])
dnl Set it in C99-mode
AC_SYS_INTERPRETER
AC_USE_SYSTEM_EXTENSIONS
dnl GNUlib
gl_EARLY
gl_INIT
AC_PROG_CC_C99
dnl AC_PROG_CPP
AC_REQUIRE_CPP
AC_PROG_CC_C_O
AC_PROG_CXX
AC_C_FLEXIBLE_ARRAY_MEMBER
AC_C_VARARRAYS
AC_PROG_CC
AC_PROG_CXX
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_CPP
AC_PROG_AWK
if test "x$GCC" = "xyes"; then
CFLAGS="${CFLAGS} -Wall -Wmissing-prototypes"
fi
AC_HEADER_STDC
AC_PROG_CC_STDC
AC_PROG_CC_C89
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
LT_PREREQ([2.4])
LT_INIT([dlopen win32-dll])
AC_SUBST([LIBTOOL_DEPS])
dnl /usr/bin/doxygen
AC_PATH_PROG(DOXYGEN, doxygen, "")
AM_CONDITIONAL(CONFIG_DOXYGEN, [test ! -z "$DOXYGEN"])
dnl C-stuff
AC_C_CONST
AC_C_INLINE
AC_C_RESTRICT
AC_C_VOLATILE
AC_SYS_POSIX_TERMIOS
AC_SYS_LARGEFILE
dnl
dnl Functions
dnl
dnl AM_GNU_GETTEXT
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FSEEKO
AC_FUNC_ALLOCA
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MALLOC
AC_FUNC_MKTIME
AC_FUNC_REALLOC
AC_FUNC_OBSTACK
AC_FUNC_STRERROR_R
AC_CHECK_FUNCS([getcwd getpagesize inet_ntoa isascii localtime_r memmove memset pathconf rmdir strcasecmp strchr strdup strerror strtol uname])
AC_CHECK_FUNC(snprintf, AC_DEFINE(HAVE_SNPRINTF, 1, [Define if your system has the SNPRINTF system call.]))
AC_CHECK_FUNC(__builtin_unreachable, AC_DEFINE(HAVE_UNREACHBLE, 1, [Define if your compiler support __builtin_unreachable().]))
dnl
dnl Headers
dnl
AC_HEADER_TIME
AC_HEADER_STDBOOL
AC_HEADER_DIRENT
AC_CHECK_HEADERS([OS.h arpa/inet.h fcntl.h inttypes.h libintl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/param.h sys/socket.h sys/time.h unistd.h utmp.h utmpx.h wchar.h errno.h])
dnl
dnl find out where various programs reside on this system
dnl
AC_PATH_PROGS(SYS_LAST, last, echo, /bin /etc /sbin /usr/bin /usr/etc /usr/sbin /usr/ucb /usr/local/bin /usr/local/etc /usr/local/sbin )
AC_PATH_PROGS(SYS_LASTCOMM, lastcomm, echo, /bin /etc /sbin /usr/bin /usr/etc /usr/sbin /usr/ucb /usr/local/bin /usr/local/etc /usr/local/sbin )
AC_PATH_PROGS(SYS_AC, ac, echo, /bin /etc /sbin /usr/bin /usr/etc /usr/sbin /usr/ucb /usr/local/bin /usr/local/etc /usr/local/sbin )
AC_PATH_PROGS(SYS_SA, sa, echo, /bin /etc /sbin /usr/bin /usr/etc /usr/sbin /usr/ucb /usr/local/bin /usr/local/etc /usr/local/sbin )
dnl
dnl Check for stat.st_rdev
dnl
AC_CHECK_MEMBERS([struct stat.st_rdev])
dnl
dnl find out what fields are valid in utmp.h
dnl
AC_CHECK_MEMBERS([struct utmpx.ut_host],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmp.ut_host],,,[$utmp_includes])
dnl
dnl
dnl
AC_ARG_ENABLE([linux-multiformat],
AS_HELP_STRING([--enable-linux-multiformat],[support various predefined linux acct file formats
instead of the one defined in <sys/acct.h>]),
[],
[
case $target_os in
*linux*)
enable_linux_multiformat=yes
;;
*)
enable_linux_multiformat=no
;;
esac
]
)
AS_IF([test "x$enable_linux_multiformat" = "xyes"],
AC_DEFINE(LINUX_MULTIFORMAT, 1, [Define to use "linux-acct.h" instead of <sys/acct.h>])
DUMP_ACCT_PROG=dump-acct
ACCTON_PROG=accton
LASTCOMM_PROG=lastcomm
SA_PROG=sa
ACCTON_MAN=accton.8
LASTCOMM_MAN=lastcomm.1
SA_MAN=sa.8
AC_DEFINE(HAVE_ACUTIME, 1, [Define if <sys/acct.h> has the AC_UTIME field.])
AC_DEFINE(ACUTIME_COMPT, 1, [Define if <sys/acct.h>'s AC_UTIME field is a COMP_T.])
AC_DEFINE(HAVE_ACSTIME, 1, [Define if <sys/acct.h> has the AC_STIME field.])
AC_DEFINE(ACSTIME_COMPT, 1, [Define if <sys/acct.h>'s AC_STIME field is a COMP_T.])
AC_DEFINE(HAVE_ACETIME, 1, [Define if <sys/acct.h> has the AC_ETIME field.])
AC_DEFINE(HAVE_ACIO, 1, [Define if <sys/acct.h> has the AC_IO field.])
AC_DEFINE(ACIO_COMPT, 1, [Define if <sys/acct.h>'s AC_IO field is a COMP_T.])
AC_DEFINE(HAVE_ACMEM, 1, [Define if <sys/acct.h> has the AC_MEM field.])
AC_DEFINE(ACMEM_COMPT, 1, [Define if <sys/acct.h>'s AC_MEM field is a COMP_T.])
AC_DEFINE(HAVE_PAGING, 1, [Define if <sys/acct.h> has the AC_MINFLT, AC_MAJFLT and AC_SWAPS fields.])
AC_DEFINE(ACMINFLT_COMPT, 1, [Define if <sys/acct.h>'s AC_MINFLT field is a COMP_T.])
AC_DEFINE(ACMAJFLT_COMPT, 1, [Define if <sys/acct.h>'s AC_MAJFLT field is a COMP_T.])
AC_DEFINE(ACSWAPS_COMPT, 1, [Define if <sys/acct.h>'s AC_SWAPS field is a COMP_T.])
AC_DEFINE(HAVE_COMP_T, 1, [Define if <sys/acct.h> uses the COMP_T type.])
, [
dnl
dnl figure out where acct.h lives
dnl and whether fields are int/comp_t
dnl
AC_CHECK_HEADER(sys/acct.h,
AC_DEFINE(HAVE_SYS_ACCT_H, ,[Define if you have the <sys/acct.h> header file.])
DUMP_ACCT_PROG=dump-acct
ACCTON_PROG=accton
LASTCOMM_PROG=lastcomm
SA_PROG=sa
ACCTON_MAN=accton.8
LASTCOMM_MAN=lastcomm.1
SA_MAN=sa.8
AC_EGREP_HEADER(ac_utime, sys/acct.h,
AC_DEFINE(HAVE_ACUTIME, 1, [Define if <sys/acct.h> has the AC_UTIME field.])
AC_EGREP_HEADER(comp_t.*ac_utime, sys/acct.h,AC_DEFINE(ACUTIME_COMPT, 1, [Define if <sys/acct.h>'s AC_UTIME field is a COMP_T.]))
)
AC_EGREP_HEADER(ac_stime, sys/acct.h,
AC_DEFINE(HAVE_ACSTIME, 1, [Define if <sys/acct.h> has the AC_STIME field.])
AC_EGREP_HEADER(comp_t.*ac_stime, sys/acct.h,
AC_DEFINE(ACSTIME_COMPT, 1, [Define if <sys/acct.h>'s AC_STIME field is a COMP_T.]))
)
AC_EGREP_HEADER(ac_etime, sys/acct.h,
AC_DEFINE(HAVE_ACETIME, 1, [Define if <sys/acct.h> has the AC_ETIME field.])
AC_EGREP_HEADER(comp_t.*ac_etime, sys/acct.h,
AC_DEFINE(ACETIME_COMPT, 1, [Define if <sys/acct.h>'s AC_ETIME field is a COMP_T.]))
)
AC_EGREP_HEADER(ac_io, sys/acct.h,
AC_DEFINE(HAVE_ACIO, 1, [Define if <sys/acct.h> has the AC_IO field.])
AC_EGREP_HEADER(comp_t.*ac_io, sys/acct.h,
AC_DEFINE(ACIO_COMPT, 1, [Define if <sys/acct.h>'s AC_IO field is a COMP_T.]))
)
AC_EGREP_HEADER(ac_mem, sys/acct.h,
AC_DEFINE(HAVE_ACMEM, 1, [Define if <sys/acct.h> has the AC_MEM field.])
AC_EGREP_HEADER(comp_t.*ac_mem, sys/acct.h,
AC_DEFINE(ACMEM_COMPT, 1, [Define if <sys/acct.h>'s AC_MEM field is a COMP_T.]))
)
AC_EGREP_HEADER(ac_minflt, sys/acct.h,
AC_EGREP_HEADER(ac_majflt, sys/acct.h,
AC_EGREP_HEADER(ac_swaps, sys/acct.h,
AC_DEFINE(HAVE_PAGING, 1, [Define if <sys/acct.h> has the AC_MINFLT, AC_MAJFLT and AC_SWAPS fields.])
AC_EGREP_HEADER(comp_t.*ac_minflt, sys/acct.h,
AC_DEFINE(ACMINFLT_COMPT, 1, [Define if <sys/acct.h>'s AC_MINFLT field is a COMP_T.]))
AC_EGREP_HEADER(comp_t.*ac_mayflt, sys/acct.h,
AC_DEFINE(ACMAJFLT_COMPT, 1, [Define if <sys/acct.h>'s AC_MAJFLT field is a COMP_T.]))
AC_EGREP_HEADER(comp_t.*ac_swaps, sys/acct.h,
AC_DEFINE(ACSWAPS_COMPT, 1, [Define if <sys/acct.h>'s AC_SWAPS field is a COMP_T.]))
)
)
)
AC_EGREP_HEADER([comp_t],[sys/acct.h],[AC_DEFINE(HAVE_COMP_T, 1, Define if <sys/acct.h> uses the COMP_T type.)])
) ]
)
dnl
dnl find out where utmp/pacct are stored
dnl
AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <stdint.h> /* GNU/kFreeBSD */
#include <sys/acct.h>
#include <utmp.h>
#ifndef WTMP_FILE
# if defined(__FreeBSD__) || defined (__NetBSD__) || defined(__linux__) \
|| defined(__FreeBSD_kernel__) || defined(__GLIBC__)
# define WTMP_FILE "/var/log/account/wtmp"
# else
# if defined(sun) || defined(AMIX)
# define WTMP_FILE "/var/adm/wtmp"
# else
# if defined(sgi) || defined(SVR4)
# define WTMP_FILE "/usr/adm/wtmp"
# else
# define WTMP_FILE "/usr/adm/wtmp"
# endif
# endif
# endif
#endif
#ifndef ACCT_FILE
# if defined(__FreeBSD__) || defined(__linux__) \
|| defined(__FreeBSD_kernel__) || defined(__GLIBC__)
# define ACCT_FILE "/var/log/account/pacct"
# else
# if defined(__NetBSD__)
# define ACCT_FILE "/var/log/account/acct"
# else
# if defined(sun) || defined(AMIX)
# define ACCT_FILE "/var/adm/pacct"
# else
# if defined(sgi) || defined(SVR4) || defined(M_XENIX)
# define ACCT_FILE "/usr/adm/pacct"
# else
# define ACCT_FILE "/usr/adm/acct"
# endif
# endif
# endif
# endif
#endif
#ifndef SAVACCT_FILE
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__linux__) \
|| defined(__FreeBSD_kernel__) || defined(__GLIBC__)
# define SAVACCT_FILE "/var/log/account/savacct"
# else
# if defined(sun) || defined(AMIX)
# define SAVACCT_FILE "/var/adm/savacct"
# else
# if defined(sgi) || defined(SVR4)
# define SAVACCT_FILE "/usr/adm/savacct"
# else
# define SAVACCT_FILE "/usr/adm/savacct"
# endif
# endif
# endif
#endif
#ifndef USRACCT_FILE
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__linux__) \
|| defined(__FreeBSD_kernel__) || defined(__GLIBC__)
# define USRACCT_FILE "/var/log/account/usracct"
# else
# if defined(sun) || defined(AMIX)
# define USRACCT_FILE "/var/adm/usracct"
# else
# if defined(sgi) || defined(SVR4)
# define USRACCT_FILE "/usr/adm/usracct"
# else
# define USRACCT_FILE "/usr/adm/usracct"
# endif
# endif
# endif
#endif
]], [[
FILE *fp;
fp = fopen ("locs", "w");
fprintf (fp, "WTMP_FILE_LOC=%s\n", WTMP_FILE);
fprintf (fp, "ACCT_FILE_LOC=%s\n", ACCT_FILE);
fprintf (fp, "SAVACCT_FILE_LOC=%s\n", SAVACCT_FILE);
fprintf (fp, "USRACCT_FILE_LOC=%s\n", USRACCT_FILE);
fclose (fp);
]])],[. ./locs; rm locs],[echo "Error -- could not locate your wtmp and acct files."; exit 1],[echo "Sorry -- you cannot cross-compile this package (FIXME)."; exit 1 ])
dnl types
AC_TYPE_PID_T dnl for sys/acct.h
AC_TYPE_UID_T dnl same as above
AC_TYPE_OFF_T
AC_TYPE_UID_T
AC_TYPE_INT32_T
AC_TYPE_MODE_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_CHECK_TYPES([ptrdiff_t])
AC_DIAGNOSE([obsolete],[your code may safely assume C89 semantics that RETSIGTYPE is void.
Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.])dnl
AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([#include <sys/types.h>
#include <signal.h>
],
[return *(signal (0, 0)) (0) == 1;])],
[ac_cv_type_signal=int],
[ac_cv_type_signal=void])])
AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers
(`int' or `void').])
AC_C_BIGENDIAN(AC_DEFINE(BYTEORDER,0x80,
[0x80 for big-endian, 0x00 for little-endian.]),
AC_DEFINE(BYTEORDER,0x00,
[0x80 for big-endian, 0x00 for little-endian.]),)
echo checking for kitchen sink... You find a ring in the sink!
dnl Substitute program names for automake
AC_SUBST(DUMP_ACCT_PROG)
AC_SUBST(ACCTON_PROG)
AC_SUBST(LASTCOMM_PROG)
AC_SUBST(SA_PROG)
dnl Substitute manual page names for automake
AC_SUBST(ACCTON_MAN)
AC_SUBST(LASTCOMM_MAN)
AC_SUBST(SA_MAN)
dnl Substitutions for file locations
AC_SUBST(WTMP_FILE_LOC)
AC_SUBST(ACCT_FILE_LOC)
AC_SUBST(SAVACCT_FILE_LOC)
AC_SUBST(USRACCT_FILE_LOC)
dnl Dump the makefiles and etc.
AC_CONFIG_FILES([Makefile lib/Makefile files.h version.h])
AC_OUTPUT