embtextf uses the GNU Build System to simplify configuration, compilation, library building, and installation. The general process is:
Most users of embtextf will want to cross-compile it for an embedded system, which is indicated by using the –host
flag to configure
to tell it to cross-compile. Be aware that with most versions of autoconf released since the year 2000 you will get the following message:
configure: WARNING: if you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used
There is nothing wrong here except the expectations of the maintainers and most users of autoconf. You don't want to set the –build
type, you do want to cross-compile, and you did exactly what you were supposed to do. Ignore the warning.
You can run:
to see what the various options mean and how you can influence the configuration and compilation process. In particular, there are options to disable features such as support for long long
types. See <embtextf/config.h> for descriptions of features that can be enabled or disabled based on specific needs.
By default, all features of embtextf are enabled, but in some cases the features may be unnecessary and support for them might increase the size of the library. As an example, the following turns off embtextf_vuprintf() support for 64-bit values (EMBTEXTF_ENABLE_VUPRINTF_LONGLONG) and format precision (EMBTEXTF_ENABLE_VUPRINTF_PRECISION) on the MSP430, resulting in a significantly smaller library:
The following can be used to produce an embtextf installation suitable for use with Texas Instruments MSP430 devices when using the mspgcc GNU-based toolchain:
Because autoconf does not nicely support multilibs, if you want to control the memory model or take advantage of CPU/MPY capabilities of the target chip you'll need to do that through TARGET_CFLAGS:
Memory model information for an object file can be displayed using msp430-readelf
with the -A
flag:
llc% msp430-readelf -A /usr/local/mspgccx/lib/libembtextf.a File: /tmp/msp430x/lib/libembtextf.a(vuprintf.o) Attribute Section: gnu File Attributes Tag_GNU_MSP430_CPUX_TARGET: c20,sr20
The following can be used to produce an embtextf installation suitable for use with Energy Micro and probably other Cortex-M3 devices when using the CodeSourcery toolchain:
The following can be used to produce an embtextf installation built with the Texas Instruments Code Composer Studio compiler toolchain:
The –with-ccs-target
option should specify the target platform, such as msp430
or tms470
. The installation root of the TI compiler toolchain should be specified in the CCS_INSTALL_ROOT
environment variable or on the configure command line.
embtextf constructs and installs a pkg-config file that can be used to obtain the flags necessary to build applications to link with an installed embtextf system. Use the tool this way:
which will produce output like:
-mcpu=cortex-m3 -mthumb -mfix-cortex-m3-ldrd -g -O2 -Os -I/usr/local/efm32/include -L/usr/local/efm32/lib -lembtextf
pkg-config assumes you combine CPPFLAGS into CFLAGS (and LDFLAGS into LIBS), so though you can obtain the include path using –cflags-only-I
there is no general way to extract only the specific pieces that belong in CFLAGS and LDFLAGS.
pkg-config also does not have a concept of optional libraries within a package, so for simplicity -lembtextf-libc
is excluded from LIBS and must be added if the libc wrappers enabled by EMBTEXTF_PROVIDE_LIBC are desired.