In message <20020825155505$[EMAIL PROTECTED]> Tom Hughes (via RT) <[EMAIL PROTECTED]> wrote:
> Recent changes to imcc make it require a working Parrot_dlopen but > unfortunately as things stand it never does work because Configure.pl > never sets HAS_DLOPEN so Parrot_dlopen is also stubbed out. > > There is a second problem in that platform.c only include dlfcn.h if > a particular symbol is defined but that symbol is not defined until > parrot.h is included which is after the include of dlfcn.h. Here's a patch that addresses both those issues and makes imcc work again. Tom -- Tom Hughes ([EMAIL PROTECTED]) http://www.compton.nu/
Index: config/auto/functions.pl =================================================================== RCS file: config/auto/functions.pl diff -N config/auto/functions.pl --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ config/auto/functions.pl 25 Aug 2002 17:42:45 -0000 @@ -0,0 +1,24 @@ +package Configure::Step; + +use strict; +use vars qw($description @args); +use Parrot::Configure::Step ':auto'; +use Config; + +$description="Probing for C functions..."; + +@args=qw(miniparrot); + +sub runstep { + my ($miniparrot) = @_; + + if ($miniparrot) { + return; + } + + for (qw(dlopen)) { + Configure::Data->set("f_$_", $Config{"d_$_"}); + } +} + +1; Index: config/gen/config_h.pl =================================================================== RCS file: /cvs/public/parrot/config/gen/config_h.pl,v retrieving revision 1.2 diff -u -r1.2 config_h.pl --- config/gen/config_h.pl 7 Jun 2002 01:12:39 -0000 1.2 +++ config/gen/config_h.pl 25 Aug 2002 17:42:45 -0000 @@ -32,6 +32,28 @@ } close HH; + + open(HF, ">include/parrot/has_feature.h") or die "Can't open has_feature.h: $!"; + + print HF qq( +/* + ** !!!!!!! DO NOT EDIT THIS FILE !!!!!!! + ** + ** This file is generated automatically by Configure.pl + */ +); + + for(Configure::Data->keys()) { + next unless /f_(\w+)/; + if(Configure::Data->get($_)) { + print HF "#define HAS_\U$1 1\n" + } + else { + print HF "#undef HAS_\U$1\n"; + } + } + + close HF; } 1; Index: config/gen/config_h/config_h.in =================================================================== RCS file: /cvs/public/parrot/config/gen/config_h/config_h.in,v retrieving revision 1.7 diff -u -r1.7 config_h.in --- config/gen/config_h/config_h.in 18 Aug 2002 03:36:57 -0000 1.7 +++ config/gen/config_h/config_h.in 25 Aug 2002 17:42:45 -0000 @@ -100,6 +100,7 @@ #define FLOATVAL_FMT "${floatvalfmt}" #include "parrot/has_header.h" +#include "parrot/has_feature.h" #endif Index: config/gen/platform/generic.c =================================================================== RCS file: /cvs/public/parrot/config/gen/platform/generic.c,v retrieving revision 1.5 diff -u -r1.5 generic.c --- config/gen/platform/generic.c 3 Aug 2002 07:58:58 -0000 1.5 +++ config/gen/platform/generic.c 25 Aug 2002 17:42:45 -0000 @@ -2,13 +2,13 @@ ** platform.c [generic version] */ +#include "parrot/parrot.h" + #include <time.h> #include <sys/time.h> #ifdef HAS_HEADER_DLFCN # include <dlfcn.h> #endif - -#include "parrot/parrot.h" #define PARROT_DLOPEN_FLAGS RTLD_LAZY Index: lib/Parrot/Configure/RunSteps.pm =================================================================== RCS file: /cvs/public/parrot/lib/Parrot/Configure/RunSteps.pm,v retrieving revision 1.8 diff -u -r1.8 RunSteps.pm --- lib/Parrot/Configure/RunSteps.pm 23 Aug 2002 06:16:06 -0000 1.8 +++ lib/Parrot/Configure/RunSteps.pm 25 Aug 2002 17:42:46 -0000 @@ -17,6 +17,7 @@ inter/pmc.pl auto/alignptrs.pl auto/headers.pl + auto/functions.pl auto/sizes.pl auto/stackdir.pl auto/byteorder.pl