Disclaimer: I don't know how perl extension are built, and how swig works.... I'm basing my idea on the fact that the swig\perl\Transcoder has a Makefile.PL with this content:

WriteMakefile(
   LINKTYPE => 'static',
   'NAME'    => 'Transcoder',
   'INC'       => $INCLUDES,
   'OBJECT'    => '$(O_FILES)',
   'CCFLAGS'   => $CFLAGS,
   'LIBS'      => [$LIBS],
   'CC'        => $CXX,
   'SKIP'      => [qw( dynamic test makeaperl xs_o)],
 @OPTIMIZE,
 @LDFLAGS,
);

__END__
sub MY::static
{
'
static  :: libtranscode$(LIB_EXT)

dynamic :: static

libtranscode$(LIB_EXT): $(O_FILES) $(MYEXTLIB)
   $(AR) cru libtranscode$(LIB_EXT) $(O_FILES)
   $(RANLIB) libtranscode$(LIB_EXT)

libtranscode.$(DLEXT): $(LDFROM) $(MYEXTLIB)
$(LD) -o libtranscode.$(DLEXT) $(LDDLFLAGS) --whole-archive $(LDFROM) $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) $(EXPORT_LIST)
   $(CHMOD) 755 libtranscode.$(DLEXT)

';

}

while the one in perl\Handler is even simpler:

WriteMakefile(
   LINKTYPE => 'static',
   'NAME'    => 'Handler',
   'INC'       => $INCLUDES,
   'OBJECT'    => '$(O_FILES)',
   'LIBS'      => [$LIBS],
   'CCFLAGS'   => $CFLAGS,
   'CC'        => $CXX,
   'SKIP'      => [qw( dynamic test makeaperl xs_o)],
 @OPTIMIZE,
 @LDFLAGS,
);

Both projects are listed in the perl\Makefile.PL in the same way the util\Makefile is referenced, i.e.

$HANDLER_LIB:
   \$(MAKE) -C Handler static

$TRANSCODER_LIB:
   \$(MAKE) -C Transcoder static

$UTIL_LIB:
   \$(MAKE) -C $SWIG_DIR

So, given that the XMLExceptionHandler.cpp is compiled into a static library just like the other two, wouldn't it be simpler to convert it to use the same makefile of the Handler subdirectory? If we can remove this dependency on configure and autoconf, it would be possible for Xerces to work regardless of the presence of the swig subdir. The perl binding would then be built either manually (cd swig; perl Makefile.PL; make -C perl test) or from the Xerces directory (make test-suite).

Alberto


Boris Kolpackov wrote:
Hi Alberto,

Alberto Massari <[EMAIL PROTECTED]> writes:

Jason, would it be possible to implement the libutil.a helper library
like you do with the libTranscoder.a, i.e. using Makefile.PL instead of
Makefile.am?

I don't think it is such a good idea. I doubt the Makefile.PL build
system has the same cross-platform support for C++ as automake. Using
Makefile.PL to build C++ libraries is just asking for trouble.

If we want to split swig and Xerces-C++ then the proper way to do it
would be for the swig directory to have its own configure script. Then
we can package swig as an "add-on" to the Xerces-C++ distribution in
the same way as we have done for the tools directory.

Boris




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to