next up previous contents
Next: Source Code Style Up: Using the Configure Previous: Makefile commands

Changing the configure script

The configure script is organized into four sections, which must be updated whenever new files or options are introduced into VMD or a change in the Makefile must be made. Also, the settings of VMD \ configuration variables must be changed to the proper settings for the user. For most users, the only section that will need to be changed is the very first section, where parameters are set. Developers of VMD will need to change all the sections of the configure script when code changes are made.

The first section of the configure script is present simply to set the values for specific configuration parameters, i.e., the directories to install VMD data files and utilities. See section 3.2 for a description of these parameters. New configuration parameters should be introduced and initialized in this section.

Following the parameters section, the configure script contains commands to parse the command-line options to the script, and initialize internal variables which store the requested OS type and list of required options. When new optional components for VMD are introduced, this section must include commands to look for the command-line option requesting the new component, and must initialize new variables to indicate the requested option.

The third section of the configure script, which is the largest part of the file, is the set of instructions used to write out the Makefile. This is accomplished by copying text embedded within the configure script to the newly forming Makefile, substituting the values of configuration parameters when necessary. Any changes to how the Makefile operates, or to specific make targets, should be made by altering this section of the configure script. At the start of the Makefile are placed general variable settings, based on the values of the configuration parameters set at the start of the configure script. Following this, the names of all files which comprise the different components of VMD are placed within the Makefile. For the different optional components, the corresponding sets of filenames are included or excluded from the Makefile based on whether the option was included or excluded. This part also includes the names of all documentation, data, etc. files. To conclude the Makefile, the definitions of all make targets are copied over.

At the end of the configure script is a section which finishes up after a new Makefile has been successfully created. This section copies the new Makefile to the proper subdirectories, saves the settings used to create this Makefile to the file configure.options, and then if requested executes a ``make'' command in the src directory. There is little need to change this part.

Adding new configurable parameters

Initialize new configurable parameters at the beginning of the configure script, in the relevant section (installation, or compilation). Later the settings for these parameters are written out to the Makefile; new parameters should also be written out to this Makefile. If the parameter is to be used as a macro within the source code, it should be written out to the file config.h, which is done by the make version command after configure has been updated and a new Makefile has been created.

Adding new configuration options

When a new option is added to the configure script, several things must be changed. It is best to search through the file for occurrances of a similar option and add references to the new option as well. Several things must be checked:

Adding support for a new architecture

If a new OS type or machine architecture is to be supported, follow these steps:

  1. Select a string name for it, upper-case if possible and specifying the OS version number, i.e., ``IRIX5''.
  2. Add this string as a configuration option in the OSTYPE category in the configure script.
  3. When the Makefile is created, a section of settings are written out for the particular OS type selected which specify the compiler name, compiler options, and names of utility programs needed to do things such as file copy, etc. A new section must be entered into the configure script for the new architecture, and this section should be written to the Makefile when the respective OS type is selected for configuration.
  4. The startup script used to run VMD must check for this OS type in order to run the proper executable when VMD is launched. Edit the file vmd in the bin directory (this script is entered into the RCS system) to check for the OS type.



next up previous contents
Next: Source Code Style Up: Using the Configure Previous: Makefile commands



Andrew Dalke
Wed May 15 02:25:03 CDT 1996