Howto port autoconf based application to RTEMS.

Karel Gardas kgardas at objectsecurity.com
Wed Jan 12 22:10:37 UTC 2005


Hello,

I'm thinking about porting MICO (http://www.mico.org) to RTEMS. It uses
autoconf based configure script, for which I need to find out the right
combination of various *FLAGS *LIBS environment variables to get
configure's generated simple files compiled. I'm most confused by RTEMS
application linking... Is there any howto targeting this task?

Example: test for gethostname looks:

----->start<-------------
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char gethostname(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gethostname();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_gethostname) || defined (__stub___gethostname)
choke me
#else
gethostname();
#endif

; return 0; }
------>end<--------------

and it is compiled with (those parameters are already hacked by me into
the configure):

configure:7258: i386-rtems-c++ -o conftest -O2
-B/mnt/karel/rtems-x86/i386-rtems/pc386//lib -specs bsp_specs -qrtems
-B/mnt/karel/rtems-x86/i386-rtems/pc386/lib/ -Wl,-Ttext,0x00100000
/mnt/karel/rtems-x86/i386-rtems/pc386/lib/no-dpmem.rel
/mnt/karel/rtems-x86/i386-rtems/pc386/lib/no-msg.rel
/mnt/karel/rtems-x86/i386-rtems/pc386/lib/no-mp.rel
/mnt/karel/rtems-x86/i386-rtems/pc386/lib/no-part.rel
 /mnt/karel/rtems-x86/i386-rtems/pc386/lib/no-signal.rel
/mnt/karel/rtems-x86/i386-rtems/pc386/lib/no-timer.rel
/mnt/karel/rtems-x86/i386-rtems/pc386/lib/no-rtmon.rel conftest.C -lm  1>&5

which results in undefined references:

/mnt/karel/rtems-x86/i386-rtems/pc386//lib/librtemscpu.a(rtems_glue.o): In
function `rtems_bsdnet_initialize_network':
/mnt/karel/downloads/RTEMS/build/tools/obj-rtems/i386-rtems/c/pc386/exec/libnetworking/../../../../../../rtems/cpukit/libnetworking/r
tems/rtems_glue.c:944: undefined reference to `rtems_bsdnet_config'
/mnt/karel/downloads/RTEMS/build/tools/obj-rtems/i386-rtems/c/pc386/exec/libnetworking/../../../../../../rtems/cpukit/libnetworking/r
tems/rtems_glue.c:953: undefined reference to `rtems_bsdnet_config'
/mnt/karel/rtems-x86/i386-rtems/pc386//lib/librtemscpu.a(rtems_glue.o): In
function `rtems_bsdnet_initialize':
/mnt/karel/downloads/RTEMS/build/tools/obj-rtems/i386-rtems/c/pc386/exec/libnetworking/../../../../../../rtems/cpukit/libnetworking/r
tems/rtems_glue.c:226: undefined reference to `rtems_bsdnet_config'
/mnt/karel/downloads/RTEMS/build/tools/obj-rtems/i386-rtems/c/pc386/exec/libnetworking/../../../../../../rtems/cpukit/libnetworking/r
tems/rtems_glue.c:234: undefined reference to `rtems_bsdnet_config'
/mnt/karel/downloads/RTEMS/build/tools/obj-rtems/i386-rtems/c/pc386/exec/libnetworking/../../../../../../rtems/cpukit/libnetworking/r
tems/rtems_glue.c:236: undefined reference to `rtems_bsdnet_config'
/mnt/karel/rtems-x86/i386-rtems/pc386//lib/librtemscpu.a(rtems_glue.o):/mnt/karel/downloads/RTEMS/build/tools/obj-rtems/i386-rtems/c/
pc386/exec/libnetworking/../../../../../../rtems/cpukit/libnetworking/rtems/rtems_glue.c:813:
more undefined references to `rtems_bsdnet_config' follow

Thanks,
Karel
--
Karel Gardas                  kgardas at objectsecurity.com
ObjectSecurity Ltd.           http://www.objectsecurity.com





More information about the users mailing list