Changeset 172

Show
Ignore:
Timestamp:
06/26/07 16:34:13 (17 months ago)
Author:
zany
Message:

using python distutils now

Location:
trunk
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/acinclude.m4

    r158 r172  
    232232]) 
    233233 
    234 # SWIG_PYTHON([use-shadow-classes = {no, yes}]) 
    235 # 
    236 # Checks for Python and provides the $(SWIG_PYTHON_CPPFLAGS), 
    237 # and $(SWIG_PYTHON_OPT) output variables. 
    238 # 
    239 # $(SWIG_PYTHON_OPT) contains all necessary SWIG options to generate 
    240 # code for Python.  Shadow classes are enabled unless the value of the 
    241 # optional first argument is exactly 'no'.  If you need multi module 
    242 # support (provided by the SWIG_MULTI_MODULE_SUPPORT() macro) use 
    243 # $(SWIG_PYTHON_LIBS) to link against the appropriate library.  It 
    244 # contains the SWIG Python runtime library that is needed by the type 
    245 # check system for example. 
    246 AC_DEFUN([SWIG_PYTHON],[ 
    247         AC_REQUIRE([AC_PROG_SWIG]) 
    248         AC_REQUIRE([AC_PYTHON_DEVEL]) 
    249         test "x$1" != "xno" || swig_shadow=" -noproxy" 
    250         AC_SUBST([SWIG_PYTHON_OPT],[-python$swig_shadow]) 
    251         AC_SUBST([SWIG_PYTHON_CPPFLAGS],[$PYTHON_CPPFLAGS]) 
    252 ]) 
    253  
    254 AC_DEFUN([AC_PYTHON_DEVEL],[ 
    255         # 
    256         # should allow for checking of python version here... 
    257         # 
    258         AC_REQUIRE([AM_PATH_PYTHON]) 
    259  
    260         # Check for Python include path 
    261         AC_MSG_CHECKING([for Python include path]) 
    262         python_path=`echo $PYTHON | sed "s,/bin.*$,,"` 
    263         for i in "$python_path/include/python$PYTHON_VERSION/" "$python_path/include/python/" "$python_path/" ; do 
    264                 python_path=`find $i -type f -name Python.h -print | sed "1q"` 
    265                 if test -n "$python_path" ; then 
    266                         break 
    267                 fi 
    268         done 
    269         python_path=`echo $python_path | sed "s,/Python.h$,,"` 
    270         AC_MSG_RESULT([$python_path]) 
    271         if test -z "$python_path" ; then 
    272                 AC_MSG_ERROR([cannot find Python include path]) 
    273         fi 
    274         AC_SUBST([PYTHON_CPPFLAGS],[-I$python_path]) 
    275  
    276         # Check for Python library path 
    277         AC_MSG_CHECKING([for Python library path]) 
    278         python_path=`echo $PYTHON | sed "s,/bin.*$,,"` 
    279         for i in "$python_path/lib/python$PYTHON_VERSION/config/" "$python_path/lib/python$PYTHON_VERSION/" "$python_path/lib/python/config/" "$python_path/lib/python/" "$python_path/" ; do 
    280                 python_path=`find $i -type f -name libpython$PYTHON_VERSION.* -print | sed "1q"` 
    281                 if test -n "$python_path" ; then 
    282                         break 
    283                 fi 
    284         done 
    285         python_path=`echo $python_path | sed "s,/libpython.*$,,"` 
    286         AC_MSG_RESULT([$python_path]) 
    287         if test -z "$python_path" ; then 
    288                 AC_MSG_ERROR([cannot find Python library path]) 
    289         fi 
    290         AC_SUBST([PYTHON_LDFLAGS],["-L$python_path -lpython$PYTHON_VERSION"]) 
    291         # 
    292         python_site=`echo $python_path | sed "s/config/site-packages/"` 
    293         AC_SUBST([PYTHON_SITE_PKG],[$python_site]) 
    294         # 
    295         # libraries which must be linked in when embedding 
    296         # 
    297         AC_MSG_CHECKING(python extra libraries) 
    298         PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \ 
    299                 conf = distutils.sysconfig.get_config_var; \ 
    300                 print conf('LOCALMODLIBS')+' '+conf('LIBS')" 
    301         AC_MSG_RESULT($PYTHON_EXTRA_LIBS)` 
    302         AC_SUBST(PYTHON_EXTRA_LIBS) 
    303 ]) 
    304  
    305234### test test test 
    306235builtin(include,tcl.m4) 
  • trunk/configure.in

    r166 r172  
    7171 
    7272if test "$ac_python_enabled" = yes; then 
    73         SWIG_PYTHON 
     73        AM_PATH_PYTHON 
    7474fi 
    75 AM_CONDITIONAL([ENABLE_PYTHON], [test x"$PYTHON_CPPFLAGS" != x""]) 
     75AM_CONDITIONAL([ENABLE_PYTHON], [test x"$PYTHON" != x""]) 
    7676 
    7777AC_ARG_ENABLE([ruby], 
     
    144144swig/perl/Makefile.PL 
    145145swig/python/Makefile 
     146swig/python/setup.py 
    146147swig/ruby/Makefile 
    147148swig/tcl/Makefile 
  • trunk/swig/python/Makefile.am

    r121 r172  
    1 pkgpython_PYTHON =      python_wrap.c __init__.py 
    2 pkgpyexec_LTLIBRARIES = _obexftp.la 
    3 _obexftp_la_SOURCES =   python_wrap.c 
    4 _obexftp_la_CFLAGS =    $(SWIG_PYTHON_CPPFLAGS) -I$(top_srcdir) 
    5 _obexftp_la_LDFLAGS =   -module 
    6 _obexftp_la_LIBADD =    $(top_builddir)/obexftp/libobexftp.la \ 
    7                         $(top_builddir)/multicobex/libmulticobex.la \ 
    8                         $(top_builddir)/bfb/libbfb.la \ 
    9                         @OPENOBEX_LIBS@ 
     1EXTRA_DIST      = python_wrap.c __init__.py 
    102 
    113if ENABLE_SWIG 
    124python_wrap.c: $(srcdir)/../client.i $(srcdir)/../charmap.i 
    13         $(SWIG) $(SWIG_PYTHON_OPT) -module obexftp -I$(top_srcdir) -o $@ $(srcdir)/../client.i 
     5        $(SWIG) -python -module obexftp -I$(top_srcdir) -o $@ $(srcdir)/../client.i 
    146        mv obexftp.py __init__.py 
    157 
    168MOSTLYCLEANFILES=python_wrap.c __init__.py 
    179endif 
     10 
     11all-local: python_wrap.c setup.py 
     12        if test ! -f python_wrap.c; then cp $(srcdir)/python_wrap.c . ; fi 
     13        $(PYTHON) setup.py build 
     14 
     15install-data-local: 
     16        $(PYTHON) setup.py install --root="/$(DESTDIR)" --prefix="$(prefix)" 
     17 
     18clean-local: 
     19        if test -x "$(PYTHON)"; then $(PYTHON) setup.py clean; fi 
     20        rm -rf build