summaryrefslogtreecommitdiff
path: root/lib/mkmf.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-08-24 06:21:43 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-08-24 06:21:43 +0000
commitdea6ce41b404df35944ab6063c614497b1b2984e (patch)
tree154318e243567b27e3f8fae8fd301971d2d68be9 /lib/mkmf.rb
parenta85a9d31db29e366cce9efb9c3fab24e750ed498 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/mkmf.rb')
-rw-r--r--lib/mkmf.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 41ffe4c..83afac6 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -313,18 +313,23 @@ def create_header()
end
end
-def dir_config(target)
- dir = with_config("%s-dir"%target)
+def dir_config(target, idefault=nil, ldefault=nil)
+ if idefault && ldefault == nil
+ default = idefault
+ idefault = default + "/include"
+ ldefault = default + "/lib"
+ end
+ dir = with_config("%s-dir"%target, default)
if dir
idir = " -I"+dir+"/include"
ldir = " -L"+dir+"/lib"
end
unless idir
- dir = with_config("%s-include"%target)
+ dir = with_config("%s-include"%target, idefault)
idir = " -I"+dir if dir
end
unless ldir
- dir = with_config("%s-lib"%target)
+ dir = with_config("%s-lib"%target, ldefault)
ldir = " -L"+dir if dir
end
@@ -386,7 +391,7 @@ hdrdir = #{$hdrdir}
CC = #{CONFIG["CC"]}
CFLAGS = #{CONFIG["CCDLFLAGS"]} #{CFLAGS} #{$CFLAGS}
- CPPFLAGS = -I$(hdrdir) -I#{CONFIG["includedir"]} #{$defs.join(" ")} #{CONFIG["CPPFLAGS"]}
+CPPFLAGS = -I$(hdrdir) -I#{CONFIG["includedir"]} #{$defs.join(" ")} #{CONFIG["CPPFLAGS"]}
CXXFLAGS = $(CFLAGS)
DLDFLAGS = #{$DLDFLAGS} #{$LDFLAGS}
LDSHARED = #{CONFIG["LDSHARED"]} #{defflag}