Recipes4Linux
DDD-2000 has been extensively tested on the following commercial distributions:
RHL 7.x
RHL 8
RHL 9
The following information has to be filtered when applied to different host distributions. If you did not install all packages doing a custom installation, you may need to install individual RPM files, as required.
All recipes on this site make assumptions about the host, to keep things simpler in the recipes. See this link to review the basic assumptions.
This section describes how to set the environment variables that enable DDD2000 to run on your host system. The following variables are described:
The typical way to set/change environment variables is in either the user's ~/.bashrc file or ~/.profile file. I usually set the variables in the ~/.bashrc file so I can kill the window I'm using and create a new one to see the changes take effect. When the ~/.profile file is used, the logged in user has to logout and login again before any changes are seen.
The following paragraphs describe how bash executes its startup files. If any of the files exist but cannot be read, bash reports an error. Tildes are expanded in file names as described below under Tilde Expansion in the EXPANSION section.
When bash is invoked as an interactive login shell, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior.
When a login shell exits, bash reads and executes commands from the file ~/.bash_logout, if it exists.
When an interactive shell that is not a login shell is started, bash reads and executes commands from ~/.bashrc, it that file exists. This may be inhibited by using the --norc option. The --rcfile file option will force bash to read and execute commands from file instead of ~/.bashrc.
The $PATH variable is used by the shell to look for executable programs. It is preset by the shell when the user first logs on and then it can be modified each time a shell is started. If DDD-2000 was installed to a directory not currently in the $PATH variable, the $PATH variable has to be adjusted. If DDD-2000 was not installed on your system (step 10 in recipe R4I : 3 : Apply patch and build DDD-2000) the $PATH variable should be adjusted to reflect the build directory for DDD2000.
If you want your additions to the $PATH variable to be seen BEFORE the system settings, use the following line in your startup file (~/.bashrc)
EXPORT PATH=/usr/local/bin:$PATH
If you want your additions to the $PATH variable to be seen AFTER the system settings, use the following line in your startup file (~/.bashrc)
EXPORT PATH=$PATH:/usr/local/bin
$DDD_HOME & $XUSERFILESEARCHPATH
From the INSTALL file in the ddd-3.3.8 tarball...
12. If you want to use DDD on your own program, please install it first (see the Step 13, below). If you absolutely *must* run DDD without installing it, be sure that the following environment variables are properly set:
- DDD_HOME must point to the top-level source package directory (such that '$DDD_HOME/NEWS' is the DDD news)
- XUSERFILESEARCHPATH must contain the path of the 'Ddd' app-defaults file, where 'Ddd' is substituted by '%N'.
These environment variables are important iff (if and only if) you wish to maintain access to the version of DDD that was installed with your host distribution. If you executed step 10 in recipe R4I : 3 : Apply patch and build DDD-2000, this is an unnecessary step. However, if you did NOT execute step 10 in the above recipe, you should add the following lines to your shell startup file:
export DDD_HOME=/usr/local/src/DDD2000/ddd-3.3.8/
export XUSERFILESEARCHPATH=$DDD_HOME/build/ddd:$XUSERFILESEARCHPATH
From Volume One, Xlib Programming Manual for Version 11, by Adrian Nye...
10.1.1 Internationalization with ANSI-C
...
The first step in any internationalized application is to establish the locale -- to cause the localization database to be read in. This is done with the C library function setlocale. It takes two arguments: a locale category and the locale name. The locale name specifies the database that should be used to localize the program, and the locale category specifies which behaviors (for exampel, the collation sequence of the alphabet or the formatting of times and dates) of the program should be changed. setlocale will most often be used as shown below:
setlocale(LC_ALL, "");
Passing the empty string as the locale name will cause setlocale to get the name of the locale from the operating system environmnet variable named LANG. This allows the application writer to leave the choice of locale to the end user of the application. There is no standard format for locale names, but they often have the form:
language[_territory[.codeset]]
From the setlocale man page...
...
If locale is "", each part of the locale that should be modified is set according to the environment variables. The details are implementation dependent. For glibc, first (regardless of category), the environment variable LC_ALL is inspected, next the environment variable with the same name as the category (LC_COLLATE, LC_CTYPE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, LC_TIME) and finally the environment variable LANG. The first existing environment variable is used. If its value is not a valid locale specification, the locale is unchanged, and setlocale returns NULL.
The locale "C" or "POSIX" is a portable locale; its LC_CTYPE part corresponds to the 7-bit ASCII character set.
A locale name is typically of the form language[_territory][.codeset][@modifier], where language is an ISO 639 language code, territory is an ISO 3166 country code, and codeset is a character set or encoding identifier like ISO-8859-1 or UTF-8. For a list of all supported locales, try "locale -a".
At startup, DDD-2000 does, in fact, make the following function call
setlocale( LC_ALL, "" );
Which implies that the locale defaults to 7-bit ASCII, unless modified by an environment variable setting. 7-bit ASCII is problematic to the proper running of DDD-2000 because of the European origins of both DDD and the Abatron BDI-2000. Non-ASCII characters are displayed in the Abatron help menu and copyright notices for DDD.
Run the command 'locale -a' on your system to determine appropriate settings for the $LANG variable. At a minimum, the following should work on all systems:
export LANG=.UTF8
DDD is a very sophisticated X-Window GUI application. By default, state and configuration data is stored in files in the ~/.ddd directory. If you want to have DDD-2000 co-exist with another ddd installation, it is probably easiest to create a startup script for DDD-2000 in your ~/bin directory. The startup script would need to cp -a ~/.ddd savedir, and restore the savedir for DDD-2000. Each version of ddd that you want to run needs its own startup script to make sure the correct savedir is restored to ~/.ddd. Please email help@recipes4linux.com if you need more detailed help. If you are trying to support multiple versions of ddd on your system, you do not want to execute step 10 of R4I : 3 : Apply patch and build DDD-2000.
Contact tmike@recipes4linux.com
Copyright © 2004 Tools Made Tough