URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.1/] [gdb/] [config/] [djgpp/] [README] - Rev 227
Compare with Previous | Blame | View Log
How to build and install the DJGPP native version of GDB********************************************************General=======GDB built with DJGPP supports native DJGPP debugging, whereby you rungdb.exe and the program being debugged on the same machine. Inaddition, this version supports remote debugging via a serial port,provided that the target machine has a GDB-compatible debugging stubwhich can be linked with the target program (see the section "RemoteSerial" in the GDB manual for more details).Installation of the binary distribution=======================================Simply unzip the gdbNNNb.zip file (where NNN is the version number)from the top DJGPP installation directory. Be sure to preserve thedirectory structure while you unzip (use -d switch if you do this withPKUNZIP). On Windows 9X and Windows 2000, use an unzip program whichsupports long file names; one such program is unzip32.exe, availablefrom the DJGPP sites.If you need the libraries which are built as part of GDB, install thecompanion file gdbNNNa.zip. This allows to develop applications whichuse the same functions as GDB. For example, you can build your ownfront end to the debugger.Rebuilding GDB from sources===========================1. Prerequisites-------------To build the package, you will need the DJGPP development environment(GCC, header files, and the libraries), and also DJGPP ports of thefollowing tools:- GNU Make 3.79.1 or later- Bash 2.03 or later- GNU Sed- GNU Fileutils- GNU Textutils 2.0 or later- GNU Sh-utils- GNU Grep 2.4 or later- GNU Findutils- GNU Awk 3.04 or later- GNU Bison (only if you change one of the gdb/*.y files)- Groff (only if you need to format the man pages)- GNU Diffutils (only if you run the test suite)These programs should be available from the DJGPP sites, in the v2gnudirectory. In addition, the configuration script invokes the `update'and `utod' utilities which are part of the basic DJGPP development kit(djdevNNN.zip).2. Unpacking the sources---------------------If you download the source distribution from one of the DJGPP sites,just unzip it while preserving the directory structure (I suggest touse unzip32.exe available with the rest of DJGPP), and proceed to thesection "How to build", below.Source distributions downloaded from one of the GNU FTP sites needsome more work to unpack. First, you MUST use the `djunpack' batchfile to unzip the package. That's because some file names in theofficial distributions need to be changed to avoid problems on thevarious platforms supported by DJGPP. `djunpack' invokes the `djtar'program (that is part of the basic DJGPP development kit) to renamethese files on the fly given a file with name mappings; thedistribution includes a file `gdb/config/djgpp/fnchange.lst' with thenecessary mappings. So you need first to retrieve that batch file,and then invoke it to unpack the distribution. Here's how:djtar -x -p -o gdb-5.2/djunpack.bat gdb-5.2.tar.gz > djunpack.batdjunpack gdb-5.2.tar.gz(The name of the distribution archive and the leading directory of thepath to `djunpack.bat' in the distribution will be different forversions of GDB other than 5.2.)If the argument to `djunpack.bat' include leading directories, it MUSTbe given with the DOS-style backslashes; Unix-style forward slasheswill NOT work.If the distribution comes as a .tar.bz2 archive, and your version of`djtar' doesn't support bzip2 decompression, you need to unpack it asfollows:bunzip2 gdb-6.4.tar.bz2djtar -x -p -o gdb-6.4/djunpack.bat gdb-6.4.tar > djunpack.batdjunpack gdb-6.4.tar3. How to build------------If the source distribution available from DJGPP archives is alreadyconfigured for DJGPP v2.x (if it is, you will find files named`Makefile' in each subdirectory), then just invoke Make:makeTo build a package that is not yet configured, or if you downloadedGDB from a GNU FTP site, you will need to configure it first. Youwill also need to configure it if you want to change the configurationoptions (e.g., compile without support for the GDBMI interface). Toconfigure GDB, type this command:sh ./gdb/config/djgpp/djconfig.shThis script checks the unpacked distribution, then edits the configurescripts in the various subdirectories, to make them suitable forDJGPP, and finally invokes the top-level configure script, whichrecursively configures all the subdirectories.You may pass optional switches to djconfig.sh. It accepts all theswitches accepted by the original GDB configure script. Theseswitches are described in the file gdb/README, and their full list canbe displayed by running the following command:sh ./gdb/configure --helpNOTE: if you *do* use optional command-line switches, you MUST passto the script the name of the directory where GDB sources areunpacked--even if you are building GDB in-place! For example:sh ./gdb/config/djgpp/djconfig.sh . --disable-gdbmiIt is also possible to build GDB in a directory that is different fromthe one where the sources were unpacked. In that case, you have topass the source directory as the first argument to the script:sh ./gdb/config/djgpp/djconfig.sh d:/gnu/gdb-6.4You MUST use forward slashes in the first argument.After the configure script finishes, run Make:makeIf you want to produce the documentation (for example, if you changedsome of the Texinfo sources), type this:make infoWhen Make finishes, you can install the package:make install prefix='${DJDIR}' INSTALL='ginstall -c'The above doesn't install the docs; for that you will need to saythis:make install-info prefix='${DJDIR}' INSTALL='ginstall -c'The test suite has been made to work with DJGPP. If you make a changein some of the programs, or want to be sure you have a fullyfunctional GDB executable, it is a good idea to run the test suite.You cannot use "make check" for that, since it will want to run the`dejagnu' utility which DJGPP doesn't support. Instead, use the specialscript gdb/config/djgpp/djcheck.sh, like this:cd gdb/testsuitesh ../config/djgpp/djcheck.shThis will run for a while and should not print anything, except themessages "Running tests in DIR", where DIR is one of thesubdirectories of the testsuite. Any test that fails to produce theexpected output will cause the diffs between the expected and theactual output be printed, and in addition will leave behind a fileSOMETHING.tst (where SOMETHING is the name of the failed test). Youshould compare each of the *.tst files with the corresponding *.outfile and convince yourself that the differences do not indicate a realproblem. Examples of differences you can disregard are changes in thecopyright blurb printed by GDB, values of unitialized variables,addresses of global variables like argv[] and envp[] (which depend onthe size of your environment), etc.Note that djcheck.sh only recurses into those of the subdirectories ofthe test suite which test features supported by the DJGPP port of GDB.For example, the tests in the gdb.gdbtk, gdb.threads, and gdb.hpdirectories are not run.Enjoy,Eli Zaretskii <eliz@gnu.org>
