This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
approch to build eCos applications with autotools.
- From: Masato Taruishi <taru at debian dot org>
- To: ecos-discuss at sources dot redhat dot com
- Date: Sun, 28 Jul 2002 15:54:10 +0900
- Subject: [ECOS] approch to build eCos applications with autotools.
I'm writing autoconf/automake macros for eCos. Although threre are
still many other problems, I guess this approach makes easy to port
autotools-aware programs to eCos.
This is a hello world example by the approach:
------------- Makefile.am --------------------
bin_PROGRAMS = hello
hello_SOURCES = hello.c
hello_DEPENDENCIES = @ECOS_DEPENDENCIES@
include ecos.am
------------- configure.in -------------------
AC_INIT(configure.in)
AM_INIT_AUTOMAKE(hello, 0.1)
AM_ECOS
AC_OUTPUT(Makefile)
To configure this source for eCos:
~$ ./configure --host=i386-ecos --build=i686-linux
<snip>
checking build system type... i686-pc-linux-gnu
checking host system type... i386-pc-ecos
checking for i386-ecos-gcc... no
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for eCos environment... yes
checking for ecosconfig... /usr/bin/ecosconfig
configure: creating a eCos savefile
configure: creating ./config.status
config.status: creating Makefile
and make it:
~$ make
<snip>
gcc -g -O2 -I.ecos/install/include -ffunction-sections -fdata-sections -L.ecos/install/lib -Ttarget.ld -nostdlib -o hello hello.o
To test eCos program on linux by using i386-linux HAL:
~$./configure --host=i386-linux-ecos --build=i686-linux
<snip>
checking build system type... i686-pc-linux-gnu
checking host system type... i386-pc-ecos
checking for i386-ecos-gcc... no
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for eCos environment... yes
checking for ecosconfig... /usr/bin/ecosconfig
configure: creating a eCos savefile
U CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT, new inferred value 0
U CYGNUM_LIBC_MAIN_DEFAULT_STACK_SIZE, new inferred value 16384
configure: creating ./config.status
config.status: creating Makefile
and make it.
Of cource, this program can be built for native linux:
~$ ./configure; make
<snip>
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for eCos environment... no
configure: creating ./config.status
config.status: creating Makefile
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"test\" -DVERSION=\"0.1\" -I. -I. -g -O2 -c hello.c
gcc -g -O2 -o hello hello.o
Any comments or suggestions are welcomed.
--
Debian Project http://debian.org/ - Masato Taruishi <taru@debian.org>
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss