pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/python24 Fix module compilation / libpython build...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/dd67bd946880
branches:  trunk
changeset: 506867:dd67bd946880
user:      recht <recht%pkgsrc.org@localhost>
date:      Mon Jan 23 08:00:02 2006 +0000

description:
Fix module compilation / libpython build on Darwin. This enables modules
not part of the std. Python install to work again.
Secondly, add a patch from Christoph Ludwig (
http://sourceforge.net/tracker/?func=detail&aid=1324762&group_id=5470&atid=305470
)
which contains the following changes (from the SourceForge post):

1) The configure option --with-cxx is renamed
--with-cxx-main. This was done to avoid surprising the user
by the changed meaning. Furthermore, it is now possible
that CXX has a different value than provided by
--with-cxx-main, so the old name would have been
confusing.

2) The compiler used to translate python's main() function is
stored in the configure / Makefile variable MAINCC. By
default, MAINCC=$(CC). If --with-cxx-main is given (without
an appended compiler name), then MAINCC=$(CXX). If
--with-cxx-main=<compiler> is on the configure command
line, then MAINCC=<compiler>. Additionally, configure sets
CXX=<compiler> unless CXX was already set on the
configure command line.

3) The command used to link the python executable is (as
before) stored in LINKCC. By default, LINKCC='$(PURIFY)
$(MAINCC)', i.e. the linker front-end is the compiler used to
translate main(). If necessary, LINKCC can be set on the
configure command line in which case it won't be altered.

4) If CXX is not set by the user (on the command line or via
--with-cxx-main), then configure tries several likely C++
compiler names. CXX is assigned the first name that refers
to a callable program in the system. (CXX is set even if
python is built with a C compiler only, so distutils can build
C++ extensions.)

5) Modules/ccpython.cc is no longer used and can be
removed.

diffstat:

 lang/python24/Makefile         |   19 +-
 lang/python24/distinfo         |    6 +-
 lang/python24/patches/patch-af |   84 ++-
 lang/python24/patches/patch-al |  920 +++++++++++++++++++++++++++++++++++++++-
 4 files changed, 955 insertions(+), 74 deletions(-)

diffs (truncated from 1187 to 300 lines):

diff -r bee938eaaa50 -r dd67bd946880 lang/python24/Makefile
--- a/lang/python24/Makefile    Mon Jan 23 07:53:13 2006 +0000
+++ b/lang/python24/Makefile    Mon Jan 23 08:00:02 2006 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.18 2005/12/10 14:36:46 recht Exp $
+# $NetBSD: Makefile,v 1.19 2006/01/23 08:00:02 recht Exp $
 #
 
 DISTNAME=      Python-2.4.2
 PKGNAME=       python24-2.4.2
-PKGREVISION=   2
+PKGREVISION=   3
 CATEGORIES=    lang python
 MASTER_SITES=  ftp://ftp.python.org/pub/python/2.4.2/
 EXTRACT_SUFX=  .tar.bz2
@@ -16,8 +16,8 @@
 
 CONFLICTS+=    python-[0-9]*
 
-USE_LANGUAGES=         c c++
 GNU_CONFIGURE=         yes
+CONFIGURE_ARGS+=       --with-threads
 CONFIGURE_ARGS+=       --enable-shared
 CONFIGURE_ARGS+=       OPT=${CFLAGS:M*:Q}
 
@@ -27,13 +27,13 @@
 CONFIGURE_ARGS+=       --with-pth
 .endif
 
+.include "../../mk/bsd.prefs.mk"
+
 # fdatasync()
 LIBS.SunOS+=           -lrt
 
 PY_VER_SUFFIX=         2.4
 
-.include "../../mk/bsd.prefs.mk"
-
 PLIST_SRC=     ${.CURDIR}/../../lang/python24/PLIST.common
 .if exists(${.CURDIR}/../../lang/python24/PLIST.${OPSYS})
 PLIST_SRC+=    ${.CURDIR}/../../lang/python24/PLIST.${OPSYS}
@@ -115,6 +115,15 @@
        ${MV} ${WRKSRC}/Lib/smtpd.py ${WRKSRC}/Lib/smtpd${PY_VER_SUFFIX}.py
        ${MV} ${WRKSRC}/Tools/scripts/pydoc ${WRKSRC}/Tools/scripts/pydoc${PY_VER_SUFFIX}
 
+.if ${OPSYS} == "Darwin"
+post-build:
+       (cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} libpython2.4.2.dylib)
+
+post-install:
+       ${LN} -fs ${PREFIX}/lib/libpython2.4.2.dylib    \
+               ${PREFIX}/lib/libpython2.4.dylib
+.endif
+
 .include "../../archivers/bzip2/buildlink3.mk"
 .include "../../devel/gettext-lib/buildlink3.mk"
 .include "../../devel/zlib/buildlink3.mk"
diff -r bee938eaaa50 -r dd67bd946880 lang/python24/distinfo
--- a/lang/python24/distinfo    Mon Jan 23 07:53:13 2006 +0000
+++ b/lang/python24/distinfo    Mon Jan 23 08:00:02 2006 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.15 2005/11/16 19:18:59 joerg Exp $
+$NetBSD: distinfo,v 1.16 2006/01/23 08:00:02 recht Exp $
 
 SHA1 (Python-2.4.2.tar.bz2) = a1f1c466fb4a06f612faac75dbaa8bc81e609c2e
 RMD160 (Python-2.4.2.tar.bz2) = c511d2b76b5394742d285e71570a2bcd3c1fa871
@@ -8,12 +8,12 @@
 SHA1 (patch-ac) = 97d2dcbc93986dc13d7866025269ae5f15827a24
 SHA1 (patch-ad) = 0fa1c66fa0ad9ce345c44b13fd3897975837c72e
 SHA1 (patch-ae) = e5dfe40afe9b1e4354a273f4ce76340f1440e1ee
-SHA1 (patch-af) = 485eaa5cc5bd0f9f1cda1815fa6d7a068bd0820c
+SHA1 (patch-af) = 15fa49e81d2a8d05654a7ad1ab0a37b58364ec3d
 SHA1 (patch-ag) = 0cdc08af9d37ae7d00a06ab81c30efa021ef28ac
 SHA1 (patch-ah) = 8d56adee024b29e5d538a9fcd1994e38eb2b33c1
 SHA1 (patch-ai) = 6435c5a7269c14d94eab6fb9777b9d059507e7b8
 SHA1 (patch-aj) = e471737ade95423039661b475f2dd0fc27aa9dac
 SHA1 (patch-ak) = f2e1d4087a94490bd3589a8c829ec72e04f31f72
-SHA1 (patch-al) = 5aa766853c353a9ceae4513dc896a1d13a548c6c
+SHA1 (patch-al) = b4050c86c0fdfe7df8bd90579646f9fa0c987211
 SHA1 (patch-am) = 9ce50340d76e8612384f94d4b03414d3f38e35d3
 SHA1 (patch-an) = 0ae5b3d547c7dbe1366c5ae6c60c11516e4550b8
diff -r bee938eaaa50 -r dd67bd946880 lang/python24/patches/patch-af
--- a/lang/python24/patches/patch-af    Mon Jan 23 07:53:13 2006 +0000
+++ b/lang/python24/patches/patch-af    Mon Jan 23 08:00:02 2006 +0000
@@ -1,57 +1,97 @@
-$NetBSD: patch-af,v 1.4 2005/10/01 21:12:05 recht Exp $
+$NetBSD: patch-af,v 1.5 2006/01/23 08:00:02 recht Exp $
 
---- Makefile.pre.in.orig       2005-03-29 09:23:01.000000000 +1000
-+++ Makefile.pre.in
-@@ -56,7 +56,7 @@ MAKESETUP=      $(srcdir)/Modules/makese
+--- Makefile.pre.in.orig       2005-12-11 23:02:31.000000000 +0100
++++ Makefile.pre.in    2005-12-11 23:02:02.000000000 +0100
+@@ -30,6 +30,7 @@
+ 
+ CC=           @CC@
+ CXX=          @CXX@
++MAINCC=               @MAINCC@
+ LINKCC=               @LINKCC@
+ AR=           @AR@
+ RANLIB=               @RANLIB@
+@@ -56,7 +57,7 @@
  OPT=          @OPT@
  BASECFLAGS=   @BASECFLAGS@
  CFLAGS=               $(BASECFLAGS) $(OPT)
 -CPPFLAGS=     -I. -I$(srcdir)/Include
-+CPPFLAGS+=    @CPPFLAGS@ -I. -I$(srcdir)/Include
++CPPFLAGS=     @CPPFLAGS@ -I. -I$(srcdir)/Include
  LDFLAGS=      @LDFLAGS@
  LDLAST=               @LDLAST@
  SGI_ABI=      @SGI_ABI@
-@@ -94,8 +94,8 @@ LIBP=                $(LIBDIR)/python$(VERSION)
+@@ -153,7 +154,6 @@
+ SYSLIBS=      $(LIBM) $(LIBC)
+ SHLIBS=               @SHLIBS@
  
- # Symbols used for using shared libraries
- SO=           @SO@
--LDSHARED=     @LDSHARED@
--BLDSHARED=    @BLDSHARED@
-+LDSHARED=     @LDSHARED@ $(LDFLAGS)
-+BLDSHARED=    @BLDSHARED@ $(LDFLAGS)
- DESTSHARED=   $(BINLIBDEST)/lib-dynload
+-MAINOBJ=      @MAINOBJ@
+ THREADOBJ=    @THREADOBJ@
+ DLINCLDIR=    @DLINCLDIR@
+ DYNLOADFILE=  @DYNLOADFILE@
+@@ -308,10 +308,10 @@
+ all:          $(BUILDPYTHON) oldsharedmods sharedmods
  
- # Executable suffix (.exe on Windows and Mac OS X)
-@@ -311,7 +311,7 @@ all:               $(BUILDPYTHON) oldsharedmods share
- $(BUILDPYTHON):       Modules/$(MAINOBJ) $(LIBRARY) $(LDLIBRARY)
+ # Build the interpreter
+-$(BUILDPYTHON):       Modules/$(MAINOBJ) $(LIBRARY) $(LDLIBRARY)
++$(BUILDPYTHON):       Modules/python.o $(LIBRARY) $(LDLIBRARY)
                $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
-                       Modules/$(MAINOBJ) \
+-                      Modules/$(MAINOBJ) \
 -                      $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
++                      Modules/python.o \
 +                      $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) ${LINK_ALL_LIBGCC_HACK}
  
  platform: $(BUILDPYTHON)
        $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
-@@ -360,6 +360,9 @@ libpython$(VERSION).so: $(LIBRARY_OBJS)
+@@ -360,6 +360,10 @@
  libpython$(VERSION).sl: $(LIBRARY_OBJS)
        $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(LIBC) $(LIBM)
  
-+libpython$(VERSION).dylib: $(LIBRARY_OBJS)
++libpython2.4.2.dylib: $(LIBRARY_OBJS)
 +      $(LINKCC) -dynamiclib -install_name $(LIBDIR)/$@ -current_version 2.4.2 -compatibility_version 2.4 -o $@ -flat_namespace -undefined suppress $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM)
 +
++
  # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
  # minimal framework (not including the Lib directory and such) in the current
  # directory.
-@@ -625,7 +628,12 @@ altbininstall:    $(BUILDPYTHON)
+@@ -437,8 +441,8 @@
+               -DVPATH='"$(VPATH)"' \
+               -o $@ $(srcdir)/Modules/getpath.c
+ 
+-Modules/ccpython.o: $(srcdir)/Modules/ccpython.cc
+-      $(CXX) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/ccpython.cc
++Modules/python.o: $(srcdir)/Modules/python.c
++      $(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c
+ 
+ 
+ $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
+@@ -520,7 +524,7 @@
+               Include/weakrefobject.h \
+               pyconfig.h
+ 
+-$(LIBRARY_OBJS) $(MODOBJS) Modules/$(MAINOBJ): $(PYTHON_HEADERS)
++$(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
+ 
+ 
+ ######################################################################
+@@ -625,7 +629,12 @@
                                (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) libpython$(VERSION)$(SO)); \
                        fi \
                fi; \
 -      else    true; \
 +      else \
-+              if test -f libpython$(VERSION).dylib; then \
-+                      $(INSTALL_SHARED) libpython$(VERSION).dylib $(DESTDIR)$(LIBDIR)/libpython$(VERSION).dylib; \
++              if test -f libpython2.4.2.dylib; then \
++                      $(INSTALL_SHARED) libpython2.4.2.dylib $(DESTDIR)$(LIBDIR)/libpython2.4.2.dylib; \
 +              else \
 +                      true; \
 +              fi \
        fi
  
  # Install the manual page
+@@ -788,7 +797,7 @@
+               fi; \
+       fi
+       $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
+-      $(INSTALL_DATA) Modules/$(MAINOBJ) $(DESTDIR)$(LIBPL)/$(MAINOBJ)
++      $(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
+       $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
+       $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
+       $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
diff -r bee938eaaa50 -r dd67bd946880 lang/python24/patches/patch-al
--- a/lang/python24/patches/patch-al    Mon Jan 23 07:53:13 2006 +0000
+++ b/lang/python24/patches/patch-al    Mon Jan 23 08:00:02 2006 +0000
@@ -1,8 +1,28 @@
-$NetBSD: patch-al,v 1.8 2005/10/01 21:12:05 recht Exp $
+$NetBSD: patch-al,v 1.9 2006/01/23 08:00:02 recht Exp $
 
---- configure.orig     2005-08-07 23:08:42.000000000 +0200
-+++ configure  2005-10-01 22:26:48.000000000 +0200
-@@ -1482,6 +1482,8 @@
+--- configure.orig     2005-12-11 23:02:37.000000000 +0100
++++ configure  2005-12-11 23:02:22.000000000 +0100
+@@ -312,7 +312,7 @@
+ # include <unistd.h>
+ #endif"
+ 
+-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir 
sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS VERSION SOVERSION CONFIG_ARGS PYTHONFRAMEWORK 
PYTHONFRAMEWORKDIR PYTHONFRAMEWORKPREFIX PYTHONFRAMEWORKINSTALLDIR MACHDEP SGI_ABI EXTRAPLATDIR EXTRAMACHDEPPATH CONFIGURE_MACOSX_DEPLOYMENT_TARGET CXX MAINOBJ EXEEXT CC CFLAGS LDFLAGS CPPFLAGS 
ac_ct_CC OBJEXT CPP EGREP BUILDEXEEXT LIBRARY LDLIBRARY DLLLIBRARY BLDLIBRARY LDLIBRARYDIR INSTSONAME RUNSHARED LINKCC RANLIB ac_ct_RANLIB AR INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN OPT 
BASECFLAGS OTHER_LIBTOOL_OPT LIBTOOL_CRUFT SO LDSHARED BLDSHARED CCSHARED LINKFORSHARED CFLAGSFORSHARED SHLIBS USE_SIGNAL_MODULE SIGNAL_OBJS USE_THREAD_MODULE LDLAST THREADOBJ DLINCLDIR DYNLOADFILE 
MACHDEP_OBJS TRUE LIBOBJS HAVE_GETHOSTBYNAME_R_6_ARG HAVE_GETHOSTBYNAME_R_5_ARG HAVE_GETHOSTBYNAME_R_3_ARG HAVE_GETHOSTBYNAME_R HAVE_GETHOSTBYNAME LIBM LIBC UNICODE_OBJS THREADHEADERS SRCDIRS 
LTLIBOBJS'
++ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir 
sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS VERSION SOVERSION CONFIG_ARGS PYTHONFRAMEWORK 
PYTHONFRAMEWORKDIR PYTHONFRAMEWORKPREFIX PYTHONFRAMEWORKINSTALLDIR MACHDEP SGI_ABI EXTRAPLATDIR EXTRAMACHDEPPATH CONFIGURE_MACOSX_DEPLOYMENT_TARGET CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT 
CXX MAINCC CPP EGREP BUILDEXEEXT LIBRARY LDLIBRARY DLLLIBRARY BLDLIBRARY LDLIBRARYDIR INSTSONAME RUNSHARED LINKCC RANLIB ac_ct_RANLIB AR INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN OPT BASECFLAGS 
OTHER_LIBTOOL_OPT LIBTOOL_CRUFT SO LDSHARED BLDSHARED CCSHARED LINKFORSHARED CFLAGSFORSHARED SHLIBS USE_SIGNAL_MODULE SIGNAL_OBJS USE_THREAD_MODULE LDLAST THREADOBJ DLINCLDIR DYNLOADFILE MACHDEP_OBJS 
TRUE LIBOBJS HAVE_GETHOSTBYNAME_R_6_ARG HAVE_GETHOSTBYNAME_R_5_ARG HAVE_GETHOSTBYNAME_R_3_ARG HAVE_GETHOSTBYNAME_R HAVE_GETHOSTBYNAME LIBM LIBC UNICODE_OBJS THREADHEADERS SRCDIRS LTLIBOBJS'
+ ac_subst_files=''
+ 
+ # Initialize some variables set by options.
+@@ -859,7 +859,9 @@
+   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+   --without-gcc           never use gcc
+-  --with-cxx=<compiler>   enable C++ support
++  --with-cxx-main=<compiler>
++                          compile main() and link python executable with C++
++                          compiler
+   --with-suffix=.exe      set executable suffix
+   --with-pydebug          build with Py_DEBUG defined
+   --with-libs='lib1 ...'  link against additional libs
+@@ -1482,6 +1484,8 @@
    # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
    OpenBSD/2.* | OpenBSD/3.[0123456])
      define_xopen_source=no;;
@@ -11,7 +31,833 @@
    # On Solaris 2.6, sys/wait.h is inconsistent in the usage
    # of union __?sigval. Reported by Stuart Bishop.
    SunOS/5.6)
-@@ -3404,7 +3406,7 @@
+@@ -1667,258 +1671,6 @@
+ echo "$as_me:$LINENO: result: $without_gcc" >&5
+ echo "${ECHO_T}$without_gcc" >&6
+ 
+-
+-
+-MAINOBJ=python.o
+-echo "$as_me:$LINENO: checking for --with-cxx=<compiler>" >&5
+-echo $ECHO_N "checking for --with-cxx=<compiler>... $ECHO_C" >&6
+-
+-# Check whether --with-cxx or --without-cxx was given.
+-if test "${with_cxx+set}" = set; then
+-  withval="$with_cxx"
+-
+-      check_cxx=no
+-      case $withval in
+-      no)     CXX=
+-              with_cxx=no;;
+-      *)      CXX=$withval
+-              MAINOBJ=ccpython.o
+-              with_cxx=$withval;;
+-      esac
+-else
+-
+-      with_cxx=no
+-      check_cxx=yes
+-
+-fi;
+-echo "$as_me:$LINENO: result: $with_cxx" >&5
+-echo "${ECHO_T}$with_cxx" >&6
+-
+-if test "$with_cxx" = "yes"
+-then
+-      { { echo "$as_me:$LINENO: error: must supply a compiler when using --with-cxx" >&5
+-echo "$as_me: error: must supply a compiler when using --with-cxx" >&2;}
+-   { (exit 1); exit 1; }; }
+-fi
+-
+-
+-
+-
+-if test "$check_cxx" = "yes"
+-then
+-      for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
+-do
+-  # Extract the first word of "$ac_prog", so it can be a program name with args.
+-set dummy $ac_prog; ac_word=$2
+-echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+-if test "${ac_cv_prog_CXX+set}" = set; then
+-  echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+-  if test -n "$CXX"; then
+-  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+-else



Home | Main Index | Thread Index | Old Index