diff --git a/Makefile.pre.in b/Makefile.pre.in index 0ed2cdf079..9ddb7777e5 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -684,11 +684,7 @@ $(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS) oldsharedmods: $(SHAREDMODS) -Makefile Modules/config.c: Makefile.pre \ - $(srcdir)/Modules/config.c.in \ - $(MAKESETUP) \ - Modules/Setup \ - Modules/Setup.local +makesetup: $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \ -s Modules \ Modules/Setup.local \ @@ -697,16 +693,6 @@ Makefile Modules/config.c: Makefile.pre \ @echo "The Makefile was updated, you may need to re-run make." -Modules/Setup: $(srcdir)/Modules/Setup.dist - @if test -f Modules/Setup; then \ - echo "-----------------------------------------------"; \ - echo "Modules/Setup.dist is newer than Modules/Setup;"; \ - echo "check to make sure you have all the updates you"; \ - echo "need in your Modules/Setup file."; \ - echo "Usually, copying Modules/Setup.dist to Modules/Setup will work."; \ - echo "-----------------------------------------------"; \ - fi - Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) @@ -1478,7 +1464,11 @@ libainstall: @DEF_MAKE_RULE@ python-config $(INSTALL_DATA) Programs/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 + @if test -e Modules/Setup; then \ + $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup + else \ + $(INSTALL_DATA) $(srcdir)/Modules/Setup.dist $(DESTDIR)$(LIBPL)/Setup \ + fi $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup @@ -1767,7 +1757,7 @@ Python/thread.o: @THREADHEADERS@ .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools .PHONY: frameworkaltinstallunixtools recheck clean clobber distclean .PHONY: smelly funny patchcheck touch altmaninstall commoninstall -.PHONY: gdbhooks +.PHONY: gdbhooks makesetup # IF YOU PUT ANYTHING HERE IT WILL GO AWAY # Local Variables: diff --git a/Modules/getpath.c b/Modules/getpath.c index e6a3e8e78c..755298eb4b 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -322,7 +322,7 @@ search_for_prefix(const _PyCoreConfig *core_config, /* Check to see if argv[0] is in the build directory */ wcsncpy(prefix, calculate->argv0_path, MAXPATHLEN); prefix[MAXPATHLEN] = L'\0'; - joinpath(prefix, L"Modules/Setup"); + joinpath(prefix, L"Modules/Setup.local"); if (isfile(prefix)) { /* Check VPATH to see if argv0_path is in the build directory. */ vpath = Py_DecodeLocale(VPATH, NULL); diff --git a/Modules/makesetup b/Modules/makesetup index 020b19938c..578e6e3355 100755 --- a/Modules/makesetup +++ b/Modules/makesetup @@ -98,11 +98,21 @@ CYGWIN*) if test $libdir = . esac # Main loop -for i in ${*-Setup} +for setupfile in ${*-Setup} do - case $i in + # Check if Setup file does not exist. In that case, use + # Setup.dist from source folder. + case $setupfile in + */Setup) + if ! test -f $setupfile; then + setupfile=$libdir/Setup.dist + fi + ;; + esac + + case $setupfile in -n) echo '*noobjects*';; - *) echo '*doconfig*'; cat "$i";; + *) echo '*doconfig*'; cat "$setupfile";; esac done | sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | diff --git a/configure b/configure index d427703f8e..cbaff110c6 100755 --- a/configure +++ b/configure @@ -18355,12 +18355,6 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi -echo "creating Modules/Setup" >&6 -if test ! -f Modules/Setup -then - cp $srcdir/Modules/Setup.dist Modules/Setup -fi - echo "creating Modules/Setup.local" >&6 if test ! -f Modules/Setup.local then diff --git a/configure.ac b/configure.ac index b98ceb2b14..aba0f04653 100644 --- a/configure.ac +++ b/configure.ac @@ -5565,12 +5565,6 @@ AC_CONFIG_FILES(Makefile.pre Misc/python.pc Misc/python-config.sh) AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix]) AC_OUTPUT -echo "creating Modules/Setup" >&AS_MESSAGE_FD -if test ! -f Modules/Setup -then - cp $srcdir/Modules/Setup.dist Modules/Setup -fi - echo "creating Modules/Setup.local" >&AS_MESSAGE_FD if test ! -f Modules/Setup.local then