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

question about Configure options for perl-only extensions #862

Closed
p5pRT opened this issue Nov 17, 1999 · 3 comments
Closed

question about Configure options for perl-only extensions #862

p5pRT opened this issue Nov 17, 1999 · 3 comments

Comments

@p5pRT
Copy link

@p5pRT p5pRT commented Nov 17, 1999

Migrated from rt.perl.org#1792 (status was 'resolved')

Searchable as RT1792$

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Nov 17, 1999

From mlevine@reshape.com

Hi,

I am building perl with a number of extensions statically linked in.
Everything is working fine with my extensions that have C code associated
with them, but the extensions that are perl code only, such as DateManip,
GIFgraph, and DProf are giving me problems because they seem to not install
correctly.

I'm confused at the intended usage of -Dextensions versus -Dstatic_ext and
-Ddynamic_ext.

If I put all of DateManip, GifGraph, and DProf in both -Dextensions and
-Dstatic_extensions, like this​:

  ./Configure -de -Dprefix='/home/mlevine/reshape/bin/perl' \
  -Dlibs='-Wl,-Bstatic -lm -lstdc++ -Wl,-Bdynamic -ldl -Wl,-Bstatic ' \
  -Dlibpth='-L/home/mlevine/reshape/blib ' -Dldflags=' ' -Dso='none' \
  ... some other unrelated stuff for setting gcc, make, etc \
  -Dextensions='Reshape POSIX Fcntl IO GD DProf GIFgraph DateManip '
  -Ddynamic_ext=' '
  -Dstatic_ext='Reshape POSIX Fcntl IO GD DProf GIFgraph DateManip '

I get the following errors when I link perl

  /home2/mlevine/reshape_tools/bin/gcc -o perl perlmain.o \
  lib/auto/DynaLoader/DynaLoader.a lib/auto/Reshape/Reshape.a \
  lib/auto/POSIX/POSIX.a lib/auto/Fcntl/Fcntl.a lib/auto/IO/IO.a \
  lib/auto/GD/GD.a lib/auto/DProf/DProf.a lib/auto/GIFgraph/GIFgraph.a \
  lib/auto/DateManip/DateManip.a libperl.a \
  `cat ext.libs` -Wl,-Bstatic -lm -lstdc++ -Wl,-Bdynamic -ldl -Wl,-Bstatic \

  gcc​: lib/auto/DProf/DProf.a​: No such file or directory \
  gcc​: lib/auto/GIFgraph/GIFgraph.a​: No such file or directory \
  gcc​: lib/auto/DateManip/DateManip.a​: No such file or directory

However, if I put DProf, GIFgraph, and DateManip in -Dextensions, but remove
it from -Dstatic_ext, like this​:

  -Dextensions='Reshape POSIX Fcntl IO GD DProf GIFgraph DateManip ' \
  -Ddynamic_ext=' '
  -Dstatic_ext='Reshape POSIX Fcntl IO GD

then when I make, I don't DProf, GIFgraph, and DateManip don't get made.
Where on the Configure line should these extensions that aren't really
dynamic or static go? If I cd into the actual extension directory and do
the standard 'perl Makefile.pl; make install', then of course, it does get
installed. But I know there must be some way for this to happen
automatically based on my arguments to Configure ...

Thanks!

- Margie Levine

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Nov 17, 1999

From @doughera88

On Wed, 17 Nov 1999, Margie Levine wrote​:

I am building perl with a number of extensions statically linked in.
Everything is working fine with my extensions that have C code associated
with them, but the extensions that are perl code only, such as DateManip,
GIFgraph, and DProf are giving me problems because they seem to not install
correctly.

I'm confused at the intended usage of -Dextensions versus -Dstatic_ext and
-Ddynamic_ext.

That's not surprising, since they weren't really designed to be
manipulated from the Configure command line.

The intended use (which I see isn't actually documented -- Hmm -- I
thought I had documented that) is that you just plop your extensions down
in the ext/ directory and Configure automatically adds them in. You don't
have to do -D anything.

If that doesn't work, your best bet is to either run Configure
interactively and specify them when prompted, or to use a config.over
file to set the appropriate Configure variables.

There are actually 5 relevant Configure variables. Here are their
definitions (from Porting/Glossary)

  known_extensions​:
  This variable holds a list of all XS extensions included in
  the package.
  dynamic_ext​:
  This variable holds a list of XS extension files we want to
  link dynamically into the package. It is used by Makefile.
  static_ext​:
  This variable holds a list of XS extension files we want to
  link statically into the package. It is used by Makefile.
  nonxs_ext​:
  This variable holds a list of all non-xs extensions included
  in the package. All of them will be built.
  extensions​:
  This variable holds a list of all extension files (both XS and
  non-xs linked into the package. It is propagated to Config.pm
  and is typically used to test whether a particular extesion
  is available.

You want your non-XS extensions to appear in $nonxs_ext. They should
automatically. The $extensions variable is effectively set to

  extensions="$dynamic_ext $static_ext $nonxs_ext"

so setting it from the command line is not what I would recommend (and I
don't think it will even work).

./Configure -de -Dprefix='/home/mlevine/reshape/bin/perl' \
-Dlibs='-Wl,-Bstatic -lm -lstdc++ -Wl,-Bdynamic -ldl -Wl,-Bstatic ' \
-Dlibpth='-L/home/mlevine/reshape/blib ' -Dldflags=' ' -Dso='none' \
... some other unrelated stuff for setting gcc, make, etc \
-Dextensions='Reshape POSIX Fcntl IO GD DProf GIFgraph DateManip '
-Ddynamic_ext=' '
-Dstatic_ext='Reshape POSIX Fcntl IO GD DProf GIFgraph DateManip '

Incidentally, if you add in a -Uusedl, then dynamic_ext will automatically
get set to ' ', and static_ext will automatically get set to pick up
all of your XS extensions, and nonxs_ext will automatically pick up all of
your non-XS extensions. In short, adding in -Uusedl ought to remove the
need to specify anything else about any of the extensions. If you want to
exclude specific extensions included in the core perl distribution, then
there are individual flags you can set for each one. These are documented
in the INSTALL file. (e.g. -Uuseposix will tell perl not to build the
POSIX extension.)

Hope this helps,

  Andy Dougherty doughera@​lafayette.edu
  Dept. of Physics
  Lafayette College, Easton PA 18042

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Nov 10, 2000

From The RT System itself

It's in INSTALL​:

  If you unpack any additional extensions in the ext/ directory before
  running Configure, then Configure will offer to build those additional
  extensions as well. Most users probably shouldn't have to do this --
  it is usually easier to build additional extensions later after perl
  has been installed. However, if you wish to have those additional
  extensions statically linked into the perl binary, then this offers a
  convenient way to do that in one step. (It is not necessary, however;
  you can build and install extensions just fine even if you don't have
  dynamic loading. See lib/ExtUtils/MakeMaker.pm for more details.)

@p5pRT p5pRT closed this Nov 28, 2003
toddr added a commit to toddr/perl that referenced this issue Sep 16, 2020
[DELTA]

1.302181  2020-09-14 09:46:04-07:00 America/Los_Angeles

    - put try_sig_mask back where it goes (And add test to prevent this in the future)
    - Drop new List::Util requirement back down

1.302180  2020-09-13 23:11:18-07:00 America/Los_Angeles

    - No changes since last trial

1.302179  2020-09-12 22:35:19-07:00 America/Los_Angeles (TRIAL RELEASE)

    - Bump minimum List::Util version (for uniq)

1.302178  2020-09-07 14:11:52-07:00 America/Los_Angeles (TRIAL RELEASE)

    - Move try_sig_mask to the only module that uses it.
    - Inherit warnings bitmask in cmp_ok string eval
    - Update copyright date
    - Improved API for interept {} and what it returns

1.302177  2020-08-06 21:46:06-07:00 America/Los_Angeles

    - Minor fix to author downstream test
    - No significant changes since the last trial

1.302176  2020-08-05 21:45:19-07:00 America/Los_Angeles (TRIAL RELEASE)

    - Fix Test::More's $TODO inside intercept (Perl#862)
toddr added a commit to toddr/perl that referenced this issue Sep 16, 2020
[DELTA]

1.302181  2020-09-14 09:46:04-07:00 America/Los_Angeles

    - put try_sig_mask back where it goes (And add test to prevent this in the future)
    - Drop new List::Util requirement back down

1.302180  2020-09-13 23:11:18-07:00 America/Los_Angeles

    - No changes since last trial

1.302179  2020-09-12 22:35:19-07:00 America/Los_Angeles (TRIAL RELEASE)

    - Bump minimum List::Util version (for uniq)

1.302178  2020-09-07 14:11:52-07:00 America/Los_Angeles (TRIAL RELEASE)

    - Move try_sig_mask to the only module that uses it.
    - Inherit warnings bitmask in cmp_ok string eval
    - Update copyright date
    - Improved API for interept {} and what it returns

1.302177  2020-08-06 21:46:06-07:00 America/Los_Angeles

    - Minor fix to author downstream test
    - No significant changes since the last trial

1.302176  2020-08-05 21:45:19-07:00 America/Los_Angeles (TRIAL RELEASE)

    - Fix Test::More's $TODO inside intercept (Perl#862)
toddr added a commit that referenced this issue Sep 16, 2020
[DELTA]

1.302181  2020-09-14 09:46:04-07:00 America/Los_Angeles

    - put try_sig_mask back where it goes (And add test to prevent this in the future)
    - Drop new List::Util requirement back down

1.302180  2020-09-13 23:11:18-07:00 America/Los_Angeles

    - No changes since last trial

1.302179  2020-09-12 22:35:19-07:00 America/Los_Angeles (TRIAL RELEASE)

    - Bump minimum List::Util version (for uniq)

1.302178  2020-09-07 14:11:52-07:00 America/Los_Angeles (TRIAL RELEASE)

    - Move try_sig_mask to the only module that uses it.
    - Inherit warnings bitmask in cmp_ok string eval
    - Update copyright date
    - Improved API for interept {} and what it returns

1.302177  2020-08-06 21:46:06-07:00 America/Los_Angeles

    - Minor fix to author downstream test
    - No significant changes since the last trial

1.302176  2020-08-05 21:45:19-07:00 America/Los_Angeles (TRIAL RELEASE)

    - Fix Test::More's $TODO inside intercept (#862)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant