cmogstored.git  about / heads / tags
alternative mogstored implementation for MogileFS
blob 22f6d9ce72c45fc910364174200fd72d6d81e3a0 2330 bytes (raw)
$ git show gl-env:configure.ac	# shows this blob on the CLI

 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
 
# Copyright (C) 2012-2016 all contributors <cmogstored-public@bogomips.org>
# License: GPLv3 or later (see COPYING for details)
AC_INIT([cmogstored],
 m4_esyscmd([build-aux/git-version-gen .tarball-version]),
 [cmogstored-public@bogomips.org])
AC_CONFIG_SRCDIR([cmogstored.c])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign silent-rules parallel-tests subdir-objects])
AM_SILENT_RULES([yes])
AC_PREREQ(2.59)

AC_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR([m4])

dnl we use C99 struct initializers
AC_PROG_CC_C99

gl_EARLY
gl_INIT
gl_WARN_ADD([-Wall])
gl_WARN_ADD([-Wcast-qual])
gl_WARN_ADD([-Wstrict-prototypes])
gl_WARN_ADD([-Wredundant-decls])
gl_WARN_ADD([-Wshadow])
gl_WARN_ADD([-Werror=write-strings])
gl_WARN_ADD([-Werror=aggregate-return])
gl_WARN_ADD([-Werror=char-subscripts])
gl_WARN_ADD([-Werror=pointer-arith])
gl_WARN_ADD([-Werror-implicit-function-declaration])
gl_WARN_ADD([-Werror=declaration-after-statement]) dnl I hate C99 for this :P
gl_WARN_ADD([-ggdb3],[CFLAGS])
gl_ENVIRON
gl_UNISTD_MODULE_INDICATOR([environ])
AX_PTHREAD(true)
CM_GCC_ATOMICS(true)
AC_SYS_LARGEFILE
AC_C_FLEXIBLE_ARRAY_MEMBER

dnl gnulib *at functions aren't thread-safe, ask for the real thing
AC_CHECK_FUNCS([openat renameat mkdirat fstatat unlinkat])

AC_CHECK_FUNCS([epoll_wait epoll_pwait ppoll])
AC_CHECK_FUNCS([epoll_ctl], [HAVE_EPOLL=1], [HAVE_EPOLL=0])
AC_SUBST(HAVE_EPOLL)
AM_CONDITIONAL(HAVE_EPOLL, test "x$HAVE_EPOLL" = "x1")

AC_CHECK_HEADERS([sys/sendfile.h])

dnl libkqueue should work in the future
AC_CHECK_FUNCS([kqueue])

AC_CHECK_FUNCS([ioctl])
AC_CHECK_FUNCS([sendfile])
AC_CHECK_FUNCS([open_memstream])
AC_CHECK_FUNCS([posix_fadvise])
AC_CHECK_FUNCS([vfork])

dnl need LIBS=-lfreebsd-glue (but not CFLAGS=-I/usr/include/freebsd)
AC_CHECK_FUNCS([bsd_sendfile])

dnl non-standard, but common
AC_CHECK_FUNCS([pthread_yield])

dnl gnulib doesn't actually define SOCK_NONBLOCK/SOCK_CLOEXEC, and
dnl even if it did, emulation wouldn't be thread-safe
AC_CHECK_FUNCS([accept4])

AC_SUBST(NOSTD_CFLAGS)

# This works for all platforms we care about:
# GNU/Linux, FreeBSD, Debian GNU/kFreeBSD
AC_CHECK_FUNCS([setproctitle], [NOSTD_CFLAGS=-DHAVE_SETPROCTITLE=1],
[
case $build_os in
*linux*) ;;
*) NOSTD_CFLAGS=-DSETPROCTITLE_NOOP;;
esac
])

CM_SYSTEMTAP
CM_LD_WRAP

AC_CONFIG_FILES([Makefile lib/Makefile])
AC_OUTPUT

git clone https://yhbt.net/cmogstored.git