summaryrefslogtreecommitdiff
path: root/xmake/modules/package
diff options
context:
space:
mode:
authorruki <[email protected]>2019-04-27 00:37:26 +0800
committerruki <[email protected]>2019-04-26 21:44:37 +0800
commitaf03058084d45e4d1c437a2f43205cf69c2b93ec (patch)
treebc73231a9d4b04169228a2630396bc1d0ca7ad73 /xmake/modules/package
parent600fb4fab529ae55a44ccdfd6045046309db8f4f (diff)
rename path.sep
Diffstat (limited to 'xmake/modules/package')
-rw-r--r--xmake/modules/package/tools/autoconf.lua38
1 files changed, 5 insertions, 33 deletions
diff --git a/xmake/modules/package/tools/autoconf.lua b/xmake/modules/package/tools/autoconf.lua
index c97ba705b..1ff42da48 100644
--- a/xmake/modules/package/tools/autoconf.lua
+++ b/xmake/modules/package/tools/autoconf.lua
@@ -68,27 +68,12 @@ function _get_configs(package, configs)
return configs
end
--- enter environments
-function _enter_envs(package, opt)
+-- get the build environments
+function _get_build_envs(package, opt)
+ -- TODO construct environments
-- get old environments
- local envs = {}
- envs.CC = os.getenv("CC")
- envs.AS = os.getenv("AS")
- envs.AR = os.getenv("AR")
- envs.LD = os.getenv("LD")
- envs.CPP = os.getenv("CPP")
- envs.LDSHARED = os.getenv("LDSHARED")
- envs.RANLIB = os.getenv("RANLIB")
- envs.CFLAGS = os.getenv("CFLAGS")
- envs.CXXFLAGS = os.getenv("CXXFLAGS")
- envs.ASFLAGS = os.getenv("ASFLAGS")
- envs.LDFLAGS = os.getenv("LDFLAGS")
- envs.ARFLAGS = os.getenv("ARFLAGS")
- envs.SHFLAGS = os.getenv("SHFLAGS")
- envs.TOOLCHAIN = os.getenv("TOOLCHAIN")
- envs.ACLOCAL_PATH = os.getenv("ACLOCAL_PATH")
- envs.PKG_CONFIG_PATH = os.getenv("PKG_CONFIG_PATH")
+ local envs = {}
-- set new environments
if package:is_plat(os.host()) then
@@ -127,13 +112,6 @@ function _enter_envs(package, opt)
return envs
end
--- leave environments
-function _leave_envs(package, envs)
- for k, v in pairs(envs) do
- os.setenv(k, v)
- end
-end
-
-- configure package
function configure(package, configs, opt)
@@ -162,14 +140,8 @@ function configure(package, configs, opt)
end
end
- -- enter environments
- local envs = _enter_envs(package, opt)
-
-- do configure
- os.vrunv("./configure", argv)
-
- -- leave environments
- _leave_envs(package, envs)
+ os.vrunv("./configure", argv, {envs = _get_build_envs(package, opt)})
end
-- install package