Skip to content

Commit c039441

Browse files
committed
patch 8.0.0570: can't run make with several jobs
Problem: Can't run make with several jobs, creating directories has a race condition. Solution: Use the MKDIR_P autoconf mechanism. (Eric N. Vander Weele, closes #1639)
1 parent 62cf09b commit c039441

File tree

8 files changed

+620
-74
lines changed

8 files changed

+620
-74
lines changed

Filelist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ SRC_UNIX = \
239239
src/link.sh \
240240
src/installman.sh \
241241
src/installml.sh \
242-
src/mkinstalldirs \
242+
src/install-sh \
243243
src/os_unix.c \
244244
src/os_unix.h \
245245
src/os_unixx.h \

src/Makefile

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
#SunOS 4.1.x +X11 -GUI 5.1b (J) Bram Moolenaar
208208
#SunOS 4.1.3_U1 (sun4c) gcc +X11 +GUI Athena 5.0w (J) Darren Hiebert
209209
#SUPER-UX 6.2 (NEC SX-4) cc +X11R6 Motif,Athena4.6b (P) Lennart Schultz
210-
#Tandem/NSK (c) Matthew Woehlke
210+
#Tandem/NSK (c) Matthew Woehlke
211211
#Unisys 6035 cc +X11 Motif 5.3 (8) Glauber Ribeiro
212212
#ESIX V4.2 cc +X11 6.0 (a) Reinhard Wobst
213213
#Mac OS X 10.[23] gcc Carbon 6.2 (x) Bram Moolenaar
@@ -403,6 +403,7 @@ CClink = $(CC)
403403
# First one is for static linking, second one for dynamic loading.
404404
# Use --with-luajit if you want to use LuaJIT instead of Lua.
405405
# Set PATH environment variable to find lua or luajit executable.
406+
# This requires at least "normal" features, "tiny" and "small" don't work.
406407
#CONF_OPT_LUA = --enable-luainterp
407408
#CONF_OPT_LUA = --enable-luainterp=dynamic
408409
#CONF_OPT_LUA = --enable-luainterp --with-luajit
@@ -429,16 +430,15 @@ CClink = $(CC)
429430
# the next line.
430431
# When you get an error for a missing "perl.exp" file, try creating an empty
431432
# one: "touch perl.exp".
432-
# This requires at least "small" features, "tiny" doesn't work.
433+
# This requires at least "normal" features, "tiny" and "small" don't work.
433434
#CONF_OPT_PERL = --enable-perlinterp
434435
#CONF_OPT_PERL = --enable-perlinterp=dynamic
435436

436437
# PYTHON
437-
# Uncomment this when you want to include the Python interface.
438-
# Requires small features or better, fails with tiny features.
438+
# Uncomment lines here when you want to include the Python interface.
439+
# This requires at least "normal" features, "tiny" and "small" don't work.
439440
# NOTE: This may cause threading to be enabled, which has side effects (such
440441
# as using different libraries and debugging becomes more difficult).
441-
# NOTE: Using this together with Perl may cause a crash in initialization.
442442
# For Python3 support make a symbolic link in /usr/local/bin:
443443
# ln -s python3 python3.1
444444
# If both python2.x and python3.x are enabled then the linking will be via
@@ -454,6 +454,7 @@ CClink = $(CC)
454454
# Uncomment this when you want to include the Ruby interface.
455455
# First one for static linking, second one for loading when used.
456456
# Note: you need the development package (e.g., ruby1.9.1-dev on Ubuntu).
457+
# This requires at least "normal" features, "tiny" and "small" don't work.
457458
#CONF_OPT_RUBY = --enable-rubyinterp
458459
#CONF_OPT_RUBY = --enable-rubyinterp=dynamic
459460
#CONF_OPT_RUBY = --enable-rubyinterp --with-ruby-command=ruby1.9.1
@@ -617,7 +618,7 @@ AUTOCONF = autoconf
617618
#PURIFY = purify
618619

619620
# VALGRIND - remove the # to use valgrind for memory leaks and access errors.
620-
# Used for the unittest targets.
621+
# Used for the unittest targets.
621622
# VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=25 --log-file=valgrind.$@
622623

623624
# NBDEBUG - debugging the netbeans interface.
@@ -649,15 +650,15 @@ LINT_OPTIONS = -beprxzF
649650
# coverage information. (provided by Yegappan Lakshmanan)
650651
# 1. make clean, run configure and build Vim as usual.
651652
# 2. Generate the baseline code coverage information:
652-
# $ lcov -c -i -b . -d objects -o objects/coverage_base.info
653+
# $ lcov -c -i -b . -d objects -o objects/coverage_base.info
653654
# 3. Run "make test" to run the unit tests. The code coverage information will
654655
# be generated in the src/objects directory.
655656
# 4. Generate the code coverage information from the tests:
656-
# $ lcov -c -b . -d objects/ -o objects/coverage_test.info
657+
# $ lcov -c -b . -d objects/ -o objects/coverage_test.info
657658
# 5. Combine the baseline and test code coverage data:
658-
# $ lcov -a objects/coverage_base.info -a objects/coverage_test.info -o objects/coverage_total.info
659+
# $ lcov -a objects/coverage_base.info -a objects/coverage_test.info -o objects/coverage_total.info
659660
# 6. Process the test coverage data and generate a report in html:
660-
# $ genhtml objects/coverage_total.info -o objects
661+
# $ genhtml objects/coverage_total.info -o objects
661662
# 7. Open the objects/index.html file in a web browser to view the coverage
662663
# information.
663664
#
@@ -2566,7 +2567,7 @@ DESKTOPPATH = $(DESTDIR)$(DATADIR)/applications
25662567
KDEPATH = $(HOME)/.kde/share/icons
25672568
install-icons:
25682569
if test -n "$(DESTDIR)"; then \
2569-
$(SHELL) ./mkinstalldirs $(ICON48PATH) $(ICON32PATH) \
2570+
$(MKDIR_P) $(ICON48PATH) $(ICON32PATH) \
25702571
$(ICON16PATH) $(DESKTOPPATH); \
25712572
fi
25722573

@@ -2607,7 +2608,7 @@ $(DESTDIR)$(exec_prefix) $(DEST_BIN) \
26072608
$(DEST_LANG) $(DEST_KMAP) $(DEST_COMP) $(DEST_MACRO) \
26082609
$(DEST_PACK) $(DEST_TOOLS) $(DEST_TUTOR) $(DEST_SPELL) \
26092610
$(DEST_AUTO) $(DEST_AUTO)/xml $(DEST_PLUG):
2610-
-$(SHELL) ./mkinstalldirs $@
2611+
$(MKDIR_P) $@
26112612
-chmod $(DIRMOD) $@
26122613

26132614
# create links from various names to vim. This is only done when the links
@@ -2787,25 +2788,25 @@ clean celan: testclean
27872788
SHADOWDIR = shadow
27882789

27892790
shadow: runtime pixmaps
2790-
mkdir $(SHADOWDIR)
2791-
cd $(SHADOWDIR); ln -s ../*.[chm] ../*.in ../*.sh ../*.xs ../*.xbm ../gui_gtk_res.xml ../toolcheck ../proto ../vimtutor ../gvimtutor ../mkinstalldirs .
2791+
$(MKDIR_P) $(SHADOWDIR)
2792+
cd $(SHADOWDIR); ln -s ../*.[chm] ../*.in ../*.sh ../*.xs ../*.xbm ../gui_gtk_res.xml ../toolcheck ../proto ../vimtutor ../gvimtutor ../install-sh .
27922793
mkdir $(SHADOWDIR)/auto
27932794
cd $(SHADOWDIR)/auto; ln -s ../../auto/configure .
2794-
mkdir $(SHADOWDIR)/po
2795+
$(MKDIR_P) $(SHADOWDIR)/po
27952796
cd $(SHADOWDIR)/po; ln -s ../../po/*.po ../../po/*.mak ../../po/*.vim ../../po/Makefile .
27962797
cd $(SHADOWDIR); rm -f auto/link.sed
27972798
cp Makefile configure $(SHADOWDIR)
27982799
rm -f $(SHADOWDIR)/auto/config.mk $(SHADOWDIR)/config.mk.dist
27992800
cp config.mk.dist $(SHADOWDIR)/auto/config.mk
28002801
cp config.mk.dist $(SHADOWDIR)
2801-
mkdir $(SHADOWDIR)/xxd
2802+
$(MKDIR_P) $(SHADOWDIR)/xxd
28022803
cd $(SHADOWDIR)/xxd; ln -s ../../xxd/*.[ch] ../../xxd/Make* .
28032804
if test -d $(RSRC_DIR); then \
28042805
cd $(SHADOWDIR); \
28052806
ln -s ../infplist.xml .; \
28062807
ln -s ../$(RSRC_DIR) ../os_mac.rsr.hqx ../dehqx.py .; \
28072808
fi
2808-
mkdir $(SHADOWDIR)/testdir
2809+
$(MKDIR_P) $(SHADOWDIR)/testdir
28092810
cd $(SHADOWDIR)/testdir; ln -s ../../testdir/Makefile \
28102811
../../testdir/Make_all.mak \
28112812
../../testdir/README.txt \
@@ -2942,7 +2943,7 @@ auto/gui_gtk_gresources.h: gui_gtk_res.xml $(GUI_GTK_RES_INPUTS)
29422943
objects: objects/.dirstamp
29432944

29442945
objects/.dirstamp:
2945-
mkdir -p objects
2946+
$(MKDIR_P) objects
29462947
touch objects/.dirstamp
29472948

29482949
# All object files depend on the objects directory, so that parallel make
@@ -3273,8 +3274,7 @@ install_macosx: gui_bundle
32733274
# Generate the help tags file now, it won't work with "make installruntime".
32743275
-@srcdir=`pwd`; cd $(HELPSOURCE); $(MAKE) VIMEXE=$$srcdir/$(VIMTARGET) vimtags
32753276
# Install the runtime files. Recursive!
3276-
-mkdir -p $(DESTDIR)$(prefix)/$(RESDIR)/vim/runtime
3277-
# -mkdir $(DESTDIR)$(prefix)/$(APPDIR)/bin
3277+
$(MKDIR_P) $(DESTDIR)$(prefix)/$(RESDIR)/vim/runtime
32783278
srcdir=`pwd`; $(MAKE) -f Makefile installruntime \
32793279
VIMEXE=$$srcdir/$(VIMTARGET) \
32803280
prefix=$(DESTDIR)$(prefix)/$(RESDIR)$(VIMDIR) \
@@ -3292,16 +3292,16 @@ gui_bundle: $(RESDIR) bundle-dir bundle-executable bundle-info bundle-resource \
32923292
bundle-language
32933293

32943294
$(RESDIR):
3295-
mkdir -p $@
3295+
$(MKDIR_P) $@
32963296

32973297
bundle-dir: $(APPDIR)/Contents $(VIMTARGET)
32983298
# Make a link to the runtime directory, so that we can try out the executable
32993299
# without installing it.
3300-
mkdir -p $(RESDIR)/vim
3300+
$(MKDIR_P) $(RESDIR)/vim
33013301
-ln -s `pwd`/../runtime $(RESDIR)/vim
33023302

33033303
bundle-executable: $(VIMTARGET)
3304-
mkdir -p $(APPDIR)/Contents/MacOS
3304+
$(MKDIR_P) $(APPDIR)/Contents/MacOS
33053305
cp $(VIMTARGET) $(APPDIR)/Contents/MacOS/$(VIMTARGET)
33063306

33073307
bundle-info: bundle-dir
@@ -3332,8 +3332,8 @@ bundle-rsrc: os_mac.rsr.hqx
33323332
bundle-language: bundle-dir
33333333

33343334
$(APPDIR)/Contents:
3335-
-$(SHELL) ./mkinstalldirs $(APPDIR)/Contents/MacOS
3336-
-$(SHELL) ./mkinstalldirs $(RESDIR)/English.lproj
3335+
$(MKDIR_P) $(APPDIR)/Contents/MacOS
3336+
$(MKDIR_P) $(RESDIR)/English.lproj
33373337

33383338

33393339
###############################################################################

src/auto/configure

Lines changed: 82 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,7 @@ XCODE_SELECT
725725
CPP_MM
726726
CROSS_COMPILING
727727
STRIP
728+
MKDIR_P
728729
AWK
729730
FGREP
730731
EGREP
@@ -3446,7 +3447,7 @@ ac_cpp='$CPP $CPPFLAGS'
34463447
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
34473448
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
34483449
ac_compiler_gnu=$ac_cv_c_compiler_gnu
3449-
ac_ext=c
3450+
ac_ext=c
34503451
ac_cpp='$CPP $CPPFLAGS'
34513452
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
34523453
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
@@ -3723,7 +3724,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
37233724

37243725
fi
37253726
rm -f conftest*
3726-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
3727+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
37273728
$as_echo_n "checking for fgrep... " >&6; }
37283729
if ${ac_cv_path_FGREP+:} false; then :
37293730
$as_echo_n "(cached) " >&6
@@ -3789,7 +3790,7 @@ fi
37893790
$as_echo "$ac_cv_path_FGREP" >&6; }
37903791
FGREP="$ac_cv_path_FGREP"
37913792

3792-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
3793+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
37933794
$as_echo_n "checking for library containing strerror... " >&6; }
37943795
if ${ac_cv_search_strerror+:} false; then :
37953796
$as_echo_n "(cached) " >&6
@@ -3844,7 +3845,7 @@ if test "$ac_res" != no; then :
38443845
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
38453846

38463847
fi
3847-
for ac_prog in gawk mawk nawk awk
3848+
for ac_prog in gawk mawk nawk awk
38483849
do
38493850
# Extract the first word of "$ac_prog", so it can be a program name with args.
38503851
set dummy $ac_prog; ac_word=$2
@@ -3885,6 +3886,76 @@ fi
38853886

38863887
test -n "$AWK" && break
38873888
done
3889+
ac_aux_dir=
3890+
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
3891+
if test -f "$ac_dir/install-sh"; then
3892+
ac_aux_dir=$ac_dir
3893+
ac_install_sh="$ac_aux_dir/install-sh -c"
3894+
break
3895+
elif test -f "$ac_dir/install.sh"; then
3896+
ac_aux_dir=$ac_dir
3897+
ac_install_sh="$ac_aux_dir/install.sh -c"
3898+
break
3899+
elif test -f "$ac_dir/shtool"; then
3900+
ac_aux_dir=$ac_dir
3901+
ac_install_sh="$ac_aux_dir/shtool install -c"
3902+
break
3903+
fi
3904+
done
3905+
if test -z "$ac_aux_dir"; then
3906+
as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
3907+
fi
3908+
3909+
# These three variables are undocumented and unsupported,
3910+
# and are intended to be withdrawn in a future Autoconf release.
3911+
# They can cause serious problems if a builder's source tree is in a directory
3912+
# whose full name contains unusual characters.
3913+
ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
3914+
ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
3915+
ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
3916+
3917+
3918+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
3919+
$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
3920+
if test -z "$MKDIR_P"; then
3921+
if ${ac_cv_path_mkdir+:} false; then :
3922+
$as_echo_n "(cached) " >&6
3923+
else
3924+
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3925+
for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
3926+
do
3927+
IFS=$as_save_IFS
3928+
test -z "$as_dir" && as_dir=.
3929+
for ac_prog in mkdir gmkdir; do
3930+
for ac_exec_ext in '' $ac_executable_extensions; do
3931+
as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
3932+
case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
3933+
'mkdir (GNU coreutils) '* | \
3934+
'mkdir (coreutils) '* | \
3935+
'mkdir (fileutils) '4.1*)
3936+
ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
3937+
break 3;;
3938+
esac
3939+
done
3940+
done
3941+
done
3942+
IFS=$as_save_IFS
3943+
3944+
fi
3945+
3946+
test -d ./--version && rmdir ./--version
3947+
if test "${ac_cv_path_mkdir+set}" = set; then
3948+
MKDIR_P="$ac_cv_path_mkdir -p"
3949+
else
3950+
# As a last resort, use the slow shell script. Don't cache a
3951+
# value for MKDIR_P within a source directory, because that will
3952+
# break other packages using the cache if that directory is
3953+
# removed, or if the value is a relative name.
3954+
MKDIR_P="$ac_install_sh -d"
3955+
fi
3956+
fi
3957+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
3958+
$as_echo "$MKDIR_P" >&6; }
38883959

38893960
# Extract the first word of "strip", so it can be a program name with args.
38903961
set dummy strip; ac_word=$2
@@ -14714,6 +14785,7 @@ gives unlimited permission to copy, distribute and modify it."
1471414785
1471514786
ac_pwd='$ac_pwd'
1471614787
srcdir='$srcdir'
14788+
MKDIR_P='$MKDIR_P'
1471714789
AWK='$AWK'
1471814790
test -n "\$AWK" || AWK=awk
1471914791
_ACEOF
@@ -15271,6 +15343,11 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
1527115343
# CONFIG_FILE
1527215344
#
1527315345
15346+
ac_MKDIR_P=$MKDIR_P
15347+
case $MKDIR_P in
15348+
[\\/$]* | ?:[\\/]* ) ;;
15349+
*/*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
15350+
esac
1527415351
_ACEOF
1527515352
1527615353
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
@@ -15324,6 +15401,7 @@ s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
1532415401
s&@builddir@&$ac_builddir&;t t
1532515402
s&@abs_builddir@&$ac_abs_builddir&;t t
1532615403
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
15404+
s&@MKDIR_P@&$ac_MKDIR_P&;t t
1532715405
$ac_datarootdir_hack
1532815406
"
1532915407
eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \

src/config.mk.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ AWK = @AWK@
103103

104104
STRIP = @STRIP@
105105

106+
MKDIR_P = @MKDIR_P@
107+
106108
EXEEXT = @EXEEXT@
107109
CROSS_COMPILING = @CROSS_COMPILING@
108110

src/configure.ac

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ AC_DEFINE(UNIX)
1111
AC_PROG_MAKE_SET
1212

1313
dnl Checks for programs.
14-
AC_PROG_CC dnl required by almost everything
15-
AC_PROG_CPP dnl required by header file checks
16-
AC_PROGRAM_EGREP dnl required by AC_EGREP_CPP
17-
AC_PROG_FGREP dnl finds working grep -F
18-
AC_ISC_POSIX dnl required by AC_C_CROSS
19-
AC_PROG_AWK dnl required for "make html" in ../doc
14+
AC_PROG_CC dnl required by almost everything
15+
AC_PROG_CPP dnl required by header file checks
16+
AC_PROGRAM_EGREP dnl required by AC_EGREP_CPP
17+
AC_PROG_FGREP dnl finds working grep -F
18+
AC_ISC_POSIX dnl required by AC_C_CROSS
19+
AC_PROG_AWK dnl required for "make html" in ../doc
20+
AC_PROG_MKDIR_P dnl portable "mkdir -p", also works in parallel
2021

2122
dnl Don't strip if we don't have it
2223
AC_CHECK_PROG(STRIP, strip, strip, :)

0 commit comments

Comments
 (0)