Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build modules with LINKTYPE=static using bare CPAN #188

Open
vadimkantorov opened this issue Dec 27, 2024 · 5 comments
Open

Build modules with LINKTYPE=static using bare CPAN #188

vadimkantorov opened this issue Dec 27, 2024 · 5 comments

Comments

@vadimkantorov
Copy link

vadimkantorov commented Dec 27, 2024

Originally reported at:

Is there any bare cpan support for having cpan pass LINKTYPE=static to perl Makefile.PL LINKTYPE=static?

Should I try PERL_MM_OPT='LINKTYPE=static' PERL_MB_OPT='LINKTYPE=static' cpan -T ...?

Thanks!

@Leont
Copy link

Leont commented Dec 28, 2024

This is a place for reporting bugs, not asking questions. There are other venues for that.

If you had looked at CPAN's documentation you would have found the o conf command, which would have led you to the makepl_arg option. So something like o conf makepl_arg LINKTYPE=static should do the trick.

@vadimkantorov
Copy link
Author

Thank you for clarifications!

Am I correct that the full equivalent command for cpan -T ... would be sth like:
perl -MCPAN -e "o conf makepl_arg LINKTYPE=static; CPAN::Shell->notest('install', $_) for @ARGV" Encode::EUCJPASCII Encode::JIS2K

Will try this!

@vadimkantorov
Copy link
Author

I've tried perl -MCPAN -e "o conf makepl_arg LINKTYPE=static; install Sort::Key; which failed with Can't locate object method "makepl_arg" via package "LINKTYPE" (perhaps you forgot to load "LINKTYPE"?) at -e line 1.

Then I've tried perl -MCPAN -e '$CPAN::Config->{makepl_arg}="LINKTYPE=static"; install Sort::Key;', but this did not actually produce a static lib.

How can I set the makepl_arg for a non-interactive install? Thank you!

@vadimkantorov
Copy link
Author

vadimkantorov commented Dec 28, 2024

I managed to do a static install with printf "o conf makepl_arg LINKTYPE=static\ninstall Sort::Key\n" | cpan, but for now I can't figure out how to do a notest (akin to cpan -T Sort::Key, but with LINKTYPE=static) install. Should using notest install in place of install in the command above work?

(and if it's possible to do the same without resorting to interactive/pipe mode)

@vadimkantorov
Copy link
Author

If anyone is searching, I managed to do installation of multiple modules with notest printf "o conf makepl_arg LINKTYPE=static\nnotest force install %s\n" Sort::Key Encode::EUCJPASCII Encode::JIS2K | cpan

wondering if this can be done without resorting to pipe / interactive mode...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants