/
configure.ac
180 lines (122 loc) · 4.24 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
dnl - The second argument of AC_INIT is the package version number.
dnl - It should be specified as major.minor.revision [1.3.0]
dnl - The third argument, should be replaced with the package
dnl - maintainers email address.
AC_INIT([dynomite], [0.2.12], [cliff@powerset.com])
SHORT_DESCRIPTION="The dynomite datastore. It is a highly available, low latency key value store. Word."
dnl - The following prerequisites line can be used to specify
dnl - the exact, or minimum, versions of packages on which this
dnl - package will depend (for build _and_ runtime)
RUNTIME_PREREQUISITES="powerset_erlang powerset_ruby"
dnl - The following prerequisites line can be used to specify
dnl - the exact, or minimum, versions of packages on which this
dnl - package will depend (for build only)
#BUILD_PREREQUISITES=""
dnl -- [ end basic configuration ]
AC_CONFIG_AUX_DIR([bones-common])
AC_CANONICAL_SYSTEM
AC_PREFIX_DEFAULT([/p])
AX_INIT
AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
AC_SUBST(SHORT_DESCRIPTION)
dnl
dnl - check for common utilities
dnl
AC_PROG_AWK
AC_PROG_EGREP
AC_PATH_PROG(TEE, tee)
AC_CHECK_PROG(HAVE_PERL, perl, yes,
[AC_MSG_ERROR([the Powerset build environment requires perl])])
dnl
dnl - determine whether or not to use pkg-config
dnl
PKG_PROG_PKG_CONFIG
AC_ARG_ENABLE([pkgconfig],
AC_HELP_STRING([--enable-pkgconfig],
[check build deps with pkg-config (default: auto)]),
[dopkgconfig="$enableval"], [dopkgconfig="maybe"])
case "$dopkgconfig" in
yes) if test -n "$PKG_CONFIG"; then
using_pkgconfig=yes
else
AC_MSG_ERROR([pkg-config not found])
fi
;;
maybe) if test -n "$PKG_CONFIG"; then
using_pkgconfig=yes
fi
;;
esac
AM_CONDITIONAL([HAVE_PKGCONFIG], [test -n "$PKG_CONFIG"])
dnl
dnl - extract build pkgconfig and non-pkgconfig prereqs
dnl
AX_PACKAGE_LIST([BUILD], [$BUILD_PREREQUISITES])
if test -n "$using_pkgconfig"; then
AX_SPLIT_PREREQUISITES([BUILD_PREREQUISITES], [$BUILD_PREREQUISITES])
if test -n "$BUILD_PREREQUISITES_PKGCONFIG"; then
PKG_CHECK_MODULES([BUILD_PREREQUISITES], [$BUILD_PREREQUISITES_PKGCONFIG])
fi
fi
AC_SUBST(BUILD_PREREQUISITES_NONPKGCONFIG)
AC_SUBST(BUILD_PREREQUISITES_PKGCONFIG)
dnl
dnl - extract runtime pkgconfig and non-pkgconfig prereqs
dnl
AX_PACKAGE_LIST([RUNTIME], [$RUNTIME_PREREQUISITES])
if test -n "$using_pkgconfig"; then
AX_SPLIT_PREREQUISITES([RUNTIME_PREREQUISITES], [$RUNTIME_PREREQUISITES])
if test -n "$RUNTIME_PREREQUISITES_PKGCONFIG"; then
PKG_CHECK_MODULES([RUNTIME_PREREQUISITES], [$RUNTIME_PREREQUISITES_PKGCONFIG])
fi
fi
AC_SUBST(RUNTIME_PREREQUISITES_NONPKGCONFIG)
AC_SUBST(RUNTIME_PREREQUISITES_PKGCONFIG)
dnl
dnl - see if we can create packages
dnl
AC_CHECK_PROG(HAVE_PP_CREATE, pp_create.rb, yes, no)
AM_CONDITIONAL(HAVE_PP_CREATE, test $HAVE_PP_CREATE = yes)
dnl
dnl - Allow override of auto-detect package architecture
dnl
AC_ARG_WITH([package-target],
AC_HELP_STRING([--with-package-target=ARG],
[override the detected rpm architecture]),
[cv_force_arch="$withval"],
[cv_force_arch="$PACKAGE_TARGET"])
AM_CONDITIONAL(FORCE_PKG_ARCH, test -n "$cv_force_arch")
AC_SUBST(cv_force_arch)
dnl
dnl - internal use only
dnl
AC_ARG_WITH([internal-release],
AC_HELP_STRING([--with-internal-release=ARG],
[internal use only]),
[PACKAGE_RELEASE=$withval],
[PACKAGE_RELEASE=0])
AC_SUBST(PACKAGE_RELEASE)
dnl
dnl - build the PKG_DEPENDS list for the yaml
dnl
AX_INIT_DEPENDENCY_SOLVER
AX_GENERATE_PKG_DEPENDS([RUNTIME_DEPENDS_LIST],
[$RUNTIME_PACKAGES],
[$pkg_name: {min: '$pkg_version', max: '$pkg_version_max'}])
AX_GENERATE_PKG_DEPENDS([BUILD_DEPENDS_LIST],
[$RUNTIME_PACKAGES $BUILD_PACKAGES],
[$pkg_name: {eq: '$pkg_version-$pkg_release'}],
[want-closure])
dnl - Uncomment if you need ruby support
#AM_PATH_RUBY
dnl - Uncomment if you need python support
#AM_PATH_PYTHON
AC_CONFIG_FILES([
Makefile
build-yaml-template.yaml
yaml-template.yaml
pkgconfig-template.pc
])
AC_OUTPUT
AX_FINI