forked from kubo/snzip
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
66 lines (56 loc) · 2.18 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
# The autoconf version must be at least 2.64 to correctly detect
# endianess of Mac OS X universal binary.
AC_PREREQ(2.64)
AC_INIT([snzip], [0.9.0])
AM_INIT_AUTOMAKE
AC_ARG_WITH([default-format],
[AS_HELP_STRING([--with-default-format=snzip|framing|framing2],
[Set default format @<:@default=framing2@:>@])],
[
AS_CASE(["$with_default_format"],
[snzip], [],
[framing], [],
[framing2], [],
[snappy-java], [with_default_format=snappy_java],
[snappy-in-java], [with_default_format=snappy_in_java],
[AC_MSG_ERROR([Unknown --with-default-format argument: $with_default_format.
It should be snzip, framing or framing2.
])])
],
[with_default_format=framing2])
AC_DEFINE_UNQUOTED([DEFAULT_FORMAT], [${with_default_format}_format], [Default format for compression])
# These are flags passed to automake (though they look like gcc flags!)
AC_PROG_CC
AC_GNU_SOURCE
AC_C_BIGENDIAN
AC_CANONICAL_HOST
if test "$GCC"; then
CFLAGS="$CFLAGS -Wall"
fi
AC_CHECK_HEADERS([unistd.h])
AC_SYS_LARGEFILE
AC_CHECK_FUNCS(posix_fadvise futimens futimes)
AC_CHECK_MEMBERS([struct stat.st_mtimensec, struct stat.st_mtim.tv_nsec, struct stat.st_mtimespec.tv_nsec], [], [], [[
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
]])
# unlocked stdio functions
AC_CHECK_FUNCS(getc_unlocked putc_unlocked fread_unlocked fwrite_unlocked ferror_unlocked feof_unlocked)
# introduce the optional configure parameter for a non-standard install prefix of snappy
AC_ARG_WITH([snappy],
[AS_HELP_STRING([--with-snappy=prefix],
[try this for a non-standard install prefix of the snappy library])],
[
CFLAGS="$CFLAGS -I$with_snappy/include"
AS_CASE(["$host_os"],
[linux*], [LDFLAGS="$LDFLAGS -L$with_snappy/lib -Wl,-rpath,$with_snappy/lib"],
[solaris*], [LDFLAGS="$LDFLAGS -L$with_snappy/lib -R$with_snappy/lib"],
[LDFLAGS="$LDFLAGS -L$with_snappy/lib"])
],
[])
AC_CHECK_LIB([snappy], [snappy_compress], [],
[AC_MSG_ERROR([No snappy library is not found.])])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT