summaryrefslogtreecommitdiff
path: root/solenv/gbuild/UnpackedTarball.mk
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2012-08-24 09:41:50 +0200
committerDavid Tardon <dtardon@redhat.com>2012-08-24 13:22:02 +0200
commit3cdd8d3b00849c263d0e6909fb5eddcef088c9d9 (patch)
treecbb577f60e8a32bd54358a7b1d161a51dc423e3f /solenv/gbuild/UnpackedTarball.mk
parentddc8881122d8d848f5ad38f2e65e7739afb955b9 (diff)
add support for building external projects
Change-Id: I1ae354e3bf85c29679919f6382e14d3e4232d798
Diffstat (limited to 'solenv/gbuild/UnpackedTarball.mk')
-rw-r--r--solenv/gbuild/UnpackedTarball.mk18
1 files changed, 18 insertions, 0 deletions
diff --git a/solenv/gbuild/UnpackedTarball.mk b/solenv/gbuild/UnpackedTarball.mk
index 8d85e01a7f29..52b496bb8297 100644
--- a/solenv/gbuild/UnpackedTarball.mk
+++ b/solenv/gbuild/UnpackedTarball.mk
@@ -103,6 +103,9 @@ endef
# converted, it is better to be changed to 1.
gb_UnpackedTarball_PATCHLEVEL_DEFAULT := 3
+gb_UnpackedTarball_CONVERTTARGET := $(SRCDIR)/solenv/bin/leconvert.pl
+gb_UnpackedTarball_CONVERTCOMMAND := $(PERL) -w $(gb_UnpackedTarball_CONVERTTARGET)
+
define gb_UnpackedTarball__copy_files_impl
$(if $(1),\
&& cp $(firstword $(1)) $(firstword $(2)) \
@@ -123,11 +126,13 @@ define gb_UnpackedTarball__command
$(call gb_Output_announce,$(2),$(true),PAT,2)
$(call gb_Helper_abbreviate_dirs,\
cd $(3) && \
+ $(if $(UNPACKED_FIX_EOL),$(gb_UnpackedTarball_CONVERTCOMMAND) unix $(UNPACKED_FIX_EOL) &&) \
$(if $(UNPACKED_PATCHES),\
for p in $(UNPACKED_PATCHES); do \
$(GNUPATCH) -s -p$(UNPACKED_PATCHLEVEL) < "$$p" || exit 1;\
done && \
) \
+ $(if $(UNPACKED_FIX_EOL),$(gb_UnpackedTarball_CONVERTCOMMAND) dos $(UNPACKED_FIX_EOL) &&) \
$(if $(UNPACKED_CXX_SUFFIX),\
for c in `find $(3) -type f -name "*.$(UNPACKED_CXX_SUFFIX)"`; do \
mv "$$c" "$${c%.$(UNPACKED_CXX_SUFFIX)}.cxx" || exit 1;\
@@ -168,6 +173,7 @@ define gb_UnpackedTarball_UnpackedTarball_internal
$(call gb_UnpackedTarball_get_target,$(1)) : UNPACKED_CXX_SUFFIX :=
$(call gb_UnpackedTarball_get_target,$(1)) : UNPACKED_DESTFILES :=
$(call gb_UnpackedTarball_get_target,$(1)) : UNPACKED_FILES :=
+$(call gb_UnpackedTarball_get_target,$(1)) : UNPACKED_FIX_EOL :=
$(call gb_UnpackedTarball_get_target,$(1)) : UNPACKED_PATCHES :=
$(call gb_UnpackedTarball_get_target,$(1)) : UNPACKED_PATCHLEVEL := $(gb_UnpackedTarball_PATCHLEVEL_DEFAULT)
$(call gb_UnpackedTarball_get_target,$(1)) : UNPACKED_POST_ACTION :=
@@ -187,6 +193,18 @@ $$(eval $$(call gb_Module_register_target,$(call gb_UnpackedTarball_get_target,$
endef
+# Convert line ending from dos to unix style for selected files
+#
+# This is done before applying patches, because patches expect unix
+# style line ending, and the files are converted back after that. The
+# files are relative to the unpacked path.
+#
+# gb_UnpackedTarball_fix_end_of_line unpacked file(s)
+define gb_UnpackedTarball_fix_end_of_line
+$(call gb_UnpackedTarball_get_target,$(1)) : UNPACKED_FIX_EOL += $(addprefix $(call gb_UnpackedTarball_get_dir,$(1))/,$(2))
+
+endef
+
# Set suffix of C++ files, if different from 'cxx'
#
# All files with that extension will be renamed to .cxx . This is because