MakeRc File

The installation of UDF software and UDF updates use a generic set of system dependent compile and link flags. These provide no or minimal optimization. Executables are built according to the system set up meaning that you will get 32 bit executables on systems which are configured as 32 bit systems even if they support 64 bit operations.

Use of the MakeRc file allows the user to override the default compile options. Compile options which include extensions tailored to a particular CPU can set here and will be used in all builds. This can sometimes lead to significant speed ups. One note: you should not mix 32 and 64 bit builds. You must stick with one or the other for all installs.

The MakeRc file consists of a set of comment and field definition lines. All lines which begin with a # are comment lines. Field definition lines consist of the field ID followed by the definition. The defined compile and link options in the file are only used if the USE_DEFINED field at the top of the file has been uncommented. Any compile or link options set in MakeRc my be ignored within some Makefiles.

The fields which may be set within the MakeRc file are described below.

USE_DEFINED
This field should be uncommented when the MakeRc file is to be used to set the compile and link options. Otherwise is should be commented. The field had no associated definition.
CTYPE
Should be set to SHARED or STATIC depending on whether libraries should be created as shared object or static libraries. The default is SHARED.
CBASE
There are the base compile options and should not be changed with the exception of -pipe which can be omitted if it desired.
CADD
Any additional compile flags including CPU specific and optimization flags.
EXT
Any extentions that needs to be added to executables. In general this is only set on WINDOWS-based systems in which case the field is set to .exe.
CSYS
All defined variables to use during compilation. Either -D_CyGnUsC (set when compiling on Cygnus based systems) or -D_UnIx must be set. Set -D_ReaLTimE_ to activate the real-time portion of the base UDF code. In general _ReaLTimE is left unset.
CSO
All required compile flags needed when compiling for shared object libraries.
SO_EXT
The extension added to the shared object library. This is generally soso but OSX uses dylib and HP_UX sl.
LD
How to invoke the loader when creating a shared object library. This is almost universally ld but OSX (Darwin) uses cc
LD_FLAGS
Any flags passed to the loader when building a shared object library.
XLIB
If the install is not able to locate the libX11 library then set this flag to pass the full path to the library including the library name.

Compile flags for specific CPUs

The MakeRc file as supplied with the base install is defaulted to be unused. It does however contain safe settings for many popular CPU's. The table below shows option settings for several current CPU's. These settings do not contain compiler optimazation (-O#) flags.

AMD 64 bit CPU's

CTYPE SHARED
CBASE -Wall -pipe -fsigned-char
CSYS -D_UnIx
CSO -fPIC -shared
SO_EXT so
LD ld
LD_FLAGS -shared
CADD -march=k8 -fforce-addr -fweb

AMD 32 bit Athlon CPU's

CTYPE SHARED
CBASE -Wall -pipe -fsigned-char
CSYS -D_UnIx
CSO -fPIC -shared
SO_EXT so
LD ld
LD_FLAGS -shared
CADD -march=athlon-xp -mfpmath=sse -msse -mmmx -3dnow

SUNOS 64 bit Sparc CPU's

The following assumes that the system is set for 32 bit operations and that the system 64 bit libraries are located in /usr/lib/sparcv9 and /usr/ucblib/sparcv9. You may also need to include these in your LD_LIBRARY_PATH environment varaible setting.

CTYPE SHARED
CBASE -Wall -pipe -fsigned-char -m64
CSYS -D_UnIx
CSO -fPIC -shared
SO_EXT so
LD ld
LD_FLAGS -G -64 -L/usr/lib/sparcv9 -L/usr/ucblib/sparcv9
CADD

SUNOS Sparc based CPU's

This will result in either a 32 or 64 bit install depending on how your system is configured.

CTYPE SHARED
CBASE -Wall -pipe -fsigned-char
CSYS -D_UnIx
CSO -fPIC -shared
SO_EXT so
LD ld
LD_FLAGS -G
CADD

PPC G3 (Linux and OSX)

CTYPE SHARED
CBASE -Wall -pipe -fsigned-char
CSYS -D_UnIx
CSO -no-cpp-precomp -dynamic -fPIC -fno-common -D_REENTRANT
SO_EXT dylib
LD cc
LD_FLAGS -flat_namespace -undefined suppress -dynamiclib
CADD -mpowerpc

PPC G4 (Linux and OSX)

You may need to change the CADD -m option to match you particular G4 CPU but generally the given setting seems to work generically.

CTYPE SHARED
CBASE -Wall -pipe -fsigned-char
CSYS -D_UnIx
CSO -no-cpp-precomp -dynamic -fPIC -fno-common -D_REENTRANT
SO_EXT dylib
LD cc
LD_FLAGS -flat_namespace -undefined suppress -dynamiclib
CADD -mcpu=7450 -maltivec -mabi=altivec -mpowerpc-gfxopt -mstring -mmultiple

HP-UX

CTYPE SHARED
CBASE -Wall -pipe -fsigned-char
CSYS -D_UnIx
CSO -fPIC -shared
SO_EXT sl
LD ld
LD_FLAGS -b -Brestricted +s
CADD

OSF1

CTYPE SHARED
CBASE -Wall -pipe -fsigned-char
CSYS -D_UnIx
CSO -fPIC -shared
SO_EXT so
LD ld
LD_FLAGS -expect_unresolved '*' -shared -all
CADD

Cygwin

This may not be current. As there is a UDF WINDOWS native install now its not been tested for quite some time.

CTYPE SHARED
CBASE -Wall -pipe -fsigned-char
CSYS -D_CyGnUsC
CSO -fPIC -shared
SO_EXT so
LD ld
LD_FLAGS -shared
CADD
EXT .exe

32 bit compiles on a 64 bit system

Setting up a 32 bit UDF installation on a 64 bit platform should be done as part of a new or fresh UDF installation. Since you cannot mix 32 and 64 bit libraries all of the UDF packages need to be built under the same compile options.

To see if your system will support a 32 bit compilation issue the command ld -V. This should show elf_i386 as one of the supported emulations. If not it probably means that the system was not set up to support 32 bit emulations.

If your system supports 32 emulations then do the initial UDF install (EasyUDFInstall). Next edit the file $UDFTOOL_HOME/ConFigs/MakeRc. Remove the comment character (#) from the line USE_DEFINED. Next change the definitions CTYPE, CBASE, CSYS, CSO, SO_EXT, LD, LD_FLAGS to match those for the system CPU. (In many cases the current settings are the correct ones and no changes are needed). If there is a CADD definition for your CPU then uncomment it and to that line add -m32. If there isn't a CADD definition create one as CADD -m32. You can add addition settings here if you want to. Last add -melf_i386 to the LD_FLAGS definition and save the file.

Now proceed according to the installation instructions. Update the base installation and add whatever additional packages are needed. All compiled programs and libraries will be elf32 based.

One rare problem that may occur in performing a 32 bit installation on a 64 bit platform is that the linker may not be able to locate the 32 bit versions of the system libraries. In this case it is necessary to locate the directory or directories they are stored under and to add those directories to the LD_LIBRARY_PATH environment variable.