bug-ncurses
[Top][All Lists]
Advanced

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

mbstate_t on 11i, -rpath on IRIX, --disable-home-terminfo


From: Albert Chin
Subject: mbstate_t on 11i, -rpath on IRIX, --disable-home-terminfo
Date: Sun, 26 Dec 2004 20:44:39 -0600
User-agent: Mutt/1.5.6i

1. A change was made on 20030705 to get mbstate_t recognized on
   HP-UX 11i:
        + add -D_XOPEN_SOURCE=500 when configuring with --enable-widec, to
          get mbstate_t declaration on HPUX 11.11 (report by David Ellement).

   Unfortunately, -D_XOPEN_SOURCE=500 makes vsscanf() invisible on
   IRIX. I have attached a solution that works on HP-UX 11i,
   Solaris 7-9/SPARC, AIX 4.3.3-5.2, Tru64 UNIX 4.0D, 5.1,
   IRIX 6.5, Redhat Linux 7.1, 9, and RHEL 2.1, 3.0.

2. You don't print the result of --disable-home-terminfo.

3. Use -rpath when compiling witht SGI C compiler.

Patches against 5.4-20041225.

-- 
albert chin (address@hidden)

-- snip snip
--- include/ncurses_cfg.hin.orig        2004-12-26 13:53:05.901673000 -0600
+++ include/ncurses_cfg.hin     2004-12-26 14:31:16.371433000 -0600
@@ -59,4 +59,14 @@
 #endif
 #endif
 
+       /* On HP-UX, the C compiler doesn't grok mbstate_t without
+          -D_XOPEN_SOURCE=500. However, this causes problems on
+          IRIX. So, we #define mbstate_t to int in configure.in
+          only for the C compiler if needed. */
+#ifndef __cplusplus
+#if NEED_MBSTATE_T_DEF
+#define mbstate_t int
+#endif
+#endif
+
 #endif /* NC_CONFIG_H */
--- aclocal.m4.orig     2004-12-26 11:56:29.002584000 -0600
+++ aclocal.m4  2004-12-26 12:47:07.525377000 -0600
@@ -3083,8 +3083,13 @@
                ;;
        irix*)
                if test "$cf_cv_ld_rpath" = yes ; then
-                       cf_ld_rpath_opt="-Wl,-rpath,"
-                       EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS"
+                       if test "$GCC" = yes; then
+                               cf_ld_rpath_opt="-Wl,-rpath,"
+                               EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) 
$EXTRA_LDFLAGS"
+                       else
+                               cf_ld_rpath_opt="-rpath "
+                               EXTRA_LDFLAGS="-rpath \$(libdir) $EXTRA_LDFLAGS"
+                       fi
                fi
                # tested with IRIX 5.2 and 'cc'.
                if test "$GCC" != yes; then
--- configure.in.orig   2004-12-26 12:35:27.820843000 -0600
+++ configure.in        2004-12-26 14:10:39.911398000 -0600
@@ -519,6 +519,7 @@
        [  --disable-home-terminfo drop ~/.terminfo from terminfo search-path],
        [with_home_terminfo=$enableval],
        [with_home_terminfo=yes])
+AC_MSG_RESULT($with_home_terminfo)
 test "$with_home_terminfo" = "yes" && AC_DEFINE(USE_HOME_TERMINFO)
 
 ###   Use option --enable-symlinks to make tic use symlinks, not hard links
@@ -607,7 +608,6 @@
 if test "$with_widec" = yes ; then
        LIB_SUFFIX="w${LIB_SUFFIX}"
        AC_DEFINE(USE_WIDEC_SUPPORT)
-       CF_PREDEFINE(_XOPEN_SOURCE,500)
        CF_PREDEFINE(_XOPEN_SOURCE_EXTENDED)
        # with_overwrite=no
        NCURSES_CH_T=cchar_t
@@ -621,6 +621,10 @@
        CF_WCHAR_TYPE(mbstate_t, NCURSES_MBSTATE_T)
        CF_WCHAR_TYPE(wchar_t,   NCURSES_WCHAR_T,   NCURSES_OK_WCHAR_T)
        CF_WCHAR_TYPE(wint_t,    NCURSES_WINT_T,    NCURSES_OK_WINT_T)
+
+       if test "$NCURSES_MBSTATE_T" != 0; then
+               AC_DEFINE(NEED_MBSTATE_T_DEF)
+       fi
 fi
 AC_SUBST(NCURSES_CH_T)
 AC_SUBST(NCURSES_LIBUTF8)




reply via email to

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