2.1 Configure Options
Keywords: sdccman

#
2.1 Configure Options

The install paths, search paths and other options are defined when running 'configure'. The defaults can be overridden by:

- [—prefix] see table below
- [—exec_prefix] see table below
- [—bindir] see table below
- [—datadir] see table below
- [—datarootdir] see table below
- [ docdir] environment variable, see table below
- [ include_dir_suffix] environment variable, see table below
- [ non_free_include_dir_suffix] environment variable, see table below
- [ lib_dir_suffix] environment variable, see table below
- [ non_free_lib_dir_suffix] environment variable, see table below
- [ sdccconf_h_dir_separator] environment variable, either / or \\ makes sense here. This character will only be used in sdccconf.h; don't forget it's a C-header, therefore a double-backslash is needed there.
- [—disable-mcs51-port] Excludes the Intel mcs51 port
- [—disable-z80-port] Excludes the z80 port
- [—disable-z180-port] Excludes the z180 port
- [—disable-ez80_z80-port] Excludes the e80_z80 port
- [—disable-r2k-port] Excludes the r2k port
- [—disable-r3ka-port] Excludes the r3ka port
- [—disable-sm83-port] Excludes the SM83 port
- [—disable-avr-port] Excludes the AVR port (disabled by default)
- [—disable-ds390-port] Excludes the DS390 port
- [—disable-hc08-port] Excludes the HC08 port
- [—disable-s08-port] Excludes the S08 port
- [—disable-stm8-port] Excludes the STM8 port
- [—disable-pic-port] Excludes the PIC14 port
- [—disable-pic16-port] Excludes the PIC16 port
- [—disable-xa51-port] Excludes the XA51 port (disabled by default)
- [—disable-ucsim] Disables configuring and building of ucsim
- [—disable-device-lib] Disables automatically building device libraries
- [—disable-packihx] Disables building packihx
- [—enable-doc] Build pdf, html and txt files from the lyx sources
- [—enable-libgc] Use the Bohem memory allocator. Lower runtime footprint.
- [—without-ccache] Do not use ccache even if available

Furthermore the environment variables CC, CFLAGS, ... the tools and their arguments can be influenced. Please see `configure —help' and the man/info pages of `configure' for details.
The names of the standard libraries STD_LIB, STD_INT_LIB, STD_LONG_LIB, STD_FP_LIB, STD_DS390_LIB, STD_XA51_LIB and the environment variables SDCC_DIR_NAME, SDCC_INCLUDE_NAME, SDCC_LIB_NAME are defined by `configure' too. At the moment it's not possible to change the default settings (it was simply never required).
These configure options are compiled into the binaries, and can only be changed by rerunning 'configure' and recompiling SDCC. The configure options are written in italics to distinguish them from run time environment variables (see section search paths).
The settings for ”Win32 builds” are used by the SDCC team to build the official Win32 binaries. The SDCC team uses Mingw32 to build the official Windows binaries, because it's

1. open source,
2. a gcc compiler and last but not least
3. the binaries can be built by cross compiling on SDCC Distributed Compile Farm.

See the examples, how to pass the Win32 settings to 'configure'. The other Win32 builds using VC or whatever don't use 'configure', but a header file sdcc_vc.h.in is the same as sdccconf.h built by 'configure' for Win32.
These defaults are:

Variable | default | Win32 builds
PREFIX | /usr/local | \sdcc
EXEC_PREFIX | $PREFIX | $PREFIX
BINDIR | $EXEC_PREFIX/bin | $EXEC_PREFIX\bin
DATADIR | $DATAROOTDIR | $DATAROOTDIR
DATAROOTDIR | $PREFIX/share | $PREFIX
DOCDIR | $DATAROOTDIR/sdcc/doc | $DATAROOTDIR\doc
INCLUDE_DIR_SUFFIX | sdcc/include | include
NON_FREE_INCLUDE_DIR_SUFFIX | sdcc/non-free/include | non-free/include
LIB_DIR_SUFFIX | sdcc/lib | lib
NON_FREE_LIB_DIR_SUFFIX | sdcc/non-free/lib | non-free/lib

'configure' also computes relative paths. This is needed for full relocatability of a binary package and to complete search paths (see section search paths below):

Variable (computed) | default | Win32 builds
BIN2DATA_DIR | ../share | ..
PREFIX2BIN_DIR | bin | bin
PREFIX2DATA_DIR | share/sdcc |

Examples:

  ./configure
  ./configure —prefix=”/usr/bin” —datarootdir=”/usr/share”
  ./configure —disable-avr-port —disable-xa51-port

To cross compile on linux for Mingw32 (see also 'sdcc/support/scripts/sdcc_mingw32'):

  ./configure \
  CC=”i586-mingw32msvc-gcc” CXX=”i586-mingw32msvc-g++” \
  RANLIB=”i586-mingw32msvc-ranlib” \
  STRIP=”i586-mingw32msvc-strip” \
  —prefix=”/sdcc” \
  —datarootdir=”/sdcc” \
  docdir=”\${datarootdir}/doc” \
  include_dir_suffix=”include” \
  non_free_include_dir_suffix=”non-free/include” \
  lib_dir_suffix=”lib” \
  non_free_lib_dir_suffix=”non-free/lib” \
  sdccconf_h_dir_separator=”\\\\” \
  —disable-device-lib \
  —host=i586-mingw32msvc \
  —build=unknown-unknown-linux-gnu

To ”cross”compile on Cygwin for Mingw32 (see also sdcc/support/scripts/sdcc_cygwin_mingw32):

  ./configure -C \
  —prefix=”/sdcc” \
  —datarootdir=”/sdcc” \
  docdir=”\${datarootdir}/doc” \
  include_dir_suffix=”include” \
  non_free_include_dir_suffix=”non-free/include” \
  lib_dir_suffix=”lib” \
  non_free_lib_dir_suffix=”non-free/lib” \
  sdccconf_h_dir_separator=”\\\\” \
  CC=”gcc -mno-cygwin” \
  CXX=”g++ -mno-cygwin”

'configure' is quite slow on Cygwin (at least on windows before Win2000/XP). The option '—C' turns on caching, which gives a little bit extra speed. However if options are changed, it can be necessary to delete the config.cache file.