From b9294f226b87808c1c1b2b33d3fc27a11a1a7a21 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 19 Nov 2013 14:38:52 +0000 Subject: configure.in: --with-os-version-style * configure.in (--with-os-version-style): option to transform target OS version string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- configure.in | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 42633ca24d..a4080e1a00 100644 --- a/configure.in +++ b/configure.in @@ -242,6 +242,29 @@ test x"$target_alias" = x && target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'` ac_install_sh='' # unusable for extension libraries. +AS_CASE($target_os, + [darwin*], [os_version_style=major+0], + [os_version_style=full]) +AC_ARG_WITH(os-version-style, + AS_HELP_STRING([--with-os-version-style=TYPE], + [OS version number for target and target_os [[full]]] + [(full|teeny|minor+0|minor|major+0|major|none)]), + [os_version_style=$withval]) +os_version_style_transform= +AS_CASE("${os_version_style}", + [full|teeny], [], + [minor+0], [os_version_style_transform=['s/\([0-9]\.[0-9][0-9]*\)\.[0-9][.0-9]*$/\1.0/']], + [minor], [os_version_style_transform=['s/\([0-9]\.[0-9][0-9]*\)\.[0-9][.0-9]*$/\1/']], + [major+0], [os_version_style_transform=['s/\([0-9]\)\.[0-9][.0-9]*$/\1.0/']], + [major], [os_version_style_transform=['s/\([0-9]\)\.[0-9][.0-9]*$/\1/']], + [none], [os_version_style_transform=['s/[0-9]\.[0-9][.0-9]*$//']], + [AC_MSG_ERROR(unknown --with-os-version-style: $withval)]) +AS_IF([test -z "$target_alias" -a -n "$os_version_style_transform"], + [ + target=`echo ${target} | sed "$os_version_style_transform"` + target_os=`echo ${target_os} | sed "$os_version_style_transform"` + ]) + AC_DEFUN([RUBY_APPEND_OPTION], [# RUBY_APPEND_OPTION($1, $2) AS_CASE([" [$]{$1-} "], -- cgit v1.2.3