Implement per-version inclusion of WebKit .defs
[pywebkitgtk.git] / configure.ac
blobf6671fd799d6ef38e0fc35622e03dbffaa78b1cf
1 # configure script for pywebkitgtk
3 m4_define([pywebkitgtk_major_version], [1])
4 m4_define([pywebkitgtk_minor_version], [0])
5 m4_define([pywebkitgtk_micro_version], [99])
7 m4_define([pywebkitgtk_version],
8           [pywebkitgtk_major_version.pywebkitgtk_minor_version.pywebkitgtk_micro_version])
10 AC_INIT([pywebkitgtk],
11         [pywebkitgtk_version],
12         [http://code.google.com/p/pywebkitgtk/issues])
14 AC_PREREQ([2.59])
15 AC_CONFIG_MACRO_DIR([m4])
16 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I .")
18 AC_CONFIG_SRCDIR([configure.ac])
19 AC_CONFIG_HEADERS([config.h])
21 AC_DEFINE_UNQUOTED(PYWEBKITGTK_VERSION, pywebkitgtk_version,
22                    [The release version of Python WebKit Gtk+])
23 AC_DEFINE_UNQUOTED(PYWEBKITGTK_MAJOR_VERSION, pywebkitgtk_major_version,
24                    [The major version of Python WebKit Gtk+.])
25 AC_DEFINE_UNQUOTED(PYWEBKITGTK_MINOR_VERSION, pywebkitgtk_minor_version,
26                    [The minor version of Python WebKit Gtk+.])
27 AC_DEFINE_UNQUOTED(PYWEBKITGTK_MICRO_VERSION, pywebkitgtk_micro_version,
28                    [The micro version of Python WebKit Gtk+.])
30 AM_INIT_AUTOMAKE([foreign subdir-objects])
32 AM_PROG_CC_C_O
33 AC_PROG_LIBTOOL
35 dnl check for python
36 AM_PATH_PYTHON(2.4)
37 AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
38 py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
39 PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
41 dnl from pygtk: get rid of -export-dynamic stuff from the configure flags...
42 export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
44 dnl check for dependencies
45 dnl Check for libxslt until upstream WebKit checks for it as this is a webkit
46 dnl dep and not pywebkitgtk's.
47 PKG_CHECK_MODULES(DEPS, 
48                   [libxslt,
49                   pygtk-2.0])
50 AC_SUBST(DEPS_CFLAGS)
51 AC_SUBST(DEPS_LIBS)
52 AC_SUBST(DEPS_CPPFLAGS)
54 dnl python code gen
55 AC_PATH_PROGS(PYGOBJECT_CODEGEN, pygobject-codegen-2.0 pygtk-codegen-2.0, no)
56 if test "x$PYGOBJECT_CODEGEN" = xno; then
57    AC_MSG_ERROR(could not find pygobject-codegen-2.0 script)
60 dnl check for pygtk defsdir
61 AC_MSG_CHECKING(for pygtk defs)
62 PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
63 AC_SUBST(PYGTK_DEFSDIR)
64 AC_MSG_RESULT($PYGTK_DEFSDIR)
66 dnl check for pygtk codegen dir
67 AC_MSG_CHECKING(for pygtk codegendir)
68 PYGTK_CODEGENDIR=`$PKG_CONFIG --variable=codegendir pygtk-2.0`
69 AC_SUBST(PYGTK_CODEGENDIR)
70 AC_MSG_RESULT($PYGTK_CODEGENDIR)
72 dnl check if Gjs is wanted
73 AC_MSG_CHECKING([if Gjs will be included])
74 AC_ARG_WITH(gjs,
75             AC_HELP_STRING([--with-gjs=@<:@yes/no@:>@],
76                            [Include GJS JavaScriptCore binding [default=no]]),
77             [with_gjs="yes"],[with_gjs="no"])
78 case "$with_gjs" in
79      yes|no)     ;;
80      *) AC_MSG_ERROR([Invalid option. Should be 'yes' or 'no']) ;;
81 esac
82 if test $with_gjs = "yes"; then
83    AC_DEFINE([HAVE_GJS],[1],[Define to have GJS Support])
85 AC_MSG_RESULT([$with_gjs])
87 dnl check for webkit versions installed
88 PKG_CHECK_MODULES(WEBKIT, webkit-1.0)
89 AC_SUBST(WEBKIT_CFLAGS)
90 AC_SUBST(WEBKIT_LIBS)
91 AC_SUBST(WEBKIT_CPPFLAGS)
93 have_webkit103=dnl
94 PKG_CHECK_MODULES(WEBKIT103, webkit-1.0 >= 1.0.3,
95                              have_webkit103="yes",
96                              have_webkit103="no")
97 if test "$have_webkit103" = "yes"; then
98    AC_DEFINE([HAVE_WEBKIT_1_0_3],[1],[Define if WebKit/Gtk 1.0.3 was found])
101 dnl conditionals
102 AM_CONDITIONAL([HAVE_WEBKIT_1_0_3],[test "$have_webkit103" = "yes"])
103 AM_CONDITIONAL([HAVE_GJS],[test "$with_gjs" = "yes"])
105 dnl output
106 AC_CONFIG_FILES([
107 Makefile
108 pywebkitgtk-1.0.pc:pywebkitgtk.pc.in
111 AC_OUTPUT