configure.ac 1.95 KB
Newer Older
1
2
dnl Process this file with autoconf to produce a configure script.

Thomas White's avatar
Thomas White committed
3
AC_INIT(crystfel, 0.1.0, taw@physics.org)
4
5
6
VERSION=AC_PACKAGE_VERSION

AM_CONFIG_HEADER(config.h)
Thomas White's avatar
Thomas White committed
7
AM_INIT_AUTOMAKE(crystfel, "$VERSION")
8
9
10
11
12
13
14
15
16
17
18
19
20

AC_PROG_CC
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_LN_S

AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
AC_C_CONST
AC_FUNC_MALLOC
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([strdup])

Thomas White's avatar
Thomas White committed
21
22
23
24
AC_ARG_WITH(hdf5,
[AS_HELP_STRING([--with-hdf5], [specify location of HDF5 library])],
[HDF5_CFLAGS="-I$withval/include"
 HDF5_LIBS="-L$withval/lib -lhdf5"],
25
[HDF5_LIBS="-lhdf5"])
Thomas White's avatar
Thomas White committed
26

Thomas White's avatar
Thomas White committed
27
28
29
30
31
32
AC_ARG_WITH(gsl,
[AS_HELP_STRING([--with-gsl], [specify location of GSL])],
[GSL_CFLAGS="-I$withval/include"
 GSL_LIBS="-L$withval/lib -lgsl -lgslcblas"],
[GSL_LIBS="-lgsl -lgslcblas"])

Thomas White's avatar
Thomas White committed
33

34
AC_ARG_ENABLE(opencl, AS_HELP_STRING([--enable-opencl], [Enable the use of OpenCL]))
35
AC_MSG_CHECKING([whether to use OpenCL])
Thomas White's avatar
Thomas White committed
36
37
38
39
40
41
42
43
44
45
46
47
AS_IF([test "x$enable_opencl" == "xyes"],
[
   AC_MSG_RESULT([yes])
   OPENCL_CFLAGS=""
   OPENCL_LIBS="-lOpenCL"
   AC_DEFINE([HAVE_OPENCL], [1], [Define to 1 if OpenCL is available])
   have_opencl=true
],
[
   AC_MSG_RESULT([no])
])

48

49
AC_ARG_ENABLE(gtk, AS_HELP_STRING([--disable-gtk], [Disable GTK+/GLib]))
50
haveglib=false
Thomas White's avatar
Thomas White committed
51
havegtk=false
52
AC_MSG_CHECKING([whether to use GTK/GLib])
Thomas White's avatar
Thomas White committed
53
54
55
56
AS_IF([test "x$enable_gtk" != "xno"],
[
   AC_MSG_RESULT([yes])
   AM_PATH_GTK_2_0(2.0.0,
57
58
59
60
61
62
      [
         havegtk=true
         haveglib=true
         AC_DEFINE([HAVE_GLIB], [1], [Define to 1 if GLib is available])
         GTK_LIBS="$GTK_LIBS -lgthread-2.0 -lutil"
      ],
Thomas White's avatar
Thomas White committed
63
64
65
66
67
68
      AC_MSG_WARN([GTK not found.  hdfsee will not be built.])
   )
],
[
   AC_MSG_RESULT([no])
])
Thomas White's avatar
Thomas White committed
69

Thomas White's avatar
Thomas White committed
70
AM_CONDITIONAL([HAVE_GTK], test x$havegtk = xtrue)
71
AM_CONDITIONAL([HAVE_GLIB], test x$haveglib = xtrue)
72
AM_CONDITIONAL([HAVE_OPENCL], test x$have_opencl = xtrue)
Thomas White's avatar
Thomas White committed
73

74
CFLAGS="$CFLAGS $HDF5_CFLAGS $GTK_CFLAGS $GSL_CFLAGS $OPENCL_CFLAGS"
75
LIBS="$LIBS $HDF5_LIBS -lm -lz $GSL_LIBS $GTK_LIBS $OPENCL_LIBS"
Thomas White's avatar
Thomas White committed
76
77

AC_OUTPUT(Makefile src/Makefile data/Makefile)