Mercurial > hg > octave-avbm
changeset 10434:f387c5b3a369
avoid problems if liboctave/config-ops.sh is run in parallel
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 22 Mar 2010 19:03:07 -0400 |
parents | 2c01d24459fb |
children | 6a271334750c |
files | liboctave/ChangeLog liboctave/Makefile.am liboctave/config-ops.sh |
diffstat | 3 files changed, 75 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,10 @@ +2010-03-22 John W. Eaton <jwe@octave.org> + + * config-ops.sh: Accept additional arguments. + * Makefile.am ($(srcdir)/vx-op-inc.mk, $(srcdir)/mx-op-inc.mk + $(srcdir)/smx-op-inc.mk, $(srcdir)/vx-op-src.mk, $(srcdir)/mx-op-src.mk + $(srcdir)/smx-op-src.mk): Pass additional arguments to config-ops.sh. + 2010-03-22 Jaroslav Hajek <highegg@gmail.com> * Sparse.cc (Sparse<T>::index (const idx_vector&, const idx_vector&,
--- a/liboctave/Makefile.am +++ b/liboctave/Makefile.am @@ -261,13 +261,13 @@ include smx-op-inc.mk $(srcdir)/vx-op-inc.mk: $(srcdir)/config-ops.sh $(srcdir)/mk-ops.awk $(srcdir)/vx-ops - $(srcdir)/config-ops.sh $(top_srcdir) + $(srcdir)/config-ops.sh $(top_srcdir) vx inc $(srcdir)/mx-op-inc.mk: $(srcdir)/config-ops.sh $(srcdir)/mk-ops.awk $(srcdir)/mx-ops - $(srcdir)/config-ops.sh $(top_srcdir) + $(srcdir)/config-ops.sh $(top_srcdir) mx inc $(srcdir)/smx-op-inc.mk: $(srcdir)/config-ops.sh $(srcdir)/sparse-mk-ops.awk $(srcdir)/sparse-mx-ops - $(srcdir)/config-ops.sh $(top_srcdir) + $(srcdir)/config-ops.sh $(top_srcdir) smx inc BUILT_INCS = \ mx-ops.h \ @@ -455,13 +455,13 @@ include smx-op-src.mk $(srcdir)/vx-op-src.mk: $(srcdir)/config-ops.sh $(srcdir)/mk-ops.awk $(srcdir)/vx-ops - $(srcdir)/config-ops.sh $(top_srcdir) + $(srcdir)/config-ops.sh $(top_srcdir) vx src $(srcdir)/mx-op-src.mk: $(srcdir)/config-ops.sh $(srcdir)/mk-ops.awk $(srcdir)/mx-ops - $(srcdir)/config-ops.sh $(top_srcdir) + $(srcdir)/config-ops.sh $(top_srcdir) mx src $(srcdir)/smx-op-src.mk: $(srcdir)/config-ops.sh $(srcdir)/sparse-mk-ops.awk $(srcdir)/sparse-mx-ops - $(srcdir)/config-ops.sh $(top_srcdir) + $(srcdir)/config-ops.sh $(top_srcdir) smx src BUILT_LIBOCTAVE_CXX_SOURCES = \ $(MX_OP_SRC) \
--- a/liboctave/config-ops.sh +++ b/liboctave/config-ops.sh @@ -4,10 +4,22 @@ : ${AWK=awk} -if [ $# -eq 1 ]; then - top_srcdir="$1"; +if [ $# -lt 3 ]; then + src_type="all" else + src_type="$3" +fi + +if [ $# -lt 2 ]; then + obj_type="all" +else + obj_type="$2" +fi + +if [ $# -lt 1 ]; then top_srcdir=".." +else + top_srcdir="$1" fi liboctave_dir="$top_srcdir/liboctave" @@ -15,32 +27,57 @@ mk_ops="$liboctave_dir/mk-ops.awk" sparse_mk_ops="$liboctave_dir/sparse-mk-ops.awk" -VX_INC=$($AWK -f $mk_ops prefix=vx list_h_files=1 $liboctave_dir/vx-ops) - -MX_INC=$($AWK -f $mk_ops prefix=mx list_h_files=1 $liboctave_dir/mx-ops) - -SMX_INC=$($AWK -f $sparse_mk_ops prefix=smx list_h_files=1 $liboctave_dir/sparse-mx-ops) +case "$obj_type" in + vx | all) + case "$src_type" in + inc | all) + VX_INC=$($AWK -f $mk_ops prefix=vx list_h_files=1 $liboctave_dir/vx-ops) + echo "VX_OP_INC = $(echo $VX_INC)" > $liboctave_dir/vx-op-inc.mk-t + $top_srcdir/move-if-change $liboctave_dir/vx-op-inc.mk-t $liboctave_dir/vx-op-inc.mk + ;; -VX_SRC=$($AWK -f $mk_ops prefix=vx list_cc_files=1 $liboctave_dir/vx-ops) - -MX_SRC=$($AWK -f $mk_ops prefix=mx list_cc_files=1 $liboctave_dir/mx-ops) + src | all) + VX_SRC=$($AWK -f $mk_ops prefix=vx list_cc_files=1 $liboctave_dir/vx-ops) + echo "VX_OP_SRC = $(echo $VX_SRC)" > $liboctave_dir/vx-op-src.mk-t + $top_srcdir/move-if-change $liboctave_dir/vx-op-src.mk-t $liboctave_dir/vx-op-src.mk + ;; + esac + ;; -SMX_SRC=$($AWK -f $sparse_mk_ops prefix=smx list_cc_files=1 $liboctave_dir/sparse-mx-ops) - -echo "VX_OP_INC = $(echo $VX_INC)" > $liboctave_dir/vx-op-inc.mk-t -$top_srcdir/move-if-change $liboctave_dir/vx-op-inc.mk-t $liboctave_dir/vx-op-inc.mk + mx | all) + case "$src_type" in + inc | all) + MX_INC=$($AWK -f $mk_ops prefix=mx list_h_files=1 $liboctave_dir/mx-ops) + echo "MX_OP_INC = $(echo $MX_INC)" > $liboctave_dir/mx-op-inc.mk-t + $top_srcdir/move-if-change $liboctave_dir/mx-op-inc.mk-t $liboctave_dir/mx-op-inc.mk + ;; -echo "MX_OP_INC = $(echo $MX_INC)" > $liboctave_dir/mx-op-inc.mk-t -$top_srcdir/move-if-change $liboctave_dir/mx-op-inc.mk-t $liboctave_dir/mx-op-inc.mk - -echo "SMX_OP_INC = $(echo $SMX_INC)" > $liboctave_dir/smx-op-inc.mk-t -$top_srcdir/move-if-change $liboctave_dir/smx-op-inc.mk-t $liboctave_dir/smx-op-inc.mk + src | all) + MX_SRC=$($AWK -f $mk_ops prefix=mx list_cc_files=1 $liboctave_dir/mx-ops) + echo "MX_OP_SRC = $(echo $MX_SRC)" > $liboctave_dir/mx-op-src.mk-t + $top_srcdir/move-if-change $liboctave_dir/mx-op-src.mk-t $liboctave_dir/mx-op-src.mk + ;; + esac + ;; -echo "VX_OP_SRC = $(echo $VX_SRC)" > $liboctave_dir/vx-op-src.mk-t -$top_srcdir/move-if-change $liboctave_dir/vx-op-src.mk-t $liboctave_dir/vx-op-src.mk + smx | all) + case "$src_type" in + inc | all) + SMX_INC=$($AWK -f $sparse_mk_ops prefix=smx list_h_files=1 $liboctave_dir/sparse-mx-ops) + echo "SMX_OP_INC = $(echo $SMX_INC)" > $liboctave_dir/smx-op-inc.mk-t + $top_srcdir/move-if-change $liboctave_dir/smx-op-inc.mk-t $liboctave_dir/smx-op-inc.mk + ;; -echo "MX_OP_SRC = $(echo $MX_SRC)" > $liboctave_dir/mx-op-src.mk-t -$top_srcdir/move-if-change $liboctave_dir/mx-op-src.mk-t $liboctave_dir/mx-op-src.mk + src | all) + SMX_SRC=$($AWK -f $sparse_mk_ops prefix=smx list_cc_files=1 $liboctave_dir/sparse-mx-ops) + echo "SMX_OP_SRC = $(echo $SMX_SRC)" > $liboctave_dir/smx-op-src.mk-t + $top_srcdir/move-if-change $liboctave_dir/smx-op-src.mk-t $liboctave_dir/smx-op-src.mk + ;; + esac + ;; +esac -echo "SMX_OP_SRC = $(echo $SMX_SRC)" > $liboctave_dir/smx-op-src.mk-t -$top_srcdir/move-if-change $liboctave_dir/smx-op-src.mk-t $liboctave_dir/smx-op-src.mk + + + +