makemaker

Using Perl's ExtUtils::MakeMaker, how can I compile an executable using the same settings as my XS module?

爷,独闯天下 提交于 2019-12-22 04:15:09
问题 Given a Perl XS module using a C library, assume there is a Makefile.PL that is set up correctly so that all header and library locations, compiler and linker flags etc work correctly. Now, let's say I want to include a small C program with said XS module that uses the same underlying C library. What is the correct, platform independent way to specify the target executable so that it gets built with the same settings and flags? If I do the following sub MY::postamble { return <<FRAG; target

How do I start a new Perl module distribution?

怎甘沉沦 提交于 2019-12-12 07:57:10
问题 I'm trying to set up a large-ish project, written in Perl. The IBM MakeMaker tutorial has been very helpful so far, but I don't understand how to link all the modules into the main program. In my project root, I have MANIFEST , Makefile.PL , README , a bin directory, and a lib directory. In my bin directory, I have my main script ( Main.pl ). In the lib directory, I have each of my modules, divided up into their own respective directories (i.e. Utils::Util1 and Utils::Utils2 in the utils

Invoking gcc -pthread under ExtUtils::MakeMaker

南笙酒味 提交于 2019-12-11 01:22:25
问题 What's the right way to specify compilation and linking with -pthread ( not -lpthread ) in a Makefile.PL? It's my understanding that gcc ought to be invoked with -pthread when building against pthreads, as this flag expands to the correct platform-specific flags for both compilation and linking. I started with: use Config; my %mm = ( NAME => 'Local::Example::Pthreaded', ...); ... if ($Config{ccname} eq 'gcc') { $mm{DEFINE} = join(' ', '-pthread', $mm{DEFINE}); # ??? in the right place? $mm

How to specify test prerequisites in the ExtUtils::MakeMaker Makefile.PL

寵の児 提交于 2019-12-07 05:02:31
问题 PREREQ_PM specifies the runtime prerequisites, but how to specify which modules are required to run the test cases? Should I use BUILD_REQUIRES for this? 回答1: As of ExtUtils::MakeMaker 6.64, there is a TEST_REQUIRES parameter. use ExtUtils::MakeMaker 6.64; WriteMakefile( ..., TEST_REQUIRES => { Test::More => 0.95, }, ..., ); 回答2: The CPAN::Meta::Spec defines how modules communicate their prerequisites to the toolchain. The version 2 spec revised the way prerequisites are listed. The test

Using Perl's ExtUtils::MakeMaker, how can I compile an executable using the same settings as my XS module?

我只是一个虾纸丫 提交于 2019-12-05 03:32:47
Given a Perl XS module using a C library, assume there is a Makefile.PL that is set up correctly so that all header and library locations, compiler and linker flags etc work correctly. Now, let's say I want to include a small C program with said XS module that uses the same underlying C library. What is the correct, platform independent way to specify the target executable so that it gets built with the same settings and flags? If I do the following sub MY::postamble { return <<FRAG; target$Config{exe_ext}: target$Config{obj_ext} target$Config{obj_ext}: target.c FRAG } I don't get those

How do I start a new Perl module distribution?

我的梦境 提交于 2019-12-03 14:14:04
I'm trying to set up a large-ish project, written in Perl. The IBM MakeMaker tutorial has been very helpful so far, but I don't understand how to link all the modules into the main program. In my project root, I have MANIFEST , Makefile.PL , README , a bin directory, and a lib directory. In my bin directory, I have my main script ( Main.pl ). In the lib directory, I have each of my modules, divided up into their own respective directories (i.e. Utils::Util1 and Utils::Utils2 in the utils directory, etc). In each module directory, there is also a t directory, containing tests My MANIFEST file