Problems in building and installing DDD                          -*- text -*-
***************************************

This file lists problems encountered when building and installing DDD
in various environments.

Table of Contents
=================

    * Ada
    * AIX
    * DEC
    * FreeBSD
    * GCC
      + GCC optimization errors
      + GCC and libg++
    * HP-UX
    * LessTif
    * Linux
    * SGI
    * Solaris 2.x
    * SunOS
      + SunOS 4.1 and X11R6
      + SunOS 4.1 and Sun C++
    * Unixware
    * X11R4

ADA
===

Reported by: Rick Flower <Rick.Flower@trw.com>

    To debug Ada programs created with Gnat, you need a set of GDB
    patches.  The current best set of patches for GDB 4.16 can be
    found at `ftp://cs.nyu.edu/pub/gnat/gdb'.


AIX
===

Reported by:  Andreas Zeller <zeller@ips.cs.tu-bs.de>

    Use GCC for building DDD.  Using xlC will cause several minor bugs.


Reported by: Jason A. Smith <smithj4@rpi.edu>

    I had problems building ddd-2.99.9 on AIX-4.1.5.0.  The errors
    were "TOC overflow" which can be fixed by adding -Wl,-bbigtoc to
    the compile and link flags.  Adding this to the final compile/link
    step did not work because of symbol mismatch errors, so I
    configured ddd with the following command:

    CFLAGS=-Wl,-bbigtoc CXXFLAGS=-Wl,-bbigtoc LDFLAGS=-Wl,-bbigtoc
    ./configure

    This might not be the correct solution but it worked for me with no
    errors, just warnings like:

    c++: -bbigtoc: linker input file unused since linking not done


Reported by:  Charlie Rusbridger <charlie@vampire.co.uk>

    Just a small note, I find because of a bug in the AIX linker, I
    have to add a C++ flag of '-mminimal-toc' or else the link fails
    with something about a toc-overflow.


Reported by:  Kai Engert <Kai.Engert@dresdner-bank.com>

    At the end of "make", linking of DDD stop withs the message "TOC
    overflow".  I could fix the problem, by modifying the following
    rule in `ddd/Makefile':

	$(ddd_canonical): ddd.o $(OBJECTS)
		$(LINK.cc) -v -o $@ ddd.o $(OBJECTS) $(ALL_X_LIBS) $(LIBS)

    I added the "-v" switch. This displays the exact parameters to "ld".
    Then I manually entered the link command again, adding the switch
	-bbigtoc
    I get warnings, that extra code is generated, but I get a working
    executable.


Reported by:	Jacek M. Holeczek <holeczek@us.edu.pl>

    This "howto" describes the way one can get ddd-3.0 compiled on AIX 4.1
    using standard AIX utilities: C Set ++ for AIX Compiler (xlC), lex
    and yacc. The same procedure should be valid on AIX 4.2 and AIX 3.2.

    First unpack the source distribution and go to the ddd-3.0 subdirectory.

    Then set some environment variables:
            export CC=xlC
            export CXX=xlC
            export CFLAGS="-O"
            export CXXFLAGS="-O"
            export LDFLAGS="-O"
            unset LIBPATH

    If you decide NOT to use gnu gcc, flex, and bison you may also
    need to remove the /usr/local/bin (or any other subdirectory where
    you keep gnu executables) from the PATH environment variable (so
    that the ./configure script will not find them, and it will find
    standard AIX xlC, lex, and yacc):
            export PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin

    Then run configure:
            ./configure -v

    On AIX 3.2 you might need to add a line in ./ddd/config.h in form:
            #define HAVE_GETHOSTNAME_DECL 1
    (On AIX 4.1, AIX 4.2 you should have it already defined by ./configure.)

    If you decide NOT to use gnu flex and gnu bison and use standard
    AIX lex and yacc instead, you have to remove some files:

            rm ./ddd/vsl-gramma.C ./ddd/vsl-gramma.h
            rm ./ddd/vsl-lex.C
            rm ./ddd/rxscan.C

    Now run "make clean" and then "make".

    If you decided to use standard AIX lex and yacc the make will
    complain (while working on ./ddd/vsl-lex.*, ./ddd/vsl-gramma.*,
    ./ddd/rxscan.*):
            lextoC: cannot determine lex type -- reverting to flex
            yacctoC: cannot determine yaccpar type -- reverting to bison
    You can safely ignore these messages (they come from ./ddd/lextoC
    and ./ddd/yacctoC and mean that they have no AIX lex and yacc
    specific entries). Later on, the make will crash while compiling 
    ./ddd/VSLRead.C. You have to edit ./ddd/vsl-gramma.C (after the
    ./ddd/vsl-gramma.C is newly created by yacc) and modify the
    declaration of vslerror:
            extern "C" void vslerror(char *s);       // added "C"

    and the definition of vslparse:
            #ifdef __cplusplus
            // extern "C"                           // commented extern "C"
            #endif /* __cplusplus */
            int
            vslparse()

    In case you created ./ddd/rxscan.C with AIX 4.1 lex (from the
    ./ddd/rxscan.L) you additionally need to modify one line in the
    beginning of this file increasing YYLMAX from 200 to 8192 (this is
    a result of a bug in AIX 4.1 lex, most probably not present on
    both AIX 3.2 and AIX 4.2 - note here that you will not get any
    compile time errors if you do not modify it, but your executable
    will be broken):

            # define YYLMAX 8192

    then run "make" again.  You should get no other warnings/errors except:
      - when compiling ./ddd/mainloop.C:
	68  1500-010: (W) WARNING in ddd_main_loop(): Infinite loop.  
            Program may not stop.
        ( this is intentional, you can safely ignore it ).
    Finally run "make strip" and "make install".  Have fun ...

DEC
===

Reported by: Pascal Quesseveur <abak@hol.fr>

    I have encountered some problems when compiling ddd on DEC Alpha 
    station running Digital UNIX 4.0 with gcc version 2.7.2.2:

    ddd/config.h created by configure is wrong: symbol 
    HAVE_GETHOSTNAME_DECL must be defined in config.h since include file 
    /usr/include/unistd.h contains a prototype for gethostname. This 
    prototype is
        int gethostname(char *, size_t)
    when symbol _XOPEN_SOURCE_EXTENDED is defined and
        int gethostname (char *, int)
    in the other cases. There is a conflict with the prototype defined in
    ddd/hostname.C.

    The `ddd/Makefile' created by configure is wrong: variables
    LIBNSL, NON_XLIBS and LIBGEN have incorrect values - the values
    must be null to link ddd correctly.


FreeBSD
=======

Reported by:  taob@gate.sinica.edu.tw (Brian Tao)

    Use `gmake' (GNU make) instead of `make' for building DDD.

Reported by: Vincenzo Capuano <vcapuano@esoc.esa.de>

    Add `-lmytinfo' as additional library to build DDD.

GCC
===

GCC Optimization Errors
-----------------------

    If DDD crashes after a few interactions, try building DDD without
    optimization. Just type `cd ddd; rm *.o; make CXXOPT=-DNDEBUG ddd'
    to re-build DDD.


GCC and LIBG++
--------------

    If you have multiple copies of gcc and/or libg++ installed, be
    sure that the referenced versions match each other.  This is a
    common source for various problems.

HP-UX
=====

Reported by:  (various)

    On HP-UX 10.01, if you cannot link DDD or get an illegal
    instruction at start-up, this is due to some bugs in the X11 and
    Motif libraries as shipped by HP.  Mark Harig <markh@landmark.com>
    says that some patches to X11 and Motif libraries are required to
    build DDD on HP-UX 10.01.  You can find these patches at:
    `ftp://us-support.external.hp.com/hp-ux_patches/'; he found the
    patches he needed in the directory `s700_800/10.X'.

    In that directory are the files:

       PHSS_10789  (the patch for S700/S800, HP-UX 10.20)
       PHSS_10789.txt (description of the patch and instructions)  

    You might also need patch PHSS_10688, PHSS_9810, PHSS_9811,
    PHSS_9813, and PHSS_9815.  Because the patch file names change as
    new patches are created, you should look in this directory for the
    file 'catalog', which lists the patch file names along with brief
    descriptions.

    According to some DDD users, linking problems on HP-UX can be
    solved by using patched versions of the GNU binutils (such as ld
    and ar) instead of the HP-UX binutils.  For more information on
    HP-PA versions of the GNU tools, see
    `ftp://jaguar.cs.utah.edu/dist/pagnutools.html'.

    Frank Hofmann <hofmann@wpax01.physik.uni-wuerzburg.de> fixed an
    `Invalid loader fixup for symbol _XtInheritTranslations,
    xmPrimitiveClassRec' by replacing `XtInheritTranslations' by
    `NULL' in `GraphEdit.C' and `ScrolledGE.C' and replacing
    `xmPrimitiveClassRec' with `XmPrimitiveWidgetClass' in
    `GraphEdit.C'.

    Roy Dragseth <royd@math.uit.no> says that you must link against
    the X11R6 version of Xmu, the X11R4 version gave an error on
    _XEditResCheckMessages being undefined at the link stage.

    Ivar Ruyter <ivarr@troll.hz.kfa-juelich.de> states: Build
    everything statically and add `-l:libdld.sl' to the LIBS line in
    the Makefile, voila you have a nice new Christmas Present.
    This also worked for Hal Manuel <hemanuel@esy.com>.

    Roy Dragseth <royd@math.uit.no> adds:
    Statically link as stated above. Actually it is only
    neccessary to statically link libXm, so if you exchange 
            -L/usr/lib/Motif1.2 -lXm
    with
            /usr/lib/Motif1.2/libXm.a
    in the link step DDD works fine. This might be useful for people
    who don't have the gnu linker. It also makes the executable ~1Mb
    smaller than when you add -l:libdld.sl to the link step.

    Lassi A. Tuura <Lassi.Tuura@cern.ch> suggests to use the option
    `-mmillicode-long-calls' when compiling.  It should permit fixes
    into shared library calls (these errors only occur with shared
    libraries).

LessTif
=======
    
    To use DDD with LessTif, get a recent LessTif release from
    `http://www.lesstif.org'; if needed, apply the patches found in
    the `patches/' subdirectory.  See the DDD WWW page for further
    issues and patches.

    With LessTif 0.85 and the patches applied, the following problems
    are currently known:

    * Menu traversal by keyboard does not work (yet); use the mouse instead.

 

Linux
=====

Intel
-----

Reported by: Jim Van Zandt <jrv@vanzandt.mv.com>

     Under slackware 3.1, the file permissions in `/dev/ptyp?' do not
     allow for DDD <-> GDB interaction.  I did "cd /dev; rm pty*;
     MAKEDEV ptyp ptyq ptys ptyt", the former permissions and device
     numbers were restored, and DDD worked.
     [Can anyone tell me how to circumvent this within DDD?  - AZ]

Reported by:  Bernie Borenstein <c372321@hc1056.mdc.com>

     Make sure you use libc version 4.6.27 or later.  Otherwise some
     Motif versions will cause DDD to crash as soon as `Open
     Program...' is selected (or any other file selection dialog is
     opened).  Linux Motif's are very sensitive about this.

     As an intermediate workaround, use the GDB `file' and `core'
     commands; to open a specific source, use the GDB `info file
     FUNCTION' command, where FUNCTION is a function defined in that
     source file.

Alpha
-----

Reported by:  J.H.M. Dassen <jdassen@wi.leidenuniv.nl>

    The kernel headers before Linux 2.1.61 and 2.0.32 don't work
    correctly with glibc.  Compiling C programs is possible in most
    cases but C++ programs have (due to the change of the name lookups
    for `struct's) problems.  One prominent example is `struct
    fd_set'.
     
    There might be some problems left but 2.1.61/2.0.32 fix most of
    the known ones.  See the BUGS file for other known problems.


Pmac
----

Reported by:  Ryan Ware <ware@shocking.com>

    I just wanted to let you know that (unlike previous versions of
    DDD) 2.99 compiles almost straight out of the box for linux-pmac.
    The only thing I had to change was the optimization level to O1.
    O2 broke the compiler.  It looks and runs great.  Thanks.  I look
    forward to many hours of using it.



SGI
===

Reported by:  Andreas Zeller <zeller@acm.org>

    Don't use SGI CC for compiling DDD; use GCC instead.

    I compiled DDD on a mips-sgi-irix5.3 using SGI's CC; the resulting
    executable fails with segmentation faults.  I could not find the
    cause for this problem and suspect a CC bug; using GCC instead
    seems a better alternative.

Solaris 2.x
===========

Reported by:  Blair Zajac <blair@olympia.gps.caltech.edu>

    When using Sun cc to compile `libiberty' as shipped with DDD, change
    `extern char *__builtin_alloca();' to `extern void
    *__builtin_alloca();' in `alloca-norm.h' to get the code to compile.
    This does not happen with GCC.

Reported by:  Andreas Zeller <zeller@acm.org>

    Solaris CC (SC4.0 18 Oct 1995 C++ 4.1) is safe for compiling DDD.
    Executables are larger compared to those compiled with GCC.

SunOS
=====

SunOS 4.1 and X11R6
-------------------

Reported by:  dmitzel@everest.hitc.com (Danny J. Mitzel) and
    doko@cs.tu-berlin.de (Matthias Klose)

    Using certain Motif and Athena libraries may cause
    `_vendorShellWidgetClass' to be defined twice.  A possible
    workaround is to configure DDD to run without Athena widgets
    (i.e. in `config.h', undefine `HAVE_ATHENA_WIDGETS' and remove the
    -lXaw flag from the `Makefile' linking command).


SunOS 4.1 and Sun C++
---------------------

Reported by:	Franklin Chen <chen@adi.com>

    On SunOS 4.1.x, with Sun C++ 4.0.1, `config.h' needs to end up with
        #define SIGHANDLERARGS int, ...
    rather than
        #define SIGHANDLERARGS int
    to avoid compile errors in a number of source files.

UNIXWARE
========

Reported by: Vinnie Shelton  <shelton@icd.teradyne.com>

    For Unixware, I have to set up `ddd/Makefile' as follows 
    after configuration:

    LINK.cc = env LD_RUN_PATH=/usr/X11R6/lib $(CXX) $(CXXBINDING) $(LDFLAGS)

X11R4
=====

Reported by:  mlj@gensym.com (Magnus Ljungberg)

    You may need to prohibit the use of the _XEditResCheckMessages()
    function by entering a line saying '#undef HAVE_X11_XMU_EDITRES_H' in
    `ddd.C'.



$Id: PROBLEMS,v 1.75 1998/06/18 13:43:10 zeller Exp $
