2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([hkl],[5.0.0],[picca@synchrotron-soleil.fr])
6 AC_CONFIG_SRCDIR([config.h.in])
7 AC_CONFIG_HEADERS([config.h])
8 AC_CONFIG_MACRO_DIR([m4])
9 AC_CONFIG_AUX_DIR(config)
11 AM_INIT_AUTOMAKE([silent-rules tar-ustar -Wno-portability])
13 # Checks for programs.
24 # Checks for libraries.
27 # Checks for header files.
32 AC_CHECK_HEADERS([float.h limits.h malloc.h memory.h stddef.h stdint.h stdlib.h string.h sys/time.h unistd.h])
34 # Checks for typedefs, structures, and compiler characteristics.
47 # Checks for library functions.
52 AC_CHECK_FUNCS([floor getcwd gettimeofday memmove memset pow select sqrt strchr strdup strstr])
58 GTK_DOC_CHECK([1.9],[--flavour no-tmpl])
64 AC_PATH_PROG([ASY], [asy], [echo])
66 dnl *********************************************
67 dnl *** took from the bullet configure script ***
68 dnl *********************************************
72 *-*-mingw*|*-*-cygwin*)
73 AC_DEFINE(PLATFORM_WIN32, 1, [Platform is Win32])
74 opengl_LIBS="-lunsupported_platform"
75 PLATFORM_STRING="Win32"
78 AC_DEFINE(PLATFORM_LINUX, 1, [Platform is Linux])
79 opengl_LIBS="-lGL -lGLU"
80 PLATFORM_STRING="Linux"
83 AC_DEFINE(PLATFORM_APPLE, 1, [Platform is Apple])
84 opengl_LIBS="-framework AGL -framework OpenGL -framework GLUT"
85 PLATFORM_STRING="Apple"
88 AC_MSG_WARN([*** Please add $host to configure.ac checks!])
94 i?86-* | k?-* | athlon-* | pentium*-)
95 AC_DEFINE(ARCH_X86, 1, [Architecture is x86])
96 ARCH_SPECIFIC_CFLAGS=""
100 AC_DEFINE(ARCH_X86_64, 1, [Architecture is x86-64])
101 ARCH_SPECIFIC_CFLAGS="-DUSE_ADDR64"
105 AC_DEFINE(ARCH_PPC, 1, [Architecture is PowerPC])
106 ARCH_SPECIFIC_CFLAGS=""
107 ARCH_STRING="PowerPC"
110 AC_MSG_ERROR([Unknown Architecture])
115 #----------------------------------------------------------------------------
116 # Package configuration switches.
117 #----------------------------------------------------------------------------
118 AC_ARG_ENABLE([multithreaded],
119 [AS_HELP_STRING([--enable-multithreaded],[build BulletMultiThreaded (default NO)])],
120 [disable_multithreaded=no], [disable_multithreaded=yes])
121 AC_MSG_CHECKING([BulletMultiThreaded])
122 AS_IF([test "$disable_multithreaded" = yes], [build_multithreaded=no], [build_multithreaded=yes])
123 AC_MSG_RESULT([$build_multithreaded])
124 AM_CONDITIONAL([CONDITIONAL_BUILD_MULTITHREADED], [test "$build_multithreaded" = yes])
126 AC_ARG_ENABLE([demos],
127 [AS_HELP_STRING([--disable-demos],
128 [disable Bullet demos])],
131 AM_CONDITIONAL([CONDITIONAL_BUILD_DEMOS], [false])
132 if test "x$enable_demos" != xno; then
133 AC_MSG_NOTICE([Building Bullet demos])
134 AM_CONDITIONAL([CONDITIONAL_BUILD_DEMOS],[true])
139 AC_ARG_ENABLE([debug],
140 [AS_HELP_STRING([--enable-debug],[build with debugging information (default NO)])],
141 [], [enable_debug=no])
143 AC_MSG_CHECKING([build mode])
144 AS_IF([test $enable_debug = yes], [build_mode=debug], [build_mode=optimize])
145 AC_MSG_RESULT([$build_mode])
147 CFLAGS="$ARCH_SPECIFIC_CFLAGS $CFLAGS"
148 CXXFLAGS="$ARCH_SPECIFIC_CFLAGS $CXXFLAGS $CFLAGS"
150 ### end bullet configure script
152 dnl *******************************
153 dnl *** add an option for hkl3d ***
154 dnl *******************************
156 AC_ARG_ENABLE([hkl3d],
157 AS_HELP_STRING([--disable-hkl3d],
158 [do not compile the hkl3d library]),
161 AM_CONDITIONAL([HKL3D], [test x$enable_hkl3d = xyes])
163 [PKG_CHECK_MODULES([G3D], [libg3d >= 0.0.8])
165 AC_SEARCH_LIBS([yaml_get_version], [yaml],
166 [AC_CHECK_HEADERS([yaml.h], [],
167 [AC_MSG_ERROR([Could not find the yaml headers, please install yaml developement files])]
169 [AC_MSG_ERROR([Could not find the libyaml runtime, please install yaml])]
172 AC_SUBST(YAML_CFLAGS)
177 dnl ****************************************
178 dnl *** add an option for the ghkl build ***
179 dnl ****************************************
182 AS_HELP_STRING([--disable-gui],
183 [do not compile the gui interface]),
186 AM_CONDITIONAL([GUI], [test x$enable_gui = xyes])
188 [PKG_CHECK_MODULES([GTKMM], [gtkmm-2.4 >= 2.18])
190 [PKG_CHECK_MODULES([GLU], [glu >= 7.7.1])
191 PKG_CHECK_MODULES([GTKGLEXTMM], [gtkglextmm-1.2])
195 dnl ************************************
196 dnl *** Enable lcov coverage reports ***
197 dnl ************************************
200 AS_HELP_STRING([--enable-gcov],
202 [use_gcov=$enableval],
205 if test "x$use_gcov" = "xyes"; then
207 if test "$GCC" != "yes"; then
208 AC_MSG_ERROR([GCC is required for --enable-gcov])
211 dnl Check if ccache is being used
212 AC_CHECK_PROG(SHTOOL, shtool, shtool)
213 case `$SHTOOL path $CC` in
214 *ccache*[)] gcc_ccache=yes;;
218 if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
219 AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
222 ltp_version_list="1.6 1.7 1.8 1.9"
223 AC_CHECK_PROG(LTP, lcov, lcov)
224 AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
227 AC_CACHE_CHECK([for ltp version], glib_cv_ltp_version, [
228 glib_cv_ltp_version=invalid
229 ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
230 for ltp_check_version in $ltp_version_list; do
231 if test "$ltp_version" = "$ltp_check_version"; then
232 glib_cv_ltp_version="$ltp_check_version (ok)"
237 ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
238 AC_MSG_ERROR([$ltp_msg])
241 case $glib_cv_ltp_version in
243 ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
244 AC_MSG_ERROR([$ltp_msg])
249 if test -z "$LTP_GENHTML"; then
250 AC_MSG_ERROR([Could not find genhtml from the LTP package])
253 AC_DEFINE(HAVE_GCOV, 1, [Whether you have gcov])
255 dnl Remove all optimization flags from CFLAGS
257 CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
258 CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9]*//g'`
261 dnl Add the special gcc flags
262 CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
263 CXXFLAGS="$CXXFLAGS -O0 -fprofile-arcs -ftest-coverage"
264 LDFLAGS="$LDFLAGS -lgcov"
267 dnl *********************
268 dnl *** introspection ***
269 dnl *********************
271 GOBJECT_INTROSPECTION_CHECK([0.6.7])
273 AM_COND_IF([HAVE_INTROSPECTION],
274 [PKG_CHECK_MODULES([GOBJECT], [gobject-2.0])
277 AC_CONFIG_FILES([Makefile
282 hkl3d/bullet/Makefile
283 hkl3d/bullet/src/Makefile
288 test/bindings/Makefile
290 Documentation/Makefile
291 Documentation/api/Makefile
292 Documentation/figures/Makefile
293 Documentation/sphinx/Makefile
294 Documentation/sphinx/source/conf.py