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

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

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

    * AIX
    * Cygwin
    * FreeBSD
    * GCC
    * HP-UX
    * Irix
    * LessTif
    * Linux
    * MacOS X
    * Solaris 2.x
    * Tru64
    * X11R4

AIX
===

Reported by: jensen@Adobe.COM (Freddy Jensen)

To compile DDD 3.3 for AIX 4.3.3:

     I had to set these two flags before running configure:

     setenv CPPFLAGS "-I/usr/shared/gcc_2.95/aix_4.3/lib/gcc-lib/rs6000-ibm-aix4.3.2.0/2.95.2/include"
     setenv LDFLAGS  "-Wl,-bbigtoc"

     After running configure I had to edit ddd/config.h and 
     change this:

     From: #define HAVE_TCDRAIN 1
     To:   #define HAVE_TCDRAIN 0

     Otherwise I would get tcdrain() undefined. I tried to link
     in libcurses.a explicitly, but that did not work. I am not
     sure exactly what the effect of not having tcdrain() is,
     although ddd seems to run just fine without it.


Reported by: Brian Cameron <bcameron@tuc.com>

    When compiling DDD using EGCS, you may get a conflict between
    <math.h> and the <exception> header.  As a workaround, create a
    local `math.h' file that contains:

	#define exception math_exception
	#include_next <math.h>
	#undef math_exception


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

    Because of a limitation in the AIX linker, linking of DDD may stop
    with the message "TOC overflow".  The AIX Table of Contents (TOC)
    by default has only 16,384 entries; DDD has far more symbols.

    If you use EGCS 1.1 or GCC 2.8.0 or later, `configure' should
    already have fixed this for you.  In other configurations, there
    are three ways to fix this problem:

    1. Add the flag `-Wl,-bbigtoc' to the `LDFLAGS' definition in
       `ddd/Makefile' and retype `make'.  This makes the AIX linker
       use a larger TOC.

    2. If this does not work, add the flags `-mno-fp-in-toc' and
       `-mno-sum-in-toc' to the `CXXFLAGS' definition in
       `ddd/Makefile' and recompile all.  Each of these options causes
       GCC to produce very slightly slower and larger code at the
       expense of conserving TOC space.

    3. If this still does not work, add the flag `-mminimal-toc' to
       the `CXXFLAGS' definition in `ddd/Makefile' and recompile all.
       When you specify this option, GCC will produce code that is
       slower and larger but which uses extremely little TOC space.


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 ...


Cygwin
======

    Cygwin is supported from ddd 3.3.9 on.


FreeBSD
=======

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

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



GCC
===

  Starting ddd 3.3.5, gcc 3.1 or later is required. gcc 2.x is known
  not to work due to its pre-ISO C++ status.


HP-UX
=====

Reported by: Andrew Gaylard <apg@users.sf.net>

    HP-UX 10.20's SOM linker has problems with linking DDD.  To work
    around it, it is necessary to build without debugging information
    (stripping after compiling doesn't help).

    It is also necessary to link with the Motif library statically.
    This is taken care of by the configure script.

    To compile DDD-3.3.8 for HP-UX 10.20 with g++ 3.x:

    1. ./configure --with-athena-includes=/usr/contrib/X11R6/include \
                   --with-athena-libraries=/usr/contrib/X11R6/lib

    2. make CFLAGS=-O2 CXXFLAGS=-O2

    (If configure fails to link statically Motif, it can be achieved with
    "make LIBXM=/usr/lib/Motif1.2_R6/libXm.a")

    Starting ddd-3.3.9, "./configure CFLAGS=-O3 CXXFLAGS=-O3; make" should
    be enough.  It seems that as features are added to DDD, the optimisation
    level needs to increase, or linking fails...

    DDD-3.3.9 builds on HP-UX 11.11 (aka 11i), with some fiddling.  The
    following process may be overkill, but is known to work:
    - Install HP's December 2003 patchset.
    - Install the linker patch PHSS_28871 (or PHSS_28869 for 11.00).
    - Install the HP-UX "developer's toolkit"; you can get it from
        http://www.software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=B3394BA
      (many thanks to Chris Seip of HP for this link!)
    - Build and install binutils 2.14 (I used /usr/local).  I also installed
      m4, bison, flex, make and zlib.
    - Build and install gcc-3.3.2 or gcc-3.4.0, using
         ../configure --with-gnu-as --with-as=/usr/local/bin/as
    - At this point, DDD's "./configure; make; make install" will work.

    If anyone's tried building DDD with HP's aCC, I'd like to hear from you.

Reported by: Tuomo Tikkanen <Tuomo.Tikkanen@nokia.com>

    To use HP's aCC to build ddd 3.3.9, setting CXXFLAGS='-AA' is necessary.


Irix
====

    Using the MIPSPro compilers:

    To compile ddd 3.3.9, CXXFLAGS needs to include "-LANG:std".

    To use Motif 2.1, the configure line is:
    env CC='cc -n32' CXX='CC -n32' \
     CFLAGS='-O' CXXFLAGS='-O -LANG:std' \
     ./configure \
     --with-motif-includes=/usr/Motif-2.1/include \
     --with-motif-libraries=/usr/Motif-2.1/lib32 \
     --x-libraries=/usr/lib32

LessTif
=======

    To use DDD with LessTif, get a recent LessTif release from
    `http://www.lesstif.org'.

    Lesstif 0.93.94 is known to work.


Linux
=====

Reported by: Andrew Gaylard <apg@users.sf.net>

    If the command window appears as follows on startup:

        GNU DDD 3.3.7 (i686-pc-linux-gnu), by Dorothea L(gdb)�

    then you probably have $LANG set to something like "en_US.UTF-8".
    Setting it to either "C" or "en_US.iso885915", or unsetting it completely
    will fix this problem.

    Alternatively, link with Lesstif.

    This has been observed on Redhat-8.1, but probably affects other
    Unixes as well.


MacOS X
=======

    Build may fail on case sensitive file systems as ddd and Ddd conflict.
    See http://mail.gnu.org/archive/html/ddd/2002-09/msg00024.html.
    Another workaround is to build ddd using "make EXEEXT=.exe".
    After installation ("make install EXEEXT=.exe"), ddd.exe needs
    to be renamed as 'ddd'. The resource file Ddd may need to be installed
    within $XAPPLRESDIR.
    ddd for MacOS X is available at http://darwinports.opendarwin.org/.


Solaris 2.x
===========

Reported by: Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>

    ddd 3.3.9 is known to build on Solaris 2.8 using the Sun compilers
    (Forte 6u2). It builds as well using g++.


Tru64
=====

Reported by: Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>

    Using the Compaq C++ compiler Version 6.5, it is necessary
    to use "CXX='cxx' CXXFLAGS='-std ansi -D__USE_STD_IOSTREAM -nousing_std'
    ./configure" to build ddd 3.3.9 and later.
    (CXXFLAGS='-std strict_ansi -nopure_cname' should do as well).


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$
