Commit f6407a18 authored by Trent Nelson's avatar Trent Nelson

Issue #15819: Fix out-of-tree builds from a readonly source.

parent 6bb9c73b
...@@ -57,6 +57,8 @@ INSTALL_DATA= @INSTALL_DATA@ ...@@ -57,6 +57,8 @@ INSTALL_DATA= @INSTALL_DATA@
# Also, making them read-only seems to be a good idea... # Also, making them read-only seems to be a good idea...
INSTALL_SHARED= ${INSTALL} -m 555 INSTALL_SHARED= ${INSTALL} -m 555
MKDIR_P= @MKDIR_P@
MAKESETUP= $(srcdir)/Modules/makesetup MAKESETUP= $(srcdir)/Modules/makesetup
# Compiler options # Compiler options
...@@ -204,8 +206,8 @@ SIGNAL_OBJS= @SIGNAL_OBJS@ ...@@ -204,8 +206,8 @@ SIGNAL_OBJS= @SIGNAL_OBJS@
########################################################################## ##########################################################################
# Grammar # Grammar
GRAMMAR_H= $(srcdir)/Include/graminit.h GRAMMAR_H= Include/graminit.h
GRAMMAR_C= $(srcdir)/Python/graminit.c GRAMMAR_C= Python/graminit.c
GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
...@@ -246,9 +248,9 @@ PGENOBJS= $(PGENMAIN) $(POBJS) $(PGOBJS) ...@@ -246,9 +248,9 @@ PGENOBJS= $(PGENMAIN) $(POBJS) $(PGOBJS)
########################################################################## ##########################################################################
# AST # AST
AST_H_DIR= $(srcdir)/Include AST_H_DIR= Include
AST_H= $(AST_H_DIR)/Python-ast.h AST_H= $(AST_H_DIR)/Python-ast.h
AST_C_DIR= $(srcdir)/Python AST_C_DIR= Python
AST_C= $(AST_C_DIR)/Python-ast.c AST_C= $(AST_C_DIR)/Python-ast.c
AST_ASDL= $(srcdir)/Parser/Python.asdl AST_ASDL= $(srcdir)/Parser/Python.asdl
...@@ -563,9 +565,11 @@ Parser/tokenizer_pgen.o: $(srcdir)/Parser/tokenizer.c ...@@ -563,9 +565,11 @@ Parser/tokenizer_pgen.o: $(srcdir)/Parser/tokenizer.c
Parser/pgenmain.o: $(srcdir)/Include/parsetok.h Parser/pgenmain.o: $(srcdir)/Include/parsetok.h
$(AST_H): $(AST_ASDL) $(ASDLGEN_FILES) $(AST_H): $(AST_ASDL) $(ASDLGEN_FILES)
$(MKDIR_P) $(AST_H_DIR)
$(ASDLGEN) -h $(AST_H_DIR) $(AST_ASDL) $(ASDLGEN) -h $(AST_H_DIR) $(AST_ASDL)
$(AST_C): $(AST_ASDL) $(ASDLGEN_FILES) $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
$(MKDIR_P) $(AST_C_DIR)
$(ASDLGEN) -c $(AST_C_DIR) $(AST_ASDL) $(ASDLGEN) -c $(AST_C_DIR) $(AST_ASDL)
Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H) Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
......
...@@ -364,6 +364,9 @@ Tests ...@@ -364,6 +364,9 @@ Tests
Build Build
----- -----
- Issue #15819: Make sure we can build Python out-of-tree from a readonly
source directory. (Somewhat related to Issue #9860.)
- Issue #15645: Ensure 2to3 grammar pickles are properly installed. - Issue #15645: Ensure 2to3 grammar pickles are properly installed.
- Issue #15560: Fix building _sqlite3 extension on OS X with an SDK. - Issue #15560: Fix building _sqlite3 extension on OS X with an SDK.
......
...@@ -640,6 +640,7 @@ UNIVERSAL_ARCH_FLAGS ...@@ -640,6 +640,7 @@ UNIVERSAL_ARCH_FLAGS
BASECFLAGS BASECFLAGS
OPT OPT
LN LN
MKDIR_P
INSTALL_DATA INSTALL_DATA
INSTALL_SCRIPT INSTALL_SCRIPT
INSTALL_PROGRAM INSTALL_PROGRAM
...@@ -5356,6 +5357,48 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' ...@@ -5356,6 +5357,48 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
if test -z "$MKDIR_P"; then
if ${ac_cv_path_mkdir+:} false; then :
$as_echo_n "(cached) " >&6
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_prog in mkdir gmkdir; do
for ac_exec_ext in '' $ac_executable_extensions; do
{ test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
'mkdir (GNU coreutils) '* | \
'mkdir (coreutils) '* | \
'mkdir (fileutils) '4.1*)
ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
break 3;;
esac
done
done
done
IFS=$as_save_IFS
fi
test -d ./--version && rmdir ./--version
if test "${ac_cv_path_mkdir+set}" = set; then
MKDIR_P="$ac_cv_path_mkdir -p"
else
# As a last resort, use the slow shell script. Don't cache a
# value for MKDIR_P within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the value is a relative name.
MKDIR_P="$ac_install_sh -d"
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
$as_echo "$MKDIR_P" >&6; }
# Not every filesystem supports hard links # Not every filesystem supports hard links
...@@ -14479,6 +14522,7 @@ gives unlimited permission to copy, distribute and modify it." ...@@ -14479,6 +14522,7 @@ gives unlimited permission to copy, distribute and modify it."
ac_pwd='$ac_pwd' ac_pwd='$ac_pwd'
srcdir='$srcdir' srcdir='$srcdir'
INSTALL='$INSTALL' INSTALL='$INSTALL'
MKDIR_P='$MKDIR_P'
test -n "\$AWK" || AWK=awk test -n "\$AWK" || AWK=awk
_ACEOF _ACEOF
...@@ -15047,6 +15091,11 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix ...@@ -15047,6 +15091,11 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
[\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
*) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
esac esac
ac_MKDIR_P=$MKDIR_P
case $MKDIR_P in
[\\/$]* | ?:[\\/]* ) ;;
*/*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
esac
_ACEOF _ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
...@@ -15101,6 +15150,7 @@ s&@builddir@&$ac_builddir&;t t ...@@ -15101,6 +15150,7 @@ s&@builddir@&$ac_builddir&;t t
s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
s&@INSTALL@&$ac_INSTALL&;t t s&@INSTALL@&$ac_INSTALL&;t t
s&@MKDIR_P@&$ac_MKDIR_P&;t t
$ac_datarootdir_hack $ac_datarootdir_hack
" "
eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
......
...@@ -878,6 +878,7 @@ bsdos*|hp*|HP*) ...@@ -878,6 +878,7 @@ bsdos*|hp*|HP*)
fi fi
esac esac
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_MKDIR_P
# Not every filesystem supports hard links # Not every filesystem supports hard links
AC_SUBST(LN) AC_SUBST(LN)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment