1 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3 m4_define([v_maj], [4])
4 m4_define([v_min], [99])
5 m4_define([v_mic], [99])
6 m4_define([v_rev], m4_esyscmd([(git rev-list --count HEAD 2>/dev/null || echo 0) | tr -d '\n']))dnl
7 ##-- When released, remove the dnl on the below line
8 dnl m4_undefine([v_rev])
9 ##-- When doing snapshots - change soname. remove dnl on below line
10 dnl m4_define([relname], [ver-pre-svn-07])
11 dnl m4_define([v_rel], [-release relname])
12 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
13 m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])], [m4_define([v_ver], [v_maj.v_min.v_mic])])
14 m4_define([lt_cur], m4_eval(v_maj + v_min))
15 m4_define([lt_rev], v_mic)
16 m4_define([lt_age], v_min)
17 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
18 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
21 AC_INIT([hkl],[v_ver],[picca@synchrotron-soleil.fr])
22 AC_CONFIG_SRCDIR([config.h.in])
23 AC_CONFIG_HEADERS([config.h])
24 AC_CONFIG_MACRO_DIR([m4])
25 AC_CONFIG_AUX_DIR(config)
27 AM_INIT_AUTOMAKE([silent-rules tar-ustar -Wno-portability subdir-objects])
29 # Checks for programs.
39 AM_PROG_VALAC([0.8.1])
41 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
42 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
43 m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
44 m4_ifdef([v_rel], , [m4_define([v_rel], [])])
45 AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
46 AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
47 AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
48 AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
49 version_info="lt_cur:lt_rev:lt_age"
51 AC_SUBST(version_info)
52 AC_SUBST(release_info)
53 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
54 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
58 # Checks for libraries.
62 # Checks for header files.
66 AC_CHECK_HEADERS([float.h limits.h malloc.h memory.h stddef.h stdint.h stdlib.h string.h sys/time.h unistd.h])
68 # Checks for typedefs, structures, and compiler characteristics.
81 # Checks for library functions.
86 AC_CHECK_FUNCS([floor getcwd gettimeofday memmove memset pow select sqrt strchr strdup strstr])
88 dnl OPTION_DEFAULT_OFF(NAME, HELP-STRING)
89 dnl Create a new --with option that defaults to being disabled.
90 dnl NAME is the base name of the option. The shell variable with_NAME
91 dnl will be set to either the user's value (if the option is
92 dnl specified; 'yes' for a plain --with-NAME) or to 'no' (if the
93 dnl option is not specified). Note that the shell variable name is
94 dnl constructed as autoconf does, by replacing non-alphanumeric
95 dnl characters with "_".
96 dnl HELP-STRING is the help text for the option.
97 AC_DEFUN([OPTION_DEFAULT_OFF], [dnl
98 AC_ARG_WITH([$1],[AS_HELP_STRING([--with-$1],[$2])],[],[dnl
99 m4_bpatsubst([with_$1], [[^0-9a-z]], [_])=no])dnl
106 GTK_DOC_CHECK([1.9],[--flavour no-tmpl])
112 AC_PATH_PROG([ASY], [asy], [echo])
114 dnl *******************************
115 dnl *** add an option for hkl3d ***
116 dnl *******************************
118 AC_ARG_ENABLE([hkl3d],
119 AS_HELP_STRING([--enable-hkl3d],
120 [compile the hkl3d library]),
123 AM_CONDITIONAL([HKL3D], [test x$enable_hkl3d != xno])
125 [PKG_CHECK_MODULES([G3D], [libg3d >= 0.0.8])
126 PKG_CHECK_MODULES([BULLET], [bullet >= 2.82])
128 AC_SEARCH_LIBS([yaml_get_version], [yaml],
129 [AC_CHECK_HEADERS([yaml.h], [],
130 [AC_MSG_ERROR([Could not find the yaml headers, please install yaml developement files])]
132 [AC_MSG_ERROR([Could not find the libyaml runtime, please install yaml])]
135 AC_SUBST(YAML_CFLAGS)
140 dnl ****************************************
141 dnl *** add an option for the ghkl build ***
142 dnl ****************************************
145 AS_HELP_STRING([--disable-gui],
146 [do not compile the gui interface]),
149 AM_CONDITIONAL([GUI], [test x$enable_gui = xyes])
151 [PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.0])
153 [PKG_CHECK_MODULES([GLU], [glu >= 7.7.1])
154 PKG_CHECK_MODULES([GTKGLEXT], [gtkglext-1.0 >= 1.2.0])
158 dnl ************************************
159 dnl *** Enable lcov coverage reports ***
160 dnl ************************************
163 AS_HELP_STRING([--enable-gcov],
165 [use_gcov=$enableval],
168 if test "x$use_gcov" = "xyes"; then
170 if test "$GCC" != "yes"; then
171 AC_MSG_ERROR([GCC is required for --enable-gcov])
174 dnl Check if ccache is being used
175 AC_CHECK_PROG(SHTOOL, shtool, shtool)
176 case `$SHTOOL path $CC` in
177 *ccache*[)] gcc_ccache=yes;;
181 if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
182 AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
185 ltp_version_list="1.6 1.7 1.8 1.9"
186 AC_CHECK_PROG(LTP, lcov, lcov)
187 AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
190 AC_CACHE_CHECK([for ltp version], glib_cv_ltp_version, [
191 glib_cv_ltp_version=invalid
192 ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
193 for ltp_check_version in $ltp_version_list; do
194 if test "$ltp_version" = "$ltp_check_version"; then
195 glib_cv_ltp_version="$ltp_check_version (ok)"
200 ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
201 AC_MSG_ERROR([$ltp_msg])
204 case $glib_cv_ltp_version in
206 ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
207 AC_MSG_ERROR([$ltp_msg])
212 if test -z "$LTP_GENHTML"; then
213 AC_MSG_ERROR([Could not find genhtml from the LTP package])
216 AC_DEFINE(HAVE_GCOV, 1, [Whether you have gcov])
218 dnl Remove all optimization flags from CFLAGS
220 CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
221 CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9]*//g'`
224 dnl Add the special gcc flags
225 CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
226 CXXFLAGS="$CXXFLAGS -O0 -fprofile-arcs -ftest-coverage"
227 LDFLAGS="$LDFLAGS -lgcov"
230 dnl *********************
231 dnl *** introspection ***
232 dnl *********************
234 GOBJECT_INTROSPECTION_CHECK([0.6.7])
236 AM_COND_IF([HAVE_INTROSPECTION],
237 [PKG_CHECK_MODULES([GOBJECT], [gobject-2.0])])
244 AC_DEFINE([HAVE_SECTION_START_STOP], [1], ["do we support section or not"])
245 AC_DEFINE([HAVE_TYPEOF], [1], ["do we have typeof"])
246 AC_DEFINE([HAVE_STATEMENT_EXPR], [1], ["do we have typeof"])
247 AC_DEFINE([HAVE_ATTRIBUTE_COLD], [1], ["do we have typeof"])
248 AC_DEFINE([HAVE_ATTRIBUTE_PRINTF], [1], ["do we have typeof"])
249 AC_DEFINE([HAVE_ATTRIBUTE_CONST], [1], ["do we have typeof"])
250 AC_DEFINE([HAVE_ATTRIBUTE_UNUSED], [1], ["do we have typeof"])
251 AC_DEFINE([HAVE_BUILTIN_CONSTANT_P], [1], ["do we have typeof"])
252 AC_DEFINE([HAVE_WARN_UNUSED_RESULT], [1], ["do we have typeof"])
253 AC_DEFINE([HAVE_ATTRIBUTE_NORETURN], [1], ["do we have typeof"])
254 AC_DEFINE([HAVE_ATTRIBUTE_USED], [1], ["do we have typeof"])
255 AC_DEFINE([HAVE_BUILTIN_TYPES_COMPATIBLE_P], [1], ["do we have typeof"])
257 AC_CONFIG_FILES([Makefile
264 tests/bindings/Makefile
266 Documentation/Makefile
267 Documentation/api/Makefile
268 Documentation/figures/Makefile
269 Documentation/sphinx/Makefile
270 Documentation/sphinx/source/conf.py