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

Message ID 1300356675-31426-2-git-send-email-thresh@videolan.org
State Superseded
Headers show

Commit Message

thresh@videolan.org March 17, 2011, 10:11 a.m.
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(-)

Comments

Mans Rullgard March 17, 2011, 11:19 a.m. | #1
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.

> +    cc_ident=$($cc -V 2>&1 | cut -d\  -f 2-)

What exactly does $cc -V print?

> +    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.

> +    speed_cflags='+Ofast'
> +    size_cflags='+Osize'
>  fi

How does this compiler deal with gcc-style flags we use elsewhere?

>  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.

> +        ;;
>      irix*)
>          target_os=irix
>          ranlib="echo ignoring ranlib"
> -- 
> 1.7.4.1

Are you able to submit FATE results for this configuration?

Patch

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
+    cc_ident=$($cc -V 2>&1 | cut -d\  -f 2-)
+    cc_version="AV_STRINGIFY(__HP_cc)"
+    CC_DEPFLAGS='+maked'
+    AS_DEPFLAGS='+maked'
+    SHFLAGS='-b -Wl,+h $$(@F)'
+    speed_cflags='+Ofast'
+    size_cflags='+Osize'
 fi
 
 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
+        ;;
     irix*)
         target_os=irix
         ranlib="echo ignoring ranlib"