summaryrefslogtreecommitdiff
blob: 1eaacfa2ef180de73e4234f4ca5249f987512a7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
diff -ru hippo-canvas-0.2.23-orig/configure.ac hippo-canvas-0.2.23/configure.ac
--- hippo-canvas-0.2.23-orig/configure.ac	2007-07-11 16:47:11.000000000 -0400
+++ hippo-canvas-0.2.23/configure.ac	2007-08-30 20:33:58.924749555 -0400
@@ -154,15 +154,28 @@
 GTK_DOC_CHECK([1.6])
 
 ## Python bindings
-AM_PATH_PYTHON
-AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
+AC_ARG_ENABLE(python,
+              [AC_HELP_STRING([--enable-python], [build python bindings [default=auto]])])
+if test "x$enable_python" = "xno" ; then
+  have_python=no
+else
+  have_python=no
+  AM_PATH_PYTHON
+  if test "x$PYTHON" = "x" ; then
+    AC_MSG_WARN([Python not found])
+  else
+    AM_CHECK_PYTHON_HEADERS([
+      AC_PATH_PROG(PYGTK_CODEGEN, pygtk-codegen-2.0, no)
+      PKG_CHECK_MODULES(PYTHON_BINDINGS, pygtk-2.0 pycairo, [
+        PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
+        AC_SUBST(PYGTK_DEFSDIR)
+        have_python=yes
+      ], [AC_MSG_WARN(could not find pygtk-2.0 or pycairo)])
+    ],[AC_MSG_WARN(could not find Python headers)])
+  fi
+fi
 
-AC_PATH_PROG(PYGTK_CODEGEN, pygtk-codegen-2.0, no)
-
-PKG_CHECK_MODULES(PYTHON_BINDINGS, pygtk-2.0 pycairo)
-
-PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
-AC_SUBST(PYGTK_DEFSDIR)
+AM_CONDITIONAL(HAVE_PYTHON, test "x$have_python" = "xyes")
 
 AC_OUTPUT([
 Makefile
@@ -179,6 +192,7 @@
         prefix:                   ${prefix}
         compiler:                 ${CC}
         LIBHIPPOCANVAS_CFLAGS:    ${LIBHIPPOCANVAS_CFLAGS}
+        build python bindings:    ${have_python}
 
         Now type 'make' to build $PACKAGE
 "
diff -ru hippo-canvas-0.2.23-orig/Makefile.am hippo-canvas-0.2.23/Makefile.am
--- hippo-canvas-0.2.23-orig/Makefile.am	2007-07-08 06:28:19.000000000 -0400
+++ hippo-canvas-0.2.23/Makefile.am	2007-08-30 20:34:06.286626454 -0400
@@ -54,6 +54,8 @@
 libhippocanvas_1_la_SOURCES=$(COMMON_CANVAS_SOURCEFILES) $(LINUX_CANVAS_SOURCEFILES)
 nodist_libhippocanvas_1_la_SOURCES=$(CANVAS_BUILT_SOURCEFILES)
 
+if HAVE_PYTHON
 include Makefile-python.am
+endif
 
 DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc