I went with just the first suggestion and just renamed the gcc types.h to _types.h, and made it past that sticking point. Now I'm stuck on dgram.c. Here's what I've copied that seemed relevant.
gcc -DHAVE_CONFIG_H -I. -I. -I../config -I./../regex-src -D_FILE_OFFSET_BITS=64 -D__STDC_EXT__ -D_FILE_OFFSET_BITS=64 -g -O2 -c dgra
m.c
<command line>:1:1: warning: "__STDC_EXT__" redefined
<command line>:1:1: warning: this is the location of the previous definition
dgram.c: In function `dgram_send':
dgram.c:222: warning: assignment makes pointer from integer without a cast
dgram.c:230: dereferencing pointer to incomplete type
dgram.c:230: dereferencing pointer to incomplete type
*** Error exit code 1
Stop.
dgram.c
222 if((hp = gethostbyname(hostname)) == 0) {
223 save_errno = errno;
224 dbprintf(("%s: dgram_send: gethostbyname(%s) failed\n",
225 get_pname(),
226 hostname));
227 errno = save_errno;
228 return -1;
229 }
230 memcpy(&name.sin_addr, hp->h_addr, hp->h_length);
I've looked everywhere I could think of for gethostbyname, and could not find the actual function for it, but it is in the man pages. In my searches, I also noticed that there were some other programs that called it (sendmail, hoststat, rpc.statd), and it kept giving failures of some type.
Has anyone successfully compiled this with gcc on hp-ux 11i? Ours is a month old system, and I didn't think I would be running into these types of problems. Thanks to all for any help!
Gary
-----Original Message-----
From: Jon LaBadie [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 31, 2002 12:16 PM
To: Gary Hines
Subject: Re: make problem - HP-UX 11i, amanda 2.4.2p2
On Fri, May 31, 2002 at 10:46:18AM -0500, Gary Hines wrote:
> Thanks very much for the help Jon (and the refresher course in C). I've
> stepped back to simple basics, and starting with a configure that just sets
> up the user and group. I've also replaced the socket.h. I reran the make
> after the new configure, and received the same error, so I tried it with -E
> as you mentioned in the previous e-mail. This shed a new light on things. It
> seems it is calling the types.h file that is included with gcc
> (/usr/local/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.1/include/sys/types.h). I
> checked, and this types.h file does not have the definitions in it, while
> the HP one (/usr/include/sys/types.h) does. So I know what's wrong, but how
> can I fix it?
Interesting, my gcc installation (solaris, from Sun's extra software cd)
does not have a sys/types.h.
I don't know the answer. I know the first thing I would try is to
rename gcc's types.h to _types.h. That will prevent it from being
found and the system one will be included. The C pre-processor
looks for include files in a sequence of include dirs. Kinda like
a PATH variable for include files. The system dirs are the last
to be looked at.
I might also consider adding #include </usr/include/sys/types.h> to
the beginning of the gcc types.h file. This could cause an explosion
of errors from duplication or redefinition, maybe not. Be careful
about placement and those nasty #ifndef's at the beginning. If
both sys/types.h use the same macro to prevent reincluding the
header file (probably something like _sys_type_h), you may want
the extra #include to replace the #define in the gcc header.
Otherwise placement is not critical.
Now that you have homed in on the problem, I'd suggest a revisit to
the mail list. Many of them are using HP-UX, and I'll bet some the
same version of gcc as you. Though I think that is pretty recent.
Explain that gcc seems to be picking up its own types.h rather than
the system one and that some definitions in the system one are needed.
Show your configure command line, but I'd suggest putting the output
into an attachment. Make sure the output is from a run AFTER a
make distclean.
Maybe also attach the resulting config.h file.
Show a make like you did before with the sbsize error.
--
Jon H. LaBadie [EMAIL PROTECTED]
JG Computing
4455 Province Line Road (609) 252-0159
Princeton, NJ 08540-4322 (609) 683-7220 (fax)
