$NetBSD: patch-af,v 1.8 2007/06/08 14:16:16 wiz Exp $ --- Makefile.pre.in.orig 2006-10-08 17:41:25.000000000 +0000 +++ Makefile.pre.in @@ -30,6 +30,7 @@ VPATH= @srcdir@ CC= @CC@ CXX= @CXX@ +MAINCC= @MAINCC@ LINKCC= @LINKCC@ AR= @AR@ RANLIB= @RANLIB@ @@ -56,7 +57,7 @@ MAKESETUP= $(srcdir)/Modules/makese OPT= @OPT@ BASECFLAGS= @BASECFLAGS@ CFLAGS= $(BASECFLAGS) $(OPT) -CPPFLAGS= -I. -I$(srcdir)/Include +CPPFLAGS= @CPPFLAGS@ -I. -I$(srcdir)/Include LDFLAGS= @LDFLAGS@ LDLAST= @LDLAST@ SGI_ABI= @SGI_ABI@ @@ -157,7 +158,6 @@ LIBC= @LIBC@ SYSLIBS= $(LIBM) $(LIBC) SHLIBS= @SHLIBS@ -MAINOBJ= @MAINOBJ@ THREADOBJ= @THREADOBJ@ DLINCLDIR= @DLINCLDIR@ DYNLOADFILE= @DYNLOADFILE@ @@ -312,10 +312,10 @@ LIBRARY_OBJS= \ all: $(BUILDPYTHON) oldsharedmods sharedmods # Build the interpreter -$(BUILDPYTHON): Modules/$(MAINOBJ) $(LIBRARY) $(LDLIBRARY) +$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \ - 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 @@ -355,14 +355,17 @@ $(LIBRARY): $(LIBRARY_OBJS) libpython$(VERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ - $(LDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \ + $(LDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LDFLAGS) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \ $(LN) -f $(INSTSONAME) $@; \ else\ - $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \ + $(LDSHARED) -o $@ $(LDFLAGS) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \ fi libpython$(VERSION).sl: $(LIBRARY_OBJS) - $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) + $(LDSHARED) -o $@ $(LDFLAGS) $(LIBRARY_OBJS) $(LIBC) $(LIBM) + +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 $(LDFLAGS) $(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 @@ -450,8 +453,8 @@ Modules/getpath.o: $(srcdir)/Modules/get -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) @@ -533,7 +536,7 @@ PYTHON_HEADERS= \ Include/weakrefobject.h \ pyconfig.h -$(LIBRARY_OBJS) $(MODOBJS) Modules/$(MAINOBJ): $(PYTHON_HEADERS) +$(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS) ###################################################################### @@ -655,7 +658,12 @@ altbininstall: $(BUILDPYTHON) (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) libpython$(VERSION)$(SO)); \ fi \ fi; \ - else true; \ + else \ + 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 @@ -773,7 +781,7 @@ $(srcdir)/Lib/$(PLATDIR): export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \ export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \ export EXE; EXE="$(BUILDEXE)"; \ - cd $(srcdir)/Lib/$(PLATDIR); ./regen + cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen # Install the include files INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY) @@ -818,7 +826,7 @@ libainstall: all 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