Rewrote configure.ac according to my new l33t knowledge of autotools, and
[rodin/chimara.git] / configure.ac
1 # configure.ac with sensible comments
2
3 ### INITIALIZATION ############################################################
4
5 # Initialize Autoconf 
6 # Args: (human-readable package name, package version, bug report address, 
7 # tarballname)
8 AC_INIT([chimara], [0.1])
9 # Sanity check to make sure we are running Autoconf from the right directory
10 AC_CONFIG_SRCDIR(src/chimara-glk.c)
11 # Initialize Automake
12 AM_INIT_AUTOMAKE([-Wall])
13
14 ### DECLARE PROGRAMS ##########################################################
15
16 AC_PROG_CC                 # C compiler
17 AC_PROG_INSTALL            # Install
18 AC_PROG_LIBTOOL            # Libtool
19 IT_PROG_INTLTOOL([0.35.0]) # Intltool
20 PKG_PROG_PKG_CONFIG        # pkg_config
21
22 ### INTERNATIONALIZATION ######################################################
23
24 GETTEXT_PACKAGE=chimara
25 AC_SUBST(GETTEXT_PACKAGE)
26 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
27 AM_GLIB_GNU_GETTEXT
28
29 ### CHECK FOR LIBRARIES #######################################################
30
31 # Libraries needed to build Chimara library
32 PKG_CHECK_MODULES([CHIMARA], [
33         glib-2.0 >= 2.6
34         gtk+-2.0 >= 2.8 
35         gthread-2.0 
36         gmodule-2.0
37 ])
38 AC_SUBST(CHIMARA_CFLAGS)
39 AC_SUBST(CHIMARA_LIBS)
40 # Libraries needed to build test programs
41 PKG_CHECK_MODULES([TEST], [
42         gtk+-2.0 >= 2.8 
43         gmodule-2.0
44 ])
45 AC_SUBST(TEST_CFLAGS)
46 AC_SUBST(TEST_LIBS)
47
48 ### GTK-DOC ###################################################################
49 # Don't know what this does yet, it was autogenerated by Anjuta.
50
51 AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
52 if test "x$with_html_dir" = "x" ; then
53   HTML_DIR='${datadir}/gtk-doc/html'
54 else
55   HTML_DIR=$with_html_dir
56 fi
57 AC_SUBST(HTML_DIR)
58
59 gtk_doc_min_version=1.0
60 AC_MSG_CHECKING([gtk-doc version >= $gtk_doc_min_version])
61 if pkg-config --atleast-version=$gtk_doc_min_version gtk-doc; then
62   AC_MSG_RESULT(yes)
63   GTKDOC=true
64 else
65   AC_MSG_RESULT(no)
66   GTKDOC=false
67 fi
68 # Let people disable the gtk-doc stuff.
69 AC_ARG_ENABLE(gtk-doc,
70               [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]],
71               enable_gtk_doc="$enableval", enable_gtk_doc=auto)
72 if test x$enable_gtk_doc = xauto ; then
73   if test x$GTKDOC = xtrue ; then
74     enable_gtk_doc=yes
75   else
76     enable_gtk_doc=no
77   fi
78 fi
79 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
80
81 # Output platform-specific definitions to config.h
82 AC_CONFIG_HEADERS([config.h])
83 # List of other files for Autoconf to output
84 AC_CONFIG_FILES([
85 Makefile
86 src/Makefile
87 po/Makefile.in
88 ])
89 # Do it
90 AC_OUTPUT
91