configure.ac 12.4 KB
Newer Older
Jose Maria Celorio's avatar
Jose Maria Celorio committed
1 2
dnl Process this file with autoconf to produce a configure script.

3
AC_PREREQ(2.52)
4 5

m4_define(glade_major_version, 3)
Juan Pablo Ugarte's avatar
Juan Pablo Ugarte committed
6
m4_define(glade_minor_version, 20)
7
m4_define(glade_micro_version, 0)
8 9
m4_define(glade_version, glade_major_version.glade_minor_version.glade_micro_version)

10
AC_INIT([glade], [glade_version],
11
	[http://bugzilla.gnome.org/enter_bug.cgi?product=glade],
12
	[glade],
13 14
	[http://glade.gnome.org/])

15
AC_CONFIG_HEADERS([config.h])
16
AC_CONFIG_SRCDIR([gladeui/glade.h])
17 18
AC_CONFIG_MACRO_DIR([m4])

19 20 21 22 23 24 25
AC_DEFINE(GLADE_MAJOR_VERSION, glade_major_version, [Glade major version])
AC_SUBST(GLADE_MAJOR_VERSION, glade_major_version)
AC_DEFINE(GLADE_MINOR_VERSION, glade_minor_version, [Glade minor version])
AC_SUBST(GLADE_MINOR_VERSION, glade_minor_version)
AC_DEFINE(GLADE_MICRO_VERSION, glade_micro_version, [Glade micro version])
AC_SUBST(GLADE_MICRO_VERSION, glade_micro_version)

26
AC_CANONICAL_TARGET
27

28 29
AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-bzip2])
AM_MAINTAINER_MODE([enable])
Tristan Van Berkom's avatar
Tristan Van Berkom committed
30

31 32 33
# Support silent build rules, requires at least automake-1.11. Disable
# by either passing --disable-silent-rules to configure or passing V=1
# to make
34
AM_SILENT_RULES([yes])
35

36
# Checks for programs
Jose Maria Celorio's avatar
Jose Maria Celorio committed
37 38 39 40
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET

41 42 43 44
# Initialize libtool
LT_PREREQ([2.2.6])
LT_INIT([dlopen win32-dll disable-static])

45
AC_PATH_PROG(GLIB_COMPILE_RESOURCES, glib-compile-resources)
46
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
47
AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
48
AC_PATH_PROG(DLLTOOL, dlltool)
49 50 51 52 53

# If the source code has changed at all, increment GLADE_REVISION
# If any interfaces have been added, removed, or changed, increment GLADE_CURRENT, and set GLADE_REVISION to 0.
# If any interfaces have been added since the last public release, then increment GLADE_AGE.
# If any interfaces have been removed since the last public release, then set GLADE_AGE to 0.
54 55
# Reference: http://www.gnu.org/software/libtool/manual/libtool.html#Versioning

56
GLADE_REVISION=0
Juan Pablo Ugarte's avatar
Juan Pablo Ugarte committed
57 58
GLADE_CURRENT=9
GLADE_AGE=3
Vincent Geddes's avatar
Vincent Geddes committed
59
GLADE_CURRENT_MINUS_AGE=`expr $GLADE_CURRENT - $GLADE_AGE`
60 61 62
AC_SUBST(GLADE_REVISION)
AC_SUBST(GLADE_CURRENT)
AC_SUBST(GLADE_AGE)
63
AC_SUBST(GLADE_CURRENT_MINUS_AGE)
64

65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
dnl are we unstable or stable?
m4_define([glade_unstable],
          m4_if(m4_eval(glade_minor_version % 2), [1], [yes], [no]))
GLADE_UNSTABLE=glade_unstable
AC_SUBST(GLADE_UNSTABLE)

dnl The symbol GLADE_UNSTABLE is defined above for substitution in
dnl Makefiles and conditionally defined here as a preprocessor symbol
dnl and automake conditional.
if test "x$GLADE_UNSTABLE" = "xyes"; then
  AC_DEFINE(GLADE_UNSTABLE, 1,
            [Define to 1 if this is an unstable version of Glade])
fi
AM_CONDITIONAL(GLADE_UNSTABLE, test "x$GLADE_UNSTABLE" = "xyes")

80 81 82 83 84 85
# ================================================================

GNOME_DEBUG_CHECK
GNOME_COMPILE_WARNINGS([maximum])
GNOME_MAINTAINER_MODE_DEFINES

86 87 88 89 90 91 92
# For the plugins, we don't use the warning flags defined by GNOME_COMPILE_WARNINGS.
# These flags include -Wmissing-prototypes, which we prefer not to use.
if test "x$GCC" = "xyes"; then
    PLUGINS_WARN_CFLAGS="-Wall -Wnested-externs -Wpointer-arith"
fi
AC_SUBST(PLUGINS_WARN_CFLAGS)

93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110

dnl ================================================================
dnl Collect some arguments.
dnl ================================================================
AC_ARG_ENABLE(debug,
              [AC_HELP_STRING([--enable-debug],
                              [enable debug build [default=no]])],,
              [enable_debug="no"])

AM_CONDITIONAL([GLADE_DEBUG],[test "x$enable_debug" = "xyes"])

if test "x$enable_debug" = "xyes"; then
   GLADE_DEBUG_FLAGS=-DGLADE_ENABLE_DEBUG
else
   GLADE_DEBUG_FLAGS=
fi
AC_SUBST(GLADE_DEBUG_FLAGS)

Jose Maria Celorio's avatar
Jose Maria Celorio committed
111
dnl ================================================================
112
dnl Gettext stuff.
Jose Maria Celorio's avatar
Jose Maria Celorio committed
113
dnl ================================================================
114 115
IT_PROG_INTLTOOL([0.41.0])

116
GETTEXT_PACKAGE=AC_PACKAGE_NAME
117
AC_SUBST(GETTEXT_PACKAGE)
118
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the gettext package.])
Jose Maria Celorio's avatar
Jose Maria Celorio committed
119

120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
dnl ================================================================
dnl va_copy.
dnl ================================================================
AC_MSG_CHECKING([how to copy va_list])
AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; va_copy(ap1, ap2);],
        AC_MSG_RESULT([va_copy]),
        [ AH_TEMPLATE([va_copy], [define if va_copy is not available])
        AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; __va_copy(ap1, ap2);],
            [ AC_DEFINE([va_copy], [__va_copy])
            AC_MSG_RESULT([__va_copy])],
            [ AC_DEFINE([va_copy(dest,src)], [memcpy(&dest,&src,sizeof(va_list))])
            AC_MSG_RESULT([memcpy])]
            )
        ])

135 136 137
dnl ================================================================
dnl Check for gtk-doc
dnl ================================================================
138
GTK_DOC_CHECK([1.13],[--flavour no-tmpl])
139

140 141 142
dnl ================================================================
dnl Check for introspection
dnl ================================================================
Juan Pablo Ugarte's avatar
Juan Pablo Ugarte committed
143
GOBJECT_INTROSPECTION_CHECK([1.32.0])
144

Paolo Borelli's avatar
Paolo Borelli committed
145
dnl ================================================================
146
dnl Check for gtk+
Paolo Borelli's avatar
Paolo Borelli committed
147
dnl ================================================================
Juan Pablo Ugarte's avatar
Juan Pablo Ugarte committed
148
GTK_REQUIRED=3.20.0
149
GLIB_REQUIRED=2.53.2
150
PKG_CHECK_MODULES([GTK],[
151
  gtk+-3.0 >= $GTK_REQUIRED
152
  glib-2.0 >= $GLIB_REQUIRED
153
  gmodule-2.0
154 155 156
  libxml-2.0 >= 2.4.0
])

157 158 159
PKG_CHECK_MODULES([GMODULE_EXPORT],[
  gmodule-export-2.0
])
160

161 162
LT_LIB_M

163 164 165 166 167 168 169
dnl ================================================================
dnl Check for the unix print widgets in gtk+
dnl ================================================================
LIBS=$GTK_LIBS
AC_CHECK_FUNCS(gtk_print_unix_dialog_new,[have_unix_print=yes]; break,[have_unix_print=no])
AM_CONDITIONAL(HAVE_GTK_UNIX_PRINT, test x"$have_unix_print" = "xyes")

170 171 172
dnl ================================================================
dnl Python for optional python dev libs
dnl ================================================================
173 174 175 176
PYGOBJECT_REQUIRED_MAJOR=3
PYGOBJECT_REQUIRED_MINOR=8
PYGOBJECT_REQUIRED_MICRO=0
PYGOBJECT_REQS=$PYGOBJECT_REQUIRED_MAJOR.$PYGOBJECT_REQUIRED_MINOR.$PYGOBJECT_REQUIRED_MICRO
177

178 179 180 181 182
AC_ARG_ENABLE(python,
    AS_HELP_STRING([--disable-python], [disable python catalog]),
    check_python=$enableval, check_python=yes)

if test x"$check_python" = x"yes"; then
183 184
  have_python=yes

185
  PKG_CHECK_MODULES([PYGOBJECT],[pygobject-3.0 >= $PYGOBJECT_REQS],[have_pygobject=yes],[have_pygobject=no])
186

187 188 189
  AM_CHECK_PYTHON_HEADERS(, [have_python_headers=no])
  AM_CHECK_PYTHON_LIBS(, [have_python_lib=no])

190 191 192 193
  if test x"$have_pygobject" = x"no"; then
    have_python=no
  fi

194 195 196 197 198 199 200 201
  if test x"$have_python_headers" = x"no"; then
    have_python=no
  fi

  if test x"$have_python_lib" = x"no"; then
    have_python=no
  fi

202 203 204
  AC_DEFINE_UNQUOTED(PYGOBJECT_REQUIRED_MAJOR, $PYGOBJECT_REQUIRED_MAJOR, pygobject major version required)
  AC_DEFINE_UNQUOTED(PYGOBJECT_REQUIRED_MINOR, $PYGOBJECT_REQUIRED_MINOR, pygobject minor version required)
  AC_DEFINE_UNQUOTED(PYGOBJECT_REQUIRED_MICRO, $PYGOBJECT_REQUIRED_MICRO, pygobject micro version required)
205

206 207 208 209 210 211
else
  have_python=no
fi

AM_CONDITIONAL(BUILD_PYTHON, test x"$have_python" = "xyes")

212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
dnl ================================================================
dnl WebKit2GTK support
dnl ================================================================
WEBKIT2GTK_REQUIRED=2.12.0

AC_ARG_ENABLE(webkit2gtk,
    AS_HELP_STRING([--disable-webkit2gtk], [disable webkit2gtk catalog]),
    check_webkit2gtk=$enableval, check_webkit2gtk=yes)

if test x"$check_webkit2gtk" = x"yes"; then
  PKG_CHECK_MODULES([WEBKIT2GTK],[webkit2gtk-4.0 >= $WEBKIT2GTK_REQUIRED],[have_webkit2gtk=yes],[have_webkit2gtk=no])
else
  have_webkit2gtk=no
fi
AM_CONDITIONAL(BUILD_WEBKIT2GTK, test x"$have_webkit2gtk" = "xyes")

228
# ==================================================================
229
# Glade User Manual (requires yelp-tools)
230
# ==================================================================
Tristan Van Berkom's avatar
Tristan Van Berkom committed
231

232
YELP_HELP_INIT
Tristan Van Berkom's avatar
Tristan Van Berkom committed
233

Matthias Clasen's avatar
Matthias Clasen committed
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249
# ==================================================================
# Man pages (requires xsltproc)
# ==================================================================

AC_ARG_ENABLE(man-pages,
              AC_HELP_STRING([--enable-man-pages],
                             [build manual pages]),,
              enable_man_pages=yes)
if test x$enable_man_pages = xyes; then
   AC_PATH_PROG([XSLTPROC], [xsltproc])
   if test x$XSLTPROC = x; then
      AC_MSG_ERROR([xsltproc is required to build manual pages])
   fi
fi
AM_CONDITIONAL(BUILD_MAN_PAGES, test x$enable_man_pages = xyes)

250 251 252 253
dnl ================================================================
dnl Check for windows
dnl ================================================================
case $host_os in
254
  *mingw* | pw32* | cygwin*)
255
    platform_win32=yes
256 257
    ;;
  *)
258
    platform_win32=no
259
    ;;
260
esac
261 262
AM_CONDITIONAL(PLATFORM_WIN32, test x"$platform_win32" = "xyes")

263 264 265 266 267 268 269 270 271 272 273
case $host_os in
  *mingw*)
    native_win32=yes
    ;;
  *)
    native_win32=no
    ;;
esac
AM_CONDITIONAL(NATIVE_WIN32, test x"$native_win32" = "xyes")

if test "$native_win32" = "yes"; then
274 275 276 277 278
  AC_CHECK_TOOL(WINDRES, windres, no)
  if test "$WINDRES" = no; then
    AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.])
  fi
fi
279

280 281 282
dnl ================================================================
dnl Check for GDK Quartz and MacOSX integration package 
dnl ================================================================
283
_gdk_tgt=`$PKG_CONFIG --variable=targets gdk-3.0`
284 285
AM_CONDITIONAL([GDK_TARGET_QUARTZ], [test x$_gdk_tgt = xquartz])
if test "x$_gdk_tgt" = xquartz; then 
286
   PKG_CHECK_MODULES(GTK_MAC, gtk-mac-integration-gtk3)
287

288
   GTK_MAC_BUNDLE_FLAG=
289 290 291 292 293 294 295 296

   AC_ARG_ENABLE(mac-bundle,
      AS_HELP_STRING([--enable-mac-bundle], [enable mac bundling]),
      build_bundle=yes, build_bundle=no)

   if test "x$build_bundle" = xyes; then
      AC_MSG_NOTICE([enableing mac bundle..])

297
      GTK_MAC_BUNDLE_FLAG=-DMAC_BUNDLE
298 299
   fi      

300 301 302
   AC_SUBST(GTK_MAC_BUNDLE_FLAG)
   AC_SUBST(GTK_MAC_LIBS)
   AC_SUBST(GTK_MAC_CFLAGS)
303 304
fi

305 306 307 308 309 310 311 312 313 314
dnl ================================================================
dnl Enable installation of Gladeui catalog
dnl ================================================================
AC_ARG_ENABLE([gladeui],
	AS_HELP_STRING([--enable-gladeui],
	[Enable installation of the Gladeui catalog]),
	[enable_gladeui="$enableval"],[enable_gladeui="no"])

AM_CONDITIONAL(BUILD_GLADEUI, test x"$enable_gladeui" = "xyes")

315 316 317
dnl ================================================================
dnl Testing environment
dnl ================================================================
318 319 320 321 322
#
# Do not redefine pixmap dir as it does not work if not inside a proper directory structure
# GLADE_PIXMAP_DIR=$(top_srcdir)/data/icons
#
GLADE_TEST_ENVIRONMENT='GLADE_TESTING=1 GLADE_CATALOG_SEARCH_PATH=$(top_srcdir)/plugins/gtk+ GLADE_MODULE_SEARCH_PATH=$(top_builddir)/plugins/gtk+/.libs'
323 324
AC_SUBST(GLADE_TEST_ENVIRONMENT)

325 326 327 328
AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])
329

Tristan Van Berkom's avatar
Tristan Van Berkom committed
330
AC_CONFIG_FILES([
Jose Maria Celorio's avatar
Jose Maria Celorio committed
331
Makefile
332 333
data/gladeui-2.0.pc
data/glade.desktop.in
334 335
data/Makefile
data/icons/Makefile
336 337 338 339 340 341 342 343 344 345 346
data/icons/hicolor/Makefile
data/icons/hicolor/16x16/Makefile
data/icons/hicolor/16x16/apps/Makefile
data/icons/hicolor/22x22/Makefile
data/icons/hicolor/22x22/apps/Makefile
data/icons/hicolor/24x24/Makefile
data/icons/hicolor/24x24/apps/Makefile
data/icons/hicolor/32x32/Makefile
data/icons/hicolor/32x32/apps/Makefile
data/icons/hicolor/48x48/Makefile
data/icons/hicolor/48x48/apps/Makefile
William Jon McCann's avatar
William Jon McCann committed
347 348
data/icons/hicolor/256x256/Makefile
data/icons/hicolor/256x256/apps/Makefile
349 350
data/icons/hicolor/scalable/Makefile
data/icons/hicolor/scalable/apps/Makefile
351
gladeui/Makefile
352
gladeui/gladeui.rc
353
gladeui/glade-previewer.rc
354
src/Makefile
355
src/glade.rc
356 357 358 359 360
plugins/Makefile
plugins/gtk+/Makefile
plugins/gtk+/icons/Makefile
plugins/gtk+/icons/16x16/Makefile
plugins/gtk+/icons/22x22/Makefile
361
plugins/python/Makefile
362
plugins/gladeui/Makefile
363
plugins/webkit2gtk/Makefile
364
po/Makefile.in
Tristan Van Berkom's avatar
Tristan Van Berkom committed
365 366
doc/Makefile
doc/version.xml
Tristan Van Berkom's avatar
Tristan Van Berkom committed
367
help/Makefile
Matthias Clasen's avatar
Matthias Clasen committed
368
man/Makefile
369
tests/Makefile
370
build/mingw-w64/glade.nsi
371
])
Jose Maria Celorio's avatar
Jose Maria Celorio committed
372

Tristan Van Berkom's avatar
Tristan Van Berkom committed
373 374
AC_OUTPUT

Jose Maria Celorio's avatar
Jose Maria Celorio committed
375 376 377 378
echo "

Configuration:

379 380
	Source code location:	 ${srcdir}
	Compiler:		 ${CC}
381
	Debug Enabled:           ${enable_debug}
382
	GTK+ UNIX Print Widgets: ${have_unix_print}
383
	PYTHON Widgets support:	 ${have_python}
384
	Gladeui Catalog:         ${enable_gladeui}
385
	WebKit2GTK+ Catalog:     ${have_webkit2gtk}
386
	Introspection Data:      ${found_introspection}
387 388

	Build Reference Manual:  ${enable_gtk_doc}
Matthias Clasen's avatar
Matthias Clasen committed
389
	Build Manual Pages:      ${enable_man_pages}
Jose Maria Celorio's avatar
Jose Maria Celorio committed
390
"