-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
150 lines (128 loc) · 3.57 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
# NOTE: autoscan can automatically generate configure.ac
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT([baler], 4.1.0, [email protected])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src/baler/balerd.c])
AC_CONFIG_AUX_DIR(config)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([foreign])
m4_ifdef([AM_SILENT_RULES],
[AM_SILENT_RULES([yes])
])
AM_PROG_LIBTOOL
LT_INIT
AC_PROG_CC_C99()
if test "$ac_cv_prog_cc_c99" = "no"; then
AC_MSG_ERROR([baler requires a compiler with C99 standard])
fi
AC_PROG_LEX()
AC_PROG_YACC()
AM_PROG_CC_C_O()
OPTION_GITINFO
dnl change sharedstatedir default
test "$sharedstatedir" = '${prefix}/com' && sharedstatedir='${prefix}/var/lib'
OPTION_DEFAULT_ENABLE([dict], [ENABLE_DICT])
OPTION_DEFAULT_DISABLE([etc], [ENABLE_ETC])
OPTION_DEFAULT_ENABLE([python], [ENABLE_PYTHON])
AM_COND_IF([ENABLE_PYTHON], [
AM_PATH_PYTHON(3.6)
AX_PYTHON_DEVEL
AC_PATH_PROG([CYTHON], [cython])
if test -z "$CYTHON"; then
AC_MSG_ERROR([baler python module requires cython to build])
fi
])
dnl ==================================================
dnl == libevent, required
OPTION_DEFAULT_ENABLE([libevent], [ENABLE_LIBEVENT])
OPTION_WITH([libevent], [LIBEVENT])
SAVED_CFLAGS=$CFLAGS
SAVED_LDFLAGS=$LDFLAGS
CFLAGS="$SAVED_CFLAGS $LIBEVENT_INCDIR_FLAG"
LDFLAGS="$SAVED_LDFLAGS $LIBEVENT_LIBDIR_FLAG $LIBEVENT_LIB64DIR_FLAG"
AC_CHECK_HEADER([event2/event.h],
[],
[AC_MSG_ERROR([cannot build with libevent header file])]
)
AC_CHECK_LIB([event], [event_base_new],
[],
[AC_MSG_ERROR([cannot build with libevent])]
)
CFLAGS=$SAVED_CFLAGS
LDFLAGS=$SAVED_LDFLAGS
LIBS=""
dnl ^^^^^^^^^^^^^^^^ (libevent) ^^^^^^^^^^^^^^^^^^^
dnl ==================================================
dnl == sos, required
OPTION_DEFAULT_ENABLE([sos], [ENABLE_SOS])
OPTION_WITH([sos], [SOS])
AM_COND_IF([ENABLE_SOS],
[],
[AC_MSG_ERROR([baler needs sos to build/run])]
)
SAVED_CFLAGS=$CFLAGS
SAVED_LDFLAGS=$LDFLAGS
CFLAGS="$SAVED_CFLAGS $SOS_INCDIR_FLAG"
LDFLAGS="$SAVED_LDFLAGS $SOS_LIBDIR_FLAG $SOS_LIB64DIR_FLAG"
AC_CHECK_HEADER([sos/sos.h],
[],
[AC_MSG_ERROR([cannot build with sos header file])]
)
AC_CHECK_LIB([sos], [sos_container_open],
[],
[AC_MSG_ERROR([cannot build with libsos])]
)
CFLAGS=$SAVED_CFLAGS
LDFLAGS=$SAVED_LDFLAGS
LIBS=""
dnl ^^^^^^^^^^^^^^^^ (sos) ^^^^^^^^^^^^^^^^^^^
dnl ovis-lib contains zap
OPTION_WITH([ovis-lib], [OVIS_LIB])
dnl ==================================================
dnl == zap, optional
OPTION_DEFAULT_DISABLE([zap], [ENABLE_ZAP])
AM_COND_IF([ENABLE_ZAP], [
SAVED_CFLAGS=$CFLAGS
SAVED_LDFLAGS=$LDFLAGS
CFLAGS="$SAVED_CFLAGS -I$OVIS_LIB_INCDIR"
LDFLAGS="$SAVED_LDFLAGS -L$OVIS_LIB_LIBDIR"
AC_CHECK_HEADER([zap/zap.h],
[],
[AC_MSG_ERROR([cannot build with zap header file])]
)
AC_CHECK_LIB([zap], [zap_get],
[],
[AC_MSG_ERROR([cannot build with zap])]
)
CFLAGS=$SAVED_CFLAGS
LDFLAGS=$SAVED_LDFLAGS
LIBS=""
])
dnl ^^^^^^^^^^^^^^^^ (zap) ^^^^^^^^^^^^^^^^^^^
OPTION_DEFAULT_DISABLE([n2da-test], [ENABLE_N2DA_TEST])
OPTION_DEFAULT_DISABLE([ocm], [ENABLE_OCM])
OPTION_DOC
distdir=${PACKAGE_NAME}-${PACKAGE_VERSION}
AC_SUBST(ac_configure_args)
AC_SUBST(prefix)
AC_SUBST(distdir)
AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
if test -z "$ENABLE_DOC_TRUE"
then
AC_CONFIG_FILES([docs/Doxyfile])
fi
AC_CONFIG_FILES([Makefile docs/Makefile src/Makefile
src/baler/Makefile src/plugins/Makefile
src/test/Makefile
src/n2dassoc/Makefile
src/tools/Makefile
etc/Makefile
etc/baler/Makefile
etc/systemd/Makefile
dict/Makefile
python/Makefile
python/ptn_cmp_ext/Makefile
])
AC_OUTPUT