Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #11651

bash 4.3.42 configure script needs to test sys/resource.h different on SunOS4

From "Klaus Ziegler - owner of sunfreeware.de" <klausz@haus-gisela.de>
Newsgroups gnu.bash.bug
Subject bash 4.3.42 configure script needs to test sys/resource.h different on SunOS4
Date 2015-10-13 22:10 +0200
Message-ID <mailman.268.1444768305.7904.bug-bash@gnu.org> (permalink)

Show all headers | View raw


Configuration Information [Automatically generated, do not change]:
Machine: m68k
OS: sunos4.1.1_U1
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='m68k' 
-DCONF_OSTYPE='sunos4.1.1_U1' -DCONF_MACHTYPE='m68k-sun-sunos4.1.1_U1' 
-DCONF_VENDOR='sun' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' 
-DSHELL -DHAVE_CONFIG_H -DSunOS4   -I.  -I. -I./include -I./lib 
-I./lib/intl -I/export/home/klausz/src/bash-4.3.30/lib/intl  -O2
uname output: SunOS suntools 4.1.1_U1 1 sun3x
Machine Type: m68k-sun-sunos4.1.1_U1

Bash Version: 4.3
Patch Level: 42
Release Status: release

Description:
if running the configure script on SunOS4 the following WARNING occurs:

./configure `cat /export/home/klausz/src/conf_bash-4.3.30`
checking build system type... m68k-sun-sunos4.1.1_U1
checking host system type... m68k-sun-sunos4.1.1_U1

Beginning configuration for bash-4.3-release for m68k-sun-sunos4.1.1_U1

checking for gcc... gcc
...
checking sys/resource.h usability... no
checking sys/resource.h presence... yes
configure: WARNING: sys/resource.h: present but cannot be compiled
configure: WARNING: sys/resource.h:     check for missing prerequisite 
headers?
configure: WARNING: sys/resource.h: see the Autoconf documentation
configure: WARNING: sys/resource.h:     section "Present But Cannot Be 
Compiled"
configure: WARNING: sys/resource.h: proceeding with the compiler's result
configure: WARNING:     ## ------------------------------- ##
configure: WARNING:     ## Report this to bug-bash@gnu.org ##
configure: WARNING:     ## ------------------------------- ##
checking for sys/resource.h... no
...
checking for snprintf... no <---- no warning here - but!
...

this leads to the following compilation errors later on:
gcc  -DPROGRAM='"bash"' -DCONF_HOSTTYPE='"m68k"' 
-DCONF_OSTYPE='"sunos4.1.1_U1"' 
-DCONF_MACHTYPE='"m68k-sun-sunos4.1.1_U1"' -DCONF_VENDOR='"sun"' 
-DLOCALEDIR='"/usr/share/locale"' -DPACKAGE='"bash"' -DSHELL 
-DHAVE_CONFIG_H -DSunOS4 -I.  -I. -I./include -I./lib -I./lib/intl 
-I/export/home/klausz/src/bash-4.3.30/lib/intl  -O2     -O2  -O2  -o 
bashversion ./support/bashversion.c buildversion.o
ld: Undefined symbol
    _snprintf
collect2: ld returned 2 exit status
gmake: *** [bashversion] Error 1
...
gcc  -DPROGRAM='"bash"' -DCONF_HOSTTYPE='"m68k"' 
-DCONF_OSTYPE='"sunos4.1.1_U1"' 
-DCONF_MACHTYPE='"m68k-sun-sunos4.1.1_U1"' -DCONF_VENDOR='"sun"' 
-DLOCALEDIR='"/usr/share/locale"' -DPACKAGE='"bash"' -DSHELL 
-DHAVE_CONFIG_H -DSunOS4   -I.  -I. -I./include -I./lib -I./lib/intl 
-I/export/home/klausz/src/bash-4.3.30/lib/intl  -O2 -c execute_cmd.c
execute_cmd.c: In function `time_command':
execute_cmd.c:1268: storage size of `selfb' isn't known
execute_cmd.c:1268: storage size of `selfa' isn't known
execute_cmd.c:1268: storage size of `kidsb' isn't known
execute_cmd.c:1268: storage size of `kidsa' isn't known
execute_cmd.c:1282: `RUSAGE_SELF' undeclared (first use in this function)
execute_cmd.c:1282: (Each undeclared identifier is reported only once
execute_cmd.c:1282: for each function it appears in.)
execute_cmd.c:1283: `RUSAGE_CHILDREN' undeclared (first use in this 
function)
gmake: *** [execute_cmd.o] Error 1

Hi Chet,

I have no clue how to fix the bashversion linking error in the configure 
script, besides modifying config.h after
configure has done it's work. However, the compile error in 
execute_cmd.c, is directly related to the failed
autoconf test for <sys/resource.h> from above. On SunOS4 a test for 
/usr/include/sys/resource.h needs to
include /usr/include/sys/time.h to be successful.

from config.log:
configure:9287: checking sys/resource.h usability
configure:9287: gcc -c -O2  conftest.c >&5
In file included from conftest.c:147:
/usr/include/sys/resource.h:24: field `ru_utime' has incomplete type
/usr/include/sys/resource.h:25: field `ru_stime' has incomplete type
configure:9287: $? = 1

from /usr/include/sys/resource.h:
     23  struct  rusage {
     24          struct timeval ru_utime;        /* user time used */
     25          struct timeval ru_stime;        /* system time used */
from /usr/include/sys/time.h:
     16  struct timeval {
     17          long    tv_sec;         /* seconds */
     18          long    tv_usec;        /* and microseconds */
     19  };
including <sys/time.h> before checking <sys/resource.h> works.

Other useful information:
configure options used:
--enable-help-builtin --enable-history --enable-job-control 
--enable-multibyte --enable-process-substitution --enable-progcomp 
--enable-prompt-string-decoding --enable-readline --enable-select 
--enable-xpg-echo-default --enable-alias --enable-arith-for-command 
--enable-array-variables --enable-bang-history --enable-brace-expansion 
--enable-casemod-attributes --enable-casemod-expansions 
--enable-command-timing --enable-cond-command --enable-cond-regexp 
--enable-coprocesses --enable-direxpand-default --enable-directory-stack 
--enable-dparen-arithmetic --enable-extended-glob 
--enable-extended-glob-default --enable-glob-asciiranges-default 
--prefix=/usr
GCC used:
gcc (GCC) 3.2.3
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
sorry it's the newest one I could find for this platform.

Repeat-By:
tried 4.1 series - also happens there.


Fix:
quick fix: change config.h after configure is run:

diff config.h.orig config.h
782c782
< #define HAVE_SNPRINTF 0
---
 > /* #undef HAVE_SNPRINTF */
1000c1000
< /* #undef HAVE_SYS_RESOURCE_H */
---
 > #define HAVE_SYS_RESOURCE_H 1

fix for autoconf test <sys/resource.h> in configure:
--- configure.orig      2014-02-11 16:38:00.000000000 +0100
+++ configure   2015-10-13 18:12:00.000000000 +0200
@@ -1806,11 +1806,32 @@
    # Is the header compilable?
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
  $as_echo_n "checking $2 usability... " >&6; }
+
+case "${host_os}" in
+sunos4*)
+if test "$2" = "sys/resource.h"; then
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  /* end confdefs.h.  */
  $4
+#include <sys/time.h>
  #include <$2>
  _ACEOF
+else
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+fi
+;;
+*)
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+;;
+esac
  if ac_fn_c_try_compile "$LINENO"; then :
    ac_header_compiler=yes
  else

I don't have the whole autoconf stuff running on this old Sun 3/80, 
therefore only the
configure patch, not a configure.ac patch, sorry about that.

Much Regards
Klaus



Back to gnu.bash.bug | Previous | Next | Find similar


Thread

bash 4.3.42 configure script needs to test sys/resource.h different on SunOS4 "Klaus Ziegler - owner of sunfreeware.de" <klausz@haus-gisela.de> - 2015-10-13 22:10 +0200

csiph-web