summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-31 13:24:27 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-31 13:24:27 +0000
commit0f52655b0685e67ad1b4292b52f3194870e804fa (patch)
treefb99aa2a2765656ccc844b44cf57087803ce4a26
parent78711606b3c5e3eec4906ccc9992d7bf72cfe14e (diff)
* lib/mkmf.rb (SRC_EXT): exclude just case different suffixes on case
insensitive file system platforms. * README.EXT, README.EXT.ja (Appendix C): utility functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog11
-rw-r--r--README.EXT52
-rw-r--r--README.EXT.ja58
-rw-r--r--lib/mkmf.rb6
4 files changed, 124 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 018d103423..234211e75a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Thu Mar 31 22:23:51 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (SRC_EXT): exclude just case different suffixes on case
+ insensitive file system platforms.
+
+ * README.EXT, README.EXT.ja (Appendix C): utility functions.
+
Thu Mar 31 14:08:43 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_engine.c (ossl_engine_s_load): should return
@@ -6,13 +13,13 @@ Thu Mar 31 14:08:43 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
Thu Mar 31 11:07:50 2005 Kouhei Sutou <kou@cozmixng.org>
* lib/rss/parser.rb: @@setter -> @@setters.
-
+
* lib/rss/parser.rb
(RSS::BaseListener.register_uri)
(RSS::BaseListener.uri_registered?)
(RSS::BaseListener.install_get_text_element):
swapped the first argument and the second argument.
-
+
* lib/rss/taxonomy.rb: swapped the first argument and the second
argument for RSS::BaseListener.install_get_text_element.
* lib/rss/image.rb: ditto.
diff --git a/README.EXT b/README.EXT
index aa9c27b51b..d47973749b 100644
--- a/README.EXT
+++ b/README.EXT
@@ -1031,6 +1031,11 @@ Appendix C. Functions Available in extconf.rb
These functions are available in extconf.rb:
+ have_macro(macro, headers)
+
+Checks whether macro is defined with header. Returns true if the macro
+is defined.
+
have_library(lib, func)
Checks whether the library exists, containing the specified function.
@@ -1047,20 +1052,61 @@ Checks whether func exists with header. Returns true if the function
exists. To check functions in an additional library, you need to
check that library first using have_library().
+ have_var(var, header)
+
+Checks whether var exists with header. Returns true if the variable
+exists. To check variables in an additional library, you need to
+check that library first using have_library().
+
have_header(header)
Checks whether header exists. Returns true if the header file exists.
+ find_header(header, path...)
+
+Checks whether header exists in path. Returns true if the header file
+exists.
+
+ have_struct_member(type, member, header)
+
+Checks whether type has member with header. Returns true if the type
+is defined and has the member.
+
+ have_type(type, header, opt)
+
+Checks whether type is defined with header. Returns true if the type
+is defined.
+
+ check_sizeof(type, header)
+
+Checks the size of type in char with header. Returns the size if the
+type is defined, otherwise nil.
+
create_makefile(target)
Generates the Makefile for the extension library. If you don't invoke
this method, the compilation will not be done.
+ find_executable(bin, path)
+
+Finds command in path, which is File::PATH_SEPARATOR-separated list of
+directories. If path is nil or omitted, environment varialbe PATH
+will be used. Returns the path name of the command if it is found,
+otherwise nil.
+
with_config(withval[, default=nil])
Parses the command line options and returns the value specified by
--with-<withval>.
+ enable_config(config, *defaults)
+ disable_config(config, *defaults)
+
+Parses the command line options for boolean. Returns true if
+--enable-<config> is given, or false if --disable-<config> is given.
+Otherwise, yields defaults to the given block and returns the result
+if it is called with a block, or returns defaults.
+
dir_config(target[, default_dir])
dir_config(target[, default_include, default_lib])
@@ -1070,6 +1116,12 @@ to $CFLAGS and/or $LDFLAGS. --with-<target>-dir=/path is equivalent to
--with-<target>-include=/path/include --with-<target>-lib=/path/lib.
Returns an array of the added directories ([include_dir, lib_dir]).
+ pkg_config(pkg)
+
+Obtains the information of pkg by pkg-config command. The actual
+command name can be overriden by --with-pkg-config command line
+option.
+
/*
* Local variables:
* fill-column: 70
diff --git a/README.EXT.ja b/README.EXT.ja
index 62ed8a3d98..c7824698bd 100644
--- a/README.EXT.ja
+++ b/README.EXT.ja
@@ -1149,6 +1149,12 @@ Appendix C. extconf.rbで使える関数たち
extconf.rbの中では利用可能なコンパイル条件チェックの関数は以
下の通りである.
+have_macro(macro, headers)
+
+ ヘッダファイルheaderをインクルードしてマクロmacroが定義さ
+ れているかどうかチェックする.マクロが定義されている時true
+ を返す.
+
have_library(lib, func)
関数funcを定義しているライブラリlibの存在をチェックする.
@@ -1166,21 +1172,67 @@ have_func(func, header)
る時には先にhave_libraryでそのライブラリをチェックしておく
事.関数が存在する時trueを返す.
+have_var(var, header)
+
+ ヘッダファイルheaderをインクルードして変数varの存在をチェッ
+ クする.varが標準ではリンクされないライブラリ内のものであ
+ る時には先にhave_libraryでそのライブラリをチェックしておく
+ 事.変数が存在する時trueを返す.
+
have_header(header)
ヘッダファイルの存在をチェックする.ヘッダファイルが存在す
る時trueを返す.
+find_header(header, path...)
+
+ ヘッダファイルheaderの存在を -Ipath を追加しながらチェック
+ する.ヘッダファイルが見付かった時,trueを返す.
+
+have_struct_member(type, member, header)
+
+ ヘッダファイルheaderをインクルードして型typeにメンバmember
+ が存在するかをチェックする.typeが定義されていて,memberを
+ 持つする時trueを返す.
+
+have_type(type, header, opt)
+
+ ヘッダファイルheaderをインクルードして型typeが存在するかを
+ チェックする.typeが定義されている時trueを返す.
+
+check_sizeof(type, header)
+
+ ヘッダファイルheaderをインクルードして型typeのchar単位サイ
+ ズを調べる.typeが定義されている時そのサイズを返す.定義さ
+ れていないときはnilを返す.
+
create_makefile(target)
拡張ライブラリ用のMakefileを生成する.この関数を呼ばなけれ
ばそのライブラリはコンパイルされない.targetはモジュール名
を表す.
+find_executable(command, path)
+
+ コマンドcommandをFile::PATH_SEPARATORで区切られたパス名の
+ リストpathから探す.pathがnilまたは省略された場合は,環境
+ 変数PATHの値を使用する.実行可能なコマンドが見つかった場合
+ はパスを含むファイル名,見つからなかった場合はnilを返す.
+
with_config(withval[, default=nil])
コマンドライン上の--with-<withval>で指定されたオプション値を得る.
+enable_config(config, *defaults)
+disable_config(config, *defaults)
+
+ コマンドライン上の--enable-<config>または
+ --disable-<config>で指定された真偽値を得る.
+ --enable-<config>が指定されていた場合はtrue,
+ --disable-<config>が指定されていた場合はfalseを返す.
+ どちらも指定されていない場合は,ブロックつきで呼び出されている場合は
+ *defaultsをyieldした結果,ブロックなしなら*defaultsを返す.
+
dir_config(target[, default_dir])
dir_config(target[, default_include, default_lib])
@@ -1191,6 +1243,12 @@ dir_config(target[, default_include, default_lib])
と等価である.追加された include ディレクトリと lib ディレクトリの
配列を返す. ([include_dir, lib_dir])
+pkg_config(pkg)
+
+ pkg-configコマンドからパッケージpkgの情報を得る.
+ pkg-configの実際のコマンド名は,--with-pkg-configコマンド
+ ラインオプションで指定可能.
+
/*
* Local variables:
* fill-column: 60
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 82a10535a2..0eb3888b39 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -8,7 +8,10 @@ require 'shellwords'
CONFIG = Config::MAKEFILE_CONFIG
ORIG_LIBPATH = ENV['LIB']
-SRC_EXT = ["c", "cc", "m", "cxx", "cpp", "C"]
+SRC_EXT = %w[c cc m cxx cpp]
+if /mswin|bccwin|mingw|msdosdjgpp|human|os2/ !~ CONFIG['build_os']
+ SRC_EXT.concat(%w[C])
+end
$static = $config_h = nil
unless defined? $configure_args
@@ -1164,6 +1167,7 @@ def init_mkmf(config = CONFIG)
$INSTALLFILES = nil
$objs = nil
+ $srcs = nil
$libs = ""
if $enable_shared or Config.expand(config["LIBRUBY"].dup) != Config.expand(config["LIBRUBY_A"].dup)
$LIBRUBYARG = config['LIBRUBYARG']