[haiku] Re: Perl XS problems

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku@xxxxxxxxxxxxx
  • Date: Fri, 13 Mar 2009 01:41:04 +0100

On 2009-03-12 at 23:09:20 [+0100], Sean Healy <jalopeura@xxxxxxxxxxx> wrote:
> I'm writing a Perl extension to interface with Haiku's kits. I'm getting
> errors from Perl's own header files. However, since somebody (apparently
> Ingo) was able to build Perl on Haiku in the first place, I'm sure there
> is a solution. If anyone can help point me in the right direction, that
> would be great.
> (By the way, I'm using the 2.95 compiler. I verified that Perl was also
> built with the 2.95 compiler.)
> /boot/common/bin/perl /boot/common/lib/perl5/5.10.0/ExtUtils/xsubpp
> -C++ -typemap /boot/common/lib/perl5/5.10.0/ExtUtils/typemap -typemap
> typemap  ApplicationKit.xs > ApplicationKit.xsc && mv ApplicationKit.xsc
> ApplicationKit.c
> Please specify prototyping behavior for ApplicationKit.xs (see perlxs
> manual)

Not sure what this is supposed to mean. I guess checking out the perlxs 
manual as suggested might help.

> g++ -c  -I. -fno-strict-aliasing -pipe -O   -DVERSION=\"0.01\"
> -DXS_VERSION=\"0.01\" -fpic
> "-I/boot/common/lib/perl5/5.10.0/BePC-haiku/CORE"   ApplicationKit.c
> In file included from
> /BeStuff/Perl_Haiku_Kits/working/Haiku-ApplicationKit/ApplicationKit.xs:5:
> /boot/common/lib/perl5/5.10.0/BePC-haiku/CORE/perl.h:1586: badly
> punctuated parameter list in `#define'
> /boot/common/lib/perl5/5.10.0/BePC-haiku/CORE/perl.h:1598: badly
> punctuated parameter list in `#define'

This is interesting. Apparently the gcc 2.95.3 C compiler supports C99 
variadic macros while the C++ compiler doesn't. Perl itself is C only, so 
there was no problem with building it. You could try to undef the 
HAS_C99_VARIADIC_MACROS macro in config.h. Maybe that will work.

At any rate, please file a bug report at HaikuPorts.

> In file included from
> /BeStuff/Perl_Haiku_Kits/working/Haiku-ApplicationKit/ApplicationKit.xs:5:
> /boot/common/lib/perl5/5.10.0/BePC-haiku/CORE/perl.h:2555:
> haiku/haikuish.h: No such file or directory

Ugh, that file has apparently not been installed. Not sure why -- I might 
have missed adding it to some file listing. You can get it from the patch on 
HaikuPorts (Scott sent the link to the port log); it's only a few lines 
long. The file must probably live in .../BePC-haiku/CORE/haiku/.

Again, please file a bug report at HaikuPorts.

> In file included from
> /BeStuff/Perl_Haiku_Kits/working/Haiku-ApplicationKit/ApplicationKit.xs:11:
> /BeStuff/Perl_Haiku_Kits/working/Haiku-ApplicationKit/ppport.h:4267:
> Invalid token in expression
> In file included from
> /boot/common/lib/perl5/5.10.0/BePC-haiku/CORE/perl.h:4695,
>                   from
> /BeStuff/Perl_Haiku_Kits/working/Haiku-ApplicationKit/ApplicationKit.xs:5:
> /boot/common/lib/perl5/5.10.0/BePC-haiku/CORE/proto.h:211: parse error
> before `*'

Nothing obvious wrong here. Run the above g++ line with "-E" instead of "-c" 
and a different output file and check what this line is preprocessed to.

> In file included from
> /boot/common/lib/perl5/5.10.0/BePC-haiku/CORE/perl.h:4725,
>                   from
> /BeStuff/Perl_Haiku_Kits/working/Haiku-ApplicationKit/ApplicationKit.xs:5:
> /boot/common/lib/perl5/5.10.0/BePC-haiku/CORE/intrpvar.h:85: syntax
> error before `;'
> /boot/common/lib/perl5/5.10.0/BePC-haiku/CORE/intrpvar.h:86: syntax
> error before `;'

Same here.

CU, Ingo

Other related posts: