From marcelotto at gmx.de Fri Feb 1 02:23:36 2008 From: marcelotto at gmx.de (Marcel Otto) Date: Fri, 01 Feb 2008 08:23:36 +0100 Subject: [Mkrf-users] Mkrf and other compilers than gcc Message-ID: <47A2C8F7.6070108@gmx.de> Hi, first thanks for writing this very useful piece of software. I'm currently using it for building an extension under Linux and Windows. Under Linux everything works fine. But under Windows I (have to) use the Visual C++ compiler and setting the compiler is currently, as I think, not possible. I saw your comment in Generator::initialize after the hard-coded initialization: @cc = 'g++' # should be in CONFIG['C++'] but is not. If this is a problem, can't you define an attr_accessor :cc, like you did it for cflags und ldshared? This worked fine for me. Is there any reason no to put that in the official release. I would appreciate that, thus the future developers in my team have not to manually patch it. Without any doubt, other users of other compilers could benefit from that too. With kind regards from Germany, Marcel Otto From kevin.clark at gmail.com Fri Feb 1 15:13:35 2008 From: kevin.clark at gmail.com (Kevin Clark) Date: Fri, 1 Feb 2008 12:13:35 -0800 Subject: [Mkrf-users] Mkrf and other compilers than gcc In-Reply-To: <47A2C8F7.6070108@gmx.de> References: <47A2C8F7.6070108@gmx.de> Message-ID: Hi Marcel, I'm glad you're having luck with mkrf. You're right, the compiler should be modifiable. If you'd like to send in a patch, I'd be happy to apply. -- Kevin Clark http://glu.ttono.us From ruby at j-davis.com Tue Feb 12 18:32:23 2008 From: ruby at j-davis.com (Jeff Davis) Date: Tue, 12 Feb 2008 15:32:23 -0800 Subject: [Mkrf-users] [BUG] @loaded_libs improperly set on some platforms Message-ID: <1202859143.21589.45.camel@dogma.ljc.laika.com> Hi, First of all, thanks for working on mkrf, I am trying to move away from mkmf and mkrf is a big improvement. In Mkrf::Availability.initialize, it assumes that every entry in Config::CONFIG["LIBS"] begins with "-l". However, that's not true on my machine, which is FreeBSD. On my machine, that variable holds: "-lcrypt -lm -pthread" It surprised me that "-pthread" is valid without the "l", but it is. This makes mkrf not work at all unless you set the :loaded_libs option. Regards, Jeff Davis From ruby at j-davis.com Tue Feb 12 18:35:31 2008 From: ruby at j-davis.com (Jeff Davis) Date: Tue, 12 Feb 2008 15:35:31 -0800 Subject: [Mkrf-users] path quoting Message-ID: <1202859331.21589.49.camel@dogma.ljc.laika.com> Is there any interest in automatically quoting library/include paths, etc? Currently, if one of those paths has a space in it, it doesn't work. That can be worked around by quoting the path manually, but it seems like mkrf could do this automatically. Regards, Jeff Davis From hoanga at alum.rpi.edu Tue Feb 12 20:20:08 2008 From: hoanga at alum.rpi.edu (Al Hoang) Date: Wed, 13 Feb 2008 10:20:08 +0900 Subject: [Mkrf-users] [BUG] @loaded_libs improperly set on some platforms In-Reply-To: <1202859143.21589.45.camel@dogma.ljc.laika.com> References: <1202859143.21589.45.camel@dogma.ljc.laika.com> Message-ID: <20080213012008.GT41361@samsara.bebear.net> Howdy, On Tue, Feb 12, 2008 at 03:32:23PM -0800, Jeff Davis wrote: > Hi, > > In Mkrf::Availability.initialize, it assumes that every entry in > Config::CONFIG["LIBS"] begins with "-l". However, that's not true on my > machine, which is FreeBSD. On my machine, that variable holds: > > "-lcrypt -lm -pthread" > > It surprised me that "-pthread" is valid without the "l", but it is. > THis is interesting as I run FreeBSD as well but pthread-config --libs tells me that -lpthread is what should be used for linking in the pthreads library and man 3 pthread says the same. Are you running FreeBSD 7.0 by any chance? I'm running 6-STABLE which might account for this difference. If possible, do you have a sample test project that you can share? I'd like to see if mkrf on my system produces the same problem. Alain From hoanga at alum.rpi.edu Tue Feb 12 20:14:51 2008 From: hoanga at alum.rpi.edu (Al Hoang) Date: Wed, 13 Feb 2008 10:14:51 +0900 Subject: [Mkrf-users] path quoting In-Reply-To: <1202859331.21589.49.camel@dogma.ljc.laika.com> References: <1202859331.21589.49.camel@dogma.ljc.laika.com> Message-ID: <20080213011451.GS41361@samsara.bebear.net> On Tue, Feb 12, 2008 at 03:35:31PM -0800, Jeff Davis wrote: > Is there any interest in automatically quoting library/include paths, > etc? > This sounds like a good idea for systems that have library/include paths that have spaces in them. If you have ideas on how you think this would be implemented, I'd be happy to accept a patch (and hopefully a test) for this functionality. Otherwise, I'll try to implement it but no promises on when I'll have this available. Alain From ruby at j-davis.com Wed Feb 13 13:15:52 2008 From: ruby at j-davis.com (Jeff Davis) Date: Wed, 13 Feb 2008 10:15:52 -0800 Subject: [Mkrf-users] [BUG] @loaded_libs improperly set on some platforms In-Reply-To: <20080213012008.GT41361@samsara.bebear.net> References: <1202859143.21589.45.camel@dogma.ljc.laika.com> <20080213012008.GT41361@samsara.bebear.net> Message-ID: <1202926552.3846.7.camel@dogma.ljc.laika.com> On Wed, 2008-02-13 at 10:20 +0900, Al Hoang wrote: > THis is interesting as I run FreeBSD as well but > pthread-config --libs tells me that -lpthread is what should > be used for linking in the pthreads library and man 3 pthread says > the same. > Are you running FreeBSD 7.0 by any chance? I'm running 6-STABLE > which might account for this difference. If possible, do you have a > sample test project that you can share? I'd like to see if mkrf on > my system produces the same problem. > 6.2-STABLE. The code to reproduce this problem is at the end of this email. I'm not saying that '-lpthread' doesn't work, but '-pthread' does as well, and for some reason ruby uses '-pthread' in Config::CONFIG["LIBS"] on my platform. So the constructor for Mkrf::Availability is producing the wrong result because it assumes everything begins with '-l'. Regards, Jeff Davis --- a.c --- int main() { return 0; } --- mkrf_config.rb --- require 'rubygems' require 'mkrf' Mkrf::Generator.new('a') --- result --- $ ruby mkrf_config.rb $ rake (in /tmp/testmkrf) cc -shared -L/usr/local/lib -o a.so a.o -lcrypt -lm -l-pthread -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -L. -lruby18 /usr/bin/ld: cannot find -l-pthread rake aborted! Command failed with status (1): [cc -shared -L/usr/local/lib -o a.so a.o ...] /tmp/testmkrf/Rakefile:34 (See full trace by running task with --trace) From ruby at j-davis.com Wed Feb 13 18:45:10 2008 From: ruby at j-davis.com (Jeff Davis) Date: Wed, 13 Feb 2008 15:45:10 -0800 Subject: [Mkrf-users] path quoting In-Reply-To: <20080213011451.GS41361@samsara.bebear.net> References: <1202859331.21589.49.camel@dogma.ljc.laika.com> <20080213011451.GS41361@samsara.bebear.net> Message-ID: <1202946310.3846.30.camel@dogma.ljc.laika.com> On Wed, 2008-02-13 at 10:14 +0900, Al Hoang wrote: > On Tue, Feb 12, 2008 at 03:35:31PM -0800, Jeff Davis wrote: > > Is there any interest in automatically quoting library/include paths, > > etc? > > > > This sounds like a good idea for systems that have library/include > paths that have spaces in them. If you have ideas on how you > think this would be implemented, I'd be happy to accept a patch > (and hopefully a test) for this functionality. > Otherwise, I'll try to implement it but no promises on when > I'll have this available. I attached a patch, including an extra test. I also fixed has_library(), which completely ignored *paths. The only problem is that my test for libraries with spaces in them or for library paths with spaces in needs some kind of real library to link against. My tests pass if I actually build that library in the proper location, but I don't know how to do that in a cross-platform way. I have tested it on my machine and it works fine, so if you can think of a good way to test that, you can modify my test to make it work cross- platform. If not, you can just remove the parts of the test that require a library to be present. Regards, Jeff Davis -------------- next part -------------- A non-text attachment was scrubbed... Name: quote_paths.diff Type: text/x-patch Size: 5314 bytes Desc: not available Url : http://rubyforge.org/pipermail/mkrf-users/attachments/20080213/5a56b362/attachment.bin From ruby at j-davis.com Wed Feb 13 18:51:02 2008 From: ruby at j-davis.com (Jeff Davis) Date: Wed, 13 Feb 2008 15:51:02 -0800 Subject: [Mkrf-users] path quoting In-Reply-To: <1202946310.3846.30.camel@dogma.ljc.laika.com> References: <1202859331.21589.49.camel@dogma.ljc.laika.com> <20080213011451.GS41361@samsara.bebear.net> <1202946310.3846.30.camel@dogma.ljc.laika.com> Message-ID: <1202946662.3846.33.camel@dogma.ljc.laika.com> On Wed, 2008-02-13 at 15:45 -0800, Jeff Davis wrote: > On Wed, 2008-02-13 at 10:14 +0900, Al Hoang wrote: > > On Tue, Feb 12, 2008 at 03:35:31PM -0800, Jeff Davis wrote: > > > Is there any interest in automatically quoting library/include paths, > > > etc? > > > > > > > This sounds like a good idea for systems that have library/include > > paths that have spaces in them. If you have ideas on how you > > think this would be implemented, I'd be happy to accept a patch > > (and hopefully a test) for this functionality. > > Otherwise, I'll try to implement it but no promises on when > > I'll have this available. > > I attached a patch, including an extra test. I also fixed has_library(), > which completely ignored *paths. > > The only problem is that my test for libraries with spaces in them or > for library paths with spaces in needs some kind of real library to link > against. My tests pass if I actually build that library in the proper > location, but I don't know how to do that in a cross-platform way. > > I have tested it on my machine and it works fine, so if you can think of > a good way to test that, you can modify my test to make it work cross- > platform. If not, you can just remove the parts of the test that require > a library to be present. > Note: for those doing quoting for themselves already without this patch, this patch might break their build process. Regards, Jeff Davis From ruby at j-davis.com Tue Feb 19 20:07:42 2008 From: ruby at j-davis.com (Jeff Davis) Date: Tue, 19 Feb 2008 17:07:42 -0800 Subject: [Mkrf-users] path quoting In-Reply-To: <1202946310.3846.30.camel@dogma.ljc.laika.com> References: <1202859331.21589.49.camel@dogma.ljc.laika.com> <20080213011451.GS41361@samsara.bebear.net> <1202946310.3846.30.camel@dogma.ljc.laika.com> Message-ID: <1203469662.3846.129.camel@dogma.ljc.laika.com> On Wed, 2008-02-13 at 15:45 -0800, Jeff Davis wrote: > On Wed, 2008-02-13 at 10:14 +0900, Al Hoang wrote: > > On Tue, Feb 12, 2008 at 03:35:31PM -0800, Jeff Davis wrote: > > > Is there any interest in automatically quoting library/include paths, > > > etc? > > > > > > > This sounds like a good idea for systems that have library/include > > paths that have spaces in them. If you have ideas on how you > > think this would be implemented, I'd be happy to accept a patch > > (and hopefully a test) for this functionality. > > Otherwise, I'll try to implement it but no promises on when > > I'll have this available. > > I attached a patch, including an extra test. I also fixed has_library(), > which completely ignored *paths. Here is an updated patch. It occurred to me that the previous one would not work well on windows/dos, so I made a special case in the code. Regards, Jeff Davis -------------- next part -------------- A non-text attachment was scrubbed... Name: quote_paths.diff Type: text/x-patch Size: 5406 bytes Desc: not available Url : http://rubyforge.org/pipermail/mkrf-users/attachments/20080219/be856abc/attachment.bin From kevin.clark at gmail.com Mon Feb 25 15:59:59 2008 From: kevin.clark at gmail.com (Kevin Clark) Date: Mon, 25 Feb 2008 12:59:59 -0800 Subject: [Mkrf-users] Building ruby extenstion libraries with Mkrf In-Reply-To: <8210ee6e0802220456o311757a4p62965a1de24e6218@mail.gmail.com> References: <8210ee6e0802220456o311757a4p62965a1de24e6218@mail.gmail.com> Message-ID: On Fri, Feb 22, 2008 at 4:56 AM, Hajime Hoshi wrote: > Dear Kevin Clark, > > My name is Hajime Hoshi, a grad student of the University of Tokyo in Japan. I'm > working to replace Make with Rake in Ruby extension libraries, for > example, json, > zlib, iconv and so on. Makefile depends on environments (for example, mkdir > command can't be run in Windows). By replacing Make with Rake, we solve this > probrem. Koichi Sasada, a VM developer of Ruby 1.9, is a supervisor of this > project. > > For this work, I'm using the Mkrf library. I'm implementing following > functions on > Mkrf. > > * A hash holding global-like variables > (ex. $objs in ripper library's extconf.rb. $objs is used in mkmf.rb.) > * macro_defined method (io/wait) > * have_macro method (io/wait) > * dir_config method (iconv) > * with_config method (iconv) > > By some possibility, you are implementing these functions. > > Let me hear your candid opinion. > > Sincerely, > > -- > Hajime Hoshi > Hi Hajime, I'm happy you're finding mkrf useful. I don't have immediate plans to implement the features you're asking about, but others may so I'm forwarding this to the users list (mkrf-users at rubyforge.org). Patches are happily accepted. -- Kevin Clark http://glu.ttono.us