From: nesius Date: 2004-09-01T05:55:10+09:00 Subject: Re: Followup on HPUX build issue On Tue, 31 Aug 2004 nobu.nokada@softhome.net wrote: > Hi, > > At Tue, 31 Aug 2004 11:19:03 +0900, > Robert Nesius wrote in [ruby-talk:111049]: > > It looks like the problem is that the Makefile for ext/pty defines in > > CPP_FLAGS -DHAVE_GLIBC or -DHAVE_OPENPTY (something along those lines - > > don't have the build area handy right now), and also includes -lutil in > > LIBS. Looks like this was done unconditionally? In any case, after > > tweaking those lines in the make file the pty extension at least > > compiled. If this wasn't the right list for my question/follow-up, > > apologies in advance. > > It should be done by have_library("util", "openpty") in > extconf.rb. Can't you show the mkmf.log? Sorry - I did not know about the mkmf.log until you pointed me at it. I build Open Source tools all of the time. The ruby build has always been a bit of a mystery to me in terms of how it is architected. In any case, upon looking at this log file I was able to root cause the failure mode that was causing ruby to think it had access to 'util.h' and -lutil. Basically, the build assumes it is using gcc, and when built with HPs ansic compiler it encounters a failure mode that leads the build to conclude the test succeeded vs. failed. The test is: $CC -o conftest $CFLAGS -lutil -E conftest.c -E tells both gcc and ansic to dump the pre-processor output. gcc interprets -o as a directive to dump the output into conftest. /opt/ansic/bin/cc, when it sees -E, does not understand -o. it just dumps the output to stdout. A better way to do this when using ansic is to use the '-P' directive, like so: $CC $CFLAGS -P conftest.c. The preprocessor output will be put into conftest.i. I tried using gcc but ran into another failure mode, and I much prefer using HPs ansic compiler on HPUX because it produces much much tighter code than gcc does. On HPUX give me Ruby and Perl compiled with ansic over perl/ruby compiled with gcc any day of the week and twice on Sunday. -Rob