| 1 |
AC_INIT([Hildon gtk widgets], [2.2.24], [hildon-devel@garage.maemo.org], [hildon]) |
| 2 |
AC_CANONICAL_SYSTEM |
| 3 |
|
| 4 |
AM_CONFIG_HEADER(config.h) |
| 5 |
AC_CONFIG_SRCDIR([hildon/hildon-window.h]) |
| 6 |
AC_CONFIG_MACRO_DIR([m4]) |
| 7 |
AM_MAINTAINER_MODE |
| 8 |
|
| 9 |
# define PACKAGE_VERSION_* variables |
| 10 |
AS_VERSION |
| 11 |
|
| 12 |
#define API_VERSION_MAJOR |
| 13 |
API_VERSION_MAJOR=1 |
| 14 |
AC_SUBST(API_VERSION_MAJOR) |
| 15 |
|
| 16 |
# set the libtool versioning |
| 17 |
# Quick guide into libtool versioning: |
| 18 |
# 1. Start with version information of `0:0:0' for each libtool library. |
| 19 |
# 2. Update the version information only immediately before a public release of your software. |
| 20 |
# More frequent updates are unnecessary, and only guarantee that the current interface number |
| 21 |
# gets larger faster. |
| 22 |
# 3. If the library source code has changed at all since the last update, then increment revision |
| 23 |
# (`c:r:a' becomes `c:r+1:a'). |
| 24 |
# 4. If any interfaces have been added, removed, or changed since the last update, |
| 25 |
# increment current, and set revision to 0. |
| 26 |
# 5. If any interfaces have been added since the last public release, then increment age. |
| 27 |
# 6. If any interfaces have been removed since the last public release, then set age to 0. |
| 28 |
AS_LIBTOOL(HILDON, 18, 7, 18) |
| 29 |
AM_INIT_AUTOMAKE |
| 30 |
|
| 31 |
AC_PROG_CC |
| 32 |
AM_PROG_CC_C_O |
| 33 |
AM_PROG_LIBTOOL |
| 34 |
AC_PROG_INSTALL |
| 35 |
AC_PROG_AWK |
| 36 |
|
| 37 |
AC_HEADER_STDC |
| 38 |
|
| 39 |
GTK_VERSION=2.14.3 |
| 40 |
|
| 41 |
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_VERSION) |
| 42 |
AC_SUBST(GTK_LIBS) |
| 43 |
AC_SUBST(GTK_CFLAGS) |
| 44 |
AC_SUBST(GTK_VERSION) |
| 45 |
|
| 46 |
# libcanberra is needed for the hildon-note sounds. |
| 47 |
|
| 48 |
PKG_CHECK_MODULES(CANBERRA, libcanberra) |
| 49 |
AC_SUBST(CANBERRA_LIBS) |
| 50 |
AC_SUBST(CANBERRA_CFLAGS) |
| 51 |
|
| 52 |
PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.6) |
| 53 |
AC_SUBST(GCONF_CFLAGS) |
| 54 |
AC_SUBST(GCONF_LIBS) |
| 55 |
|
| 56 |
ALL_LINGUAS="en_GB" |
| 57 |
AC_SUBST(ALL_LINGUAS) |
| 58 |
AM_GLIB_GNU_GETTEXT |
| 59 |
|
| 60 |
GTK_DOC_CHECK([1.3]) |
| 61 |
|
| 62 |
localedir=${datadir}/locale |
| 63 |
|
| 64 |
AC_SUBST(localedir) |
| 65 |
|
| 66 |
# Disable rebuild of glib-mkenum -generated source code: |
| 67 |
AC_ARG_ENABLE(rebuilds, [ --disable-rebuilds disable all source autogeneration rules],,enable_rebuilds=yes) |
| 68 |
|
| 69 |
# define a MAINT-like variable REBUILD which is set if Perl |
| 70 |
# is found, so autogenerated sources can be rebuilt |
| 71 |
AC_CHECK_PROGS(PERL, perl5 perl) |
| 72 |
|
| 73 |
REBUILD=\# |
| 74 |
if test "x$enable_rebuilds" = "xyes" && \ |
| 75 |
test -n "$PERL" && \ |
| 76 |
$PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 ; then |
| 77 |
REBUILD= |
| 78 |
fi |
| 79 |
AC_SUBST(REBUILD) |
| 80 |
|
| 81 |
# build examples (or not) |
| 82 |
AC_ARG_WITH(examples, |
| 83 |
AC_HELP_STRING([--with-examples], [Build the examples]), |
| 84 |
[ |
| 85 |
case "${withval}" in |
| 86 |
yes) BUILD_EXAMPLES=yes ;; |
| 87 |
no) BUILD_EXAMPLES=no ;; |
| 88 |
*) AC_MSG_ERROR(bad value ${withval} for --with-examples) ;; |
| 89 |
esac], |
| 90 |
[BUILD_EXAMPLES=no]) |
| 91 |
|
| 92 |
AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes") |
| 93 |
|
| 94 |
# just print out our status |
| 95 |
if test x$BUILD_EXAMPLES = xyes; then |
| 96 |
AC_MSG_NOTICE(Will locally build example programs) |
| 97 |
else |
| 98 |
AC_MSG_NOTICE(Will not build examples ) |
| 99 |
fi |
| 100 |
|
| 101 |
# use maemo gtk+ specific api (or not) |
| 102 |
AC_ARG_WITH(maemo-gtk, |
| 103 |
AC_HELP_STRING([--with-maemo-gtk], [Use Maemo GTK+ API]), |
| 104 |
[ |
| 105 |
case "${withval}" in |
| 106 |
yes) USE_MAEMO_GTK=yes ;; |
| 107 |
no) USE_MAEMO_GTK=no ;; |
| 108 |
*) AC_MSG_ERROR(bad value ${withval} for --with-maemo-gtk) ;; |
| 109 |
esac], |
| 110 |
[USE_MAEMO_GTK=yes]) |
| 111 |
|
| 112 |
AM_CONDITIONAL(USE_MAEMO_GTK, test "x$USE_MAEMO_GTK" = "xyes") |
| 113 |
|
| 114 |
# just print out our status |
| 115 |
if test x$USE_MAEMO_GTK = xyes; then |
| 116 |
AC_MSG_NOTICE(Will use Maemo GTK+ specific API) |
| 117 |
MAEMO_GTK="-DMAEMO_GTK" |
| 118 |
AC_SUBST(MAEMO_GTK) |
| 119 |
MAEMO_CHANGES="-DMAEMO_CHANGES" |
| 120 |
AC_SUBST(MAEMO_CHANGES) |
| 121 |
else |
| 122 |
AC_MSG_NOTICE(Will not use Maemo GTK+ specific API) |
| 123 |
fi |
| 124 |
|
| 125 |
# build with assertion checks (or not) |
| 126 |
AC_ARG_WITH(asserts, |
| 127 |
AC_HELP_STRING([--with-asserts], [Build with the assertion checks]), |
| 128 |
[ |
| 129 |
case "${withval}" in |
| 130 |
yes) BUILD_WITH_ASSERTS=yes ;; |
| 131 |
no) BUILD_WITH_ASSERTS=no ;; |
| 132 |
*) AC_MSG_ERROR(bad value ${withval} for --with-asserts) ;; |
| 133 |
esac], |
| 134 |
[BUILD_WITH_ASSERTS=no]) |
| 135 |
|
| 136 |
# just print out our status |
| 137 |
if test x$BUILD_WITH_ASSERTS = xyes; then |
| 138 |
AC_MSG_NOTICE(Will build with assertion checks) |
| 139 |
ASSERT_CFLAGS="" |
| 140 |
else |
| 141 |
AC_MSG_NOTICE(Will not build with assertion checks) |
| 142 |
ASSERT_CFLAGS="-DG_DISABLE_ASSERT" |
| 143 |
fi |
| 144 |
|
| 145 |
# build with debug (or not) |
| 146 |
AC_ARG_ENABLE(debug, |
| 147 |
AC_HELP_STRING([--enable-debug], [turn on debugging]), |
| 148 |
[ |
| 149 |
case "${enableval}" in |
| 150 |
yes) BUILD_WITH_DEBUG=yes ;; |
| 151 |
no) BUILD_WITH_DEBUG=no ;; |
| 152 |
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; |
| 153 |
esac], |
| 154 |
[BUILD_WITH_DEBUG=no]) |
| 155 |
|
| 156 |
# just print out our status |
| 157 |
if test x$BUILD_WITH_DEBUG = xyes; then |
| 158 |
AC_MSG_NOTICE(Will build with debugging info) |
| 159 |
DEBUG_CFLAGS="" |
| 160 |
else |
| 161 |
AC_MSG_NOTICE(Will not build with debugging info) |
| 162 |
DEBUG_CFLAGS="-DG_DISABLE_CAST_CHECKS" |
| 163 |
fi |
| 164 |
|
| 165 |
# build with relaxed flags or not |
| 166 |
AC_ARG_ENABLE(fatal, |
| 167 |
AC_HELP_STRING([--enable-fatal], [Build with fatal warnings]), |
| 168 |
[ |
| 169 |
case "${enableval}" in |
| 170 |
yes) BUILD_WITH_FATAL=yes ;; |
| 171 |
no) BUILD_WITH_FATAL=no ;; |
| 172 |
*) AC_MSG_ERROR(bad value ${enableval} for --enable-fatal) ;; |
| 173 |
esac], |
| 174 |
[BUILD_WITH_FATAL=no]) |
| 175 |
|
| 176 |
# just print out our status |
| 177 |
if test x$BUILD_WITH_FATAL = xyes; then |
| 178 |
AC_MSG_NOTICE(Will build with fatal warnings) |
| 179 |
FATAL_CFLAGS="-Werror" |
| 180 |
else |
| 181 |
AC_MSG_NOTICE(Will build with non-fatal warnings) |
| 182 |
FATAL_CFLAGS="" |
| 183 |
fi |
| 184 |
|
| 185 |
# disable deprecated symbols |
| 186 |
AC_ARG_ENABLE(deprecated, |
| 187 |
[AC_HELP_STRING([--enable-deprecated], |
| 188 |
[enable use of deprecated symbols [default=yes]])],, |
| 189 |
[enable_deprecated="yes"]) |
| 190 |
|
| 191 |
if test x$enable_deprecated = xno; then |
| 192 |
DISABLE_DEPRECATED="-DHILDON_DISABLE_DEPRECATED" |
| 193 |
fi |
| 194 |
|
| 195 |
AM_CONDITIONAL([HILDON_DISABLE_DEPRECATED], test "x$enable_deprecated" = "xno") |
| 196 |
|
| 197 |
# Check support (c unit test) |
| 198 |
PKG_CHECK_MODULES(CHECK, check , [BUILD_TESTS="yes"], [BUILD_TESTS="no"]) |
| 199 |
AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes") |
| 200 |
|
| 201 |
CFLAGS="$CFLAGS ${ASSERT_CFLAGS} ${DEBUG_CFLAGS} -Wall -Wmissing-prototypes -Wmissing-declarations -Wno-format ${FATAL_CFLAGS}" |
| 202 |
# -Wno-format due to way translation string are done |
| 203 |
|
| 204 |
### disable deprecated symbols and enable MAEMO platform extensions |
| 205 |
EXTRA_CFLAGS="$DISABLE_DEPRECATED $MAEMO_CHANGES $MAEMO_GTK" |
| 206 |
AC_SUBST(EXTRA_CFLAGS) |
| 207 |
|
| 208 |
# HILDON_OBJ_* |
| 209 |
# default vars for the examples |
| 210 |
# includes all the low-level flags |
| 211 |
# FIXME Add esd and gconf flags |
| 212 |
HILDON_OBJ_CFLAGS="\$(CFLAGS) \$(GTK_CFLAGS) \$(CHECK_CFLAGS) \$(GCONF_CFLAGS) -I\$(top_builddir)/hildon/" |
| 213 |
HILDON_OBJ_LIBS="\$(top_builddir)/hildon/libhildon-\$(API_VERSION_MAJOR).la \$(GTK_LIBS) \$(GCONF_LIBS) \$(CHECK_LIBS) `pkg-config --libs gthread-2.0`" |
| 214 |
AC_SUBST(HILDON_OBJ_CFLAGS) |
| 215 |
AC_SUBST(HILDON_OBJ_LIBS) |
| 216 |
|
| 217 |
AC_CONFIG_FILES([Makefile \ |
| 218 |
hildon/Makefile \ |
| 219 |
hildon/hildon-version.h \ |
| 220 |
pkgconfig/Makefile \ |
| 221 |
examples/Makefile \ |
| 222 |
pkgconfig/hildon.pc \ |
| 223 |
tests/Makefile \ |
| 224 |
doc/Makefile \ |
| 225 |
po/POTFILES \ |
| 226 |
po/porules.mk \ |
| 227 |
po/Makefile]) |
| 228 |
|
| 229 |
AC_OUTPUT |
| 230 |
|
| 231 |
echo " |
| 232 |
|
| 233 |
Configuration: |
| 234 |
|
| 235 |
- Package:...........: ${PACKAGE} |
| 236 |
- Version............: ${VERSION} |
| 237 |
- Api................: ${PACKAGE}-${API_VERSION_MAJOR} |
| 238 |
- Compiler...........: ${CC} |
| 239 |
- Enable deprecated..: ${enable_deprecated} |
| 240 |
- gtk-doc support....: ${enable_gtk_doc} |
| 241 |
- Build examples.....: ${BUILD_EXAMPLES} |
| 242 |
- Build with asserts.: ${BUILD_WITH_ASSERTS} |
| 243 |
- Build with debug...: ${BUILD_WITH_DEBUG} |
| 244 |
- Build unit tests...: ${BUILD_TESTS} |
| 245 |
- Fatal warnings.....: ${BUILD_WITH_FATAL} |
| 246 |
|
| 247 |
" |