mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/extmk.rb.in, lib/mkmf.rb: (dir_config) do not add the
specified include directory if already included in $CPPFLAGS. * ext/extmk.rb.in, lib/mkmf.rb: (dir_config) return a more useful value, [include_dir, lib_dir]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
eccb4d0210
commit
4dfc822aec
3 changed files with 54 additions and 55 deletions
|
@ -1,3 +1,11 @@
|
|||
Tue Apr 24 15:18:49 2001 Akinori MUSHA <knu@iDaemons.org>
|
||||
|
||||
* ext/extmk.rb.in, lib/mkmf.rb: (dir_config) do not add the
|
||||
specified include directory if already included in $CPPFLAGS.
|
||||
|
||||
* ext/extmk.rb.in, lib/mkmf.rb: (dir_config) return a more useful
|
||||
value, [include_dir, lib_dir].
|
||||
|
||||
Sun Apr 22 17:44:37 2001 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||
|
||||
* configure.in: add -mieee to CFLAGS on Linux/Alpha
|
||||
|
|
|
@ -338,21 +338,27 @@ def dir_config(target, idefault=nil, ldefault=nil)
|
|||
idefault = default + "/include"
|
||||
ldefault = default + "/lib"
|
||||
end
|
||||
dir = with_config("%s-dir"%target, default)
|
||||
if dir
|
||||
idir = " -I"+dir+"/include"
|
||||
ldir = dir+"/lib"
|
||||
end
|
||||
unless idir
|
||||
dir = with_config("%s-include"%target, idefault)
|
||||
idir = " -I"+dir if dir
|
||||
end
|
||||
unless ldir
|
||||
ldir = with_config("%s-lib"%target, ldefault)
|
||||
|
||||
dir = with_config(target + "-dir", default)
|
||||
|
||||
idir, ldir = if dir then [
|
||||
dir + "/include",
|
||||
dir + "/lib"
|
||||
] else [
|
||||
with_config(target + "-include", idefault),
|
||||
with_config(target + "-lib", ldefault)
|
||||
] end
|
||||
|
||||
if idir
|
||||
idircflag = "-I" + idir
|
||||
$CPPFLAGS += " " + idircflag unless $CPPFLAGS.split.include?(idircflag)
|
||||
end
|
||||
|
||||
$CPPFLAGS += idir if idir
|
||||
$LIBPATH |= [ldir] if ldir
|
||||
if ldir
|
||||
$LIBPATH << ldir unless $LIBPATH.include?(ldir)
|
||||
end
|
||||
|
||||
[idir, ldir]
|
||||
end
|
||||
|
||||
def create_makefile(target)
|
||||
|
@ -609,23 +615,12 @@ def extmake(target)
|
|||
$local_flags = "-link /INCREMENTAL:no /EXPORT:Init_$(TARGET)"
|
||||
end
|
||||
$LOCAL_LIBS = "" # to be assigned in extconf.rb
|
||||
dir = with_config("opt-dir")
|
||||
if dir
|
||||
idir = "-I"+dir+"/include"
|
||||
ldir = dir+"/lib"
|
||||
end
|
||||
unless idir
|
||||
dir = with_config("opt-include")
|
||||
idir = "-I"+dir if dir
|
||||
end
|
||||
unless ldir
|
||||
ldir = with_config("opt-lib")
|
||||
end
|
||||
|
||||
$CFLAGS = ""
|
||||
$CPPFLAGS = idir || ""
|
||||
$CPPFLAGS = ""
|
||||
$LDFLAGS = ""
|
||||
$LIBPATH = [ldir].compact
|
||||
$LIBPATH = []
|
||||
|
||||
dir_config("opt")
|
||||
|
||||
begin
|
||||
Dir.mkdir target unless File.directory?(target)
|
||||
|
|
50
lib/mkmf.rb
50
lib/mkmf.rb
|
@ -336,21 +336,27 @@ def dir_config(target, idefault=nil, ldefault=nil)
|
|||
idefault = default + "/include"
|
||||
ldefault = default + "/lib"
|
||||
end
|
||||
dir = with_config("%s-dir"%target, default)
|
||||
if dir
|
||||
idir = " -I"+dir+"/include"
|
||||
ldir = dir+"/lib"
|
||||
end
|
||||
unless idir
|
||||
dir = with_config("%s-include"%target, idefault)
|
||||
idir = " -I"+dir if dir
|
||||
end
|
||||
unless ldir
|
||||
ldir = with_config("%s-lib"%target, ldefault)
|
||||
|
||||
dir = with_config(target + "-dir", default)
|
||||
|
||||
idir, ldir = if dir then [
|
||||
dir + "/include",
|
||||
dir + "/lib"
|
||||
] else [
|
||||
with_config(target + "-include", idefault),
|
||||
with_config(target + "-lib", ldefault)
|
||||
] end
|
||||
|
||||
if idir
|
||||
idircflag = "-I" + idir
|
||||
$CPPFLAGS += " " + idircflag unless $CPPFLAGS.split.include?(idircflag)
|
||||
end
|
||||
|
||||
$CPPFLAGS += idir if idir
|
||||
$LIBPATH |= [ldir] if ldir
|
||||
if ldir
|
||||
$LIBPATH << ldir unless $LIBPATH.include?(ldir)
|
||||
end
|
||||
|
||||
[idir, ldir]
|
||||
end
|
||||
|
||||
def create_makefile(target, srcdir = File.dirname($0))
|
||||
|
@ -581,20 +587,10 @@ $LOCAL_LIBS = ""
|
|||
$defs = []
|
||||
|
||||
$make = with_config("make-prog", ENV["MAKE"] || "make")
|
||||
dir = with_config("opt-dir")
|
||||
if dir
|
||||
idir = "-I"+dir+"/include"
|
||||
ldir = dir+"/lib"
|
||||
end
|
||||
unless idir
|
||||
dir = with_config("opt-include")
|
||||
idir = "-I"+dir if dir
|
||||
end
|
||||
unless ldir
|
||||
ldir = with_config("opt-lib")
|
||||
end
|
||||
|
||||
$CFLAGS = with_config("cflags", "")
|
||||
$CPPFLAGS = [with_config("cppflags", ""), idir].compact.join(" ")
|
||||
$CPPFLAGS = with_config("cppflags", "")
|
||||
$LDFLAGS = with_config("ldflags", "")
|
||||
$LIBPATH = [ldir].compact
|
||||
$LIBPATH = []
|
||||
|
||||
dir_config("opt")
|
||||
|
|
Loading…
Reference in a new issue