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.
61 # Checks for header files.
65 AC_CHECK_HEADERS([float.h limits.h malloc.h memory.h stddef.h stdint.h stdlib.h string.h sys/time.h unistd.h])
67 # Checks for typedefs, structures, and compiler characteristics.
80 # Checks for library functions.
85 AC_CHECK_FUNCS([floor getcwd gettimeofday memmove memset pow select sqrt strchr strdup strstr])
87 dnl OPTION_DEFAULT_OFF(NAME, HELP-STRING)
88 dnl Create a new --with option that defaults to being disabled.
89 dnl NAME is the base name of the option. The shell variable with_NAME
90 dnl will be set to either the user's value (if the option is
91 dnl specified; 'yes' for a plain --with-NAME) or to 'no' (if the
92 dnl option is not specified). Note that the shell variable name is
93 dnl constructed as autoconf does, by replacing non-alphanumeric
94 dnl characters with "_".
95 dnl HELP-STRING is the help text for the option.
96 AC_DEFUN([OPTION_DEFAULT_OFF], [dnl
97 AC_ARG_WITH([$1],[AS_HELP_STRING([--with-$1],[$2])],[],[dnl
98 m4_bpatsubst([with_$1], [[^0-9a-z]], [_])=no])dnl
105 GTK_DOC_CHECK([1.9],[--flavour no-tmpl])
111 AC_PATH_PROG([ASY], [asy], [echo])
113 dnl *********************************************
114 dnl *** took from the bullet configure script ***
115 dnl *********************************************
119 *-*-mingw*|*-*-cygwin*)
120 AC_DEFINE(PLATFORM_WIN32, 1, [Platform is Win32])
121 opengl_LIBS="-lunsupported_platform"
122 PLATFORM_STRING="Win32"
125 AC_DEFINE(PLATFORM_LINUX, 1, [Platform is Linux])
126 opengl_LIBS="-lGL -lGLU"
127 PLATFORM_STRING="Linux"
130 AC_DEFINE(PLATFORM_APPLE, 1, [Platform is Apple])
131 opengl_LIBS="-framework AGL -framework OpenGL -framework GLUT"
132 PLATFORM_STRING="Apple"
135 AC_MSG_WARN([*** Please add $host to configure.ac checks!])
138 AC_SUBST(opengl_LIBS)
141 i?86-* | k?-* | athlon-* | pentium*-)
142 AC_DEFINE(ARCH_X86, 1, [Architecture is x86])
143 ARCH_SPECIFIC_CFLAGS=""
147 AC_DEFINE(ARCH_X86_64, 1, [Architecture is x86-64])
148 ARCH_SPECIFIC_CFLAGS="-DUSE_ADDR64"
152 AC_DEFINE(ARCH_PPC, 1, [Architecture is PowerPC])
153 ARCH_SPECIFIC_CFLAGS=""
154 ARCH_STRING="PowerPC"
157 AC_MSG_ERROR([Unknown Architecture])
162 #----------------------------------------------------------------------------
163 # Package configuration switches.
164 #----------------------------------------------------------------------------
165 AC_ARG_ENABLE([multithreaded],
166 [AS_HELP_STRING([--enable-multithreaded],[build BulletMultiThreaded (default NO)])],
167 [disable_multithreaded=no], [disable_multithreaded=yes])
168 AC_MSG_CHECKING([BulletMultiThreaded])
169 AS_IF([test "$disable_multithreaded" = yes], [build_multithreaded=no], [build_multithreaded=yes])
170 AC_MSG_RESULT([$build_multithreaded])
171 AM_CONDITIONAL([CONDITIONAL_BUILD_MULTITHREADED], [test "$build_multithreaded" = yes])
173 AC_ARG_ENABLE([demos],
174 [AS_HELP_STRING([--disable-demos],
175 [disable Bullet demos])],
178 AM_CONDITIONAL([CONDITIONAL_BUILD_DEMOS], [false])
179 if test "x$enable_demos" != xno; then
180 AC_MSG_NOTICE([Building Bullet demos])
181 AM_CONDITIONAL([CONDITIONAL_BUILD_DEMOS],[true])
186 AC_ARG_ENABLE([debug],
187 [AS_HELP_STRING([--enable-debug],[build with debugging information (default NO)])],
188 [], [enable_debug=no])
190 AC_MSG_CHECKING([build mode])
191 AS_IF([test $enable_debug = yes], [build_mode=debug], [build_mode=optimize])
192 AC_MSG_RESULT([$build_mode])
194 CFLAGS="$ARCH_SPECIFIC_CFLAGS $CFLAGS"
195 CXXFLAGS="$ARCH_SPECIFIC_CFLAGS $CXXFLAGS $CFLAGS"
197 ### end bullet configure script
199 dnl *******************************
200 dnl *** add an option for hkl3d ***
201 dnl *******************************
203 AC_ARG_ENABLE([hkl3d],
204 AS_HELP_STRING([--enable-hkl3d],
205 [compile the hkl3d library]),
208 AM_CONDITIONAL([HKL3D], [test x$enable_hkl3d != xno])
210 [PKG_CHECK_MODULES([G3D], [libg3d >= 0.0.8])
212 AC_SEARCH_LIBS([yaml_get_version], [yaml],
213 [AC_CHECK_HEADERS([yaml.h], [],
214 [AC_MSG_ERROR([Could not find the yaml headers, please install yaml developement files])]
216 [AC_MSG_ERROR([Could not find the libyaml runtime, please install yaml])]
219 AC_SUBST(YAML_CFLAGS)
224 dnl ****************************************
225 dnl *** add an option for the ghkl build ***
226 dnl ****************************************
229 AS_HELP_STRING([--disable-gui],
230 [do not compile the gui interface]),
233 AM_CONDITIONAL([GUI], [test x$enable_gui = xyes])
235 [PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.0])
236 PKG_CHECK_MODULES([GTKMM], [gtkmm-2.4 >= 2.18])
238 [PKG_CHECK_MODULES([GLU], [glu >= 7.7.1])
239 PKG_CHECK_MODULES([GTKGLEXT], [gtkglext-1.0 >= 1.2.0])
240 PKG_CHECK_MODULES([GTKGLEXTMM], [gtkglextmm-1.2])
244 dnl ************************************
245 dnl *** Enable lcov coverage reports ***
246 dnl ************************************
249 AS_HELP_STRING([--enable-gcov],
251 [use_gcov=$enableval],
254 if test "x$use_gcov" = "xyes"; then
256 if test "$GCC" != "yes"; then
257 AC_MSG_ERROR([GCC is required for --enable-gcov])
260 dnl Check if ccache is being used
261 AC_CHECK_PROG(SHTOOL, shtool, shtool)
262 case `$SHTOOL path $CC` in
263 *ccache*[)] gcc_ccache=yes;;
267 if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
268 AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
271 ltp_version_list="1.6 1.7 1.8 1.9"
272 AC_CHECK_PROG(LTP, lcov, lcov)
273 AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
276 AC_CACHE_CHECK([for ltp version], glib_cv_ltp_version, [
277 glib_cv_ltp_version=invalid
278 ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
279 for ltp_check_version in $ltp_version_list; do
280 if test "$ltp_version" = "$ltp_check_version"; then
281 glib_cv_ltp_version="$ltp_check_version (ok)"
286 ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
287 AC_MSG_ERROR([$ltp_msg])
290 case $glib_cv_ltp_version in
292 ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
293 AC_MSG_ERROR([$ltp_msg])
298 if test -z "$LTP_GENHTML"; then
299 AC_MSG_ERROR([Could not find genhtml from the LTP package])
302 AC_DEFINE(HAVE_GCOV, 1, [Whether you have gcov])
304 dnl Remove all optimization flags from CFLAGS
306 CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
307 CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9]*//g'`
310 dnl Add the special gcc flags
311 CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
312 CXXFLAGS="$CXXFLAGS -O0 -fprofile-arcs -ftest-coverage"
313 LDFLAGS="$LDFLAGS -lgcov"
316 dnl *********************
317 dnl *** introspection ***
318 dnl *********************
320 GOBJECT_INTROSPECTION_CHECK([0.6.7])
322 AM_COND_IF([HAVE_INTROSPECTION],
323 [PKG_CHECK_MODULES([GOBJECT], [gobject-2.0])
331 AC_DEFINE([HAVE_SECTION_START_STOP], [1], ["do we support section or not"])
332 AC_DEFINE([HAVE_TYPEOF], [1], ["do we have typeof"])
333 AC_DEFINE([HAVE_STATEMENT_EXPR], [1], ["do we have typeof"])
334 AC_DEFINE([HAVE_ATTRIBUTE_COLD], [1], ["do we have typeof"])
335 AC_DEFINE([HAVE_ATTRIBUTE_PRINTF], [1], ["do we have typeof"])
336 AC_DEFINE([HAVE_ATTRIBUTE_CONST], [1], ["do we have typeof"])
337 AC_DEFINE([HAVE_ATTRIBUTE_UNUSED], [1], ["do we have typeof"])
338 AC_DEFINE([HAVE_BUILTIN_CONSTANT_P], [1], ["do we have typeof"])
339 AC_DEFINE([HAVE_WARN_UNUSED_RESULT], [1], ["do we have typeof"])
340 AC_DEFINE([HAVE_ATTRIBUTE_NORETURN], [1], ["do we have typeof"])
341 AC_DEFINE([HAVE_ATTRIBUTE_USED], [1], ["do we have typeof"])
342 AC_DEFINE([HAVE_BUILTIN_TYPES_COMPATIBLE_P], [1], ["do we have typeof"])
344 AC_CONFIG_FILES([Makefile
349 hkl3d/bullet/Makefile
350 hkl3d/bullet/src/Makefile
353 tests/bindings/Makefile
355 Documentation/Makefile
356 Documentation/api/Makefile
357 Documentation/figures/Makefile
358 Documentation/sphinx/Makefile
359 Documentation/sphinx/source/conf.py