Add initial support for defect #12:
[pywebkitgtk.git] / configure.ac
blob6975ae0864325ec8863bf082e438933861795a3d
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 m4_define([webkit_stable_version], [1.0.2])
12 AC_INIT([pywebkitgtk],
13         [pywebkitgtk_version],
14         [http://code.google.com/p/pywebkitgtk/issues])
16 AC_PREREQ([2.59])
17 AC_CONFIG_MACRO_DIR([m4])
18 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I .")
20 AC_CONFIG_SRCDIR([configure.ac])
21 AC_CONFIG_HEADERS([config.h])
23 AC_DEFINE_UNQUOTED(PYWEBKITGTK_VERSION, pywebkitgtk_version,
24                    [The release version of Python WebKit Gtk+])
25 AC_DEFINE_UNQUOTED(PYWEBKITGTK_MAJOR_VERSION, pywebkitgtk_major_version,
26                    [The major version of Python WebKit Gtk+.])
27 AC_DEFINE_UNQUOTED(PYWEBKITGTK_MINOR_VERSION, pywebkitgtk_minor_version,
28                    [The minor version of Python WebKit Gtk+.])
29 AC_DEFINE_UNQUOTED(PYWEBKITGTK_MICRO_VERSION, pywebkitgtk_micro_version,
30                    [The micro version of Python WebKit Gtk+.])
32 AM_INIT_AUTOMAKE([foreign subdir-objects])
34 AM_PROG_CC_C_O
35 AC_PROG_LIBTOOL
37 dnl check for python
38 AM_PATH_PYTHON(2.4)
39 AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
40 py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
41 PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
43 dnl from pygtk: get rid of -export-dynamic stuff from the configure flags...
44 export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
46 dnl check for dependencies
47 dnl Check for libxslt until upstream WebKit checks for it as this is a webkit
48 dnl dep and not pywebkitgtk's.
49 PKG_CHECK_MODULES(DEPS, 
50                   [libxslt,
51                   pygtk-2.0,
52                   webkit-1.0])
53 AC_SUBST(DEPS_CFLAGS)
54 AC_SUBST(DEPS_LIBS)
55 AC_SUBST(DEPS_CPPFLAGS)
57 dnl python code gen
58 AC_PATH_PROGS(PYGOBJECT_CODEGEN, pygobject-codegen-2.0 pygtk-codegen-2.0, no)
59 if test "x$PYGOBJECT_CODEGEN" = xno; then
60    AC_MSG_ERROR(could not find pygobject-codegen-2.0 script)
63 dnl check for pygtk defsdir
64 AC_MSG_CHECKING(for pygtk defs)
65 PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
66 AC_SUBST(PYGTK_DEFSDIR)
67 AC_MSG_RESULT($PYGTK_DEFSDIR)
69 dnl check for pygtk codegen dir
70 AC_MSG_CHECKING(for pygtk codegendir)
71 PYGTK_CODEGENDIR=`$PKG_CONFIG --variable=codegendir pygtk-2.0`
72 AC_SUBST(PYGTK_CODEGENDIR)
73 AC_MSG_RESULT($PYGTK_CODEGENDIR)
75 dnl check if Gjs is wanted
76 AC_MSG_CHECKING([if Gjs will be included])
77 AC_ARG_WITH(gjs,
78             AC_HELP_STRING([--with-gjs=@<:@yes/no@:>@],
79                            [Include GJS JavaScriptCore binding [default=no]]),
80             [with_gjs="yes"],[with_gjs="no"])
81 case "$with_gjs" in
82      yes|no)     ;;
83      *) AC_MSG_ERROR([Invalid option. Should be 'yes' or 'no']) ;;
84 esac
85 if test $with_gjs = "yes"; then
86    AC_DEFINE([HAVE_GJS],[1],[Define to have GJS Support])
88 AC_MSG_RESULT([$with_gjs])
90 dnl check which .defs file we should use
91 dnl 
92 dnl webkit-stable.defs is for upstream webkit/gtk stable releases
93 dnl webkit-dev.defs is for webkit/gtk ToT installations
94 AC_MSG_CHECKING(which definitions file to use)
95 PYWEBKIT_DEFS="webkit-stable.defs"
96 webkit_installed_version=`$PKG_CONFIG --modversion webkit-1.0`
97 if test $webkit_installed_version > $webkit_stable_version; then
98    PYWEBKIT_DEFS="webkit-dev.defs"
100 AC_SUBST(PYWEBKIT_DEFS)
101 AC_MSG_RESULT($PYWEBKIT_DEFS)
103 dnl conditionals
104 AM_CONDITIONAL([HAVE_GJS],[test "$with_gjs" = "yes"])
106 dnl output
107 AC_CONFIG_FILES([
108 Makefile
109 pywebkitgtk-1.0.pc:pywebkitgtk.pc.in
112 AC_OUTPUT