Fix bug 944:

src/frontends/xforms/forms/fdfix.sh uses fixed file names for temporary
files, thus make dist on SMP fails.
Fix is trivial -- all temporary files should have $$ (PID) appended to them.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6483 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2003-03-13 11:37:15 +00:00
parent 1ea1f923a8
commit 7fb50b8c66
3 changed files with 32 additions and 13 deletions

View File

@ -1,3 +1,9 @@
2003-03-13 Angus Leeming <leeming@lyx.org>
* forms/fdfix.sh:
* forms/fdfixh.sed: fix #944 by making the temporary filenames unique
and so enable reentrant builds on SMP machines.
2003-03-12 Angus Leeming <leeming@lyx.org> 2003-03-12 Angus Leeming <leeming@lyx.org>
* Dialogs.C: * Dialogs.C:

View File

@ -15,13 +15,17 @@
INTRO_MESSAGE () INTRO_MESSAGE ()
{ {
test $# -eq 1 || {
echo "Expected a file name!"
exit 1
}
# Note that we can't create a variable containing this and then # Note that we can't create a variable containing this and then
# echo it across because some machines require -e to recognize \n et al. # echo it across because some machines require -e to recognize \n et al.
# Other machines, of course output -e, it not being an option they # Other machines, of course output -e, it not being an option they
# recognise ;-) # recognise ;-)
# Set ${OUTPUT_FILE} to ${HOUT} or ${COUT} as appropriate cat - > $1 <<EOF
cat - > ${OUTPUT_FILE} <<EOF
// File generated by fdesign from ${FDFILE} // File generated by fdesign from ${FDFILE}
// and modified by fdfix.sh for use by LyX. // and modified by fdfix.sh for use by LyX.
@ -69,23 +73,30 @@ HOUT=${BASENAME}.hpp
# put the sorted, unique list in file ${EXTERN_FUNCS} # put the sorted, unique list in file ${EXTERN_FUNCS}
# The contents of this file are used by ${FDFIXH} to replace the mess # The contents of this file are used by ${FDFIXH} to replace the mess
# output by fdesign # output by fdesign
EXTERN_FUNCS=extern.tmp # Note that we use unique file names for temp files to enable re-entrant
# builds with SMP machines
EXTERN_FUNCS=extern.$$
sed -n 's/extern void \(.*\)/void \1/p' ${HIN} > ${EXTERN_FUNCS} sed -n 's/extern void \(.*\)/void \1/p' ${HIN} > ${EXTERN_FUNCS}
if [ -s ${EXTERN_FUNCS} ]; then if [ -s ${EXTERN_FUNCS} ]; then
sort -u ${EXTERN_FUNCS} > tmp TMP=tmp.$$
sort -u ${EXTERN_FUNCS} > ${TMP}
echo "extern \"C\" {" > ${EXTERN_FUNCS} echo "extern \"C\" {" > ${EXTERN_FUNCS}
cat tmp >> ${EXTERN_FUNCS} cat ${TMP} >> ${EXTERN_FUNCS}
echo "}" >> ${EXTERN_FUNCS} echo "}" >> ${EXTERN_FUNCS}
rm -f tmp rm -f ${TMP}
fi fi
FDFIXH=${DIRNAME}/fdfixh.sed # First ensure that the sed script knows where to find ${EXTERN_FUNCS}
FDFIXH=fdfixh.$$
sed "s/EXTERN_FUNCS/${EXTERN_FUNCS}/" ${DIRNAME}/fdfixh.sed > ${FDFIXH}
OUTPUT_FILE=${HOUT}; INTRO_MESSAGE INTRO_MESSAGE ${HOUT}
sed -f ${FDFIXH} < ${HIN} >> ${HOUT} sed -f ${FDFIXH} < ${HIN} >> ${HOUT}
rm -f ${EXTERN_FUNCS}
# Don't forget to clean up the temporary files.
rm -f ${EXTERN_FUNCS} ${FDFIXH}
# Patch the .h file if a patch exists # Patch the .h file if a patch exists
if [ -f "${HPATCH}" ] ; then if [ -f "${HPATCH}" ] ; then
@ -122,8 +133,9 @@ FINAL_COUT=${BASENAME}.C
# Pass 1. The bulk of the clean-up # Pass 1. The bulk of the clean-up
FDFIXC=${DIRNAME}/fdfixc.sed FDFIXC=${DIRNAME}/fdfixc.sed
TMP=tmp
OUTPUT_FILE=${TMP}; INTRO_MESSAGE TMP=tmp.$$
INTRO_MESSAGE ${TMP}
echo "#include <config.h>" >> ${TMP} echo "#include <config.h>" >> ${TMP}
echo "#include \"forms_gettext.h\"" >> ${TMP} echo "#include \"forms_gettext.h\"" >> ${TMP}

View File

@ -29,14 +29,15 @@ s/[ ]*$//
# Immediately after line "#define FD_xxx_h_" that starts off the header file, # Immediately after line "#define FD_xxx_h_" that starts off the header file,
# #include "fdesign_base.h" and append the contents of file "extern.tmp". # #include "fdesign_base.h" and append the contents of file EXTERN_FUNCS.
# This latter is a sorted, unique list of any function declarations. # This latter is a sorted, unique list of any function declarations.
# The actual name of the file is inserted by the parent shell script.
/#define FD/{ /#define FD/{
a\ a\
\ \
#include "fdesign_base.h"\ #include "fdesign_base.h"\
r extern.tmp r EXTERN_FUNCS
} }