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 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
|
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_define([v_maj], [5])
m4_define([v_min], [1])
m4_define([v_mic], [3])
m4_define([v_rev], m4_esyscmd([(git rev-list --count HEAD 2>/dev/null || echo 0) | tr -d '\n']))dnl
##-- When released, remove the dnl on the below line
m4_undefine([v_rev])
##-- When doing snapshots - change soname. remove dnl on below line
dnl m4_define([relname], [ver-pre-svn-07])
dnl m4_define([v_rel], [-release relname])
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
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])])
m4_define([lt_cur], m4_eval(v_maj + v_min))
m4_define([lt_rev], v_mic)
m4_define([lt_age], v_min)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
AC_PREREQ([2.69])
AC_INIT([hkl],[v_ver],[picca@synchrotron-soleil.fr])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE([silent-rules tar-ustar -Wno-portability subdir-objects])
# Checks for programs.
AC_PROG_AWK
AC_PROG_CC_C99
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
LT_INIT
AM_SILENT_RULES
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
m4_ifdef([v_rel], , [m4_define([v_rel], [])])
AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
version_info="lt_cur:lt_rev:lt_age"
release_info="v_rel"
AC_SUBST(version_info)
AC_SUBST(release_info)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
VMAJ=v_maj
AC_SUBST(VMAJ)
# activate all the warnings
AX_CFLAGS_WARN_ALL
AX_CXXFLAGS_WARN_ALL
# Checks for libraries.
AX_PATH_GSL
AM_PATH_GLIB_2_0
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_TIME
AC_FUNC_ALLOCA
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])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_VPRINTF
AC_FUNC_FORK
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])
dnl OPTION_DEFAULT_OFF(NAME, HELP-STRING)
dnl Create a new --enable option that defaults to being disabled.
dnl NAME is the base name of the option. The shell variable enable_NAME
dnl will be set to either the user's value (if the option is
dnl specified; 'yes' for a plain --enable-NAME) or to 'no' (if the
dnl option is not specified). Note that the shell variable name is
dnl constructed as autoconf does, by replacing non-alphanumeric
dnl characters with "_".
dnl HELP-STRING is the help text for the option.
AC_DEFUN([OPTION_DEFAULT_OFF], [dnl
AC_ARG_ENABLE([$1],[AS_HELP_STRING([--enable-$1],[$2])],[],[dnl
m4_bpatsubst([enable_$1], [[^0-9a-z]], [_])=no])dnl
])dnl
dnl OPTION_DEFAULT_ON(NAME, HELP-STRING)
dnl Create a new --enable option that defaults to being enabled.
dnl NAME is the base name of the option. The shell variable enable_NAME
dnl will be set to either the user's value (if the option is
dnl specified; 'no' for a plain --enable-NAME) or to 'yes' (if the
dnl option is not specified). Note that the shell variable name is
dnl constructed as autoconf does, by replacing non-alphanumeric
dnl characters with "_".
dnl HELP-STRING is the help text for the option.
AC_DEFUN([OPTION_DEFAULT_ON], [dnl
AC_ARG_ENABLE([$1],[AS_HELP_STRING([--disable-$1],[$2])],[],[dnl
m4_bpatsubst([enable_$1], [[^0-9a-z]], [_])=yes])dnl
])dnl
dnl ****************
dnl *** analyzer ***
dnl ****************
OPTION_DEFAULT_OFF([analyzer], [enable gcc-10 -fanalyzer])
AM_CONDITIONAL([ANALYZER], [test x$enable_analyzer != xno])
AM_COND_IF([ANALYZER],
AX_CHECK_COMPILE_FLAG([-fanalyzer], [CFLAGS="$CFLAGS -fanalyzer"], [], [])
)
dnl ***************
dnl *** logging ***
dnl ***************
OPTION_DEFAULT_OFF([logging], [enable the glib logging])
AM_CONDITIONAL([LOGGING], [test x$enable_logging != xno])
AM_COND_IF([LOGGING],
AC_DEFINE([LOGGING], [1], [activate the logging or not])
)
dnl ***********
dnl *** doc ***
dnl ***********
OPTION_DEFAULT_ON([hkl-doc], [build documentation])
AM_CONDITIONAL([HKL_DOC], [test x$enable_hkl_doc = xyes])
AM_COND_IF([HKL_DOC],
[dnl *** asymptote ***
AC_PATH_PROG([ASY], [asy], [echo])
dnl *** emacs ***
AC_PATH_PROG([EMACS], [emacs], [no])
dnl *** gnuplot ***
AC_PATH_PROG([GNUPLOT], [gnuplot], [echo])
dnl *** xvfb-run ***
AC_PATH_PROG([XVFB_RUN], [xvfb-run], [echo])
])
dnl *** mathkjax ***
AC_ARG_WITH([mathjax],
[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")])],
[use_mathjax=$withval],
[use_mathjax="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML"])
MATHJAX_PATH=$use_mathjax
AC_SUBST(MATHJAX_PATH)
dnl *** gtk-doc ***
GTK_DOC_CHECK([1.9],[--flavour no-tmpl])
dnl **********************************************
dnl *** add an option for the binoculars build ***
dnl **********************************************
OPTION_DEFAULT_ON([binoculars], [do not compile the binoculars API])
AM_CONDITIONAL([BINOCULARS], [test x$enable_binoculars = xyes])
AM_COND_IF([BINOCULARS],
[PKG_CHECK_MODULES([HDF5], [hdf5-serial >= 1.8.13])
PKG_CHECK_MODULES([CGLM], [cglm >= 0.7])
PKG_CHECK_MODULES([INIH], [inih >= 55])
AC_PATH_PROG([CABAL], [cabal])
if test -z "$CABAL" ; then
AC_MSG_ERROR([cabal was not found])
fi
])
dnl *******************************
dnl *** add an option for hkl3d ***
dnl *******************************
OPTION_DEFAULT_OFF([hkl3d], [compile the hkl3d library])
AM_CONDITIONAL([HKL3D], [test x$enable_hkl3d != xno])
AM_COND_IF([HKL3D],
[PKG_CHECK_MODULES([G3D], [libg3d >= 0.0.8])
PKG_CHECK_MODULES([BULLET], [bullet >= 2.82])
dnl check for yaml
AC_SEARCH_LIBS([yaml_get_version], [yaml],
[AC_CHECK_HEADERS([yaml.h], [],
[AC_MSG_ERROR([Could not find the yaml headers, please install yaml developement files])]
)],
[AC_MSG_ERROR([Could not find the libyaml runtime, please install yaml])]
)
YAML_CFLAGS=""
AC_SUBST(YAML_CFLAGS)
YAML_LIBS="-lyaml"
AC_SUBST(YAML_LIBS)
])
dnl ****************************************
dnl *** add an option for the ghkl build ***
dnl ****************************************
OPTION_DEFAULT_ON([gui], [do not compile the gui interface])
AM_CONDITIONAL([GUI], [test x$enable_gui = xyes])
AM_COND_IF([GUI],
[PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.22])
AM_COND_IF([HKL3D],
[PKG_CHECK_MODULES([GL], [gl >= 1.0.0])
PKG_CHECK_MODULES([GLU], [glu >= 7.7.1])
])
])
dnl *********************
dnl *** introspection ***
dnl *********************
GOBJECT_INTROSPECTION_CHECK([0.6.7])
AM_COND_IF([HAVE_INTROSPECTION],
[PKG_CHECK_MODULES([GOBJECT], [gobject-2.0])])
dnl ***************
dnl *** contrib ***
dnl ***************
OPTION_DEFAULT_OFF([contrib], [compile the contrib part])
AM_CONDITIONAL([CONTRIB], [test x$enable_contrib != xno])
dnl ******************
dnl *** datatype99 ***
dnl ******************
OPTION_DEFAULT_OFF([datatype99], [use the system datatype99])
AC_CHECK_HEADERS([datatype99.h], [], [enable_datatype99=no])
DATATYPE99_CFLAGS="-ftrack-macro-expansion=0"
AM_CONDITIONAL([DATATYPE99], [test x$enable_datatype99 != xno])
AM_COND_IF([DATATYPE99],
[],
[DATATYPE99_CFLAGS=$DATATYPE99_CFLAGS' -I$(top_srcdir)/third-party/']
)
AC_SUBST(DATATYPE99_CFLAGS)
AC_CONFIG_FILES([Makefile
binoculars-ng/binoculars/Makefile
binoculars-ng/hkl.cabal
binoculars-ng/Makefile
hkl/Makefile
hkl/api2/Makefile
hkl/ccan/Makefile
hkl.h
hkl.pc
hkl3d/Makefile
hkl3d.pc
tests/Makefile
tests/bindings/Makefile
tests/tap/Makefile
third-party/Makefile
Documentation/Makefile
Documentation/hkl.org
Documentation/api/Makefile
Documentation/figures/Makefile
Documentation/sphinx/Makefile
Documentation/sphinx/source/conf.py
gui/Makefile
data/Makefile
contrib/Makefile
contrib/cristal/Makefile
contrib/cristal/xrays/Makefile
contrib/sixs/Makefile
contrib/petra3/Makefile
])
AC_OUTPUT
|