summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Morris <michael.patrick.morris@gmail.com>2014-10-28 13:42:23 -0400
committerMike Morris <michael.patrick.morris@gmail.com>2014-10-28 13:42:23 -0400
commit652c616048745cf78df656536fefed18e595f6d9 (patch)
treeb05ae9333f175613fa666300e1e8dd2b36a6210b
parent124cc01bf101b242792ef94b338635b8520b6721 (diff)
downloadqtlocation-mapboxgl-652c616048745cf78df656536fefed18e595f6d9.tar.gz
build simple, working mbgl-config script from gyp
-rw-r--r--gyp/install.gypi17
-rwxr-xr-xutils/mbgl-config/build.sh17
-rwxr-xr-xutils/mbgl-config/dummy.sh3
-rw-r--r--utils/mbgl-config/mbgl-config.template.sh87
4 files changed, 32 insertions, 92 deletions
diff --git a/gyp/install.gypi b/gyp/install.gypi
index b3b20cef53..0eadb94f56 100644
--- a/gyp/install.gypi
+++ b/gyp/install.gypi
@@ -10,14 +10,6 @@
'mbgl-headless',
'mbgl-<(platform)',
],
- 'defines': [
- 'PLATFORM=<(platform)',
- ],
- 'export_dependent_settings': [
- 'mbgl',
- 'mbgl-headless',
- 'mbgl-<(platform)',
- ],
'copies': [
{ 'files': [ '<(PRODUCT_DIR)/libmbgl.a' ], 'destination': '<(install_prefix)/lib' },
{ 'files': [ '<(PRODUCT_DIR)/libmbgl-headless.a' ], 'destination': '<(install_prefix)/lib' },
@@ -28,15 +20,16 @@
{ 'action_name': 'mbgl-config',
'inputs': [
'../utils/mbgl-config/mbgl-config.template.sh',
- '../utils/mbgl-config/dummy.sh',
+ '../utils/mbgl-config/build.sh',
],
'outputs': [
'<(install_prefix)/bin/mbgl-config',
],
'action': [
- './utils/mbgl-config/dummy.sh',
- 'PREFIX=<(install_prefix)',
- 'PLATFORM=<(platform)',
+ './utils/mbgl-config/build.sh',
+ '<(install_prefix)',
+ '<(platform)',
+ 'mbgl',
]
}
]
diff --git a/utils/mbgl-config/build.sh b/utils/mbgl-config/build.sh
new file mode 100755
index 0000000000..4fd4a93cfc
--- /dev/null
+++ b/utils/mbgl-config/build.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+PREFIX=$1
+PLATFORM=$2
+
+VARIABLES="#!/bin/bash
+
+## variables
+
+CONFIG_MBGL_PREFIX=$PREFIX
+CONFIG_MBGL_PLATFORM=$PLATFORM
+"
+
+echo "$VARIABLES" | cat - utils/mbgl-config/mbgl-config.template.sh \
+ > $PREFIX/bin/mbgl-config
+
+chmod 755 $PREFIX/bin/mbgl-config
diff --git a/utils/mbgl-config/dummy.sh b/utils/mbgl-config/dummy.sh
deleted file mode 100755
index 04685b2c14..0000000000
--- a/utils/mbgl-config/dummy.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-echo "mbgl-config DUMMY $PLATFORM $PREFIX";
diff --git a/utils/mbgl-config/mbgl-config.template.sh b/utils/mbgl-config/mbgl-config.template.sh
index 8ca8cde6b0..87f4d50e1f 100644
--- a/utils/mbgl-config/mbgl-config.template.sh
+++ b/utils/mbgl-config/mbgl-config.template.sh
@@ -1,29 +1,18 @@
-
## program below
usage()
{
cat <<EOF
-Usage: mbgl-config [OPTION]
+Usage:
+ mbgl-config [OPTION...]
-Known values for OPTION are:
+Help Options:
+ -h, --help Show help options
- -h --help display this help and exit
- -v --version version information
- --git-revision git hash from "git rev-list --max-count=1 HEAD"
- --git-describe git decribe output
- --defines pre-processor defines for mbgl build
- --prefix mbgl prefix [default $CONFIG_PREFIX]
- --lib-name mbgl library name
- --libs library linking information
- --dep-libs library linking information for mbgl dependencies
- --ldflags library paths (-L) information
- --includes include paths (-I) for mbgl headers
- --dep-includes include paths (-I) for mbgl dependencies
- --cxxflags c++ compiler flags and pre-processor defines
- --cflags all include paths, compiler flags, and pre-processor defines (for back-compatibility)
- --cxx c++ compiler used to build mbgl
- --all-flags all compile and link flags
+Application Options:
+ --prefix output prefix where mbgl is installed
+ --libs output -L flags
+ --includes output -I flags
EOF
exit $1
@@ -49,72 +38,16 @@ while test $# -gt 0; do
usage 0
;;
- -v)
- echo ${CONFIG_MBGL_VERSION_STRING}
- ;;
-
- --version)
- echo ${CONFIG_MBGL_VERSION_STRING}
- ;;
-
- --version-number)
- echo ${CONFIG_MBGL_VERSION}
- ;;
-
- --git-revision)
- echo ${CONFIG_MBGL_GIT_REVISION}
- ;;
-
- --git-describe)
- echo ${CONFIG_MBGL_GIT_DESCRIBE}
- ;;
-
- --defines)
- echo ${CONFIG_MBGL_DEFINES}
- ;;
-
--prefix)
echo ${CONFIG_MBGL_PREFIX}
;;
- --lib-name)
- echo ${CONFIG_MBGL_LIBNAME}
- ;;
-
--libs)
- echo -L${CONFIG_MBGL_LIBPATH} -l${CONFIG_MBGL_LIBNAME}
- ;;
-
- --dep-libs)
- echo ${CONFIG_MBGL_DEP_LIBS}
- ;;
-
- --ldflags)
- echo ${CONFIG_MBGL_LDFLAGS}
+ echo -L${CONFIG_MBGL_PREFIX}/lib -lmbgl -lmbgl-${CONFIG_MBGL_PLATFORM} -lmbgl-headless
;;
--includes)
- echo -I${CONFIG_MBGL_INCLUDES}
- ;;
-
- --dep-includes)
- echo ${CONFIG_MBGL_DEP_INCLUDES}
- ;;
-
- --cxxflags)
- echo ${CONFIG_MBGL_CXXFLAGS}
- ;;
-
- --cflags)
- echo -I${CONFIG_MBGL_INCLUDE} ${CONFIG_MBGL_DEP_INCLUDES} ${CONFIG_MBGL_DEFINES} ${CONFIG_MBGL_CXXFLAGS}
- ;;
-
- --cxx)
- echo ${CONFIG_MBGL_CXX}
- ;;
-
- --all-flags)
- echo -I${CONFIG_MBGL_INCLUDES} ${CONFIG_MBGL_DEP_INCLUDES} ${CONFIG_MBGL_DEFINES} ${CONFIG_MBGL_CXXFLAGS} -L${CONFIG_MBGL_LIBPATH} -l${CONFIG_MBGL_LIBNAME} ${CONFIG_MBGL_LDFLAGS} ${CONFIG_MBGL_DEP_LIBS}
+ echo -I${CONFIG_MBGL_PREFIX}/include/mbgl
;;
*)