build simple, working mbgl-config script from gyp
This commit is contained in:
@@ -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',
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
17
utils/mbgl-config/build.sh
Executable file
17
utils/mbgl-config/build.sh
Executable file
@@ -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
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "mbgl-config DUMMY $PLATFORM $PREFIX";
|
||||
@@ -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
|
||||
;;
|
||||
|
||||
*)
|
||||
|
||||
Reference in New Issue
Block a user