1 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3 m4_define([v_maj], [5])
4 m4_define([v_min], [0])
5 m4_define([v_mic], [0])
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
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.
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 # activate all the warnings
62 # Checks for libraries.
66 # Checks for header files.
70 AC_CHECK_HEADERS([fcntl.h float.h limits.h malloc.h memory.h stddef.h stdint.h stdlib.h string.h sys/param.h sys/time.h unistd.h])
72 # Checks for typedefs, structures, and compiler characteristics.
86 # Checks for library functions.
92 AC_CHECK_FUNCS([atexit dup2 fchdir floor getcwd getpagesize gettimeofday isascii memchr memmove memset mkdir pow putenv rmdir select sqrt strchr strcasecmp strdup strerror strncasecmp strrchr strstr strtol strtoul])
94 dnl OPTION_DEFAULT_OFF(NAME, HELP-STRING)
95 dnl Create a new --enable option that defaults to being disabled.
96 dnl NAME is the base name of the option. The shell variable enable_NAME
97 dnl will be set to either the user's value (if the option is
98 dnl specified; 'yes' for a plain --enable-NAME) or to 'no' (if the
99 dnl option is not specified). Note that the shell variable name is
100 dnl constructed as autoconf does, by replacing non-alphanumeric
101 dnl characters with "_".
102 dnl HELP-STRING is the help text for the option.
103 AC_DEFUN([OPTION_DEFAULT_OFF], [dnl
104 AC_ARG_ENABLE([$1],[AS_HELP_STRING([--enable-$1],[$2])],[],[dnl
105 m4_bpatsubst([enable_$1], [[^0-9a-z]], [_])=no])dnl
108 dnl OPTION_DEFAULT_ON(NAME, HELP-STRING)
109 dnl Create a new --enable option that defaults to being enabled.
110 dnl NAME is the base name of the option. The shell variable enable_NAME
111 dnl will be set to either the user's value (if the option is
112 dnl specified; 'no' for a plain --enable-NAME) or to 'yes' (if the
113 dnl option is not specified). Note that the shell variable name is
114 dnl constructed as autoconf does, by replacing non-alphanumeric
115 dnl characters with "_".
116 dnl HELP-STRING is the help text for the option.
117 AC_DEFUN([OPTION_DEFAULT_ON], [dnl
118 AC_ARG_ENABLE([$1],[AS_HELP_STRING([--disable-$1],[$2])],[],[dnl
119 m4_bpatsubst([enable_$1], [[^0-9a-z]], [_])=yes])dnl
126 OPTION_DEFAULT_OFF([analyzer], [enable gcc-10 -fanalyzer])
127 AM_CONDITIONAL([ANALYZER], [test x$enable_analyzer != xno])
128 AM_COND_IF([ANALYZER],
129 AX_CHECK_COMPILE_FLAG([-fanalyzer], [CFLAGS="$CFLAGS -fanalyzer"], [], [])
136 OPTION_DEFAULT_OFF([logging], [enable the glib logging])
137 AM_CONDITIONAL([LOGGING], [test x$enable_logging != xno])
138 AM_COND_IF([LOGGING],
139 AC_DEFINE([LOGGING], [1], [activate the logging or not])
146 OPTION_DEFAULT_ON([hkl-doc], [build documentation])
147 AM_CONDITIONAL([HKL_DOC], [test x$enable_hkl_doc = xyes])
148 AM_COND_IF([HKL_DOC],
149 [dnl *** asymptote ***
150 AC_PATH_PROG([ASY], [asy], [echo])
152 AC_PATH_PROG([EMACS], [emacs], [no])
154 AC_PATH_PROG([GNUPLOT], [gnuplot], [echo])
156 AC_PATH_PROG([XVFB_RUN], [xvfb-run], [echo])
160 AC_ARG_WITH([mathjax],
161 [AS_HELP_STRING([--with-mathjax],[use mathjax (default is "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML")])],
162 [use_mathjax=$withval],
163 [use_mathjax="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML"])
165 MATHJAX_PATH=$use_mathjax
166 AC_SUBST(MATHJAX_PATH)
169 GTK_DOC_CHECK([1.9],[--flavour no-tmpl])
171 dnl **********************************************
172 dnl *** add an option for the binoculars build ***
173 dnl **********************************************
175 OPTION_DEFAULT_ON([binoculars], [do not compile the binoculars API])
177 AM_CONDITIONAL([BINOCULARS], [test x$enable_binoculars = xyes])
178 AM_COND_IF([BINOCULARS],
179 [PKG_CHECK_MODULES([HDF5], [hdf5-serial >= 1.8.13])
180 PKG_CHECK_MODULES([CGLM], [cglm >= 0.7])
181 PKG_CHECK_MODULES([INIH], [inih >= 55])
182 AC_PATH_PROG([CABAL], [cabal])
183 if test -z "$CABAL" ; then
184 AC_MSG_ERROR([cabal was not found])
188 dnl *******************************
189 dnl *** add an option for hkl3d ***
190 dnl *******************************
192 OPTION_DEFAULT_OFF([hkl3d], [compile the hkl3d library])
194 AM_CONDITIONAL([HKL3D], [test x$enable_hkl3d != xno])
196 [PKG_CHECK_MODULES([G3D], [libg3d >= 0.0.8])
197 PKG_CHECK_MODULES([BULLET], [bullet >= 2.82])
199 AC_SEARCH_LIBS([yaml_get_version], [yaml],
200 [AC_CHECK_HEADERS([yaml.h], [],
201 [AC_MSG_ERROR([Could not find the yaml headers, please install yaml developement files])]
203 [AC_MSG_ERROR([Could not find the libyaml runtime, please install yaml])]
206 AC_SUBST(YAML_CFLAGS)
211 dnl ****************************************
212 dnl *** add an option for the ghkl build ***
213 dnl ****************************************
215 OPTION_DEFAULT_ON([gui], [do not compile the gui interface])
217 AM_CONDITIONAL([GUI], [test x$enable_gui = xyes])
219 [PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.22])
221 [PKG_CHECK_MODULES([GL], [gl >= 1.0.0])
222 PKG_CHECK_MODULES([GLU], [glu >= 7.7.1])
226 dnl *********************
227 dnl *** introspection ***
228 dnl *********************
230 GOBJECT_INTROSPECTION_CHECK([0.6.7])
232 AM_COND_IF([HAVE_INTROSPECTION],
233 [PKG_CHECK_MODULES([GOBJECT], [gobject-2.0])])
240 OPTION_DEFAULT_OFF([contrib], [compile the contrib part])
242 AM_CONDITIONAL([CONTRIB], [test x$enable_contrib != xno])
245 dnl ******************
246 dnl *** datatype99 ***
247 dnl ******************
249 OPTION_DEFAULT_OFF([datatype99], [use the system datatype99])
250 AC_CHECK_HEADERS([datatype99.h], [], [enable_datatype99=no])
252 DATATYPE99_CFLAGS="-ftrack-macro-expansion=0"
253 AM_CONDITIONAL([DATATYPE99], [test x$enable_datatype99 != xno])
254 AM_COND_IF([DATATYPE99],
256 [DATATYPE99_CFLAGS=$DATATYPE99_CFLAGS' -I$(top_srcdir)/third-party/']
258 AC_SUBST(DATATYPE99_CFLAGS)
261 AC_CONFIG_FILES([Makefile
262 binoculars-ng/binoculars/Makefile
263 binoculars-ng/hkl.cabal
264 binoculars-ng/Makefile
272 tests/bindings/Makefile
275 Documentation/Makefile
276 Documentation/hkl.org
277 Documentation/api/Makefile
278 Documentation/figures/Makefile
279 Documentation/sphinx/Makefile
280 Documentation/sphinx/source/conf.py
284 contrib/cristal/Makefile
285 contrib/cristal/xrays/Makefile
286 contrib/sixs/Makefile
287 contrib/petra3/Makefile