nmh-workers
[Top][All Lists]
Advanced

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

[Nmh-workers] Solaris 2.9 incompatibilities


From: Marcin Cieslak
Subject: [Nmh-workers] Solaris 2.9 incompatibilities
Date: Wed, 26 Aug 2015 23:24:51 +0000

With some efforts I have installed a decent
compiler on an oldish SPARC box running Solaris 2.9.

Pretty nice setup for portability testing.

I gave nmh git master a try and it fails
due to the following:

uip/whatnowsbr.o wants setenv(), not present
uip/mhparse.o wants isblank() and getline(), both not present

mhical.c warns about gmtime_r unknown,
which is fixed by adding -D_POSIX_C_SOURCE=200800L to CFLAGS.
This is turn makes it forget about strcpy(), so I'd thrown
-D_XPG4_2 additionally. This makes it unhappy about
snprintf() which gets fixed by adding -D_XPG5.
All three make mhical warning-free.

Adding all three defines to a whole build makes it stop at:

depbase=`echo etc/gen-ctype-checked.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -m64 -mcpu=ultrasparc3 -DHAVE_CONFIG_H -I. -I/home/admini/saper/src/nmh   
-D_FORTIFY_SOURCE=2  -D_POSIX_C_SOURCE=200800L -D_XPG4_2 -D_XPG5 -MT 
etc/gen-ctype-checked.o -MD -MP -MF $depbase.Tpo -c -o etc/gen-ctype-checked.o 
/home/admini/saper/src/nmh/etc/gen-ctype-checked.c &&\
mv -f $depbase.Tpo $depbase.Po
/home/admini/saper/src/nmh/etc/gen-ctype-checked.c:49:32: error: ‘isblank’ 
undeclared here (not in a function)
 # define CTYPE_FUNCTIONS_C99 X(isblank)
                                ^
/home/admini/saper/src/nmh/etc/gen-ctype-checked.c:56:34: note: in definition 
of macro ‘X’
 #define X(function) { #function, function },
                                  ^
/home/admini/saper/src/nmh/etc/gen-ctype-checked.c:58:46: note: in expansion of 
macro ‘CTYPE_FUNCTIONS_C99’
     { CTYPE_FUNCTIONS CTYPE_FUNCTION_ISASCII CTYPE_FUNCTIONS_C99 { NULL, 0} };
                                              ^
Makefile:2301: recipe for target 'etc/gen-ctype-checked.o' failed
make: *** [etc/gen-ctype-checked.o] Error 1

(which is a consequence of the isblank() missing).

Finally there is a problem with getting signals right,
fixed by the  patch below.

~Marcin


>From f5114bb2523edcf5c13a460cf182728d569fd487 Mon Sep 17 00:00:00 2001
From: saper <address@hidden>
Date: Thu, 27 Aug 2015 01:19:58 +0200
Subject: [PATCH] Solaris 2.9: Signal handling fixes

1. Include <signal.h> in pidstatus.c
   to get SIGINT:

sbr/pidstatus.c:57:16: error: SIGINT undeclared (first use in this function)
  if (signum != SIGINT) {

2. Try using /usr/include/sys/iso/signal_iso.h
   to extract the list of signals.
---
 configure.ac    | 1 +
 sbr/pidstatus.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/configure.ac b/configure.ac
index 0936556..0b94ba1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -540,6 +540,7 @@ AC_CACHE_CHECK(where signal.h is located, 
nmh_cv_path_signal_h,
                  /usr/include/asm/signal.h      dnl Linux 1.3.0 and above
                  /usr/include/asm/signum.h      dnl some versions of 
Linux/Alpha
                  /usr/include/linux/signal.h    dnl Linux up to 1.2.11
+                 /usr/include/sys/iso/signal_iso.h dnl Solaris 2.9
                  /usr/include/sys/signal.h      dnl Almost everybody else
                  /dev/null;                     dnl Just in case we fall 
through
 do
diff --git a/sbr/pidstatus.c b/sbr/pidstatus.c
index 1c1f734..b3e5af8 100644
--- a/sbr/pidstatus.c
+++ b/sbr/pidstatus.c
@@ -12,6 +12,7 @@
 /*
  * auto-generated header
  */
+#include <signal.h>
 #include <sigmsg.h>
 
 #ifndef WTERMSIG
-- 
2.5.0



reply via email to

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