Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix package configure flags

  • Loading branch information...
commit 32d3668bc53954dba24f75d9670ea3fb837633d0 1 parent 98c15c6
Michal Papis mpapis authored
Showing with 30 additions and 9 deletions.
  1. +30 −9 core/ext/shell/package/functions
39 core/ext/shell/package/functions
View
@@ -1,5 +1,11 @@
#!/bin/sh
+package_initialize()
+{
+ declare -a package_dependencies
+ declare -a configure_flags
+}
+
package_error()
{
local _message="${1:-}" _log="${2:-}"
@@ -94,6 +100,24 @@ package_definition()
done
}
+package_configure_flags()
+{
+ local _flag
+ for _flag in "$@"
+ do
+ string_contains "${configure_flags[*]}" "${_flag}" ||
+ configure_flags+=( "${_flag}" )
+ done
+}
+
+package_configure_flag_add_key()
+{
+ local _flag=$1 _value=$2
+ string_contains_key "${configure_flags[*]}" "${_flag}" ||
+ configure_flags+=( "${_flag}=${_value}" )
+}
+
+
package_cli()
{
local _ignored_args=() _package_args=( $@ ) _token
@@ -158,12 +182,12 @@ package_cli()
force_flag=1
;;
static)
- configure_flags+=( --static )
+ package_configure_flags --static
static_flag=1
;;
shared)
shared_flag=1
- configure_flags+=( --enable-shared )
+ package_configure_flags --enable-shared
;;
licence)
extension_license
@@ -174,8 +198,7 @@ package_cli()
succeed
;;
--with*|--enable*|--disable*)
- string_contains "${configure_flags[*]}" "${_token}" ||
- configure_flags+=( "${_token}" )
+ package_configure_flags "${_token}"
;;
*)
_ignored_args+=("${_token}")
@@ -208,9 +231,6 @@ package_init()
;;
esac
- declare -a package_dependencies
- declare -a configure_flags
-
if command_exists "${package_name}_initialize"
then
string_contains "${FUNCNAME[*]}" "${package_name}_initialize" ||
@@ -256,7 +276,7 @@ package_init()
"${install_base_path:="${packages_path}/versions/${package_name}"}" \
"${install_path:="${install_base_path}/${package_version}"}"
- configure_flags+=( --prefix="${install_path}" )
+ package_configure_flag_add_key --prefix "${install_path}"
# This check should only happen in places that require a version...
#[[ -n "${package_version}" ]] ||
@@ -514,7 +534,8 @@ package_configure()
else
export PREFIX="${install_base_path}/${package_version}"
- _command="./configure ${configure_flags[@]:-"--prefix=${install_path}"}"
+ package_configure_flag_add_key --prefix "${install_path}"
+ _command="./configure ${configure_flags[*]}"
file_is_executable "configure" || return 0
fi
Please sign in to comment.
Something went wrong with that request. Please try again.