Discussion:
How to generate autosplit.ix?
(too old to reply)
Josef Wolf
2008-08-13 16:55:22 UTC
Permalink
Hello,

I am about to write an XS interface to a C library. To make #defines
for error codes available in perl, I used this command:

h2xs -O -b 5.8.0 -x -n Module module.h $(LIBS)

With this, I keep getting the following error message:

Can't locate auto/Module/autosplit.ix in @INC (@INC contains: [ ...
snip ... ]) at /usr/lib/perl5/5.8.7/AutoLoader.pm line 160.
at Module/lib/Module.pm line 9

This error message disappears if I add the -A option to h2xs, but
then I don't have the #defines from C available in perl.

Any ideas how to generate this autosplit.ix file? Or how to tell
h2xs to include the #defines without using autosplit?
Paul Miller
2008-08-13 17:16:39 UTC
Permalink
Few people actually autosplit anymore. I think the secret would be to
take the Autoloader out of your new module.pm
Post by Josef Wolf
Hello,
I am about to write an XS interface to a C library. To make #defines
h2xs -O -b 5.8.0 -x -n Module module.h $(LIBS)
snip ... ]) at /usr/lib/perl5/5.8.7/AutoLoader.pm line 160.
at Module/lib/Module.pm line 9
This error message disappears if I add the -A option to h2xs, but
then I don't have the #defines from C available in perl.
Any ideas how to generate this autosplit.ix file? Or how to tell
h2xs to include the #defines without using autosplit?
--
If riding in an airplane is flying, then riding in a boat is swimming.
104 jumps, 42.2 minutes of freefall, 81.3 freefall miles.
Josef Wolf
2008-08-13 19:02:48 UTC
Permalink
Post by Paul Miller
Few people actually autosplit anymore. I think the secret would be to
take the Autoloader out of your new module.pm
Thanks for your quick response, Paul!

When I omit autoloading via h2xs's -A flag, then my #defines are ignored
also because -A implies the -c flag to omit constants.

What am I missing here?
Paul Miller
2008-08-14 14:19:55 UTC
Permalink
Post by Josef Wolf
Post by Paul Miller
Few people actually autosplit anymore. I think the secret would be to
take the Autoloader out of your new module.pm
Thanks for your quick response, Paul!
When I omit autoloading via h2xs's -A flag, then my #defines are ignored
also because -A implies the -c flag to omit constants.
What am I missing here?
I wouldn't know, I don't normally use h2xs. I know you're supposed
to, but I find that it generates a lot of extraneous cruft that you
don't really need. When I'm actually processing a header file I do
use it, but I cut out a lot of the cruft afterwards.

What I really meant for you to do was comment out the 'use Autoloader'
line in the generated module text. I doubt you actually need it.
It's possible, in which case it's worth figuring out that .ix problem.
But I suspect the reason the .ix isn't found is because you aren't
using any autosplit features!
--
If riding in an airplane is flying, then riding in a boat is swimming.
104 jumps, 42.2 minutes of freefall, 81.3 freefall miles.
Josef Wolf
2008-08-15 14:29:07 UTC
Permalink
Post by Paul Miller
Post by Josef Wolf
Post by Paul Miller
Few people actually autosplit anymore. I think the secret would be to
take the Autoloader out of your new module.pm
Thanks for your quick response, Paul!
When I omit autoloading via h2xs's -A flag, then my #defines are ignored
also because -A implies the -c flag to omit constants.
What am I missing here?
I wouldn't know, I don't normally use h2xs. I know you're supposed
to, but I find that it generates a lot of extraneous cruft that you
don't really need. When I'm actually processing a header file I do
use it, but I cut out a lot of the cruft afterwards.
Ugh, how do you know what can be removed without breaking something?
Post by Paul Miller
What I really meant for you to do was comment out the 'use Autoloader'
line in the generated module text. I doubt you actually need it.
Yes, this stops the error message and my #defines are still available in
perl. Thanks for your patience :-)

Nicholas Clark
2008-08-15 08:23:09 UTC
Permalink
Post by Josef Wolf
Post by Paul Miller
Few people actually autosplit anymore. I think the secret would be to
take the Autoloader out of your new module.pm
Thanks for your quick response, Paul!
When I omit autoloading via h2xs's -A flag, then my #defines are ignored
also because -A implies the -c flag to omit constants.
What am I missing here?
I think you need the --skip-autoloader flag for h2xs

Nicholas Clark
Loading...