mklove update

This commit is contained in:
Magnus Edenhill 2014-03-21 13:58:52 +07:00
parent 98224a24df
commit 91152acebb
2 changed files with 20 additions and 2 deletions

2
configure vendored
View File

@ -1,6 +1,8 @@
#!/bin/bash
#
MKL_CONFIGURE_ARGS="$0 $*"
# Load base module
source mklove/modules/configure.base

View File

@ -435,6 +435,10 @@ function mkl_generate {
done
mkl_write_mk "# Config variables"
mkl_write_mk "#"
mkl_write_mk "# Generated by:"
mkl_write_mk "# $MKL_CONFIGURE_ARGS"
mkl_write_mk ""
local n=
for n in $MKL_MKVARS ; do
# Some special variables should be prefixable by the caller, so
@ -633,6 +637,17 @@ function mkl_def {
}
# Render a string (e.g., evaluate its $varrefs)
# Arguments:
# string
function mkl_render {
if [[ $* == *\$* ]]; then
eval "echo $*"
else
echo "$*"
fi
}
# Escape a string so that it becomes suitable for being an env variable.
# This is a destructive operation and the original string cannot be restored.
function mkl_env_esc {
@ -933,12 +948,13 @@ function mkl_lib_check {
# Check for library with pkg-config
# Automatically sets CFLAGS and LIBS from pkg-config information.
# Arguments:
# config name
# define name
# action (fail|disable|ignore)
function mkl_pkg_config_check {
mkl_check_begin "$1" "$2" "$3" "$1 (by pkg-config)" && return $?
mkl_check_begin "$1" "$2" "no-cache" "$1 (by pkg-config)" && return $?
local cflags=
local cmd="${PKG_CONFIG} --short-errors --cflags $1"
@ -1388,7 +1404,7 @@ function mkl_option {
if [[ $optval = "PATH" ]]; then
# PATH argument: make it an absolute path.
# Only set the make variable (not config.h)
eval "function opt_$safeopt { $setmkvar $varname \"\$(mkl_abspath \$1)\"; }"
eval "function opt_$safeopt { $setmkvar $varname \"\$(mkl_abspath \$(mkl_render \$1))\"; }"
else
# Standard argument: simply set the value
if [[ -z "$6" ]]; then