-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
72 lines (55 loc) · 2.09 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.69)
AC_INIT([dbfs], m4_esyscmd([ tr -d '\n' < version ]))
CXXFLAGS=""
LDFLAGS=""
AC_CONFIG_SRCDIR([src/dbfs_main.cpp])
AC_CONFIG_HEADERS([include/config.h:include/config.in])
LT_INIT
AM_INIT_AUTOMAKE([subdir-objects])
AM_MAINTAINER_MODE([disable])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_FILES([Makefile
src/Makefile])
# Checks for programs.
AC_PROG_CXX
AC_PROG_INSTALL
# Checks for header files.
AC_HEADER_STDC
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
# Check the presence of PostgreSQL headers
AC_CHECK_HEADER([libpq-fe.h],,
[AC_CHECK_HEADER([postgresql/libpq-fe.h],AC_DEFINE(POSTGRESQL_PREFIX,1,[Define if you need to include postgresql/libpq-fe.h, not just libpq-fe.h]),
[AC_MSG_WARN([No PostgreSQL header found, not building this plugin]) && PGSQL_BUILD=0])])
# Check the presence of Syslog headers
AC_CHECK_HEADER(syslog.h)
# Libs list autmatically generated from dependecy script
AC_CHECK_LIB([fuse],[fuse_main],[],[AC_MSG_FAILURE([could not find lib FUSE])])
AC_CHECK_LIB([pq],[PQconnectdb],[],[AC_MSG_FAILURE([could not find postgreSQL libpq])])
AC_CANONICAL_HOST
AS_CASE(["$host_cpu"],
[ia64 | x86_64 | hppa64],
AC_DEFINE(_FILE_OFFSET_BITS, 64, [FUSE WORD LEN]),
AC_DEFINE(_FILE_OFFSET_BITS, 32, [FUSE WORD LEN]) )
AS_CASE(["$host_os"],
[linux*],
[ OPTIMIZATION="-O2 "
AS_CASE(["$CC"],
[gcc],
[ CXXFLAGS=" -ggdb -std=c++11 -Wall -Wextra \
-D_FORTIFY_SOURCE=2 ${OPTIMIZATION} -fstack-protector \
--param=ssp-buffer-size=4 -Wformat -Werror=format-security "
LDFLAGS="$LDFLAGS ${LIB_SSL_CUSTOM}-Wl,-z,relro"
],
[
CXXFLAGS=" -std=c++11 -O2 -g -Wall "
LDFLAGS="$LDFLAGS "
])
],
[
AC_MSG_ERROR([Your platform is not currently supported.])
])
AC_OUTPUT