summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--README.EXT52
-rw-r--r--README.EXT.ja58
-rw-r--r--lib/mkmf.rb6
4 files changed, 122 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 8c5e43d96e..1539a61230 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:15:44 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_engine.c (ossl_engine_s_load): should return
diff --git a/README.EXT b/README.EXT
index e5c4203832..5f2427747f 100644
--- a/README.EXT
+++ b/README.EXT
@@ -1005,6 +1005,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.
@@ -1021,20 +1026,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])
@@ -1044,6 +1090,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 7a4cb5df2a..f5fdbd2613 100644
--- a/README.EXT.ja
+++ b/README.EXT.ja
@@ -1123,6 +1123,12 @@ Appendix C. extconf.rbで使える関数たち
extconf.rbの中では利用可能なコンパイル条件チェックの関数は以
下の通りである.
+have_macro(macro, headers)
+
+ ヘッダファイルheaderをインクルードしてマクロmacroが定義さ
+ れているかどうかチェックする.マクロが定義されている時true
+ を返す.
+
have_library(lib, func)
関数funcを定義しているライブラリlibの存在をチェックする.
@@ -1140,21 +1146,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])
@@ -1165,6 +1217,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 2222eb5705..3c4d5f54ac 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']