fix configure.in multiple PKG_CHECK_MODULES calls; don't use private pygnomevfs.h file

parent 29d2cb98
2005-08-25 Gustavo J. A. M. Carneiro <gjc@gnome.org>
* src/pygnomevfs.h: Removed. Now it is installed by gnome-python.
* src/Makefile.am: Update to use NAUTILUS_PYTHON_{LIBS,CFLAGS}.
(EXTRA_DIST): Remove pygnomevfs.h.
* configure.in: Call PKG_CHECK_MODULES only one time, store
LIBS/CFLAGS in NAUTILUS_PYTHON.
* examples/Makefile.am: Don't install examples into extensions
dir; they're only examples, not something the user normally would
like to run. Instead, they are installed into the package doc
......
......@@ -13,8 +13,8 @@ AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I .")
NAUTILUS_REQUIRED=2.6.0
EEL_REQUIRED=2.6.0
PYGTK_REQUIRED=2.4.0
GNOME_PYTHON_REQUIRED=2.0.0
PYGTK_REQUIRED=2.7.99
GNOME_PYTHON_REQUIRED=2.12.0
AC_PROG_CC
AC_DISABLE_STATIC
......@@ -126,8 +126,10 @@ else
AC_MSG_ERROR(you need to have python installed !)
fi
PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= $PYGTK_REQUIRED)
AC_SUBST(PYGTK_CFLAGS)
PKG_CHECK_MODULES(NAUTILUS_PYTHON, [pygtk-2.0 >= $PYGTK_REQUIRED
gnome-python-2.0 >= $GNOME_PYTHON_REQUIRED
libnautilus-extension >= $NAUTILUS_REQUIRED
eel-2.0 >= $EEL_REQUIRED])
AC_MSG_CHECKING(for pygtk defs)
PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
......@@ -139,14 +141,6 @@ PYGTK_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/codegen.py"
AC_SUBST(PYGTK_CODEGEN)
AC_MSG_RESULT($PYGTK_CODEGEN)
PKG_CHECK_MODULES(GNOME_PYTHON, gnome-python-2.0 >= $GNOME_PYTHON_REQUIRED)
dnl nautilus and its extension library
PKG_CHECK_MODULES(NAUTILUS, libnautilus-extension >= $NAUTILUS_REQUIRED eel-2.0 >= $EEL_REQUIRED)
AC_SUBST(NAUTILUS_CFLAGS)
AC_SUBST(NAUTILUS_LIBS)
NAUTILUS_LIBDIR=`$PKG_CONFIG --variable=libdir libnautilus-extension`
AC_SUBST(NAUTILUS_LIBDIR)
AC_DEFINE_UNQUOTED(NAUTILUS_LIBDIR, "$NAUTILUS_LIBDIR", [Nautilus libdir])
......
......@@ -5,9 +5,8 @@ INCLUDES = \
-I$(top_srcdir) \
-I$(top_builddir) \
$(DISABLE_DEPRECATED_CFLAGS) \
$(NAUTILUS_CFLAGS) \
$(PY_CFLAGS) \
$(PYGTK_CFLAGS)
$(NAUTILUS_PYTHON_CFLAGS) \
$(PY_CFLAGS)
PYTHON_LIBS = \
-l$(PY_LIBS) \
......@@ -25,18 +24,18 @@ libnautilus_python_la_SOURCES = \
nautilus-python-object.h
libnautilus_python_la_LDFLAGS = -module -avoid-version $(PY_LIB_LOC)
libnautilus_python_la_LIBADD = $(NAUTILUS_LIBS) $(PYTHON_LIBS)
libnautilus_python_la_LIBADD = $(NAUTILUS_PYTHON_LIBS) $(PYTHON_LIBS)
pyexec_LTLIBRARIES = nautilus.la
pyexecdir = $(NAUTILUS_LIBDIR)/nautilus-python
nautilus_la_LDFLAGS = -module -avoid-version -export-symbols-regex initnautilus
nautilus_la_LIBADD = $(NAUTILUS_LIBS)
nautilus_la_LIBADD = $(NAUTILUS_PYTHON_LIBS)
nautilus_la_SOURCES = nautilusmodule.c
nodist_nautilus_la_SOURCES = nautilus.c
nautilus.c: nautilus.defs nautilus.override
CLEANFILES = nautilus.c
EXTRA_DIST = nautilus.override nautilus.defs pygnomevfs.h
EXTRA_DIST = nautilus.override nautilus.defs
.defs.c:
(cd $(srcdir)\
......
/*
* nautilus-python.c - Nautilus Python extension
*
* Copyright (C) 2004 Johan Dahlin
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU 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 General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#ifndef PYGNOME_VFS_H
#define PYGNOME_VFS_H
#include <Python.h>
#include <libgnomevfs/gnome-vfs-init.h>
#include <libgnomevfs/gnome-vfs-uri.h>
#include <libgnomevfs/gnome-vfs-file-info.h>
#include <libgnomevfs/gnome-vfs-directory.h>
#include <libgnomevfs/gnome-vfs-ops.h>
#include <libgnomevfs/gnome-vfs-mime-handlers.h>
#include <libgnomevfs/gnome-vfs-mime-utils.h>
#include <libgnomevfs/gnome-vfs-result.h>
#include <libgnomevfs/gnome-vfs-context.h>
#include <libgnomevfs/gnome-vfs-xfer.h>
typedef struct {
PyObject_HEAD
GnomeVFSURI *uri;
} PyGnomeVFSURI;
typedef struct {
PyObject_HEAD
GnomeVFSFileInfo *finfo;
} PyGnomeVFSFileInfo;
typedef struct {
PyObject_HEAD
GnomeVFSContext *context;
} PyGnomeVFSContext;
#define pygnome_vfs_uri_get(v) (((PyGnomeVFSURI *)(v))->uri)
#define pygnome_vfs_uri_check(v) ((v)->ob_type == _PyGnomeVFS_API->uri_type)
#define pygnome_vfs_file_info_get(v) (((PyGnomeVFSFileInfo *)(v))->finfo)
#define pygnome_vfs_file_info_check(v) ((v)->ob_type == _PyGnomeVFS_API->file_info_type)
#define pygnome_vfs_context_get(v) (((PyGnomeVFSURI *)(v))->context)
#define pygnome_vfs_context_check(v) ((v)->ob_type == _PyGnomeVFS_API->context_type)
struct _PyGnomeVFS_Functions {
GnomeVFSResult (* exception_check)(void);
PyObject *(* uri_new)(GnomeVFSURI *uri);
PyTypeObject *uri_type;
PyObject *(* file_info_new)(GnomeVFSFileInfo *finfo);
PyTypeObject *file_info_type;
PyObject *(* context_new)(GnomeVFSContext *context);
PyTypeObject *context_type;
};
#if defined(NO_IMPORT) || defined(NO_IMPORT_PYGNOMEVFS)
extern struct _PyGnomeVFS_Functions *_PyGnomeVFS_API;
#else
struct _PyGnomeVFS_Functions *_PyGnomeVFS_API;
#endif
#define pygnome_vfs_exception_check (_PyGnomeVFS_API->exception_check)
#define pygnome_vfs_uri_new (_PyGnomeVFS_API->uri_new)
#define PyGnomeVFSURI_Type (*_PyGnomeVFS_API->uri_type)
#define pygnome_vfs_file_info_new (_PyGnomeVFS_API->file_info_new)
#define PyGnomeVFSFileInfo_Type (*_PyGnomeVFS_API->file_info_type)
#define pygnome_vfs_context_new (_PyGnomeVFS_API->context_new)
#define PyGnomeVFSContext_Type (*_PyGnomeVFS_API->context_type)
#define np_init_pygnomevfs() { \
PyObject *gobject = PyImport_ImportModule("gnomevfs"); \
if (gobject != NULL) { \
PyObject *mdict = PyModule_GetDict(gobject); \
PyObject *cobject = PyDict_GetItemString(mdict, "_PyGnomeVFS_API"); \
if (PyCObject_Check(cobject)) \
_PyGnomeVFS_API = (struct _PyGnomeVFS_Functions *)PyCObject_AsVoidPtr(cobject); \
else { \
Py_FatalError("could not find _PyGnomeVFS_API object"); \
return FALSE; \
} \
} else { \
Py_FatalError("could not import gnomevfs"); \
return FALSE; \
} \
}
#endif /* PYGNOME_VFS_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment