Re^2: RFC: Setting up a minGW compiling envronment for Perl 5.10
by Bloodrage (Monk) on Mar 02, 2008 at 20:37 UTC
|
First I'll quickly cover generating my Makefile. When I do exactly as you instructed I get this output for generating my Makefile:
...but when I use CPAN to generate the makefile, which explicitly passes a more complete set of include and lib paths to Makefile.PL (because of the program I've mentioned earlier) I get this output:
Which has none of the "No library found" warnings. So I'll continue with the CPAN generated Makefile.
| [reply] [Watch: Dir/Any] [d/l] [select] |
Re^2: RFC: Setting up a minGW compiling envronment for Perl 5.10
by Bloodrage (Monk) on Mar 02, 2008 at 20:47 UTC
|
I'm making Glib first as I suspect that Gtk may be dependent on it. Following your instructions here is the rather copious output from dmake >d.txt 2>&1:
| [reply] [Watch: Dir/Any] [d/l] |
|
undefined reference to ....
Looks like the glib libraries are not being found. If you're using Strawberry Perl, and libraries that were built with Visual Studio, then you probably need to change the '.lib' extensions to '.a'.
Cheers, Rob
| [reply] [Watch: Dir/Any] |
|
Fantastic. I did not know to do this. A quick little script:
...and that's done.
Update The code now handles files ending in .dll.lib and renames them to .a as well...(and files that have been misnamed .dll.a, oh and properly escapes the .)
| [reply] [Watch: Dir/Any] [d/l] [select] |
Re^2: RFC: Setting up a minGW compiling envronment for Perl 5.10
by Bloodrage (Monk) on Mar 02, 2008 at 23:39 UTC
|
With all the library files renamed with s/.lib$/.a/i the output is now (I now run dmake twice, which reduces the output to just the failed parts), hmm... no -L"G:\GTK\lib", so my GTK libraries are not being handed to the compiler by dmake?
| [reply] [Watch: Dir/Any] [d/l] [select] |
|
LDDLFLAGS = -mdll -s -L"G:\strawberry\perl\lib\CORE" -L"G:\strawberry\
+c\lib" -L"G:\GTK\lib"
LDFLAGS = -s -L"G:\strawberry\perl\lib\CORE" -L"G:\strawberry\c\lib" -
+L"G:\GTK\lib"
Makes no difference to the output from dmake except that these libs are now included :( | [reply] [Watch: Dir/Any] [d/l] [select] |
|
Makes no difference to the output from dmake except that these libs are now included
Well ... all that you have done is to provide the *location* of those libs. Apparently, therefore, the build process is not even trying to find those libs - and you'll have to tell it to do that with -lglib (assuming the glib library is named glib.a or libglib.a). There are probably other libraries that need to be explicitly linked in, too - but start by just trying to get those glib undefined references fixed. That should (at least) greatly reduce the number of undefined references that you get.
Cheers, Rob
| [reply] [Watch: Dir/Any] [d/l] |
|
Re^2: RFC: Setting up a minGW compiling envronment for Perl 5.10
by Bloodrage (Monk) on Mar 03, 2008 at 08:04 UTC
|
Righty, after repeating the key steps, to make sure it's repeatable, not at all because when you change your compiler-onna-stick to a new machine with a new drive letter, your hand-crafted Makefile is now broken...
The next step; dmake test >t.txt 2>&1:
deee deed dah dee... this takes a while
Hmm, gets to test 9 and just hangs. (and only fails 6/12 of the 64-bit tests). I'll post this so far and see if it finishes.
A quick look at 9.t makes me suspect that test 9 is for the timeout and thread yielding handling stuff. If I delete it all the other tests succeed except some in 64-bit.t and filename.t
| [reply] [Watch: Dir/Any] [d/l] [select] |
Re^2: RFC: Setting up a minGW compiling envronment for Perl 5.10
by Bloodrage (Monk) on Mar 03, 2008 at 07:25 UTC
|
A Quick recap for those who can't be bothered drilling down through the reply tree to it's darkest depths. We have successfully compiled Glib by first renaming all the library files s/.lib/.a/i (here's a program), then appending the Glib libraries to EXTRALIBS and LDLOADLIBS in the Makefile. This is dispite Makefile.PL being given this information by CPAN and MakeMaker.
Hence for any required Glib|Gtk library file, $ENV{'GTK_BASEPATH'}.'\lib\'.$lib_file has to be appended to the end of LDLOADLIBS in the Makefile.
| [reply] [Watch: Dir/Any] [d/l] [select] |
|
| [reply] [Watch: Dir/Any] [d/l] |
|
| [reply] [Watch: Dir/Any] [d/l] [select] |