aboutsummaryrefslogtreecommitdiffstats
path: root/tools/ocaml
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2011-05-24 17:52:02 +0100
committerIan Campbell <ian.campbell@citrix.com>2011-05-24 17:52:02 +0100
commit63cd6b046b65ac1fda203ea1ee62717011f17a6a (patch)
tree32cd3de58b1dfeccaaf7d2578239e3a333b82560 /tools/ocaml
parent9932ce68c24cd6a2b30d2af11373340ed263326f (diff)
downloadxen-63cd6b046b65ac1fda203ea1ee62717011f17a6a.tar.gz
xen-63cd6b046b65ac1fda203ea1ee62717011f17a6a.tar.bz2
xen-63cd6b046b65ac1fda203ea1ee62717011f17a6a.zip
tools: ocaml: remove non-posix-ism from sed script.
Christoph Egger reported than on NetBSD the build fails with Parsing tools/ocaml/libs/xl/../../../../tools/libxl/libxl.idl sed: 1: "1i(*\ * AUTO-GENERATED ...": command i expects \ followed by test gmake[7]: Leaving directory `tools/ocaml/libs/xl' The following was tested by Christoph on NetBSD and also with GNU-sed with and without the --posix flag. In addition when sed fails will still create the output file, which confuses subsequent make invocations. Generate to a temporary file and move into place only on success. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Christoph Egger <Christoph.Egger@amd.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/ocaml')
-rw-r--r--tools/ocaml/libs/xl/Makefile14
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/ocaml/libs/xl/Makefile b/tools/ocaml/libs/xl/Makefile
index decdf62a5a..342dc3511a 100644
--- a/tools/ocaml/libs/xl/Makefile
+++ b/tools/ocaml/libs/xl/Makefile
@@ -17,29 +17,33 @@ xl_C_OBJS = xl_stubs
OCAML_LIBRARY = xl
-GENERATED_FILES += xl.ml xl.mli
+GENERATED_FILES += xl.ml xl.ml.tmp xl.mli xl.mli.tmp
GENERATED_FILES += _libxl_types.ml.in _libxl_types.mli.in
GENERATED_FILES += _libxl_types.inc
all: $(INTF) $(LIBS)
xl.ml: xl.ml.in _libxl_types.ml.in
- $(Q)sed -e '1i(*\
+ $(Q)sed -e '1i\
+(*\
* AUTO-GENERATED FILE DO NOT EDIT\
* Generated from xl.ml.in and _libxl_types.ml.in\
*)\
' \
-e '/^(\* @@LIBXL_TYPES@@ \*)$$/r_libxl_types.ml.in' \
- < xl.ml.in > xl.ml
+ < xl.ml.in > xl.ml.tmp
+ $(Q)mv xl.ml.tmp xl.ml
xl.mli: xl.mli.in _libxl_types.mli.in
- $(Q)sed -e '1i(*\
+ $(Q)sed -e '1i\
+(*\
* AUTO-GENERATED FILE DO NOT EDIT\
* Generated from xl.mli.in and _libxl_types.mli.in\
*)\
' \
-e '/^(\* @@LIBXL_TYPES@@ \*)$$/r_libxl_types.mli.in' \
- < xl.mli.in > xl.mli
+ < xl.mli.in > xl.mli.tmp
+ $(Q)mv xl.mli.tmp xl.mli
_libxl_types.ml.in _libxl_types.mli.in _libxl_types.inc: genwrap.py $(XEN_ROOT)/tools/libxl/libxl.idl \
$(XEN_ROOT)/tools/libxl/libxltypes.py