[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AW: address@hidden: HP-UX: link error]
From: |
Bauer, Christoph |
Subject: |
AW: address@hidden: HP-UX: link error] |
Date: |
Wed, 22 Mar 2006 13:00:24 +0100 |
> cc fails with this error in lib-src:
>
> cc -DHAVE_CONFIG_H -I. -I../src -
> I/T/tools/unix/build/emacs/emacs/lib-src
> -I/T/tools/unix/build/emacs/emacs/lib-src/../src -g
> /T/tools/unix/build/emacs/emacs/lib-src/fakemail.c -l:libdld.sl -
> o
> fakemail
> cpp: "/T/tools/unix/build/emacs/emacs/lib-src/../src/s/hpux9.h", line
> 63:
> warning 2001: Redefinition of macro HAVE_PSTAT_GETDYNAMIC.
> cc: "/usr/include/sys/_mbstate_t.h", line 11: error 1000: Unexpected
> symbol:
> "int".
> cc: "/usr/include/stdlib.h", line 117: warning 573: Parameter list is
> inconsistent for "getenv".
>
> Would you like to debug it and send a patch we can try?
I don't have a complete fix, but a first explanation for the message.
src/config.h contains
/* Define to 1 if <wchar.h> declares mbstate_t. */
/* #undef HAVE_MBSTATE_T */
#define HAVE_SYS__MBSTATE_T_H 1
#define mbstate_t int
/* End of config.h */
But <sys/_mbstate_t.h> defines mbstate_t as a struct. This leads to
the syntax error above. src/config.h from the gcc-build doesn't
define mbstate_t. configure.in:AC_TYPE_MSTATE_T
generates a test program, which includes only <wchar.h>.
Here is a patch for configure.in with a workaround:
diff -r1.406 configure.in
2695a2696,2700
> echo "$ac_cv_header_sys__mbstate_t_h"
> if test "$ac_cv_header_sys__mbstate_t_h" = "yes"; then
> ac_cv_type_mbstate_t="yes"
> fi
>
There is a second problem, which is located in src/strftime.c.
#ifdef _LIBC
...
# define MULTIBYTE_IS_FORMAT_SAFE 1
...
#endif
...
#define DO_MULTIBYTE (HAVE_MBLEN && ! MULTIBYTE_IS_FORMAT_SAFE)
#if DO_MULTIBYTE
# if HAVE_MBRLEN
# include <wchar.h>
# ifdef HAVE_SYS__MBSTATE_H /* previously tested __hpux */
# include <sys/_mbstate_t.h>
# endif
# if !defined (mbsinit) && !defined (HAVE_MBSINIT)
# define mbsinit(ps) 1
# endif /* !defined (mbsinit) && !defined (HAVE_MBSINIT) */
So <sys/_mbstate_t.h> is not included (_LIBC in not defined).
When I define MULTIBYTE_IS_FORMAT_SAFE in config.h, the build
succeeds.