mirror of https://github.com/GNOME/gimp.git
conditionally compile pygimp.
1999-09-06 James Henstridge <james@daa.com.au> * plug-ins/Makefile.am: conditionally compile pygimp. * configure.in: added in macros for pygimp. You must pass --enable-python to configure for it to even consider checking for python at the moment. * acinclude.m4: added python detection macros.
This commit is contained in:
parent
05a9b97c2b
commit
6b5f967d0c
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
1999-09-06 James Henstridge <james@daa.com.au>
|
||||
|
||||
* plug-ins/Makefile.am: conditionally compile pygimp.
|
||||
|
||||
* configure.in: added in macros for pygimp. You must pass
|
||||
--enable-python to configure for it to even consider checking for
|
||||
python at the moment.
|
||||
|
||||
* acinclude.m4: added python detection macros.
|
||||
|
||||
Mon Sep 6 03:19:27 CEST 1999 Olof S Kylander <olof@frozenriver.com>
|
||||
|
||||
* app/blob.c Fixed a cut&paste error
|
||||
|
|
133
acinclude.m4
133
acinclude.m4
|
@ -425,3 +425,136 @@ AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
|
|||
|
||||
dnl This is just to silence aclocal about the macro not being used
|
||||
ifelse([AC_DISABLE_FAST_INSTALL])dnl
|
||||
|
||||
|
||||
## Find the install dirs for the python installation.
|
||||
## By James Henstridge
|
||||
|
||||
# serial 1
|
||||
|
||||
AC_DEFUN(AM_PATH_PYTHON,
|
||||
[AC_CHECK_PROGS(PYTHON, python python1.5 python1.4 python1.3,no)
|
||||
if test "$PYTHON" != no; then
|
||||
AC_MSG_CHECKING([where .py files should go])
|
||||
changequote(, )dnl
|
||||
pythondir=`$PYTHON -c '
|
||||
import sys
|
||||
if sys.version[0] > "1" or sys.version[2] > "4":
|
||||
print "%s/lib/python%s/site-packages" % (sys.prefix, sys.version[:3])
|
||||
else:
|
||||
print "%s/lib/python%s" % (sys.prefix, sys.version[:3])'`
|
||||
changequote([, ])dnl
|
||||
AC_MSG_RESULT($pythondir)
|
||||
AC_MSG_CHECKING([where python extensions should go])
|
||||
changequote(, )dnl
|
||||
pyexecdir=`$PYTHON -c '
|
||||
import sys
|
||||
if sys.version[0] > "1" or sys.version[2] > "4":
|
||||
print "%s/lib/python%s/site-packages" % (sys.exec_prefix, sys.version[:3])
|
||||
else:
|
||||
print "%s/lib/python%s/sharedmodules" % (sys.exec_prefix, sys.version[:3])'`
|
||||
changequote([, ])dnl
|
||||
AC_MSG_RESULT($pyexecdir)
|
||||
else
|
||||
# these defaults are version independent ...
|
||||
AC_MSG_CHECKING([where .py files should go])
|
||||
pythondir='$(prefix)/lib/site-python'
|
||||
AC_MSG_RESULT($pythondir)
|
||||
AC_MSG_CHECKING([where python extensions should go])
|
||||
pyexecdir='$(exec_prefix)/lib/site-python'
|
||||
AC_MSG_RESULT($pyexecdir)
|
||||
fi
|
||||
AC_SUBST(pythondir)
|
||||
AC_SUBST(pyexecdir)])
|
||||
|
||||
|
||||
## 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
|
||||
])
|
||||
|
||||
|
||||
|
||||
# serial 1
|
||||
|
||||
dnl finds information needed for compilation of shared library style python
|
||||
dnl extensions. AM_PATH_PYTHON should be called before hand.
|
||||
AC_DEFUN(AM_INIT_PYEXEC_MOD,
|
||||
[AC_REQUIRE([AM_PATH_PYTHON])
|
||||
AC_MSG_CHECKING([for python headers])
|
||||
AC_CACHE_VAL(am_cv_python_includes,
|
||||
[changequote(,)dnl
|
||||
am_cv_python_includes="`$PYTHON -c '
|
||||
import sys
|
||||
includepy = \"%s/include/python%s\" % (sys.prefix, sys.version[:3])
|
||||
if sys.version[0] > \"1\" or sys.version[2] > \"4\":
|
||||
libpl = \"%s/include/python%s\" % (sys.exec_prefix, sys.version[:3])
|
||||
else:
|
||||
libpl = \"%s/lib/python%s/config\" % (sys.exec_prefix, sys.version[:3])
|
||||
print \"-I%s -I%s\" % (includepy, libpl)'`"
|
||||
changequote([, ])])
|
||||
PYTHON_INCLUDES="$am_cv_python_includes"
|
||||
AC_MSG_RESULT(found)
|
||||
AC_SUBST(PYTHON_INCLUDES)
|
||||
|
||||
AC_MSG_CHECKING([definitions from Python makefile])
|
||||
AC_CACHE_VAL(am_cv_python_makefile,
|
||||
[changequote(,)dnl
|
||||
py_makefile="`$PYTHON -c '
|
||||
import sys
|
||||
print \"%s/lib/python%s/config/Makefile\"%(sys.exec_prefix, sys.version[:3])'`"
|
||||
if test ! -f "$py_makefile"; then
|
||||
AC_MSG_WARN([*** Couldn't find the python config makefile. Maybe you are
|
||||
*** missing the development portion of the python installation])
|
||||
am_cv_python_makefile=no
|
||||
else
|
||||
eval `sed -n \
|
||||
-e "s/^CCSHARED=[ ]*\(.*\)/am_cv_python_CCSHARED='\1'/p" \
|
||||
-e "s/^LDSHARED=[ ]*\(.*\)/am_cv_python_LDSHARED='\1'/p" \
|
||||
-e "s/^SO=[ ]*\(.*\)/am_cv_python_SO='\1'/p" \
|
||||
$py_makefile`
|
||||
am_cv_python_makefile=found
|
||||
fi
|
||||
changequote([, ])])
|
||||
AC_MSG_RESULT(done)
|
||||
SO="$am_cv_python_SO"
|
||||
PYTHON_CFLAGS="$am_cv_python_CCSHARED"
|
||||
PYTHON_LINK="$am_cv_python_LDSHARED -o \[$]@"
|
||||
|
||||
AC_SUBST(SO)dnl
|
||||
AC_SUBST(PYTHON_CFLAGS)dnl
|
||||
AC_SUBST(PYTHON_LINK)])
|
||||
|
||||
|
|
25
configure.in
25
configure.in
|
@ -561,6 +561,28 @@ EOF
|
|||
fi
|
||||
fi
|
||||
|
||||
dnl Pygimp configure stuff ...
|
||||
AC_ARG_ENABLE(python,
|
||||
[ --disable-python do not build python extension],,[enable_python=no])
|
||||
build_python=false
|
||||
if test "x$enable_python" != xno; then
|
||||
AM_PATH_PYTHON
|
||||
if test "x$PYTHON" != xno; then
|
||||
AM_INIT_PYEXEC_MOD
|
||||
if test "x$am_cv_python_makefile" != xno; then
|
||||
PYGIMP_CFLAGS_NOUI="-I\$(top_srcdir) $GLIB_CFLAGS"
|
||||
PYGIMP_LIBS_NOUI="-L\$(top_builddir)/libgimp/.libs -lgimp $GLIB_LIBS"
|
||||
|
||||
build_python=true
|
||||
AM_CHECK_PYMOD(gtk,,,build_python=fasle)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(PYGIMP_CFLAGS_NOUI)
|
||||
AC_SUBST(PYGIMP_LIBS_NOUI)
|
||||
AM_CONDITIONAL(BUILD_PYTHON, $build_python)
|
||||
|
||||
|
||||
GIMPINSTALL=
|
||||
if test "$INSTALL" = "$ac_install_sh"; then
|
||||
GIMPINSTALL="gimpinstall"
|
||||
|
@ -680,6 +702,9 @@ plug-ins/maze/Makefile
|
|||
plug-ins/mosaic/Makefile
|
||||
plug-ins/pagecurl/Makefile
|
||||
plug-ins/print/Makefile
|
||||
plug-ins/pygimp/Makefile
|
||||
plug-ins/pygimp/doc/Makefile
|
||||
plug-ins/pygimp/plug-ins/Makefile
|
||||
plug-ins/rcm/Makefile
|
||||
plug-ins/sel2path/Makefile
|
||||
plug-ins/sgi/Makefile
|
||||
|
|
|
@ -21,6 +21,12 @@ EXTRA_DIST = \
|
|||
winsnap/winsnap.ico \
|
||||
winsnap/winsnap.rc
|
||||
|
||||
if BUILD_PYTHON
|
||||
pygimp=pygimp
|
||||
else
|
||||
pygimp=
|
||||
endif
|
||||
|
||||
SUBDIRS = \
|
||||
libgck \
|
||||
megawidget \
|
||||
|
@ -49,6 +55,7 @@ SUBDIRS = \
|
|||
mosaic \
|
||||
pagecurl \
|
||||
print \
|
||||
$(pygimp) \
|
||||
rcm \
|
||||
sgi \
|
||||
sel2path \
|
||||
|
|
|
@ -42,7 +42,7 @@ pkgdatadir = $(datadir)/@PACKAGE@
|
|||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = .
|
||||
top_builddir = ../..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
|
@ -63,8 +63,8 @@ PRE_UNINSTALL = :
|
|||
POST_UNINSTALL = :
|
||||
CC = @CC@
|
||||
GIMPTOOL = @GIMPTOOL@
|
||||
GIMP_CFLAGS_NOUI = @GIMP_CFLAGS_NOUI@
|
||||
GIMP_LIBS_NOUI = @GIMP_LIBS_NOUI@
|
||||
PYGIMP_CFLAGS_NOUI = @PYGIMP_CFLAGS_NOUI@
|
||||
PYGIMP_LIBS_NOUI = @PYGIMP_LIBS_NOUI@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OPT = @OPT@
|
||||
PACKAGE = @PACKAGE@
|
||||
|
@ -80,12 +80,12 @@ pythondir = @pythondir@
|
|||
|
||||
SUBDIRS = doc plug-ins
|
||||
|
||||
INCLUDES = $(PYTHON_INCLUDES) $(PYTHON_CFLAGS) $(GIMP_CFLAGS_NOUI)
|
||||
INCLUDES = $(PYTHON_INCLUDES) $(PYTHON_CFLAGS) $(PYGIMP_CFLAGS_NOUI)
|
||||
|
||||
pyexec_PROGRAMS = gimpmodule$(SO)
|
||||
|
||||
gimpmodule__SO__SOURCES = gimpmodule.c
|
||||
gimpmodule__SO__LDADD = $(GIMP_LIBS_NOUI)
|
||||
gimpmodule__SO__LDADD = $(PYGIMP_LIBS_NOUI)
|
||||
gimpmodule__SO__LINK = $(PYTHON_LINK)
|
||||
|
||||
python_PYTHON = gimpplugin.py gimpenums.py gimpshelf.py gimpui.py gimpfu.py
|
||||
|
@ -111,10 +111,10 @@ CCLD = $(CC)
|
|||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
PYTHONFILES = gimpplugin.py gimpenums.py gimpshelf.py gimpui.py \
|
||||
gimpfu.py
|
||||
py_compile = $(top_srcdir)/py-compile
|
||||
py_compile = $(srcdir)/py-compile
|
||||
DIST_COMMON = README $(PYTHONFILES) AUTHORS COPYING ChangeLog INSTALL \
|
||||
Makefile.am.14 Makefile.in NEWS aclocal.m4 configure configure.in \
|
||||
install-sh missing mkinstalldirs py-compile
|
||||
Makefile.am.14 Makefile.in NEWS configure.in \
|
||||
py-compile
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
pluginexecdir = $(gimpplugindir)/plug-ins
|
||||
|
||||
pluginexec_SCRIPTS = clothify.py gimpcons.py pdbbrowse.py sphere.py \
|
||||
whirlpinch.py foggify.py shadow_bevel.py
|
||||
|
||||
|
|
Loading…
Reference in New Issue