RCS 5.5 patches: IBM AIX RS6000

Andy Glew glew at pdx007.intel.com
Thu Jun 20 08:37:30 AEST 1991


Here is a set of patches that made RCS 5.5 work on 
an IBM AIX RS6000.
    uname -a =>AIX pdx007 1 3 000118433000
if those numbers mean anything to you.

These patches have been submitted to the RCS maintainers 
and will, I hope, be in RCS 5.6, but they are provided
to this newsgroup to help others.

With these patches, conf.sh ran (i.e. conf.h did not need to be
manually repaired), RCS made with two minor compiler warnings, and RCS
passed most of its own self test (src/rcstest).

The rcsmerge test failed (there seems to be a problem with ed error
reporting that breaks the merge script), and subsequent tests did not
run -- but enough of RCS builds to be useful.

The patch consists of the following:

    rcs/README
    	Added description of how to run rcstest
    	without installing RCS

    Makefile
    	Variable settings for AIX:
    	    diff3 path
    	    bsdcc
    	    conf.sh
    	(if GNU make were the standard these could
    	be IF'ed within the Makefile, but as it
    	is they must be commented in/out as appropriate)

    conf.sh
    	Parametrized use of -S flag (use -c for AIX)

    partime.c
    	Added CUT to timesone list
    	(this change already reported, was necessary for SUN 386i)

    rcsbase.h
    	Funky ifdeffing to sidestep a problem in an AIX header file.

The minor compiler warnings were (in case anyone feels motivated
to fixing nits - I'd rather go on vacation) are:
    bsdcc -qlanglvl=ansi -O    -c rcsutil.c 
	  439 | static volatile sig_atomic_t heldsignal, holdlevel;
		a..................................................
    a - 1506-112: (W) Duplicate type qualifier ignored.

    	    sig_atomic_t is typedef'ed volatile int,
    	    so the volatile up here is redundant.


    bsdcc -qlanglvl=ansi -O    -c rcsfnms.c 
	  585 |                         p += purefname-arg;
		..........................a................
    a - 1506-016: (E) Operands must be pointers to compatible types.

    	    p and arg are char *,
    	    while purefname is const char *;
    	    IBM seems to thing that this is incompatible
    	    (reading the ANSI standard I disagree, ie. I think
    	    it is a compiler bug)


				   
*** virgin/rcs/README	Thu Jan  3 21:07:38 1991
--- ibm/rcs/README	Wed Jun 19 23:06:55 1991
***************
*** 46,55 ****
--- 46,62 ----
    copy of src/conf.heg.
  
    Manual entries reside in man.
  
    To test your installation of RCS, run the shell file src/rcstest.
+   Note that this script only tests an "installed" rcs, with paths 
+   wired into some commands. In order to test RCS without installing it,
+   define RCSPREFIX to be empty, in src/Makefile. This will create 
+   a version of RCS without hardwired paths for subcommands. This 
+   permits src/rcstest to be run, as long as the directory "src" (or .)
+   is in the path of the person running the test.  Be sure to restore
+   RCSPREFIX before installing RCS.
  
    Troff source for the paper `RCS--A System for Version Control', which
    appeared in _Software--Practice & Experience_, is in rcs.ms.
  
  
*** ibm/rcs/src/Makefile	Wed Jun 19 23:13:34 1991
--- virgin/rcs/src/Makefile	Thu Jan  3 21:07:19 1991
***************
*** 1,6 ****
! # $Id: Makefile,v 5.9 91/06/20 00:53:15 glew Exp Locker: glew $
  # Copyright (C) 1982, 1988, 1989 Walter Tichy
  #   Copyright 1990 by Paul Eggert
  #   Distributed under license by the Free Software Foundation, Inc.
  #
  # This file is part of RCS.
--- 1,6 ----
! # $Id: Makefile,v 5.8 1990/12/13 06:54:06 eggert Exp $
  # Copyright (C) 1982, 1988, 1989 Walter Tichy
  #   Copyright 1990 by Paul Eggert
  #   Distributed under license by the Free Software Foundation, Inc.
  #
  # This file is part of RCS.
***************
*** 51,61 ****
  #	for starting shell files, you must use a nonempty RCSPREFIX, because
  #	in this case rcsmerge invokes `/bin/sh ${RCSPREFIX}merge'.
  
  #RCSPREFIX =
  #RCSPREFIX = ${RCSDIR}/
!  RCSPREFIX =
  
  #	Define DIFF and DIFF3 to be the name of your diff and diff3 programs.
  #	DIFF must be an absolute path name if setgid or setuid is used.
  #	Define DIFF_FLAGS to be diff's options for RCS format output.
  #	If available, use the -a option for comparing arbitrary files.
--- 51,61 ----
  #	for starting shell files, you must use a nonempty RCSPREFIX, because
  #	in this case rcsmerge invokes `/bin/sh ${RCSPREFIX}merge'.
  
  #RCSPREFIX =
  #RCSPREFIX = ${RCSDIR}/
!  RCSPREFIX = ${RCSDIR}/
  
  #	Define DIFF and DIFF3 to be the name of your diff and diff3 programs.
  #	DIFF must be an absolute path name if setgid or setuid is used.
  #	Define DIFF_FLAGS to be diff's options for RCS format output.
  #	If available, use the -a option for comparing arbitrary files.
***************
*** 81,91 ****
  #DIFF3_TYPE = bin
  
   DIFF = /bin/diff
   DIFF_FLAGS = -n
   DIFF_L = 0
!  DIFF3 = /usr/bin/diff3
   DIFF3_TYPE = lib
  
  
  #	Set SENDMAIL to be a comma-separated list of strings that are a command
  #	to send mail.  The first string should be an absolute pathname.
--- 81,91 ----
  #DIFF3_TYPE = bin
  
   DIFF = /bin/diff
   DIFF_FLAGS = -n
   DIFF_L = 0
!  DIFF3 = /usr/lib/diff3
   DIFF3_TYPE = lib
  
  
  #	Set SENDMAIL to be a comma-separated list of strings that are a command
  #	to send mail.  The first string should be an absolute pathname.
***************
*** 132,146 ****
  
  # for traditional C compilers
  #CC = cc
  #CFLAGS = ${CC_O} ${CC_R}
  
! # for IBM AIX RS6000
! #CC = bsdcc
! #CFLAGS = ${CC_O} ${CC_R}
! 
!  CC = bsdcc -qlanglvl=ansi
   CFLAGS = ${CC_O} ${CC_R}
  
  
  LINT = lint
  
--- 132,142 ----
  
  # for traditional C compilers
  #CC = cc
  #CFLAGS = ${CC_O} ${CC_R}
  
!  CC = cc
   CFLAGS = ${CC_O} ${CC_R}
  
  
  LINT = lint
  
***************
*** 211,239 ****
  	sh rcstest -v
  
  clean ::
  	rm -f a.* *.o conf.h conf.error ${RCSCOMMANDS}
  
- 
- # conf.sh constantly needs to compile small program fragments,
- # without performing a full compilation to an executable.
- # On most systems the -S flag (compile to assembly) works,
- # but on an IBM AIX RS6000 -S fails, so we use -c (compile to object)
- # instead.
- #INCOMPLETE_COMPILATION_FLAG=-S
- INCOMPLETE_COMPILATION_FLAG=-c
- 
- 
  conf.h : conf.sh # Makefile
  	C='${CC} ${CFLAGS}' \
  	COMPAT2='${COMPAT2}' \
  	DIFF='${DIFF}' \
  	DIFF_L='${DIFF_L}' \
  	DIFF_FLAGS='${DIFF_FLAGS}' \
  	RCSPREFIX='${RCSPREFIX}' \
  	SENDMAIL='${SENDMAIL}' \
-     	INCOMPLETE_COMPILATION_FLAG='${INCOMPLETE_COMPILATION_FLAG}' \
  	L='${LDLIBS}' \
  	sh -x conf.sh 2>conf.error
  	mv a.h $@
  	rm -f a.*
  
--- 207,224 ----
*** ibm/rcs/src/conf.sh	Wed Jun 19 23:08:20 1991
--- virgin/rcs/src/conf.sh	Thu Jan  3 21:07:20 1991
***************
*** 1,8 ****
  #!/bin/sh
  # Output RCS compile-time configuration.
! Id='$Id: conf.sh,v 5.7 1991/06/20 00:53:15 glew Exp $'
  #	Copyright 1990 by Paul Eggert
  #	Distributed under license by the Free Software Foundation, Inc.
  
  # This file is part of RCS.
  #
--- 1,8 ----
  #!/bin/sh
  # Output RCS compile-time configuration.
! Id='$Id: conf.sh,v 5.6 1990/11/01 05:03:28 eggert Exp $'
  #	Copyright 1990 by Paul Eggert
  #	Distributed under license by the Free Software Foundation, Inc.
  
  # This file is part of RCS.
  #
***************
*** 38,56 ****
  : ${RCSPREFIX=/usr/local/bin/}
  : ${SENDMAIL=/usr/lib/sendmail}
  : ${L=}
  : ${DIFF=${RCSPREFIX}diff}
  
- # conf.sh constantly needs to compile small program fragments,
- # without performing a full compilation to an executable.
- # On most systems the -S flag (compile to assembly) works,
- # but on an IBM AIX RS6000 -S fails, so we use -c (compile to object)
- # instead.
- #INCOMPLETE_COMPILATION_FLAG=-S
- : ${INCOMPLETE_COMPILATION_FLAG=-c}
  
- 
  cat <<EOF || exit
  /* RCS compile-time configuration */
  
  	/* $Id */
  
--- 38,48 ----
***************
*** 126,136 ****
  do
  	cat >a.c <<EOF || exit
  #	include "a.h"
  	$i int * $i * zero;
  EOF
! 	if $C ${INCOMPLETE_COMPILATION_FLAG} a.c >&2
  	then echo "/* #define $i */ /* The '$i' keyword works.  */"
  	else echo "#define $i /* The '$i' keyword does not work.  */"
  	fi
  done
  
--- 118,128 ----
  do
  	cat >a.c <<EOF || exit
  #	include "a.h"
  	$i int * $i * zero;
  EOF
! 	if $C -S a.c >&2
  	then echo "/* #define $i */ /* The '$i' keyword works.  */"
  	else echo "#define $i /* The '$i' keyword does not work.  */"
  	fi
  done
  
***************
*** 145,155 ****
  	: $t
  	case $t in
  	time_t) i=long;;
  	*) i=int;;
  	esac
! 	if $C ${INCOMPLETE_COMPILATION_FLAG} -Dt=$t a.c >&2
  	then echo "/* typedef $i $t; */ /* Standard headers define $t.  */"
  	else echo "typedef $i $t; /* Standard headers do not define $t.  */"
  	fi
  done
  
--- 137,147 ----
  	: $t
  	case $t in
  	time_t) i=long;;
  	*) i=int;;
  	esac
! 	if $C -S -Dt=$t a.c >&2
  	then echo "/* typedef $i $t; */ /* Standard headers define $t.  */"
  	else echo "typedef $i $t; /* Standard headers do not define $t.  */"
  	fi
  done
  
***************
*** 157,167 ****
  cat >a.c <<'EOF' || exit
  #include "a.h"
  int main(int, char**);
  int main(int argc, char **argv) { exitmain(!argv[argc-1]); }
  EOF
! if $C ${INCOMPLETE_COMPILATION_FLAG} a.c >&2
  then h=1
  else h=0
  fi
  cat <<EOF
  #define has_prototypes $h /* Do function prototypes work?  */
--- 149,159 ----
  cat >a.c <<'EOF' || exit
  #include "a.h"
  int main(int, char**);
  int main(int argc, char **argv) { exitmain(!argv[argc-1]); }
  EOF
! if $C -S a.c >&2
  then h=1
  else h=0
  fi
  cat <<EOF
  #define has_prototypes $h /* Do function prototypes work?  */
***************
*** 235,245 ****
  cat >a.c <<'EOF' || exit
  #include "a.h"
  void f() {}
  int main() {f(); exitmain(0);}
  EOF
! if $C ${INCOMPLETE_COMPILATION_FLAG} a.c >&2
  then
  	v='(void) '
  else
  	v=
  	echo 'typedef int void;'
--- 227,237 ----
  cat >a.c <<'EOF' || exit
  #include "a.h"
  void f() {}
  int main() {f(); exitmain(0);}
  EOF
! if $C -S a.c >&2
  then
  	v='(void) '
  else
  	v=
  	echo 'typedef int void;'
***************
*** 306,316 ****
  : has_sigaction
  cat >a.c <<'EOF' || exit
  #include <signal.h>
  struct sigaction s;
  EOF
! if $C ${INCOMPLETE_COMPILATION_FLAG} a.c >&2
  then h=1
  else h=0
  fi
  echo "#define has_sigaction $h /* Does struct sigaction work?  */"
  
--- 298,308 ----
  : has_sigaction
  cat >a.c <<'EOF' || exit
  #include <signal.h>
  struct sigaction s;
  EOF
! if $C -S a.c >&2
  then h=1
  else h=0
  fi
  echo "#define has_sigaction $h /* Does struct sigaction work?  */"
  
***************
*** 349,359 ****
  #ifndef exit
  	void exit();
  #endif
  int main() { exit(0); }
  EOF
! if $C ${INCOMPLETE_COMPILATION_FLAG} a.c >&2
  then t=void
  else t=int
  fi
  echo "#define exit_type $t /* type returned by exit() */"
  cat >a.c <<'EOF' || exit
--- 341,351 ----
  #ifndef exit
  	void exit();
  #endif
  int main() { exit(0); }
  EOF
! if $C -S a.c >&2
  then t=void
  else t=int
  fi
  echo "#define exit_type $t /* type returned by exit() */"
  cat >a.c <<'EOF' || exit
***************
*** 361,371 ****
  #ifndef _exit
  	void _exit();
  #endif
  int main() { _exit(0); }
  EOF
! if $C ${INCOMPLETE_COMPILATION_FLAG} a.c >&2
  then t=void
  else t=int
  fi
  echo "#define underscore_exit_type $t /* type returned by _exit() */"
  
--- 353,363 ----
  #ifndef _exit
  	void _exit();
  #endif
  int main() { _exit(0); }
  EOF
! if $C -S a.c >&2
  then t=void
  else t=int
  fi
  echo "#define underscore_exit_type $t /* type returned by _exit() */"
  
***************
*** 375,385 ****
  #ifndef fread
  	size_t fread();
  #endif
  int main() { char b; exitmain(!(fread(&b,1,1,stdin)==1 && b=='#')); }
  EOF
! if $C ${INCOMPLETE_COMPILATION_FLAG} a.c $L >&2
  then t=size_t
  else t=int
  fi
  echo "typedef $t fread_type; /* type returned by fread() and fwrite() */"
  
--- 367,377 ----
  #ifndef fread
  	size_t fread();
  #endif
  int main() { char b; exitmain(!(fread(&b,1,1,stdin)==1 && b=='#')); }
  EOF
! if $C -S a.c $L >&2
  then t=size_t
  else t=int
  fi
  echo "typedef $t fread_type; /* type returned by fread() and fwrite() */"
  
***************
*** 390,400 ****
  #ifndef malloc
  	malloc_type malloc();
  #endif
  int main() { exitmain(!malloc(1)); }
  EOF
! if $C ${INCOMPLETE_COMPILATION_FLAG} a.c >&2
  then t=void
  else t=char
  fi
  echo "typedef $t *malloc_type; /* type returned by malloc() */"
  
--- 382,392 ----
  #ifndef malloc
  	malloc_type malloc();
  #endif
  int main() { exitmain(!malloc(1)); }
  EOF
! if $C -S a.c >&2
  then t=void
  else t=char
  fi
  echo "typedef $t *malloc_type; /* type returned by malloc() */"
  
***************
*** 407,417 ****
  #ifndef free
  	void free();
  #endif
  int main() { free(malloc(1)); exitmain(0); }
  EOF
! if $C ${INCOMPLETE_COMPILATION_FLAG} a.c >&2
  then t=void
  else t=int
  fi
  echo "#define free_type $t /* type returned by free() */"
  
--- 399,409 ----
  #ifndef free
  	void free();
  #endif
  int main() { free(malloc(1)); exitmain(0); }
  EOF
! if $C -S a.c >&2
  then t=void
  else t=int
  fi
  echo "#define free_type $t /* type returned by free() */"
  
***************
*** 421,431 ****
  #ifndef strlen
  	size_t strlen();
  #endif
  int main() { exitmain(strlen("")); }
  EOF
! if $C ${INCOMPLETE_COMPILATION_FLAG} a.c >&2
  then t=size_t
  else t=int
  fi
  echo "typedef $t strlen_type; /* type returned by strlen() */"
  
--- 413,423 ----
  #ifndef strlen
  	size_t strlen();
  #endif
  int main() { exitmain(strlen("")); }
  EOF
! if $C -S a.c >&2
  then t=size_t
  else t=int
  fi
  echo "typedef $t strlen_type; /* type returned by strlen() */"
  
***************
*** 640,650 ****
  #ifndef printf
  	int printf P((const char*,...));
  #endif
  int main() { printf(""); exitmain(0); }
  EOF
! if $C ${INCOMPLETE_COMPILATION_FLAG} a.c >&2
  then a='1 /* These agree with <stdio.h>.  */'
  else a='0 /* These conflict with <stdio.h>.  */'
  fi
  cat <<EOF || exit
  #if $a
--- 632,642 ----
  #ifndef printf
  	int printf P((const char*,...));
  #endif
  int main() { printf(""); exitmain(0); }
  EOF
! if $C -S a.c >&2
  then a='1 /* These agree with <stdio.h>.  */'
  else a='0 /* These conflict with <stdio.h>.  */'
  fi
  cat <<EOF || exit
  #if $a
***************
*** 688,698 ****
  	'int fcntl P((int,int,...));' \
  	'int open P((const char*,int,...));' \
  	'mode_t umask P((mode_t));' \
  	'pid_t wait P((int*));'
  do
! 	if $C ${INCOMPLETE_COMPILATION_FLAG} -Ddeclaration="$declaration" a.c >&2
  	then echo "$declaration"
  	else echo "/* $declaration */"
  	fi
  done
  for i in '
--- 680,690 ----
  	'int fcntl P((int,int,...));' \
  	'int open P((const char*,int,...));' \
  	'mode_t umask P((mode_t));' \
  	'pid_t wait P((int*));'
  do
! 	if $C -S -Ddeclaration="$declaration" a.c >&2
  	then echo "$declaration"
  	else echo "/* $declaration */"
  	fi
  done
  for i in '
***************
*** 705,714 ****
  #endif'
  	# See declare_getpwuid for how getpwuid() is handled.
  do
  	echo '#include "a.h"
  		int main() { exitmain(0); }'"$i" >a.c || exit
! 	if $C ${INCOMPLETE_COMPILATION_FLAG} a.c >&2
  	then sed 1,2d a.c
  	else sed '1,2d; s|.*|/* & */|' a.c
  	fi
  done
--- 697,706 ----
  #endif'
  	# See declare_getpwuid for how getpwuid() is handled.
  do
  	echo '#include "a.h"
  		int main() { exitmain(0); }'"$i" >a.c || exit
! 	if $C -S a.c >&2
  	then sed 1,2d a.c
  	else sed '1,2d; s|.*|/* & */|' a.c
  	fi
  done
*** ibm/rcs/src/partime.c	Wed Jun 19 20:03:32 1991
--- virgin/rcs/src/partime.c	Thu Jan  3 21:07:22 1991
***************
*** 19,34 ****
   *		to use a FILE input stream.  Need terminator, though.
   *	Perhaps should return 0 on success, else a non-zero error val?
   */
  
  /* $Log: partime.c,v $
-  * Revision 5.5  1991/06/19  18:55:32  glew
-  * *** empty log message ***
-  *
-  * Revision 5.4  90/10/04  06:30:15  eggert
-  * checked in with -k by glew at 1991/06/19 20:44:48
-  * 
   * Revision 5.4  1990/10/04  06:30:15  eggert
   * Remove date vs time heuristics that fail between 2000 and 2400.
   * Check for overflow when lexing an integer.
   * Parse 'Jan 10 LT' as 'Jan 10, LT', not 'Jan, 10 LT'.
   *
--- 19,28 ----
***************
*** 60,70 ****
   * 
   */
  
  #include "rcsbase.h"
  
! libId(partId, "$Id: partime.c,v 5.5 1991/06/19 18:55:32 glew Exp $")
  
  #define given(v) (0 <= (v))
  #define TMNULL (-1) /* Items not given are given this value */
  #define TZ_OFFSET (24*60) /* TMNULL  <  zone_offset - TZ_OFFSET */
  
--- 54,64 ----
   * 
   */
  
  #include "rcsbase.h"
  
! libId(partId, "$Id: partime.c,v 5.4 1990/10/04 06:30:15 eggert Exp $")
  
  #define given(v) (0 <= (v))
  #define TMNULL (-1) /* Items not given are given this value */
  #define TZ_OFFSET (24*60) /* TMNULL  <  zone_offset - TZ_OFFSET */
  
***************
*** 113,123 ****
  	{"saturday",     6, 0, TM_WDAY},
  
  	{"gmt",          0*60, TWTIME, TM_ZON},   /* Greenwich */
  	{"utc",          0*60, TWTIME, TM_ZON},
  	{"ut",           0*60, TWTIME, TM_ZON},
- 	{"cut",          0*60, TWTIME, TM_ZON},	  /* Coordinated Universal Time */
  
  	{"nzst",        -12*60, TWTIME, TM_ZON},  /* New Zealand */
  	{"jst",         -9*60, TWTIME, TM_ZON},   /* Japan */
  	{"kst",         -9*60, TWTIME, TM_ZON},   /* Korea */
  	{"ist",         -5*60-30, TWTIME, TM_ZON},/* India */
--- 107,116 ----
*** ibm/rcs/src/rcsbase.h	Wed Jun 19 20:03:33 1991
--- virgin/rcs/src/rcsbase.h	Thu Jan  3 21:07:23 1991
***************
*** 1,10 ****
  
  /*
   *                     RCS common definitions and data structures
   */
! #define RCSBASE "$Id: rcsbase.h,v 5.6 1991/06/20 00:53:15 glew Exp $"
  
  /* Copyright (C) 1982, 1988, 1989 Walter Tichy
     Copyright 1990 by Paul Eggert
     Distributed under license by the Free Software Foundation, Inc.
  
--- 1,10 ----
  
  /*
   *                     RCS common definitions and data structures
   */
! #define RCSBASE "$Id: rcsbase.h,v 5.5 1990/12/04 05:18:43 eggert Exp $"
  
  /* Copyright (C) 1982, 1988, 1989 Walter Tichy
     Copyright 1990 by Paul Eggert
     Distributed under license by the Free Software Foundation, Inc.
  
***************
*** 41,56 ****
   *****************************************************************************
   */
  
  
  /* $Log: rcsbase.h,v $
-  * Revision 5.6  1991/06/20  00:53:15  glew
-  * Compiles on IBM AIX RS6000
-  *
-  * Revision 5.5  90/12/04  05:18:43  eggert
-  * checked in with -k by glew at 1991/06/19 20:44:48
-  * 
   * Revision 5.5  1990/12/04  05:18:43  eggert
   * Use -I for prompts and -q for diagnostics.
   *
   * Revision 5.4  1990/11/01  05:03:35  eggert
   * Don't assume that builtins are functions; they may be macros.
--- 41,50 ----
***************
*** 310,334 ****
  #			define PATH_MAX (MAXPATHLEN-1)
  #		endif
  #	endif
  
  	/* <sys/wait.h> */
- #   	ifdef _AIX
-     	    	/* Interim: kluge for IBM RS6000.
-     	    	   Wait is union wait,
- 		   but cannot return that union from a function.
- 		   Play games with POSIX versus BSD versions
- 		   of header files.
- 		   */
- #   	    	undef _BSD
- #   	endif
  #	if has_sys_wait_h
  #		include <sys/wait.h>
  #	endif
- #   	ifdef _AIX
- #   	    	define _BSD 1
- #   	endif
  #	ifndef WEXITSTATUS
  #		define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
  #		undef WIFEXITED /* Avoid 4.3BSD incompatibility with Posix.  */
  #	endif
  #	ifndef WIFEXITED
--- 304,316 ----
--

Andy Glew, glew at ichips.intel.com
Intel Corp., M/S JF1-19, 5200 NE Elam Young Parkway, 
Hillsboro, Oregon 97124-6497

This is a private posting; it does not indicate opinions or positions
of Intel Corp.



More information about the Comp.unix.aix mailing list