fix install script
This commit is contained in:
2
Makefile
2
Makefile
@@ -75,7 +75,7 @@ mbgl: build/mbgl/Makefile
|
||||
|
||||
.PHONY: install
|
||||
install: build/mbgl/Makefile
|
||||
$(MAKE) -C build/mbgl BUILDTYPE=$(BUILDTYPE) install
|
||||
LINK=`pwd`/gyp/link.py $(MAKE) -C build/mbgl BUILDTYPE=$(BUILDTYPE) install
|
||||
|
||||
.PHONY: standalone
|
||||
standalone: build/mbgl/Makefile
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
'variables': {
|
||||
'install_prefix%': '',
|
||||
'standalone_product_dir':'<!@(pwd)/build',
|
||||
},
|
||||
'target_defaults': {
|
||||
'default_configuration': 'Release',
|
||||
|
||||
101
gyp/install.gypi
101
gyp/install.gypi
@@ -1,76 +1,39 @@
|
||||
{
|
||||
'conditions': [
|
||||
['install_prefix != ""', {
|
||||
'targets': [
|
||||
{ 'target_name': 'install',
|
||||
'type': 'none',
|
||||
'hard_dependency': 1,
|
||||
'dependencies': [
|
||||
'core',
|
||||
'platform-<(platform_lib)',
|
||||
'http-<(http_lib)',
|
||||
'asset-<(asset_lib)',
|
||||
'cache-<(cache_lib)',
|
||||
'headless-<(headless_lib)',
|
||||
'standalone',
|
||||
'targets': [
|
||||
{ 'target_name': 'install',
|
||||
'type': 'none',
|
||||
'hard_dependency': 1,
|
||||
'dependencies': [
|
||||
'core',
|
||||
'platform-<(platform_lib)',
|
||||
'http-<(http_lib)',
|
||||
'asset-<(asset_lib)',
|
||||
'cache-<(cache_lib)',
|
||||
'headless-<(headless_lib)',
|
||||
'standalone',
|
||||
],
|
||||
'copies': [
|
||||
{ 'files': [ '<(PRODUCT_DIR)/libmbgl.a' ], 'destination': '<(install_prefix)/lib' },
|
||||
{ 'files': [ '../include/mbgl' ], 'destination': '<(install_prefix)/include' },
|
||||
{ 'files': [ '<(SHARED_INTERMEDIATE_DIR)/include/mbgl/util/version.hpp' ], 'destination': '<(install_prefix)/include/mbgl/util' },
|
||||
],
|
||||
|
||||
'actions': [
|
||||
{ 'action_name': 'mbgl-config',
|
||||
'inputs': [
|
||||
'../utils/mbgl-config/mbgl-config.template.sh',
|
||||
'../utils/mbgl-config/build.sh',
|
||||
],
|
||||
'copies': [
|
||||
{ 'files': [ '<(standalone_product_dir)/libmbgl.a' ], 'destination': '<(install_prefix)/lib' },
|
||||
{ 'files': [ '<(PRODUCT_DIR)/libmbgl-core.a' ], 'destination': '<(install_prefix)/lib' },
|
||||
{ 'files': [ '<(PRODUCT_DIR)/lib<(headless_lib).a' ], 'destination': '<(install_prefix)/lib' },
|
||||
{ 'files': [ '<(PRODUCT_DIR)/lib<(platform_lib).a' ], 'destination': '<(install_prefix)/lib' },
|
||||
{ 'files': [ '<(PRODUCT_DIR)/lib<(http_lib).a' ], 'destination': '<(install_prefix)/lib' },
|
||||
{ 'files': [ '<(PRODUCT_DIR)/lib<(asset_lib).a' ], 'destination': '<(install_prefix)/lib' },
|
||||
{ 'files': [ '<(PRODUCT_DIR)/lib<(cache_lib).a' ], 'destination': '<(install_prefix)/lib' },
|
||||
{ 'files': [ '../include/mbgl' ], 'destination': '<(install_prefix)/include' },
|
||||
'outputs': [
|
||||
'<(install_prefix)/bin/mbgl-config',
|
||||
],
|
||||
'variables': {
|
||||
'conditions': [
|
||||
['OS == "linux"', {
|
||||
'other_ldflags': [
|
||||
'<@(nu_static_libs)',
|
||||
'<@(png_static_libs)',
|
||||
'<@(jpeg_static_libs)',
|
||||
'<@(glfw3_static_libs)',
|
||||
'<@(glfw3_ldflags)',
|
||||
]
|
||||
}, {
|
||||
'other_ldflags': [ ]
|
||||
}]
|
||||
],
|
||||
},
|
||||
'actions': [
|
||||
{ 'action_name': 'mbgl-config',
|
||||
'inputs': [
|
||||
'../utils/mbgl-config/mbgl-config.template.sh',
|
||||
'../utils/mbgl-config/build.sh',
|
||||
],
|
||||
'outputs': [
|
||||
'<(install_prefix)/bin/mbgl-config',
|
||||
],
|
||||
'action': [
|
||||
'./utils/mbgl-config/build.sh',
|
||||
'<(install_prefix)',
|
||||
'<@(sqlite3_static_libs)',
|
||||
'<@(sqlite3_ldflags)',
|
||||
'<@(curl_ldflags)',
|
||||
'<@(png_ldflags)',
|
||||
'<@(other_ldflags)'
|
||||
]
|
||||
}
|
||||
'action': [
|
||||
'./utils/mbgl-config/build.sh',
|
||||
'<(install_prefix)',
|
||||
'<(PRODUCT_DIR)/libmbgl.a.ldflags',
|
||||
]
|
||||
},
|
||||
{ 'target_name': 'copy_version',
|
||||
'type': 'none',
|
||||
'hard_dependency': 1,
|
||||
'dependencies': [
|
||||
'install',
|
||||
],
|
||||
'copies': [
|
||||
{ 'files': [ '<(SHARED_INTERMEDIATE_DIR)/include/mbgl/util/version.hpp' ], 'destination': '<(install_prefix)/include/mbgl/util' },
|
||||
],
|
||||
}
|
||||
]
|
||||
}],
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
11
gyp/link.py
11
gyp/link.py
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import os
|
||||
from merge_static_libs import MergeLibs
|
||||
|
||||
args = sys.argv[1:]
|
||||
@@ -31,4 +32,14 @@ while i < l:
|
||||
|
||||
i += 1
|
||||
|
||||
flags.reverse()
|
||||
unique_flags = []
|
||||
for flag in flags:
|
||||
if flag not in unique_flags:
|
||||
unique_flags.append(flag)
|
||||
unique_flags.reverse()
|
||||
|
||||
with open(out_lib + '.ldflags', 'w+') as f:
|
||||
f.write(' '.join(unique_flags));
|
||||
|
||||
MergeLibs(in_libs, out_lib)
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
PREFIX=$1
|
||||
PLATFORM=$2
|
||||
shift
|
||||
shift
|
||||
LDFLAGS=$2
|
||||
|
||||
VARIABLES="#!/bin/bash
|
||||
|
||||
## variables
|
||||
|
||||
CONFIG_MBGL_PREFIX=$PREFIX
|
||||
CONFIG_MBGL_PLATFORM=$PLATFORM
|
||||
CONFIG_MBGL_LDFLAGS=\"$@\"
|
||||
CONFIG_MBGL_LDFLAGS=\"`cat $LDFLAGS`\"
|
||||
"
|
||||
|
||||
echo "$VARIABLES" | cat - utils/mbgl-config/mbgl-config.template.sh \
|
||||
|
||||
@@ -24,12 +24,6 @@ if test $# -eq 0; then
|
||||
usage 1
|
||||
fi
|
||||
|
||||
if [ ${CONFIG_MBGL_PLATFORM} == 'linux' ]; then
|
||||
LIBS="-Wl,--start-group -lmbgl-core -lmbgl-${CONFIG_MBGL_PLATFORM} -Wl,--end-group -lmbgl-headless"
|
||||
else
|
||||
LIBS="-lmbgl-core -lmbgl-${CONFIG_MBGL_PLATFORM} -lmbgl-headless"
|
||||
fi
|
||||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
esac
|
||||
@@ -49,7 +43,7 @@ while test $# -gt 0; do
|
||||
;;
|
||||
|
||||
--libs)
|
||||
echo -L${CONFIG_MBGL_PREFIX}/lib ${LIBS} ${CONFIG_MBGL_LDFLAGS}
|
||||
echo ${CONFIG_MBGL_PREFIX}/lib/libmbgl.a ${CONFIG_MBGL_LDFLAGS}
|
||||
;;
|
||||
|
||||
--includedir)
|
||||
|
||||
Reference in New Issue
Block a user