1dnl Process this file with autoconf to produce a configure script.
2
3AC_INIT([refocus],[0.9.0])
4AC_CONFIG_SRCDIR(README)
5AM_INIT_AUTOMAKE
6
7AC_PROG_CC
8AC_CHECK_PROG(GCC3, gcc3, gcc3)
9
10if test "$GCC3" ; then
11   CC=$GCC3
12   AC_MSG_RESULT([using $CC as compiler])
13fi
14
15AC_HEADER_STDC([])
16AC_PROG_RANLIB
17
18BUNDLED_LAPACK_LIB_DIR='${top_srcdir}/lib'
19AC_SUBST(BUNDLED_LAPACK_LIB_DIR)
20
21have_atlas=no
22AC_ARG_WITH(lapack-libs, [  --with-lapack-libs=LIBS ])
23if test "x$with_lapack_libs" = "x" ; then
24  LAPACK_LIBS='-L${top_srcdir}/lib -latlas -lcblas -llapack'
25else
26  LAPACK_LIBS="$with_lapack_libs"
27  have_atlas=yes
28fi
29AC_SUBST(LAPACK_LIBS)
30AM_CONDITIONAL(HAVE_ATLAS, test x${have_atlas} = xyes)
31
32AC_ARG_WITH(lapack-includes, [  --with-lapack-includes=INCLUDES ])
33if test "x$with_lapack_includes" = "x" ; then
34  LAPACK_INCLUDES='-I ${top_srcdir}/lib'
35else
36  LAPACK_INCLUDES="$with_lapack_includes"
37fi
38AC_SUBST(LAPACK_INCLUDES)
39
40AM_PATH_GIMP_2_0(2.0.0)
41AM_PATH_GTK_2_0(2.0.0)
42AM_PATH_GLIB_2_0(2.0.0)
43
44# This is a check for gtk-doc which you can insert into your configure.in.
45# You shouldn't need to change it at all.
46
47
48##################################################
49# Check for gtk-doc.
50##################################################
51
52AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
53
54if test "x$with_html_dir" = "x" ; then
55  HTML_DIR='${datadir}/gtk-doc/html'
56else
57  HTML_DIR=$with_html_dir
58fi
59
60AC_SUBST(HTML_DIR)
61
62AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
63
64gtk_doc_min_version=0.6
65if $GTKDOC ; then
66    gtk_doc_version=`gtkdoc-mkdb --version`
67    AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
68    if perl <<EOF ; then
69      exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
70            ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
71EOF
72      AC_MSG_RESULT(yes)
73   else
74      AC_MSG_RESULT(no)
75      GTKDOC=false
76   fi
77fi
78
79dnl Let people enable the gtk-doc stuff.
80AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc        Use gtk-doc to build documentation [default=no]], enable_gtk_doc="$enableval", enable_gtk_doc=no)
81
82if test x$enable_gtk_doc = xyes ; then
83  if test x$GTKDOC = xtrue ; then
84    enable_gtk_doc=yes
85  else
86    enable_gtk_doc=no
87  fi
88fi
89
90AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
91# End of gtk-doc stuff.
92
93AC_ARG_ENABLE(debug, [  --enable-debug          Show debugging output [default=no]], enable_debug=yes, enable_debug=no)
94
95if test x$enable_debug = xyes ; then
96   AC_DEFINE(RF_DEBUG)
97   AC_DEFINE(PREVIEW_DEBUG)
98fi
99
100#Check if erf is defined in the mathlibrary
101AC_CHECK_LIB(m, erf, AC_DEFINE(HAVE_ERF))
102
103AC_CONFIG_FILES([Makefile src/Makefile lib/Makefile doc/Makefile gtk-doc/Makefile ])
104AC_OUTPUT
105
106