Skip to content

Commit 1999ef4

Browse files
committed
Test wether we are building on a case-insensitive filesystem (such
as OSX HFS+) and if so add an extension to the python executable, but only in the build directory, not on the installed python.
1 parent 3ecc1ce commit 1999ef4

4 files changed

Lines changed: 417 additions & 395 deletions

File tree

Makefile.pre.in

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ DESTSHARED= $(BINLIBDEST)/lib-dynload
100100

101101
# Executable suffix (.exe on Windows and Mac OS X)
102102
EXE= @EXEEXT@
103+
BUILDEXE= @BUILDEXEEXT@
103104

104105
# Short name and location for Mac OS X Python framework
105106
PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
@@ -150,6 +151,7 @@ MACHDEP_OBJS= @MACHDEP_OBJS@
150151
UNICODE_OBJS= @UNICODE_OBJS@
151152

152153
PYTHON= python$(EXE)
154+
BUILDPYTHON= python$(BUILDEXE)
153155

154156
# === Definitions added by makesetup ===
155157

@@ -286,23 +288,23 @@ LIBRARY_OBJS= \
286288
# Rules
287289

288290
# Default target
289-
all: $(PYTHON) oldsharedmods sharedmods
291+
all: $(BUILDPYTHON) oldsharedmods sharedmods
290292

291293
# Build the interpreter
292-
$(PYTHON): Modules/$(MAINOBJ) $(LDLIBRARY)
294+
$(BUILDPYTHON): Modules/$(MAINOBJ) $(LDLIBRARY)
293295
$(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
294296
Modules/$(MAINOBJ) \
295297
$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
296298

297-
platform: $(PYTHON)
298-
./$(PYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
299+
platform: $(BUILDPYTHON)
300+
./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
299301

300302

301303
# Build the shared modules
302-
sharedmods: $(PYTHON)
304+
sharedmods: $(BUILDPYTHON)
303305
case $$MAKEFLAGS in \
304-
*-s*) CC='$(CC)' LDSHARED='$(LDSHARED)' OPT='$(OPT)' ./$(PYTHON) -E $(srcdir)/setup.py -q build;; \
305-
*) CC='$(CC)' LDSHARED='$(LDSHARED)' OPT='$(OPT)' ./$(PYTHON) -E $(srcdir)/setup.py build;; \
306+
*-s*) CC='$(CC)' LDSHARED='$(LDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
307+
*) CC='$(CC)' LDSHARED='$(LDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
306308
esac
307309

308310
# buildno should really depend on something like LIBRARY_SRC
@@ -484,7 +486,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/$(MAINOBJ): $(PYTHON_HEADERS)
484486
# Test the interpreter (twice, once without .pyc files, once with)
485487
TESTOPTS= -l
486488
TESTPROG= $(srcdir)/Lib/test/regrtest.py
487-
TESTPYTHON= ./$(PYTHON) -E -tt
489+
TESTPYTHON= ./$(BUILDPYTHON) -E -tt
488490
test: all platform
489491
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
490492
-$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
@@ -544,7 +546,7 @@ bininstall: altbininstall
544546

545547
# Install the interpreter with $(VERSION) affixed
546548
# This goes into $(exec_prefix)
547-
altbininstall: $(PYTHON)
549+
altbininstall: $(BUILDPYTHON)
548550
@for i in $(BINDIR); \
549551
do \
550552
if test ! -d $$i; then \
@@ -553,7 +555,7 @@ altbininstall: $(PYTHON)
553555
else true; \
554556
fi; \
555557
done
556-
$(INSTALL_PROGRAM) $(PYTHON) $(BINDIR)/python$(VERSION)$(EXE)
558+
$(INSTALL_PROGRAM) $(BUILDPYTHON) $(BINDIR)/python$(VERSION)$(EXE)
557559
if test -f libpython$(VERSION).so; then \
558560
$(INSTALL_DATA) libpython$(VERSION).so $(LIBDIR); \
559561
else true; \
@@ -583,7 +585,7 @@ XMLLIBSUBDIRS= xml xml/dom xml/parsers xml/sax
583585
LIBSUBDIRS= lib-old lib-tk site-packages test test/output test/data \
584586
encodings email compiler hotshot \
585587
distutils distutils/command $(XMLLIBSUBDIRS) curses $(MACHDEPS)
586-
libinstall: $(PYTHON) $(srcdir)/Lib/$(PLATDIR)
588+
libinstall: $(BUILDPYTHON) $(srcdir)/Lib/$(PLATDIR)
587589
@for i in $(SCRIPTDIR) $(LIBDEST); \
588590
do \
589591
if test ! -d $$i; then \
@@ -639,10 +641,10 @@ libinstall: $(PYTHON) $(srcdir)/Lib/$(PLATDIR)
639641
done
640642
$(INSTALL_DATA) $(srcdir)/LICENSE $(LIBDEST)/LICENSE.txt
641643
PYTHONPATH=$(LIBDEST) \
642-
./$(PYTHON) -tt $(LIBDEST)/compileall.py -x badsyntax \
644+
./$(BUILDPYTHON) -tt $(LIBDEST)/compileall.py -x badsyntax \
643645
$(LIBDEST)
644646
PYTHONPATH=$(LIBDEST) \
645-
./$(PYTHON) -O $(LIBDEST)/compileall.py -x badsyntax $(LIBDEST)
647+
./$(BUILDPYTHON) -O $(LIBDEST)/compileall.py -x badsyntax $(LIBDEST)
646648

647649
# Create the PLATDIR source directory, if one wasn't distributed..
648650
$(srcdir)/Lib/$(PLATDIR):
@@ -731,7 +733,7 @@ libainstall: all
731733
# Install the dynamically loadable modules
732734
# This goes into $(exec_prefix)
733735
sharedinstall:
734-
./$(PYTHON) -E $(srcdir)/setup.py install \
736+
./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
735737
--install-scripts=$(BINDIR) \
736738
--install-platlib=$(DESTSHARED)
737739

@@ -802,7 +804,7 @@ Makefile.pre: Makefile.pre.in config.status
802804
config.status: $(srcdir)/configure
803805
$(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
804806

805-
.PRECIOUS: config.status $(PYTHON) Makefile Makefile.pre
807+
.PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
806808

807809
# Some make's put the object file in the current directory
808810
.c.o:
@@ -842,7 +844,7 @@ clean:
842844
find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
843845

844846
clobber: clean
845-
-rm -f $(PYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
847+
-rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
846848
tags TAGS \
847849
config.cache config.log pyconfig.h Modules/config.c
848850
-rm -rf build platform

Misc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ Tools/Demos
6262

6363
Build
6464

65+
- It is no longer necessary to use --with-suffix when building on a
66+
case-insensitive file system (such as Mac OS X HFS+). In the build
67+
directory an extension is used, but not in the installed python.
68+
6569
C API
6670

6771
- PyArg_ParseTupleAndKeywords() requires that the number of entries in

0 commit comments

Comments
 (0)