From d35011a6dd3839d04b098522a7071b1306893397 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Thu, 14 Aug 2003 15:51:34 +0000 Subject: [PATCH] * configure.in: Check for include directory of $PYTHON, not $PYTHON22. Set PYTHON_CPPFLAGS accordingly. Do not set $PYTHON22 and $P22_INCLUDES, they are not used anymore. * src/Makefile.am (GVFSINC): Remove, unused. (intl22.so, grampslib.so): Adjust to use $P22_INCLUDES. svn: r2003 --- gramps2/configure.in | 28 ++++------------------------ gramps2/src/Makefile.am | 7 +++---- 2 files changed, 7 insertions(+), 28 deletions(-) diff --git a/gramps2/configure.in b/gramps2/configure.in index 9040590a4..700fd797d 100644 --- a/gramps2/configure.in +++ b/gramps2/configure.in @@ -44,13 +44,6 @@ pkgpyexecdir=\${prefix}/share/\${PACKAGE} AC_PATH_PROG(BINSH, sh) AC_PATH_PROG(SWIG, swig) -if test "$PYTHON_VERSION" != "2.2" -then - AC_PATH_PROG(PYTHON22, python2.2) -else - PYTHON22=$PYTHON -fi - AC_PATH_PROG(ZIP, zip) AC_PROG_CC @@ -195,22 +188,10 @@ dnl Checks for libraries. dnl Checks for header files. -AC_MSG_CHECKING(for headers required to compile python extensions) - -if test "$PYTHON22" != ""; then - py_prefix=`$PYTHON22 -c "import sys; print sys.prefix"` - py_exec_prefix=`$PYTHON22 -c "import sys; print sys.exec_prefix"` - P22_INCLUDES="-I${py_prefix}/include/python2.2" - if test "$py_prefix" != "$py_exec_prefix"; then - P22_INCLUDES="$P22_INCLUDES -I${py_exec_prefix}/include/python2.2" - fi - if test -f "${py_exec_prefix}/include/python2.2/Python.h" - then - INTLLIBS="${INTLLIBS}intl22.so " - fi -fi - -AC_MSG_RESULT(ok) +AC_CACHE_CHECK([for Python include directory], + [gramps_cv_python_inc], + [gramps_cv_python_inc=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_inc()" 2>/dev/null`]) +AC_SUBST([PYTHON_CPPFLAGS], ["-I$gramps_cv_python_inc"]) dnl ==================================== dnl = Begin tests for scrollkeeper @@ -244,7 +225,6 @@ AC_SUBST(SCROLLKEEPER_BUILD_REQUIRED) AC_SUBST(GNOMEHELP) AC_SUBST(GPREFIX) -AC_SUBST(P22_INCLUDES) AC_SUBST(GNOMEINC) AC_SUBST(GNOMELIB) AC_SUBST(INTLLIBS) diff --git a/gramps2/src/Makefile.am b/gramps2/src/Makefile.am index 7ba99023c..39e9ce22a 100644 --- a/gramps2/src/Makefile.am +++ b/gramps2/src/Makefile.am @@ -2,7 +2,6 @@ SUBDIRS = docgen filters plugins data po calendars # For intl. support, how do we compile? -GVFSINC = @GPREF@ CFLAGS = -fPIC -shared -O @GNOMEINC@ @CFLAGS@ @CPPFLAGS@ -I@includedir@ LDFLAGS = @GNOMELIB@ @LDFLAGS@ -L@libdir@ @LIBS@ CLEANFILES = $(INTLLIBS) grampslib.so @@ -142,10 +141,10 @@ all-local: $(INTLLIBS) grampslib.so # These can probably be done in a better or more elegant/generic way # eventually (libtool?), but this works. intl22.so: $(srcdir)/intl.c - $(CC) $(CFLAGS) $(LDFLAGS) @P22_INCLUDES@ -DVER22 -o $@ $(srcdir)/intl.c + $(CC) $(CFLAGS) $(LDFLAGS) $(PYTHON_CPPFLAGS) -DVER22 -o $@ $(srcdir)/intl.c grampslib.so: $(srcdir)/grampslib_wrap.c - $(CC) $(CFLAGS) @P22_INCLUDES@ -o $@ $(srcdir)/grampslib_wrap.c $(LDFLAGS) + $(CC) $(CFLAGS) $(PYTHON_CPPFLAGS) -o $@ $(srcdir)/grampslib_wrap.c $(LDFLAGS) # In principle the following rule slightly violates the automake/autoconf # spirit of keeping each subdirectory as a separate entity unto itself. @@ -161,7 +160,7 @@ pycheck: (cd $$d; make pycheck); \ done; pychecker $(pkgpython_PYTHON) - + install-data-local: $(INSTALL) -d $(DESTDIR)$(prefix)/share/pixmaps $(INSTALL_DATA) $(srcdir)/gramps.png $(DESTDIR)$(prefix)/share/pixmaps