[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Subversion 1.4.0 for z/OS 1.6

From: Timo Lilja <timo.lilja_at_hut.fi>
Date: 2006-11-02 10:02:12 CET

I managed to compile Subversion 1.4.0 for IBM z/OS 1.6. I attach my
notes below. There are few patches needed to make subversion compile
but extra care should be if they are ever deemed to be applied to the
subversion code base.

Disclaimer: I am no mainframe expert so the approach taken here could
be totally wrong but it works for me and we have been using Subversion
in z/OS successfully for couple of weeks so far.

The approach taken here is somewhat orthogonal to one taken by the
AS/400 port. I decided to keep everything internally in ASCII and rely
on the AUTOCVT ASCII->EBCDIC conversion functions when needed.

Building Subversion 1.4.0 for z/OS

cd $HOME
zcat subversion-1.4.0.tar.gz | pax -ofrom=ISO8859-1,to=IBM-1047 -rv
zcat subversion-deps-1.4.0.tar.gz | pax -ofrom=ISO8859-1,to=IBM-1047 -rv

export _C89_CCMODE=1
export _C89_OPTIONS="-Wc,ascii,xplink,nocsect,langlvl(extended) -Wl,xplink"
export CC=c89
export LD=c89
export _CXX_CXXSUFFIX=cc
export MAKE=gmake
export CPPFLAGS="-D_ALL_SOURCE -I$HOME/subversion-1.4.0/zlib"
export LDFLAGS="-L$HOME/subversion-1.4.0/zlib"
# currently we use Gnu cpp for deps, but these flags might do the job with c89
#export MKDEP=c89
#export _C89_ELINES=1

Build zlib
apply zconf.h.in.patch
bash configure

Build subversion
export CPPFLAGS="-D_ALL_SOURCE -I$HOME/subversion-1.4.0/zlib"
apply apr-uri.patch
apply neon-socket.patch
apply svn-create-ascii.patch
apply svn-ensure-ascii.patch
bash configure

Known Issues
(Some of the notes below might be specific to our development
environment only but I attach them all here anyway.)

- Configuration of apr and apr-util may fail or produce empty
  Makefiles to some subdirectories. This might be because of the
  open file limit that is set to 400. I have no idea how to increase
  the limit. Workaround: run configure in apr/ and apr-util/
  directories again. (You can get the original configure invocation
  arguments from corresponding configure.log files.)

- The port converts everything output with svn_cmdline_printf() to EBCDIC.

- The port writes every file in ASCII/UTF-8 and sets the encoding attribute
  CCSID to 819 with __chattr(). That is, if you want to add a new file
  to the repository, you have to make it in ASCII format and use

   chtag -tc ISO8859-1 foo.c

  before adding/importing the file(s). Maybe svn add could
  convert EBCDIC to ASCII and set the file attributes automatically?

- Binary files CCSID has to be manually switched to 1047 and the text
  flag has to be toggled off. Currently patched SVN toggles the text
  flag on and sets CCSID to 819 for every file that SVN accesses.
  Thus, binary files have to be chtag(3) every time they are updated.
  Maybe SVN should set the CCSID only for newly created files?

- svn blame and svn cat do no ASCII->EBCDIC conversion
  Workaround: svn blame foo.c | iconv -f ISO8859-1 -t IBM-1047

  One way to fix this would be to modify svn_stream_write() in
  libsvn_subr/stream.c but this might break something else using
  svn_stream_write() that depends on not doing the conversion.
  (Not sure why blame-cmd.c:blame_receiver() uses svn_stream_printf()
  instead of svn_cmdline_printf()?)

- Non-ASCII characters may be a problem: subversion uses internally
  UTF-8 and the auto-conversion doesn't seem to support UTF-8 at all?

- I don't have access to python on z/OS, cannot gmake check.


- zconf.h.in.patch: zlib cannot have unistd.h included in zconf.h because
  otherwise libsvn_delta/svndiff.c compilation fails on some redefinition
  error of getopt(). (This is caused by the fact that apr/apr-util
  redefines long and some other C basic types and c89 cannot grok this.)

- apr-uri.patch: without this patch uri_delims.h will be generated in ASCII.
  This patch cannot be applied in other platforms! The proper
  way would be to do the conversion conditionally only when building on

- neon-socket.patch: in z/OS poll.h is in /usr/include, not in

- svn-create-ascii.patch: this will set CCSID to 819 (ASCII) on each file
  that is created by Subversion.

- svn-ensure-ascii.patch: this will set AUTOCVT on for each stream
  that is written through svn_cmdline_fputs(). This patch is needed if
  the ssh client toggles auto-conversion off which is propagated to
  subversion's stdout/stderr stream.

Timo Lilja
"It's a 106 miles to Chicago. We've got a full tank of gas, 
half a pack of cigarettes, it's dark, and we're wearing sunglasses."

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Received on Thu Nov 2 14:37:06 2006

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.