Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Device::Serial could not find ioctl definitions!

14 views
Skip to first unread message

Todd Seidenberg

unread,
Oct 7, 2002, 10:20:43 AM10/7/02
to
Hi,

I'm trying to install the Device-SerialPort module on RedHat 8, and
I'm encountering an error I've never encountered before.

This is what happens when I run the 'perl Makefile.PL':

############################
perl Makefile.PL /dev/ttyS0
Finding ioctl methods ...
trying 'termios.ph'... nope
trying 'asm/termios.ph'... nope
trying 'sys/termiox.ph'... nope
trying 'sys/termios.ph'... not useful
trying 'sys/ttycom.ph'... nope
Device::Serial could not find ioctl definitions!
Perl did not find any .ph files to get at least the following ioctls:
TIOCMBIS
TIOCMBIC
TIOCMGET
CRTSCTS
Please check your Perl installation, or read 'man h2ph'. As root, you
may
need to run:
cd /usr/include; h2ph -r -l .
#################

I performed the h2ph like it says, and I still have the same error
message. It doesn't seem to have made any difference.


Other info: This worked when I was using RedHat 7.3 on the same box.
When I upgraded to RedHat 8, I think it also updated the perl version.
Anyway, now I can't install this module.


Any thoughts? Please Help!!!!!

- Thanks,

Todd

Todd Seidenberg

unread,
Oct 8, 2002, 8:19:34 AM10/8/02
to
Hi,

I'm trying to install the Device::Serial module, so that I can use
sendpage. I've installed it perfectly in the past, on this very
machine. However, I just upgraded to RedHat 8 (From RedHat 7.3),
which updated the perl version (to 5.8) and now I can't install
Device::Serial.

I get the following error when I try:

######################
perl Makefile.PL


Finding ioctl methods ...
trying 'termios.ph'... nope
trying 'asm/termios.ph'... nope
trying 'sys/termiox.ph'... nope
trying 'sys/termios.ph'... not useful
trying 'sys/ttycom.ph'... nope
Device::Serial could not find ioctl definitions!
Perl did not find any .ph files to get at least the following ioctls:
TIOCMBIS
TIOCMBIC
TIOCMGET
CRTSCTS
Please check your Perl installation, or read 'man h2ph'. As root, you
may
need to run:
cd /usr/include; h2ph -r -l .

before the Perl *.ph files will work.
####################

I've run the 'h2ph' command, specifically "cd /usr/include; h2ph -r
-l" but it still doesn't work.


Any thoughts?

- Thanks,

Todd

Benjamin Goldberg

unread,
Oct 11, 2002, 1:29:11 AM10/11/02
to

To build the .ph files, you need the corresponding .h files. Do they
exist?

Also, you may need to be root for perl to write the files where it wants
to by default -- either run h2ph using the sudo program (if you know the
root password), or else use the appropriate command-line options to tell
h2ph to install the .ph files in a directory which is in your @INC and
to which you have write access.

--
my $n = 2; print +(split //, 'e,4c3H r ktulrnsJ2tPaeh'
."\n1oa! er")[map $n = ($n * 24 + 30) % 31, (42) x 26]

Todd Seidenberg

unread,
Oct 14, 2002, 10:58:39 AM10/14/02
to
Benjamin Goldberg <gol...@earthlink.net> wrote in message news:<3DA661A7...@earthlink.net>...


I did run the h2ph utility as root, and the .h versions of the
following files do exist in /usr/include.

'termios.h'
'asm/termios.h'
'sys/termios.h


Do I need all of the others that its looking for? Eitherway, why would
it say it can't find them when they're there?


- Todd

Benjamin Goldberg

unread,
Oct 14, 2002, 5:48:06 PM10/14/02
to
Todd Seidenberg wrote:
> Benjamin Goldberg wrote:
> > Todd Seidenberg wrote:
[snip]

> > > I get the following error when I try:
> > >
> > > ######################
> > > perl Makefile.PL
> > > Finding ioctl methods ...
> > > trying 'termios.ph'... nope
> > > trying 'asm/termios.ph'... nope
> > > trying 'sys/termiox.ph'... nope
> > > trying 'sys/termios.ph'... not useful
> > > trying 'sys/ttycom.ph'... nope
> > > Device::Serial could not find ioctl definitions!
[snip]

> > > I've run the 'h2ph' command, specifically "cd /usr/include; h2ph
> > > -r -l" but it still doesn't work.
> > >
> > > Any thoughts?
> >
> > To build the .ph files, you need the corresponding .h files. Do
> > they exist?
> >
> > Also, you may need to be root for perl to write the files where it
> > wants to by default -- either run h2ph using the sudo program (if
> > you know the root password), or else use the appropriate
> > command-line options to tell h2ph to install the .ph files in a
> > directory which is in your @INC and to which you have write access.
>
> I did run the h2ph utility as root, and the .h versions of the
> following files do exist in /usr/include.
>
> 'termios.h'
> 'asm/termios.h'
> 'sys/termios.h

After running h2ph as root, were the .ph versions of those files
created? And more importantly, *where* were they created? (You don't
need to tell me the specifics, but were they created in /usr/include, or
where they created in someplace in your @INC?)

> Do I need all of the others that its looking for? Eitherway, why would
> it say it can't find them when they're there?
>
> - Todd

--

Todd Seidenberg

unread,
Oct 16, 2002, 7:56:02 AM10/16/02
to
Benjamin Goldberg <gol...@earthlink.net> wrote in message news:<3DAB3B96...@earthlink.net>...


These are the contents of my @INC variable:

% perl -e 'foreach ( @INC ) {print $_."\n" ; }'

/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0
/usr/lib/perl5/vendor_perl/5.6.1
/usr/lib/perl5/vendor_perl

-------

a find of 'termios.h' on the above directories yeilds the following:

-------
foreach x ( `perl -e 'foreach ( @INC ) {print $_."\n" ; }'` )
foreach? find $x -name termios.ph -print
foreach? end

/usr/lib/perl5/5.8.0/i386-linux-thread-multi/bits/termios.ph
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/linux/termios.ph
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/sys/termios.ph
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/bits/termios.ph
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/linux/termios.ph
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/sys/termios.ph
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/termios.ph
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/asm/termios.ph
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/termios.ph
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/asm/termios.ph
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/termios.ph
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/asm/termios.ph

-----


I assume that these were either a.) put there by the RedHat
installation, or b.) put there by the h2ph command. Either way, its
not like it can't find those files. Why would it still be
complaining?

Benjamin Goldberg

unread,
Oct 20, 2002, 1:36:29 AM10/20/02
to
Todd Seidenberg wrote:
> Benjamin Goldberg wrote:
[lots of snippage, and a bit of rearrangement]

> > > > > perl Makefile.PL
> > > > > Finding ioctl methods ...
> > > > > trying 'termios.ph'... nope

This should have found:
> /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/termios.ph

> > > > > trying 'asm/termios.ph'... nope

This should have found:
> /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/termios.ph


> > > > > trying 'sys/termiox.ph'... nope
> > > > > trying 'sys/termios.ph'... not useful

Obviously, this found what it was looking for, but it didn't contain
what was wanted.

> > > > > trying 'sys/ttycom.ph'... nope
> > > > > Device::Serial could not find ioctl definitions!
[snip]

> I assume that these were either a.) put there by the RedHat
> installation, or b.) put there by the h2ph command. Either way, its
> not like it can't find those files. Why would it still be
> complaining?

One possibility is ... the last perl statement of a require()ed or
do()ne file has to evaluate to a true value -- usually this is done by
ending the file with a line with a 1 (number 1) and a semicolon. Maybe
the h2ph program forgot to do this? (Just a WAG -- I don't have h2ph
in front of me). If that's not it... I guess I'm lost without a clue.

Benjamin Goldberg

unread,
Oct 22, 2002, 12:54:39 AM10/22/02
to
Todd Seidenberg wrote:
[snip]

> I've run the 'h2ph' command, specifically "cd /usr/include; h2ph -r
> -l" but it still doesn't work.
>
> Any thoughts?

Maybe using the h2xs program, you could create a perl extention which
will produce the constants you need? (WAG ... I've never done such a
thing)

Simon Cozens

unread,
Oct 22, 2002, 8:48:51 AM10/22/02
to
todd.se...@l-3com.com (Todd Seidenberg) writes:
> Any thoughts?

On Linux, these constants are defined in asm/ioctls.h which is included
by asm/termios.h; what happened to asm/termios.ph? What does that contain?

--
A formal parsing algorithm should not always be used.
-- D. Gries

Todd Seidenberg

unread,
Nov 4, 2002, 3:48:52 PM11/4/02
to
Sorry that I haven't reponded for a while.


This is what asm/termios.ph contains:

#####################

require '_h2ph_pre.ph';

unless(defined(&_I386_TERMIOS_H)) {
eval 'sub _I386_TERMIOS_H () {1;}' unless
defined(&_I386_TERMIOS_H);
require 'asm/termbits.ph';
require 'asm/ioctls.ph';

.....
.....
etc...

###############################
I do notice that I DON'T have a asm/ioctls.ph file anywhere in
/usr/lib/perl*. The only one I have is in

/usr/lib/perl5/5.8.0/i386-linux-thread-multi/bits/ioctls.ph
.
Should I create a link to the above in
/perl5/site_perl/5.8.0/i386-linux-thread-multi/asm?


- THanks,

Todd

Simon Cozens <simon....@computing-services.oxford.ac.uk> wrote in message news:<86hefey...@squash.oucs.ox.ac.uk>...

Todd Seidenberg

unread,
Nov 5, 2002, 11:51:55 AM11/5/02
to
Sorry,


My bad. I fixed the problem. It turns out that h2ph wasn't running
completely. It was failing on two different files:
/usr/include/asm/checksum.h and /usr/include/asm/string-486.h


Has anyone else Out there experienced this problem with RedHat 8 and
h2ph? I did a fresh install, and h2ph bombed on the above files. I had
to move them out of the way, in order for h2ph to complete.


- Just an FYI.

Todd

todd.se...@l-3com.com (Todd Seidenberg) wrote in message news:<c2753f41.02110...@posting.google.com>...

Eric Talavéra

unread,
Nov 5, 2002, 4:27:00 PM11/5/02
to
todd.se...@l-3com.com (Todd Seidenberg) wrote in message news:<c2753f41.02110...@posting.google.com>...


Hello Todd and everybody ... (sorry for my english!)

In my case (perl 5.8.0 under RH 8.0), the command "h2ph -r -l" refuse
to make the job, exactly like your case. So I try to pass header files
has argument, by subdirectorie or individually, and this make me
happy!

ex:
# cd /usr/include
# h2ph asm/*.h
or
# h2ph asm/termbits.h
# h2ph asm/ioctls.h
# h2ph asm/termios.h ... and what you wish.

The installation of Device-SerialPort-0.13 go sleekly after that.

I hope this help you.

Eric

0 new messages