[2/2] configure: recognize HP-UX.

Message ID 20110317130917.GA32630@snowwhite.immo
State Superseded
Headers show

Commit Message

thresh@videolan.org March 17, 2011, 1:09 p.m.
On Thu, Mar 17, 2011 at 11:19:27AM +0000, Måns Rullgård wrote:
> thresh@videolan.org writes:
> 
> > From: Konstantin Pavlov <thresh@videolan.org>
> >
> > This commit adds flags to support HP-UX aCC compiler.
> > Tested on HP-UX B.11.31, aCC B3910B A.06.25 [Nov 30 2009].
> > ---
> >  configure |   12 ++++++++++++
> >  1 files changed, 12 insertions(+), 0 deletions(-)
> >
> > diff --git a/configure b/configure
> > index 1494994..9242df0 100755
> > --- a/configure
> > +++ b/configure
> > @@ -2061,6 +2061,15 @@ elif $cc -v 2>&1 | grep -q Open64; then
> >      AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
> >      speed_cflags='-O2'
> >      size_cflags='-Os'
> > +elif $cc -V 2>&1 | grep -q 'HP C'; then
> > +    cc_type=hpux
> 
> This should be acc, not hpux.  We're talking about the compiler, not the OS.

OK

> > +    cc_ident=$($cc -V 2>&1 | cut -d\  -f 2-)
> 
> What exactly does $cc -V print?

$ cc -V
cc: HP C/aC++ B3910B A.06.25 [Nov 30 2009]

> > +    cc_version="AV_STRINGIFY(__HP_cc)"
> > +    CC_DEPFLAGS='+maked'
> > +    AS_DEPFLAGS='+maked'
> > +    SHFLAGS='-b -Wl,+h $$(@F)'
> 
> The SHFLAGS (except possibly -b) are a property of the linker and should
> be in the OS section for HP-UX.

OK

> > +    speed_cflags='+Ofast'
> > +    size_cflags='+Osize'
> >  fi
> 
> How does this compiler deal with gcc-style flags we use elsewhere?

Ignores everything it does not know about and spits a warning message
#901, like that:

$ cc -fomit-frame-pointers 
cc: warning 901: unknown option: `-fomit-frame-pointers': use +help for
online documentation. 

Unfortunately I couldnt find a way how to tell a compiler to fail on
unknown options, that's why I explicitely disabled this warning in
add_cflags, +W901.

> >  test -n "$cc_type" && enable $cc_type ||
> > @@ -2454,6 +2463,9 @@ case $target_os in
> >      linux)
> >          enable dv1394
> >          ;;
> > +    hp-ux)
> > +        add_cflags -Ae +Olit=all -O +W4232 +W901 +u4
> 
> At least some of those are specific to the compiler and should be in a
> compiler section, not the OS one.

OK

I still left -O here because libav would not link properly without it
with ld reporting missing symbols that were not enabled during the
configure phase (like external libraries).

> > +        ;;
> >      irix*)
> >          target_os=irix
> >          ranlib="echo ignoring ranlib"
> > -- 
> > 1.7.4.1
> 
> Are you able to submit FATE results for this configuration?

I need to ask the machine owner (there are some concerns about available
amount of traffic).

BTW, I had to --disable-demuxer='rtsp,sdp' as aCC thinks it is smart
enough to substitute the field 'open' in libavcodec/rtpdec_asf.c:289 when
-D_FILE_OFFSET_BITS=64 is defined so the compilation fails.

Also, I had to --disable-encoder=vorbis because aCC catches a segmentation
fault on it.

Updated patch attached.

Comments

thresh@videolan.org April 11, 2011, 5:38 a.m. | #1
On Thu, Mar 17, 2011 at 04:09:17PM +0300, Konstantin Pavlov wrote:
> Updated patch attached.

I have tested the compilation under gcc on this same machine and ran a
fate test against it.  The updated patch differs only in a add_cflags part
for hpux OS, I've added needed flags similar to those for aCC needed to
build libav.

Also, it looks like the platform lacks isnan function used in
libavfilter/vf_crop.c, so I provided a replacement for it.

Patch

diff --git a/configure b/configure
index 1494994..cf0c3d8 100755
--- a/configure
+++ b/configure
@@ -2061,6 +2061,16 @@  elif $cc -v 2>&1 | grep -q Open64; then
     AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
     speed_cflags='-O2'
     size_cflags='-Os'
+elif $cc -V 2>&1 | grep -q 'HP C'; then
+    cc_type=acc
+    cc_ident=$($cc -V 2>&1 | cut -d\  -f 2-)
+    cc_version="AV_STRINGIFY(__HP_cc)"
+    CC_DEPFLAGS='+maked'
+    AS_DEPFLAGS='+maked'
+    SHFLAGS='-b'
+    speed_cflags='+Ofast'
+    size_cflags='+Osize'
+    add_cflags -Ae +Olit=all +W4232 +W901 +u4
 fi
 
 test -n "$cc_type" && enable $cc_type ||
@@ -2454,6 +2464,10 @@  case $target_os in
     linux)
         enable dv1394
         ;;
+    hp-ux)
+        add_cflags -O
+        append SHFLAGS '-Wl,+h\$\$(@F)'
+        ;;
     irix*)
         target_os=irix
         ranlib="echo ignoring ranlib"