bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gawk 3.2.1 on HP-UX


From: Mike Langas
Subject: Re: Gawk 3.2.1 on HP-UX
Date: Fri, 25 Jun 2004 13:17:26 -0700 (PDT)

Michael,

Your suggestion works.  I think getting multibyte support to work might be
fairly straight forward however.

I did some research into the issue and found that to get full multibyte support
to work on HP there are a few things that need to be done.

1) define UNIX_STD=98 in the environment.
2) compile with the macro -D_XOPEN_SOURCE=500
3) with gcc, explicitly link with the object file unix98.o

I'm fairly sure I did the first two steps correctly.  The compile makes it much
further before I get errors.  I'm also fairly sure that I'm not correctly
linking with the unix98.o object.  It's times like this that I wish I had more
development experience ;-/

If you can tell me how get unix98.o used with the linker, I'll give it another
try.

Thanks again,

Mike


--- Michael Elizabeth Chastain <address@hidden> wrote:
> I've run into this problem.
> 
> The issue is that HP-UX 11i has partial support for multibyte libraries.
> The gawk configury machinery sees the partial support and turns on
> multibyte support, but then the build fails because of the lack of full
> support.
> 
> ---
> 
> One solution is to patch the multibyte configuration machinery.  At the
> end of this message is a patch for gawk 3.1.3.  I tested this with
> several compilers and multibyte environment settings, and have been
> using it regularly on hppa2.0w-hp-hpux11.11.
> 
> After applying this patch, you have to touch (or regenerate) these
> files:
> 
>   sleep 2 ; touch gawk-3.1.3/aclocal.m4
>   sleep 2 ; touch gawk-3.1.3/configh.in
>   sleep 2 ; touch gawk-3.1.3/configure
>   sleep 2 ; touch gawk-3.1.3/patchlev.h
>   sleep 2 ; touch gawk-3.1.3/version.c
> 
> ---
> 
> Here's an alternative that should probably work and is definitely
> simpler.  I haven't tested this, though.  Before you configure gawk, do
> this:
> 
>   export ac_cv_func_mbrlen=no
>   export ac_cv_func_mbrtowc=no
> 
> If you use csh or tcsh, the command would be:
> 
>   setenv ac_cv_func_mbrlen no
>   setenv ac_cv_func_mbrtowc no
> 
> This pre-answers some of the configuration probes to disable
> some of the multibyte functions.  No source change needed.
> 
> Would you mind trying this out and sending an email back to the
> list about whether it works or not?
> 
> ---
> 
> All this should be sorted in the next release of gawk.  I've been
> testing pre-releases on hpux 11.11 with gcc and hp ansi c and
> it's working in the pre-releases.
> 
> Hope this helps,
> 
> Michael C
> 
> ---
> 
> diff -c3p -r ORIGINAL-gawk-3.1.3/awk.h gawk-3.1.3/awk.h
> *** ORIGINAL-gawk-3.1.3/awk.h 2003-06-29 08:52:40.000000000 -0400
> --- gawk-3.1.3/awk.h  2003-12-20 17:02:13.000000000 -0500
> *************** extern int errno;
> *** 73,79 ****
>   #ifdef HAVE_SIGNUM_H
>   #include <signum.h>
>   #endif
> ! #if defined(HAVE_MBRLEN) && defined(HAVE_MBRTOWC) && defined(HAVE_WCHAR_H)
> && defined(HAVE_WCTYPE_H)
>   /* We can handle multibyte strings.  */
>   #define MBS_SUPPORT
>   #include <wchar.h>
> --- 73,79 ----
>   #ifdef HAVE_SIGNUM_H
>   #include <signum.h>
>   #endif
> ! #if defined(HAVE_MBSTATE_T) && defined(HAVE_MBRLEN) &&
> defined(HAVE_MBRTOWC) && defined(HAVE_WCHAR_H) && defined(HAVE_WCTYPE_H)
>   /* We can handle multibyte strings.  */
>   #define MBS_SUPPORT
>   #include <wchar.h>
> diff -c3p -r ORIGINAL-gawk-3.1.3/configh.in gawk-3.1.3/configh.in
> *** ORIGINAL-gawk-3.1.3/configh.in    2003-07-04 13:49:45.000000000 -0400
> --- gawk-3.1.3/configh.in     2003-12-20 17:02:18.000000000 -0500
> ***************
> *** 129,134 ****
> --- 129,137 ----
>   /* Define to 1 if you have the `mbrtowc' function. */
>   #undef HAVE_MBRTOWC
>   
> + /* Define to 1 if <wchar.h> declares mbstate_t. */
> + #undef HAVE_MBSTATE_T
> + 
>   /* Define to 1 if you have the <mcheck.h> header file. */
>   #undef HAVE_MCHECK_H
>   
> ***************
> *** 430,435 ****
> --- 433,441 ----
>   /* Define to widest signed type if <inttypes.h> doesn't define. */
>   #undef intmax_t
>   
> + /* Define to a type if <wchar.h> does not define. */
> + #undef mbstate_t
> + 
>   /* Define to `long' if <sys/types.h> does not define. */
>   #undef off_t
>   
> diff -c3p -r ORIGINAL-gawk-3.1.3/configure gawk-3.1.3/configure
> *** ORIGINAL-gawk-3.1.3/configure     2003-07-04 13:49:09.000000000 -0400
> --- gawk-3.1.3/configure      2003-12-20 17:02:20.000000000 -0500
> *************** cat >>confdefs.h <<_ACEOF
> *** 9266,9271 ****
> --- 9266,9329 ----
>   _ACEOF
>   
>   
> + echo "$as_me:$LINENO: checking for mbstate_t" >&5
> + echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6
> + if test "${ac_cv_type_mbstate_t+set}" = set; then
> +   echo $ECHO_N "(cached) $ECHO_C" >&6
> + else
> +   cat >conftest.$ac_ext <<_ACEOF
> + #line $LINENO "configure"
> + /* confdefs.h.  */
> + _ACEOF
> + cat confdefs.h >>conftest.$ac_ext
> + cat >>conftest.$ac_ext <<_ACEOF
> + /* end confdefs.h.  */
> + $ac_includes_default
> + #       include <wchar.h>
> + int
> + main ()
> + {
> + mbstate_t x; return sizeof x;
> +   ;
> +   return 0;
> + }
> + _ACEOF
> + rm -f conftest.$ac_objext
> + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
> +   (eval $ac_compile) 2>&5
> +   ac_status=$?
> +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
> +   (exit $ac_status); } &&
> +          { ac_try='test -s conftest.$ac_objext'
> +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
> +   (eval $ac_try) 2>&5
> +   ac_status=$?
> +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
> +   (exit $ac_status); }; }; then
> +   ac_cv_type_mbstate_t=yes
> + else
> +   echo "$as_me: failed program was:" >&5
> + sed 's/^/| /' conftest.$ac_ext >&5
> + 
> + ac_cv_type_mbstate_t=no
> + fi
> + rm -f conftest.$ac_objext conftest.$ac_ext
> + fi
> + echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5
> + echo "${ECHO_T}$ac_cv_type_mbstate_t" >&6
> +    if test $ac_cv_type_mbstate_t = yes; then
> + 
> + cat >>confdefs.h <<\_ACEOF
> + #define HAVE_MBSTATE_T 1
> + _ACEOF
> + 
> +    else
> + 
> + cat >>confdefs.h <<\_ACEOF
> + #define mbstate_t int
> + _ACEOF
> + 
> +    fi
>   
>     echo "$as_me:$LINENO: checking for long long" >&5
>   echo $ECHO_N "checking for long long... $ECHO_C" >&6
> diff -c3p -r ORIGINAL-gawk-3.1.3/configure.ac gawk-3.1.3/configure.ac
> *** ORIGINAL-gawk-3.1.3/configure.ac  2003-07-04 13:26:33.000000000 -0400
> --- gawk-3.1.3/configure.ac   2003-12-20 17:02:13.000000000 -0500
> *************** AC_TYPE_PID_T
> *** 159,164 ****
> --- 159,165 ----
>   AC_TYPE_SIGNAL
>   AC_SIZE_T
>   AC_TYPE_GETGROUPS
> + AC_TYPE_MBSTATE_T
>   jm_AC_TYPE_LONG_LONG
>   jm_AC_TYPE_UNSIGNED_LONG_LONG
>   jm_AC_TYPE_INTMAX_T
> diff -c3p -r ORIGINAL-gawk-3.1.3/regex_internal.h gawk-3.1.3/regex_internal.h
> *** ORIGINAL-gawk-3.1.3/regex_internal.h      2003-03-11 04:44:35.000000000 
> -0500
> --- gawk-3.1.3/regex_internal.h       2003-12-20 17:02:13.000000000 -0500
> ***************
> *** 39,44 ****
> --- 39,51 ----
>   #include <stdlib.h>
>   #include <string.h>
>   
> + /* HPUX 11.11 needs stdarg/varargs before wchar.h */
> + #if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
> + #include <stdarg.h>
> + #else
> + #include <varargs.h>
> + #endif
> + 
>   #if defined HAVE_LOCALE_H || defined _LIBC
>   # include <locale.h>
>   #endif
> ***************
> *** 81,87 ****
>   # define gettext_noop(String) String
>   #endif
>   
> ! #if (defined MB_CUR_MAX && HAVE_LOCALE_H && HAVE_WCTYPE_H && HAVE_WCHAR_H
> && HAVE_WCRTOMB && HAVE_MBRTOWC && HAVE_WCSCOLL) || _LIBC
>   # define RE_ENABLE_I18N
>   #endif
>   
> --- 88,94 ----
>   # define gettext_noop(String) String
>   #endif
>   
> ! #if (defined MB_CUR_MAX && HAVE_LOCALE_H && HAVE_WCTYPE_H && HAVE_WCHAR_H
> && HAVE_MBSTATE_T && HAVE_WCRTOMB && HAVE_MBRTOWC && HAVE_WCSCOLL) || _LIBC
>   # define RE_ENABLE_I18N
>   #endif
>   
> 
> 
> _______________________________________________
> address@hidden
> http://lists.gnu.org/mailman/listinfo/bug-gnu-utils
> 



        
                
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]