summaryrefslogtreecommitdiff
path: root/configure.in
blob: dc99c893a8606ac2ab402242e053fc1ab21e470c (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
-*- mode: m4 -*-
AC_PREREQ(2.52)

dnl the pygtk version number
m4_define(pygtk_major_version, 1)
m4_define(pygtk_minor_version, 99)
m4_define(pygtk_micro_version, 8)
m4_define(pygtk_version, pygtk_major_version.pygtk_minor_version.pygtk_micro_version)

dnl versions of packages we require ...
m4_define(glib_required_version,     2.0.0)
m4_define(pango_required_version,    1.0.0)
m4_define(atk_required_version,      1.0.0)
m4_define(gtk_required_version,      2.0.0)
m4_define(libglade_required_version, 1.99.9)
m4_define(gtkgl_required_version,    1.99.0)

AC_INIT(pygtk, pygtk_version,
        [http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-python&component=pygtk])

AC_DEFINE(PYGTK_MAJOR_VERSION, pygtk_major_version, [PyGtk major version])
AC_DEFINE(PYGTK_MINOR_VERSION, pygtk_minor_version, [PyGtk minor version])
AC_DEFINE(PYGTK_MICRO_VERSION, pygtk_micro_version, [PyGtk macro version])

AC_CONFIG_SRCDIR([gtk/gtkmodule.c])
AM_CONFIG_HEADER(config.h)

AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)

dnl put the ACLOCAL flags in the makefile
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"

AC_DISABLE_STATIC
AC_PROG_LIBTOOL

dnl AM_PATH_PYTHON(2.2)
AM_PATH_PYTHON
AC_MSG_CHECKING(for python >= 2.2)
prog="
import sys, string
minver = (2,2,0,'final',0)
if sys.version_info < minver:
  sys.exit(1)
sys.exit(0)"
if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
then
  AC_MSG_RESULT(okay)
else
  AC_MSG_ERROR(too old)
fi


AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])

AC_ARG_ENABLE(thread,
  AC_HELP_STRING([--disable-thread], [Disable pygtk threading support]),,
  enable_thread=no)

AM_CHECK_PYMOD(thread,,,enable_thread=no)

AC_MSG_CHECKING(whether to enable threading in pygtk)
if test "x$enable_thread" != xno; then
  extra_mods=gthread
  AC_DEFINE(ENABLE_PYGTK_THREADING)
  AC_MSG_RESULT(yes)
else
  extra_mods=
  AC_MSG_RESULT(no)
fi

dnl glib
AM_PATH_GLIB_2_0(glib_required_version,,[AC_MSG_ERROR(maybe you want the gtk-gnome-1-2 branch?)],gobject $extra_mods)

dnl atk
PKG_CHECK_MODULES(ATK, atk >= atk_required_version,,[AC_MSG_ERROR(maybe you want the gtk-gnome-1-2 branch?)])
AC_SUBST(ATK_CFLAGS)
AC_SUBST(ATK_LIBS)

dnl pango
PKG_CHECK_MODULES(PANGO, pango >= pango_required_version,,[AC_MSG_ERROR(maybe you want the gtk-gnome-1-2 branch?)])
AC_SUBST(PANGO_CFLAGS)
AC_SUBST(PANGO_LIBS)

dnl gtk+
AM_PATH_GTK_2_0(gtk_required_version,,[AC_MSG_ERROR(maybe you want the gtk-gnome-1-2 branch?)],$extra_mods)

dnl libglade
build_libglade=false
PKG_CHECK_MODULES(LIBGLADE, libglade-2.0 >= libglade_required_version,
  build_libglade=true,
  build_libglade=false)
AC_SUBST(LIBGLADE_CFLAGS)
AC_SUBST(LIBGLADE_LIBS)
AM_CONDITIONAL(BUILD_LIBGLADE, $build_libglade)

dnl gtkgl
build_gtkgl=false
PKG_CHECK_MODULES(GTKGL, gtkgl-2.0 >= gtkgl_required_version,
  build_gtkgl=true,
  build_gtkgl=false)
AC_SUBST(GTKGL_CFLAGS)
AC_SUBST(GTKGL_LIBS)
AM_CONDITIONAL(BUILD_GTKGL, $build_gtkgl)


AC_ARG_ENABLE(numpy,
  AC_HELP_STRING([--disable-numpy], [Disable numeric python features]),,
  enable_numpy=yes)

dnl checks to see if Numeric Python is installed.
if test "x$enable_numpy" != xno; then
  save_CPPFLAGS="$CPPFLAGS"
  CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
  AC_CHECK_HEADER(arrayobject.h,
    [AC_DEFINE(HAVE_NUMPY)
     AC_DEFINE(HAVE_ARRAYOBJECT_H)],
    [AC_CHECK_HEADER(Extensions/arrayobject.h,
      [AC_DEFINE(HAVE_NUMPY)
       AC_DEFINE(HAVE_EXTENSIONS_ARRAYOBJECT_H)],
      [AC_CHECK_HEADER(Numeric/arrayobject.h,
        [AC_DEFINE(HAVE_NUMPY)
         AC_DEFINE(HAVE_NUMERIC_ARRAYOBJECT_H)])])])
  CPPFLAGS="$save_CPPFLAGS"
fi

dnl add debugging options ...
changequote(,)dnl
if test "x$GCC" = xyes; then
  case " $CFLAGS " in
  *[\	\ ]-Wall[\	\ ]*) ;;
  *) CFLAGS="$CFLAGS -Wall" ;;
  esac

  case " $CFLAGS " in
  *[\	\ ]-std=c9x[\	\ ]*) ;;
  *) CFLAGS="$CFLAGS -std=c9x" ;;
  esac
fi
changequote([,])dnl

AC_CONFIG_FILES(
  Makefile
  pygtk-2.0.pc
  codegen/Makefile
  gtk/Makefile
  codegen/pygtk-codegen-2.0
  pygtk.spec)
AC_OUTPUT