summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Henstridge <jamesh@src.gnome.org>2000-04-06 15:33:26 +0000
committerJames Henstridge <jamesh@src.gnome.org>2000-04-06 15:33:26 +0000
commitb9586c2ea390920ed14850b2e2627fe1f8d3be7e (patch)
treef5ee2c3508069e6098df079c76070b35444c7754
parent7278dba0411aa9579d3af932a37e92e108d7fcc7 (diff)
downloadpygtk-b9586c2ea390920ed14850b2e2627fe1f8d3be7e.tar.gz
Update build system to use automake-1.4a. Now you don't need my automake
patches to build gnome-python. Just make sure that you set the prefix correctly when installing, as the official automake patches install to the specified prefix, rather than trying to guess the value.
-rw-r--r--.cvsignore7
-rw-r--r--ChangeLog4
-rw-r--r--Makefile.am43
-rw-r--r--acconfig.h33
-rw-r--r--acinclude.m463
-rw-r--r--configure.in18
-rw-r--r--gdkimlibmodule.c14
-rw-r--r--gtkglmodule.c4
-rw-r--r--gtkmodule.c14
-rw-r--r--pyglade/Makefile.am2
10 files changed, 174 insertions, 28 deletions
diff --git a/.cvsignore b/.cvsignore
index adf9ec74..4cd64767 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -18,16 +18,19 @@ stamp.h
version.h
config.h.in
.exrc
-gnome-config
install-sh
missing
mkinstalldirs
+depcomp
INSTALL
intl
ABOUT-NLS
py-compile
+.deps
+.libs
*_defs.c
*_impl.c
*.pyc
*.pyo
-.deps
+*.lo
+*.la \ No newline at end of file
diff --git a/ChangeLog b/ChangeLog
index 07caeb61..bca0e17c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2000-04-06 James Henstridge <james@daa.com.au>
+
+ * (lots of files): switch over to using libtool and automake-1.4a.
+
2000-03-13 James Henstridge <james@daa.com.au>
* pyglade/__init__.py: remove python-1.4 ni stuff, and put in a
diff --git a/Makefile.am b/Makefile.am
index c08bd1c6..fe64b8ce 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,53 +1,56 @@
+AUTOMAKE_OPTIONS = 1.4a
+
SUBDIRS = generate pyglade
-INCLUDES= $(PYTHON_INCLUDES) $(PYTHON_CFLAGS) $(GTK_CFLAGS) \
- $(GDK_IMLIB_CFLAGS) $(GTKGL_CFLAGS) $(LIBGLADE_CFLAGS)
+INCLUDES= $(PYTHON_INCLUDES) $(GTK_CFLAGS) $(GDK_IMLIB_CFLAGS) \
+ $(GTKGL_CFLAGS) $(LIBGLADE_CFLAGS)
if BUILD_IMLIB
-imlib_libs = _gdkimlibmodule$(SO)
+imlib_libs = _gdkimlibmodule.la
imlib_mods = GdkImlib.py
else
imlib_libs =
imlib_mods =
endif
if BUILD_GTKGL
-gtkgl_libs = _gtkglmodule$(SO)
+gtkgl_libs = _gtkglmodule.la
gtkgl_mods = gtkgl.py
else
gtkgl_libs =
gtkgl_mods =
endif
if BUILD_LIBGLADE
-libglade_libs = _libglademodule$(SO)
+libglade_libs = _libglademodule.la
libglade_mods = libglade.py
else
libglade_libs =
libglade_mods =
endif
-pyexec_PROGRAMS = _gtkmodule$(SO) $(imlib_libs) $(gtkgl_libs) $(libglade_libs)
-EXTRA_PROGRAMS =
+pyexecdir = $(PYTHON_SITE_EXEC)
+pyexec_LTLIBRARIES = _gtkmodule.la $(imlib_libs) $(gtkgl_libs) $(libglade_libs)
-_gtkmodule__SO__SOURCES = gtkmodule.c
-_gtkmodule__SO__LDADD = $(GTK_LIBS)
-_gtkmodule__SO__LINK = $(PYTHON_LINK)
+_gtkmodule_la_LDFLAGS = -module -avoid-version
+_gtkmodule_la_SOURCES = gtkmodule.c
+_gtkmodule_la_LIBADD = $(GTK_LIBS)
-_gdkimlibmodule__SO__SOURCES = gdkimlibmodule.c
-_gdkimlibmodule__SO__LDADD = $(GDK_IMLIB_LIBS)
-_gdkimlibmodule__SO__LINK = $(PYTHON_LINK)
+_gdkimlibmodule_la_LDFLAGS = -module -avoid-version
+_gdkimlibmodule_la_SOURCES = gdkimlibmodule.c
+_gdkimlibmodule_la_LIBADD = $(GDK_IMLIB_LIBS)
-_gtkglmodule__SO__SOURCES = gtkglmodule.c
-_gtkglmodule__SO__LDADD = $(GTKGL_LIBS) $(GTK_LIBS)
-_gtkglmodule__SO__LINK = $(PYTHON_LINK)
+_gtkglmodule_la_LDFLAGS = -module -avoid-version
+_gtkglmodule_la_SOURCES = gtkglmodule.c
+_gtkglmodule_la_LIBADD = $(GTKGL_LIBS) $(GTK_LIBS)
-_libglademodule__SO__SOURCES = libglademodule.c
-_libglademodule__SO__LDADD = $(LIBGLADE_LIBS)
-_libglademodule__SO__LINK = $(PYTHON_LINK)
+_libglademodule_la_LDFLAGS = -module -avoid-version
+_libglademodule_la_SOURCES = libglademodule.c
+_libglademodule_la_LIBADD = $(LIBGLADE_LIBS)
pkginclude_HEADERS = pygtk.h pygdkimlib.h
-python_PYTHON = gtk.py Gtkinter.py GTK.py GDK.py GtkExtra.py \
+pysitedir = $(PYTHON_SITE)
+pysite_PYTHON = gtk.py Gtkinter.py GTK.py GDK.py GtkExtra.py \
$(imlib_mods) $(gtkgl_mods) $(libglade_mods)
noinst_PYTHON = mkgtk.py description.py
diff --git a/acconfig.h b/acconfig.h
new file mode 100644
index 00000000..bfe533c0
--- /dev/null
+++ b/acconfig.h
@@ -0,0 +1,33 @@
+/* -*- Mode: C; c-basic-offset: 4 -*- */
+/* PyGTK - python bindings for GTK+
+ * Copyright (C) 1997-2000 James Henstridge <james@daa.com.au>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef _PYGTK_CONFIG_H_
+#define _PYGTK_CONFIG_H_
+@TOP@
+
+/* define if Numeric Python support is to be used */
+#undef HAVE_NUMPY
+
+#undef HAVE_ARRAYOBJECT_H
+#undef HAVE_EXTENSIONS_ARRAYOBJECT_H
+#undef HAVE_NUMERIC_ARRAYOBJECT_H
+
+@BOTTOM@
+#endif /* !_PYGTK_CONFIG_H_ */
diff --git a/acinclude.m4 b/acinclude.m4
new file mode 100644
index 00000000..c1e31aae
--- /dev/null
+++ b/acinclude.m4
@@ -0,0 +1,63 @@
+## this one is commonly used with AM_PATH_PYTHONDIR ...
+dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
+dnl Check if a module containing a given symbol is visible to python.
+AC_DEFUN(AM_CHECK_PYMOD,
+[AC_REQUIRE([AM_PATH_PYTHON])
+py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
+AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1)
+AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
+ifelse([$2],[], [prog="
+import sys
+try:
+ import $1
+except ImportError:
+ sys.exit(1)
+except:
+ sys.exit(0)
+sys.exit(0)"], [prog="
+import $1
+$1.$2"])
+if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
+ then
+ eval "py_cv_mod_$py_mod_var=yes"
+ else
+ eval "py_cv_mod_$py_mod_var=no"
+ fi
+])
+py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
+if test "x$py_val" != xno; then
+ AC_MSG_RESULT(yes)
+ ifelse([$3], [],, [$3
+])dnl
+else
+ AC_MSG_RESULT(no)
+ ifelse([$4], [],, [$4
+])dnl
+fi
+])
+
+dnl a macro to check for ability to create python extensions
+dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
+dnl function also defines PYTHON_INCLUDES
+AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
+[AC_REQUIRE([AM_PATH_PYTHON])
+AC_MSG_CHECKING(for headers required to compile python extensions)
+dnl deduce PYTHON_INCLUDES
+py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
+py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
+PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
+if test "$py_prefix" != "$py_exec_prefix"; then
+ PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
+fi
+AC_SUBST(PYTHON_INCLUDES)
+dnl check if the headers exist:
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
+AC_TRY_CPP([#include <Python.h>],dnl
+[AC_MSG_RESULT(found)
+$1],dnl
+[AC_MSG_RESULT(not found)
+$2])
+CPPFLAGS="$save_CPPFLAGS"
+])
+
diff --git a/configure.in b/configure.in
index cb2dfae7..6d8e4ce6 100644
--- a/configure.in
+++ b/configure.in
@@ -1,9 +1,13 @@
AC_INIT(gtkmodule.c)
+AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(pygtk, 0.6.5)
-AM_PATH_PYTHON
-AM_INIT_PYEXEC_MOD
+AC_DISABLE_STATIC
+AC_PROG_LIBTOOL
+
+AM_PATH_PYTHON(module)
+AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
AM_CHECK_PYMOD(thread,,extra_mods=gthread,extra_mods=)
@@ -21,7 +25,15 @@ AM_CONDITIONAL(BUILD_LIBGLADE, $build_libglade)
dnl checks to see if Numeric Python is installed.
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
-AC_CHECK_HEADER(arrayobject.h, AC_DEFINE(HAVE_NUMPY))
+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"
AC_OUTPUT(Makefile generate/Makefile pyglade/Makefile)
diff --git a/gdkimlibmodule.c b/gdkimlibmodule.c
index 44dbf39a..69e62aa4 100644
--- a/gdkimlibmodule.c
+++ b/gdkimlibmodule.c
@@ -18,12 +18,24 @@
* Boston, MA 02111-1307, USA.
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <Python.h>
#include <gtk/gtk.h>
#include <gdk_imlib.h>
#ifdef HAVE_NUMPY
-#include <arrayobject.h>
+# if defined(HAVE_ARRAYOBJECT_H)
+# include <arrayobject.h>
+# elif defined(HAVE_EXTESNSIONS_ARRAYOBJECT_H)
+# include <Extensions/arrayobject.h>
+# elif defined(HAVE_NUMERIC_ARRAYOBJECT_H)
+# include <Numeric/arrayobject.h>
+# else
+# error "arrayobject.h not found, but HAVE_NUMPY defined"
+# endif
#endif
#include "pygtk.h"
diff --git a/gtkglmodule.c b/gtkglmodule.c
index 6a8422aa..055f6452 100644
--- a/gtkglmodule.c
+++ b/gtkglmodule.c
@@ -18,6 +18,10 @@
* Boston, MA 02111-1307, USA.
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <Python.h>
#include <gtkgl/gtkglarea.h>
diff --git a/gtkmodule.c b/gtkmodule.c
index 7be610e8..32eb6264 100644
--- a/gtkmodule.c
+++ b/gtkmodule.c
@@ -18,10 +18,22 @@
* Boston, MA 02111-1307, USA.
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <Python.h>
#include <sysmodule.h>
#ifdef HAVE_NUMPY
-#include <arrayobject.h>
+# if defined(HAVE_ARRAYOBJECT_H)
+# include <arrayobject.h>
+# elif defined(HAVE_EXTESNSIONS_ARRAYOBJECT_H)
+# include <Extensions/arrayobject.h>
+# elif defined(HAVE_NUMERIC_ARRAYOBJECT_H)
+# include <Numeric/arrayobject.h>
+# else
+# error "arrayobject.h not found, but HAVE_NUMPY defined"
+# endif
#endif
#include <gtk/gtk.h>
diff --git a/pyglade/Makefile.am b/pyglade/Makefile.am
index 77ea0e49..8ca29972 100644
--- a/pyglade/Makefile.am
+++ b/pyglade/Makefile.am
@@ -1,3 +1,3 @@
-pygladedir = $(pythondir)/pyglade
+pygladedir = $(PYTHON_SITE)/pyglade
pyglade_PYTHON = __init__.py build.py style.py xmlparse.py