mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* README.EXT, README.EXT.ja: remove MANIFEST stuff.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									49fb289ea1
								
							
						
					
					
						commit
						0aeea1ad38
					
				
					 3 changed files with 18 additions and 58 deletions
				
			
		| 
						 | 
				
			
			@ -7,6 +7,8 @@ Mon Nov  1 13:59:28 2004  WATANABE Hirofumi  <eban@ruby-lang.org>
 | 
			
		|||
 | 
			
		||||
	* MANIFEST, ext/**/MANIFEST: removed.
 | 
			
		||||
 | 
			
		||||
	* README.EXT, README.EXT.ja: remove MANIFEST stuff.
 | 
			
		||||
 | 
			
		||||
Mon Nov  1 11:52:18 2004  NAKAMURA Usaku  <usa@ruby-lang.org>
 | 
			
		||||
 | 
			
		||||
	* io.c (pipe_open): avoid conflict of variable name. [ruby-dev:24662]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										33
									
								
								README.EXT
									
										
									
									
									
								
							
							
						
						
									
										33
									
								
								README.EXT
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -460,19 +460,11 @@ directory in the Ruby's source tree.
 | 
			
		|||
 | 
			
		||||
Make a directory for the extension library under ext directory.
 | 
			
		||||
 | 
			
		||||
(2) create MANIFEST file
 | 
			
		||||
 | 
			
		||||
  % cd ext/dbm
 | 
			
		||||
  % touch MANIFEST
 | 
			
		||||
 | 
			
		||||
There should be MANIFEST file in the directory for the extension
 | 
			
		||||
library.  Make an empty file for now.
 | 
			
		||||
 | 
			
		||||
(3) design the library
 | 
			
		||||
(2) design the library
 | 
			
		||||
 | 
			
		||||
You need to design the library features, before making it.
 | 
			
		||||
 | 
			
		||||
(4) write C code.
 | 
			
		||||
(3) write C code.
 | 
			
		||||
 | 
			
		||||
You need to write C code for your extension library.  If your library
 | 
			
		||||
has only one source file, choosing ``LIBRARY.c'' as a file name is
 | 
			
		||||
| 
						 | 
				
			
			@ -600,7 +592,7 @@ are not exported to the Ruby world.  You need to protect them by
 | 
			
		|||
 | 
			
		||||
  void rb_global_variable(VALUE *var)
 | 
			
		||||
 | 
			
		||||
(5) prepare extconf.rb
 | 
			
		||||
(4) prepare extconf.rb
 | 
			
		||||
 | 
			
		||||
If the file named extconf.rb exists, it will be executed to generate
 | 
			
		||||
Makefile.  If not, the compilation scheme will try to generate Makefile
 | 
			
		||||
| 
						 | 
				
			
			@ -628,7 +620,7 @@ If a compilation condition is not fulfilled, you should not call
 | 
			
		|||
``create_makefile''.  The Makefile will not generated, compilation will
 | 
			
		||||
not be done.
 | 
			
		||||
 | 
			
		||||
(6) prepare depend (optional)
 | 
			
		||||
(5) prepare depend (optional)
 | 
			
		||||
 | 
			
		||||
If the file named depend exists, Makefile will include that file to
 | 
			
		||||
check dependencies.  You can make this file by invoking
 | 
			
		||||
| 
						 | 
				
			
			@ -637,16 +629,7 @@ check dependencies.  You can make this file by invoking
 | 
			
		|||
 | 
			
		||||
It's no harm.  Prepare it.
 | 
			
		||||
 | 
			
		||||
(7) put file names into MANIFEST (optional)
 | 
			
		||||
 | 
			
		||||
  % find * -type f -print > MANIFEST
 | 
			
		||||
  % vi MANIFEST
 | 
			
		||||
 | 
			
		||||
Append file names into MANIFEST.  The compilation scheme requires
 | 
			
		||||
MANIFEST only to exist, but it's better to take this step in order
 | 
			
		||||
to distinguish which files are required.
 | 
			
		||||
 | 
			
		||||
(8) generate Makefile
 | 
			
		||||
(6) generate Makefile
 | 
			
		||||
 | 
			
		||||
Try generating the Makefile by:
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -656,7 +639,7 @@ You don't need this step if you put the extension library under the ext
 | 
			
		|||
directory of the ruby source tree.  In that case, compilation of the
 | 
			
		||||
interpreter will do this step for you.
 | 
			
		||||
 | 
			
		||||
(9) make
 | 
			
		||||
(7) make
 | 
			
		||||
 | 
			
		||||
Type
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -665,13 +648,13 @@ Type
 | 
			
		|||
to compile your extension.  You don't need this step either if you have
 | 
			
		||||
put extension library under the ext directory of the ruby source tree.
 | 
			
		||||
 | 
			
		||||
(9) debug
 | 
			
		||||
(8) debug
 | 
			
		||||
 | 
			
		||||
You may need to rb_debug the extension.  Extensions can be linked
 | 
			
		||||
statically by the adding directory name in the ext/Setup file so that
 | 
			
		||||
you can inspect the extension with the debugger.
 | 
			
		||||
 | 
			
		||||
(10) done, now you have the extension library
 | 
			
		||||
(9) done, now you have the extension library
 | 
			
		||||
 | 
			
		||||
You can do anything you want with your library.  The author of Ruby
 | 
			
		||||
will not claim any restrictions on your code depending on the Ruby API.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -542,28 +542,14 @@ Ruby 1.1
 | 
			
		|||
ライブラリ用のディレクトリを作る必要があります.名前は適当に
 | 
			
		||||
選んで構いません.
 | 
			
		||||
 | 
			
		||||
(2) MANIFESTファイルを作る
 | 
			
		||||
 | 
			
		||||
  % cd ext/dbm
 | 
			
		||||
  % touch MANIFEST
 | 
			
		||||
 | 
			
		||||
拡張ライブラリのディレクトリの下にはMANIFESTというファイルが
 | 
			
		||||
必要なので,とりあえず空のファイルを作っておきます.後でこの
 | 
			
		||||
ファイルには必要なファイル一覧が入ることになります.
 | 
			
		||||
 | 
			
		||||
MANIFESTというファイルは,静的リンクのmakeの時にディレクトリ
 | 
			
		||||
が拡張ライブラリを含んでいるかどうか判定するために使われれて
 | 
			
		||||
います.ダイナミックライブラリを作る場合には必ずしも必要では
 | 
			
		||||
ありません.
 | 
			
		||||
 | 
			
		||||
(3) 設計する
 | 
			
		||||
(2) 設計する
 | 
			
		||||
 | 
			
		||||
まあ,当然なんですけど,どういう機能を実現するかどうかまず設
 | 
			
		||||
計する必要があります.どんなクラスをつくるか,そのクラスには
 | 
			
		||||
どんなメソッドがあるか,クラスが提供する定数などについて設計
 | 
			
		||||
します.
 | 
			
		||||
 | 
			
		||||
(4) Cコードを書く
 | 
			
		||||
(3) Cコードを書く
 | 
			
		||||
 | 
			
		||||
拡張ライブラリ本体となるC言語のソースを書きます.C言語のソー
 | 
			
		||||
スがひとつの時には「ライブラリ名.c」を選ぶと良いでしょう.C
 | 
			
		||||
| 
						 | 
				
			
			@ -706,7 +692,7 @@ C
 | 
			
		|||
 | 
			
		||||
  void rb_global_variable(VALUE *var)
 | 
			
		||||
 | 
			
		||||
(5) extconf.rbを用意する
 | 
			
		||||
(4) extconf.rbを用意する
 | 
			
		||||
 | 
			
		||||
Makefileを作る場合の雛型になるextconf.rbというファイルを作り
 | 
			
		||||
ます.extconf.rbはライブラリのコンパイルに必要な条件のチェッ
 | 
			
		||||
| 
						 | 
				
			
			@ -731,7 +717,7 @@ Makefile
 | 
			
		|||
パイルしない時にはcreate_makefileを呼ばなければMakefileは生
 | 
			
		||||
成されず,コンパイルも行われません.
 | 
			
		||||
 | 
			
		||||
(6) dependを用意する
 | 
			
		||||
(5) dependを用意する
 | 
			
		||||
 | 
			
		||||
もし,ディレクトリにdependというファイルが存在すれば,
 | 
			
		||||
Makefileが依存関係をチェックしてくれます.
 | 
			
		||||
| 
						 | 
				
			
			@ -740,18 +726,7 @@ Makefile
 | 
			
		|||
 | 
			
		||||
などで作ることが出来ます.あって損は無いでしょう.
 | 
			
		||||
 | 
			
		||||
(7) MANIFESTファイルにファイル名を入れる
 | 
			
		||||
 | 
			
		||||
  % find * -type f -print > MANIFEST
 | 
			
		||||
  % vi MANIFEST
 | 
			
		||||
 | 
			
		||||
*.o, *~など不必要なファイル以外はMANIFESTに追加しておきます.
 | 
			
		||||
make時にはMANIFESTの内容は参照しませんので,空のままでも問題
 | 
			
		||||
は起きませんが,パッケージングの時に参照することがあるのと,
 | 
			
		||||
必要なファイルを区別できるので,用意しておいた方が良いでしょ
 | 
			
		||||
う.
 | 
			
		||||
 | 
			
		||||
(8) Makefileを生成する
 | 
			
		||||
(6) Makefileを生成する
 | 
			
		||||
 | 
			
		||||
Makefileを実際に生成するためには
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -767,7 +742,7 @@ Makefile
 | 
			
		|||
ディレクトリをext以下に用意した場合にはRuby全体のmakeの時に
 | 
			
		||||
自動的にMakefileが生成されますので,このステップは不要です.
 | 
			
		||||
 | 
			
		||||
(9) makeする
 | 
			
		||||
(7) makeする
 | 
			
		||||
 | 
			
		||||
動的リンクライブラリを生成する場合にはその場でmakeしてくださ
 | 
			
		||||
い.必要であれば make install でインストールされます.
 | 
			
		||||
| 
						 | 
				
			
			@ -785,13 +760,13 @@ extconf.rb
 | 
			
		|||
を作り,そこに 拡張子 .rb のファイルを置いておけば同時にイン
 | 
			
		||||
ストールされます.
 | 
			
		||||
 | 
			
		||||
(10) デバッグ
 | 
			
		||||
(8) デバッグ
 | 
			
		||||
 | 
			
		||||
まあ,デバッグしないと動かないでしょうね.ext/Setupにディレ
 | 
			
		||||
クトリ名を書くと静的にリンクするのでデバッガが使えるようにな
 | 
			
		||||
ります.その分コンパイルが遅くなりますけど.
 | 
			
		||||
 | 
			
		||||
(11) できあがり
 | 
			
		||||
(9) できあがり
 | 
			
		||||
 | 
			
		||||
後はこっそり使うなり,広く公開するなり,売るなり,ご自由にお
 | 
			
		||||
使いください.Rubyの作者は拡張ライブラリに関して一切の権利を
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue