Updating deps, making hildon0 a hildon1. Fixing a dash expansion problem.
[hildon] / configure.ac
1 AC_INIT([Hildon gtk widgets], [1.0.0], [michael.kostrzewa@nokia.com], [hildon])
2 AC_CANONICAL_SYSTEM
3
4 AM_CONFIG_HEADER(config.h)
5 AC_CONFIG_SRCDIR([src/hildon-window.h])
6 AC_CONFIG_MACRO_DIR([m4])
7 AM_MAINTAINER_MODE
8
9 # define PACKAGE_VERSION_* variables
10 AS_VERSION
11
12 # set the libtool versioning
13 AS_LIBTOOL(HILDON, 0, 0, 0)
14 AM_INIT_AUTOMAKE
15
16 AC_PROG_CC
17 AM_PROG_LIBTOOL
18 AC_PROG_INSTALL
19 AC_PROG_AWK
20
21 AC_HEADER_STDC
22
23 GTK_VERSION=2.10
24
25 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.10)
26 AC_SUBST(GTK_LIBS)
27 AC_SUBST(GTK_CFLAGS)
28 AC_SUBST(GTK_VERSION)
29
30 # ESD is needed for the hildon-note sounds.
31
32 PKG_CHECK_MODULES(ESD, esound)
33 AC_SUBST(ESD_LIBS)
34 AC_SUBST(ESD_CFLAGS)
35
36 PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.6)
37 AC_SUBST(GCONF_CFLAGS)
38 AC_SUBST(GCONF_LIBS)
39
40 ALL_LINGUAS="en_GB"
41 AC_SUBST(ALL_LINGUAS) 
42 AM_GLIB_GNU_GETTEXT
43
44 # Check for gtk-doc.
45 #ifdef(GTK_DOC_CHECK, GTK_DOC_CHECK([1.0]))
46 #GTK_DOC_CHECK([1.0])
47
48 #AC_CHECK_PROG(DOXYGEN_FOUND, doxygen, yes, no)
49 #AM_CONDITIONAL(HAVE_DOXYGEN, [test "$DOXYGEN_FOUND" = "yes"])
50
51 localedir=${datadir}/locale
52
53 AC_SUBST(localedir)
54
55 # Disable rebuild of glib-mkenum -generated source code:
56 AC_ARG_ENABLE(rebuilds, [  --disable-rebuilds      disable all source autogeneration rules],,enable_rebuilds=yes)
57
58 # define a MAINT-like variable REBUILD which is set if Perl
59 # is found, so autogenerated sources can be rebuilt
60 AC_CHECK_PROGS(PERL, perl5 perl)
61
62 REBUILD=\#
63 if test "x$enable_rebuilds" = "xyes" && \
64      test -n "$PERL" && \
65      $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 ; then
66   REBUILD=
67 fi
68 AC_SUBST(REBUILD)
69
70 # build examples (or not)
71 AC_ARG_WITH(examples, 
72     AC_HELP_STRING([--with-examples], [Build the examples]),
73     [
74      case "${withval}" in
75          yes) BUILD_EXAMPLES=yes ;;
76          no)  BUILD_EXAMPLES=no ;;
77          *)   AC_MSG_ERROR(bad value ${withval} for --with-examples) ;;
78      esac],
79      [BUILD_EXAMPLES=no])
80
81 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
82
83 # just print out our status
84 if test x$BUILD_EXAMPLES = xyes; then
85     AC_MSG_NOTICE(Will locally build example programs)
86 else
87     AC_MSG_NOTICE(Will not build examples )
88 fi
89
90 # build with assertion checks (or not)
91 AC_ARG_WITH(asserts, 
92     AC_HELP_STRING([--with-asserts], [Build with the assertion checks]),
93     [
94      case "${withval}" in
95          yes) BUILD_WITH_ASSERTS=yes ;;
96          no)  BUILD_WITH_ASSERTS=no ;;
97          *)   AC_MSG_ERROR(bad value ${withval} for --with-asserts) ;;
98      esac],
99      [BUILD_WITH_ASSERTS=no])
100
101 # just print out our status
102 if test x$BUILD_WITH_ASSERTS = xyes; then
103     AC_MSG_NOTICE(Will build with assertion checks)
104     ASSERT_CFLAGS=""
105 else
106     AC_MSG_NOTICE(Will not build with assertion checks)
107     ASSERT_CFLAGS="-DG_DISABLE_ASSERT"
108 fi
109
110 # Check support (c unit test)
111 PKG_CHECK_MODULES(CHECK, check , [BUILD_TESTS="yes"], [BUILD_TESTS="no"])
112 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
113
114 # HILDON_OBJ_*
115 # default vars for the examples
116 # includes all the low-level flags
117 # FIXME Add esd and gconf flags
118 HILDON_OBJ_CFLAGS="\$(CFLAGS) \$(GTK_CFLAGS) \$(CHECK_CFLAGS) \$(GCONF_CFLAGS) -I\$(top_builddir)/src/"
119 HILDON_OBJ_LIBS="\$(top_builddir)/src/libhildon_\$(PACKAGE_VERSION_MAJOR).la \$(GTK_LIBS) \$(GCONF_LIBS) \$(CHECK_LIBS)"
120 AC_SUBST(HILDON_OBJ_CFLAGS)
121 AC_SUBST(HILDON_OBJ_LIBS)
122
123 CFLAGS="$CFLAGS ${ASSERT_CFLAGS} -Wall -Wmissing-prototypes -Wmissing-declarations -Werror -Wno-format"
124 # -Wno-format due to way translation string are done
125
126 AC_CONFIG_FILES([Makefile src/Makefile  \
127                  pkgconfig/Makefile     \
128                  examples/Makefile      \
129                  pkgconfig/hildon.pc    \
130                  tests/Makefile])
131
132 AC_OUTPUT
133
134 echo "
135
136 Configuration:
137
138 - Package:...........: ${PACKAGE}
139 - Version............: ${VERSION}
140 - Api................: ${PACKAGE}-${PACKAGE_VERSION_MAJOR}
141 - Compiler...........: ${CC}
142 - gtk-doc support....: ${enable_gtk_doc}
143 - Build examples.....: ${BUILD_EXAMPLES}
144 - Build with asserts.: ${BUILD_WITH_ASSERTS}
145 - Build unit tests...: ${BUILD_TESTS}
146
147 "