summaryrefslogtreecommitdiff
path: root/build/make/gen_msvs_vcxproj.sh
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2014-04-24 11:27:43 -0700
committerJames Zern <jzern@google.com>2014-04-24 15:53:13 -0700
commit092a20f0a6ea0ee58bbe799afd01ddd284527779 (patch)
treee4bc873effc63970df17f23bb116e1b7f8b287a5 /build/make/gen_msvs_vcxproj.sh
parent95735c3938cf18e5140a4528b65c713502884710 (diff)
downloadlibvpx-092a20f0a6ea0ee58bbe799afd01ddd284527779.tar
libvpx-092a20f0a6ea0ee58bbe799afd01ddd284527779.tar.gz
libvpx-092a20f0a6ea0ee58bbe799afd01ddd284527779.tar.bz2
libvpx-092a20f0a6ea0ee58bbe799afd01ddd284527779.zip
gen_msvs_*proj.sh: factorize some functions
-> msvs_common.sh Change-Id: Id4878805183c0ec11e5d681e4bf820b598b085f9
Diffstat (limited to 'build/make/gen_msvs_vcxproj.sh')
-rwxr-xr-xbuild/make/gen_msvs_vcxproj.sh90
1 files changed, 2 insertions, 88 deletions
diff --git a/build/make/gen_msvs_vcxproj.sh b/build/make/gen_msvs_vcxproj.sh
index a64e129b2..9dc790629 100755
--- a/build/make/gen_msvs_vcxproj.sh
+++ b/build/make/gen_msvs_vcxproj.sh
@@ -9,17 +9,11 @@
## be found in the AUTHORS file in the root of the source tree.
##
-
self=$0
self_basename=${self##*/}
self_dirname=$(dirname "$0")
-EOL=$'\n'
-if [ "$(uname -o 2>/dev/null)" = "Cygwin" ] \
- && cygpath --help >/dev/null 2>&1; then
- FIXPATH='cygpath -m'
-else
- FIXPATH='echo'
-fi
+
+. "$self_dirname/msvs_common.sh"|| exit 127
show_help() {
cat <<EOF
@@ -50,86 +44,6 @@ EOF
exit 1
}
-die() {
- echo "${self_basename}: $@" >&2
- exit 1
-}
-
-die_unknown(){
- echo "Unknown option \"$1\"." >&2
- echo "See ${self_basename} --help for available options." >&2
- exit 1
-}
-
-fix_path() {
- $FIXPATH "$1"
-}
-
-generate_uuid() {
- local hex="0123456789ABCDEF"
- local i
- local uuid=""
- local j
- #93995380-89BD-4b04-88EB-625FBE52EBFB
- for ((i=0; i<32; i++)); do
- (( j = $RANDOM % 16 ))
- uuid="${uuid}${hex:$j:1}"
- done
- echo "${uuid:0:8}-${uuid:8:4}-${uuid:12:4}-${uuid:16:4}-${uuid:20:12}"
-}
-
-indent1=" "
-indent=""
-indent_push() {
- indent="${indent}${indent1}"
-}
-indent_pop() {
- indent="${indent%${indent1}}"
-}
-
-tag_attributes() {
- for opt in "$@"; do
- optval="${opt#*=}"
- [ -n "${optval}" ] ||
- die "Missing attribute value in '$opt' while generating $tag tag"
- echo "${indent}${opt%%=*}=\"${optval}\""
- done
-}
-
-open_tag() {
- local tag=$1
- shift
- if [ $# -ne 0 ]; then
- echo "${indent}<${tag}"
- indent_push
- tag_attributes "$@"
- echo "${indent}>"
- else
- echo "${indent}<${tag}>"
- indent_push
- fi
-}
-
-close_tag() {
- local tag=$1
- indent_pop
- echo "${indent}</${tag}>"
-}
-
-tag() {
- local tag=$1
- shift
- if [ $# -ne 0 ]; then
- echo "${indent}<${tag}"
- indent_push
- tag_attributes "$@"
- indent_pop
- echo "${indent}/>"
- else
- echo "${indent}<${tag}/>"
- fi
-}
-
tag_content() {
local tag=$1
local content=$2