-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
131 lines (114 loc) · 4.15 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
AC_PREREQ([2.69])
AC_INIT([mobject], [0.7], [mdorier@anl.gov])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects silent-rules])
AM_SILENT_RULES([yes])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([include/libmobject-store.h])
AC_CONFIG_HEADERS([src/mobject-store-config.h])
LT_PREREQ([2.2])
AM_PROG_AR
LT_INIT([dlopen])
# checks for programs
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_INSTALL
# check for C++11
AX_CXX_COMPILE_STDCXX(11, noext, mandatory)
# checks for libraries
# pkg-config and libraries supporting that
PKG_PROG_PKG_CONFIG
if test "x$PKG_CONFIG" == "x"; then
AC_MSG_ERROR([Could not find pkg-config utility!])
fi
# coreutils checks for OSX
AC_ARG_VAR([TIMEOUT], timeout program)
AC_ARG_VAR([MKTEMP], mktemp program)
if test -z "$TIMEOUT" ; then
AC_CHECK_PROGS(TIMEOUT, [timeout gtimeout])
if test -z "$TIMEOUT" ; then
AC_MSG_ERROR([Could not find timeout command (can optionally provide via the TIMEOUT variable)])
fi
else
AC_SUBST([TIMEOUT], ["$TIMEOUT"])
fi
if test -z "$MKTEMP" ; then
AC_CHECK_PROGS(MKTEMP, [mktemp gmktemp])
if test -z "$MKTEMP" ; then
AC_MSG_ERROR([Could not find mktemp command (can optionally provide via the MKTEMP variable)])
fi
else
AC_SUBST([MKTEMP], ["$MKTEMP"])
fi
dnl seems like this should be a function but my first stab at m4 exploded
dnl mightily...
PKG_CHECK_MODULES([MARGO],[margo],[],
AC_MSG_ERROR([Could not find working margo installation!]) )
LIBS="$MARGO_LIBS $LIBS"
CPPFLAGS="$MARGO_CFLAGS $CPPFLAGS"
CFLAGS="$MARGO_CFLAGS $CFLAGS"
PKG_CHECK_MODULES([YOKAN_CLIENT],[yokan-client],[],
AC_MSG_ERROR([Could not find working Yokan client installation!]) )
SERVER_LIBS="$YOKAN_CLIENT_LIBS $SERVER_LIBS"
SERVER_CPPFLAGS="$YOKAN_CLIENT_CFLAGS $SERVER_CPPFLAGS"
SERVER_CFLAGS="$YOKAN_CLIENT_CFLAGS $SERVER_CFLAGS"
PKG_CHECK_MODULES([BAKE_CLIENT],[bake-client],[],
AC_MSG_ERROR([Could not find working Bake client installation!]) )
SERVER_LIBS="$BAKE_CLIENT_LIBS $SERVER_LIBS"
SERVER_CPPFLAGS="$BAKE_CLIENT_CFLAGS $SERVER_CPPFLAGS"
SERVER_CFLAGS="$BAKE_CLIENT_CFLAGS $SERVER_CFLAGS"
PKG_CHECK_MODULES([CH_PLACEMENT], [ch-placement], [],
AC_MSG_ERROR([Could not find ch-placement]) )
CLIENT_CFLAGS="$CH_PLACEMENT_CFLAGS $CLIENT_CFLAGS"
CLIENT_LIBS="$CH_PLACEMENT_LIBS $CLIENT_LIBS"
PKG_CHECK_MODULES([SSG],[ssg],[],
AC_MSG_ERROR([Could not find working SSG installation!]) )
CLIENT_LIBS="$SSG_LIBS $CLIENT_LIBS"
CLIENT_CPPFLAGS="$SSG_CFLAGS $CLIENT_CPPFLAGS"
CLIENT_CFLAGS="$SSG_CFLAGS $CLIENT_CFLAGS"
# check for RADOS
AC_ARG_WITH([rados],
AS_HELP_STRING([--with-rados], [Additionally build tests against librados (default is no)]),
[], [])
if test x"$with_rados" == "xyes" ; then
# check for RADOS headers and libraries
AC_CHECK_HEADERS([rados/librados.h rados/rados_types.h],
[],
[AC_MSG_ERROR([RADOS support requested but could not find RADOS headers!])],
[])
AC_CHECK_LIB([rados], [rados_create],
[],
[AC_MSG_ERROR([RADOS support requested but could not link against librados!])])
fi
# both found, set output to additionally build tests against RADOS
AM_CONDITIONAL(HAVE_RADOS, test x"$with_rados" == "xyes")
AC_ARG_ENABLE(bedrock,
[AS_HELP_STRING([--enable-bedrock],[Enable Bedrock (Mochi loader) support @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_bedrock="yes" ;;
no) enable_bedrock="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-bedrock) ;;
esac],
[enable_bedrock="no"]
)
AM_CONDITIONAL(ENABLE_BEDROCK, test x$enable_bedrock = xyes)
if test "$enable_bedrock" = "yes" ; then
AC_DEFINE(USE_BEDROCK, 1, [Bedrock support enabled.])
ENABLE_BEDROCK=1
PKG_CHECK_MODULES([BEDROCK],[bedrock-server],[],
AC_MSG_ERROR([Bedrock requested, but could not find bedrock]))
else
ENABLE_BEDROCK=0
fi
AM_CONDITIONAL(BUILD_BEDROCK, test $ENABLE_BEDROCK -eq 1)
AC_SUBST(ENABLE_BEDROCK)
AC_SUBST(BEDROCK_LIBS)
AC_SUBST(BEDROCK_CFLAGS)
AC_SUBST(SERVER_LIBS)
AC_SUBST(CLIENT_LIBS)
AC_SUBST(SERVER_CPPFLAGS)
AC_SUBST(CLIENT_CPPFLAGS)
AC_SUBST(SERVER_CFLAGS)
AC_SUBST(CLIENT_CFLAGS)
AC_CONFIG_FILES([Makefile maint/mobject-store.pc maint/mobject-server.pc])
AC_OUTPUT