Module: xenomai-forge
Branch: next
Commit: 24e3b7c1b080bbb1e17318f32d0aee36889a2446
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=24e3b7c1b080bbb1e17318f32d0aee36889a2446

Author: Philippe Gerum <r...@xenomai.org>
Date:   Fri Aug 16 17:04:02 2013 +0200

copperplate, scripts/xeno-config: introduce auto-init feature

By default or when --auto-init is passed to xeno-config, executables
which depend on Copperplate will call copperplate_init()
automatically, before main() runs, hiding such requirement from the
application code.

This mechanism is implemented via ld's --wrap trick, interposing on
the application's main() routine for performing the Copperplate inits
first.

Conversely, passing --no-auto-init to xeno-config disables this
feature.

---

 include/copperplate/init.h       |    2 ++
 lib/alchemy/testsuite/alarm-1.c  |    3 ---
 lib/alchemy/testsuite/buffer-1.c |    3 ---
 lib/alchemy/testsuite/event-1.c  |    3 ---
 lib/alchemy/testsuite/heap-1.c   |    3 ---
 lib/alchemy/testsuite/mq-1.c     |    3 ---
 lib/alchemy/testsuite/mq-2.c     |    3 ---
 lib/alchemy/testsuite/mq-3.c     |    3 ---
 lib/alchemy/testsuite/mutex-1.c  |    3 ---
 lib/alchemy/testsuite/sem-1.c    |    3 ---
 lib/alchemy/testsuite/sem-2.c    |    3 ---
 lib/alchemy/testsuite/task-1.c   |    3 ---
 lib/alchemy/testsuite/task-2.c   |    3 ---
 lib/alchemy/testsuite/task-3.c   |    3 ---
 lib/alchemy/testsuite/task-4.c   |    3 ---
 lib/alchemy/testsuite/task-5.c   |    3 ---
 lib/alchemy/testsuite/task-6.c   |    3 ---
 lib/alchemy/testsuite/task-7.c   |    3 ---
 lib/alchemy/testsuite/task-8.c   |    3 ---
 lib/copperplate/Makefile.am      |    6 ++++--
 lib/copperplate/Makefile.in      |   37 ++++++++++++++++++++++++++++---------
 lib/copperplate/init.c           |    8 ++++++++
 lib/copperplate/main.c           |   30 ++++++++++++++++++++++++++++++
 lib/copperplate/wrappers.c       |   27 +++++++++++++++++++++++++++
 lib/psos/testsuite/mq-1.c        |    3 ---
 lib/psos/testsuite/mq-2.c        |    3 ---
 lib/psos/testsuite/mq-3.c        |    3 ---
 lib/psos/testsuite/pt-1.c        |    3 ---
 lib/psos/testsuite/rn-1.c        |    3 ---
 lib/psos/testsuite/sem-1.c       |    3 ---
 lib/psos/testsuite/sem-2.c       |    3 ---
 lib/psos/testsuite/task-1.c      |    3 ---
 lib/psos/testsuite/task-2.c      |    3 ---
 lib/psos/testsuite/task-3.c      |    3 ---
 lib/psos/testsuite/task-4.c      |    3 ---
 lib/psos/testsuite/task-5.c      |    3 ---
 lib/psos/testsuite/task-6.c      |    3 ---
 lib/psos/testsuite/task-7.c      |    3 ---
 lib/psos/testsuite/task-8.c      |    3 ---
 lib/psos/testsuite/task-9.c      |    3 ---
 lib/psos/testsuite/tm-1.c        |    3 ---
 lib/psos/testsuite/tm-2.c        |    3 ---
 lib/psos/testsuite/tm-3.c        |    3 ---
 lib/psos/testsuite/tm-4.c        |    3 ---
 lib/psos/testsuite/tm-5.c        |    3 ---
 lib/psos/testsuite/tm-6.c        |    3 ---
 lib/psos/testsuite/tm-7.c        |    3 ---
 lib/vxworks/testsuite/lst-1.c    |    3 ---
 lib/vxworks/testsuite/msgQ-1.c   |    3 ---
 lib/vxworks/testsuite/msgQ-2.c   |    3 ---
 lib/vxworks/testsuite/msgQ-3.c   |    3 ---
 lib/vxworks/testsuite/rng-1.c    |    3 ---
 lib/vxworks/testsuite/sem-1.c    |    3 ---
 lib/vxworks/testsuite/sem-2.c    |    3 ---
 lib/vxworks/testsuite/sem-3.c    |    3 ---
 lib/vxworks/testsuite/sem-4.c    |    3 ---
 lib/vxworks/testsuite/task-1.c   |    3 ---
 lib/vxworks/testsuite/task-2.c   |    3 ---
 lib/vxworks/testsuite/wd-1.c     |    3 ---
 scripts/Makefile.am              |   17 +++++++++++------
 scripts/Makefile.in              |   34 ++++++++++++++++++++--------------
 scripts/dynlist.ld               |    3 +++
 scripts/xeno-config-cobalt.in    |   13 +++++++++++--
 scripts/xeno-config-mercury.in   |   11 ++++++++++-
 utils/slackspot/Makefile.in      |    2 +-
 65 files changed, 155 insertions(+), 194 deletions(-)

diff --git a/include/copperplate/init.h b/include/copperplate/init.h
index 69e5672..ff97591 100644
--- a/include/copperplate/init.h
+++ b/include/copperplate/init.h
@@ -54,6 +54,8 @@ struct copperskin {
 extern "C" {
 #endif
 
+int copperplate_main(int argc, char *const argv[]);
+
 void copperplate_init(int *argcp, char *const **argvp);
 
 void copperplate_register_skin(struct copperskin *p);
diff --git a/lib/alchemy/testsuite/alarm-1.c b/lib/alchemy/testsuite/alarm-1.c
index 79ae458..662d420 100644
--- a/lib/alchemy/testsuite/alarm-1.c
+++ b/lib/alchemy/testsuite/alarm-1.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
 #include <alchemy/alarm.h>
@@ -73,8 +72,6 @@ int main(int argc, char *const argv[])
 {
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        ret = rt_alarm_create(&alrm, "ALARM", alarm_handler, &alrm);
diff --git a/lib/alchemy/testsuite/buffer-1.c b/lib/alchemy/testsuite/buffer-1.c
index 36411c2..49a439f 100644
--- a/lib/alchemy/testsuite/buffer-1.c
+++ b/lib/alchemy/testsuite/buffer-1.c
@@ -1,7 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <memory.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
 #include <alchemy/buffer.h>
@@ -77,8 +76,6 @@ int main(int argc, char *const argv[])
 {
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], 0);
 
        ret = rt_buffer_create(&buffer, NULL, 2, B_FIFO);
diff --git a/lib/alchemy/testsuite/event-1.c b/lib/alchemy/testsuite/event-1.c
index 46246cb..79c2e55 100644
--- a/lib/alchemy/testsuite/event-1.c
+++ b/lib/alchemy/testsuite/event-1.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
 #include <alchemy/event.h>
@@ -66,8 +65,6 @@ int main(int argc, char *const argv[])
 {
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], 0);
 
        ret = rt_event_create(&event, "EVENT", 0, EV_FIFO);
diff --git a/lib/alchemy/testsuite/heap-1.c b/lib/alchemy/testsuite/heap-1.c
index 7b002da..d7667b3 100644
--- a/lib/alchemy/testsuite/heap-1.c
+++ b/lib/alchemy/testsuite/heap-1.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
 #include <alchemy/heap.h>
@@ -89,8 +88,6 @@ int main(int argc, char *const argv[])
        RT_HEAP heap;
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        ret = rt_task_create(&t_bgnd, "BGND", 0,  20, 0);
diff --git a/lib/alchemy/testsuite/mq-1.c b/lib/alchemy/testsuite/mq-1.c
index 4a418b9..ae021d8 100644
--- a/lib/alchemy/testsuite/mq-1.c
+++ b/lib/alchemy/testsuite/mq-1.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
 #include <alchemy/queue.h>
@@ -93,8 +92,6 @@ int main(int argc, char *const argv[])
        RT_TASK t_main;
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], 0);
 
        ret = rt_task_spawn(&t_main, "main_task", 0,  50, 0, main_task, NULL);
diff --git a/lib/alchemy/testsuite/mq-2.c b/lib/alchemy/testsuite/mq-2.c
index 1b3fce8..2c238d6 100644
--- a/lib/alchemy/testsuite/mq-2.c
+++ b/lib/alchemy/testsuite/mq-2.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
 #include <alchemy/queue.h>
@@ -99,8 +98,6 @@ int main(int argc, char *const argv[])
        RT_TASK t_main;
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        ret = rt_task_spawn(&t_main, "main_task", 0,  50, 0, main_task, NULL);
diff --git a/lib/alchemy/testsuite/mq-3.c b/lib/alchemy/testsuite/mq-3.c
index d4c6a78..3a66eec 100644
--- a/lib/alchemy/testsuite/mq-3.c
+++ b/lib/alchemy/testsuite/mq-3.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
 #include <alchemy/queue.h>
@@ -96,8 +95,6 @@ int main(int argc, char *const argv[])
        RT_TASK t_main, t_peer;
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        traceobj_mark(&trobj, 11);
diff --git a/lib/alchemy/testsuite/mutex-1.c b/lib/alchemy/testsuite/mutex-1.c
index 8b9fc22..8143712 100644
--- a/lib/alchemy/testsuite/mutex-1.c
+++ b/lib/alchemy/testsuite/mutex-1.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
 #include <alchemy/mutex.h>
@@ -123,8 +122,6 @@ int main(int argc, char *const argv[])
 {
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        ret = rt_task_create(&t_b, "taskB", 0, 21, 0);
diff --git a/lib/alchemy/testsuite/sem-1.c b/lib/alchemy/testsuite/sem-1.c
index 4ba2e98..ac32404 100644
--- a/lib/alchemy/testsuite/sem-1.c
+++ b/lib/alchemy/testsuite/sem-1.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
 #include <alchemy/sem.h>
@@ -130,8 +129,6 @@ int main(int argc, char *const argv[])
 {
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        ret = rt_task_create(&t_a, "taskA", 0, 20, 0);
diff --git a/lib/alchemy/testsuite/sem-2.c b/lib/alchemy/testsuite/sem-2.c
index 3e57714..0a06795 100644
--- a/lib/alchemy/testsuite/sem-2.c
+++ b/lib/alchemy/testsuite/sem-2.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
 #include <alchemy/sem.h>
@@ -44,8 +43,6 @@ int main(int argc, char *const argv[])
 {
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        ret = rt_task_create(&t_main, "main_task", 0, 20, 0);
diff --git a/lib/alchemy/testsuite/task-1.c b/lib/alchemy/testsuite/task-1.c
index e34eb0f..d11683a 100644
--- a/lib/alchemy/testsuite/task-1.c
+++ b/lib/alchemy/testsuite/task-1.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
 
@@ -19,8 +18,6 @@ int main(int argc, char *const argv[])
 {
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], 0);
 
        ret = rt_task_create(&t_main, "main_task", 0, 99, 0);
diff --git a/lib/alchemy/testsuite/task-2.c b/lib/alchemy/testsuite/task-2.c
index 8f2297b..7376dab 100644
--- a/lib/alchemy/testsuite/task-2.c
+++ b/lib/alchemy/testsuite/task-2.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
 #include <alchemy/sem.h>
@@ -66,8 +65,6 @@ int main(int argc, char *const argv[])
 {
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        ret = rt_sem_create(&sem, "SEMA", 0, S_PRIO);
diff --git a/lib/alchemy/testsuite/task-3.c b/lib/alchemy/testsuite/task-3.c
index ea63149..9df4525 100644
--- a/lib/alchemy/testsuite/task-3.c
+++ b/lib/alchemy/testsuite/task-3.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
 
@@ -13,8 +12,6 @@ int main(int argc, char *const argv[])
        RT_TASK t;
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], 0);
 
        ret = rt_task_create(&t_a, "taskA", 0,  20, 0);
diff --git a/lib/alchemy/testsuite/task-4.c b/lib/alchemy/testsuite/task-4.c
index d1cc2ff..42d668b 100644
--- a/lib/alchemy/testsuite/task-4.c
+++ b/lib/alchemy/testsuite/task-4.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
 #include <alchemy/sem.h>
@@ -63,8 +62,6 @@ int main(int argc, char *const argv[])
 {
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        ret = rt_sem_create(&sem, "SEMA", 0, S_FIFO);
diff --git a/lib/alchemy/testsuite/task-5.c b/lib/alchemy/testsuite/task-5.c
index a50176a..eaf0af2 100644
--- a/lib/alchemy/testsuite/task-5.c
+++ b/lib/alchemy/testsuite/task-5.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
 #include <alchemy/sem.h>
@@ -72,8 +71,6 @@ int main(int argc, char *const argv[])
 {
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        ret = rt_sem_create(&sem, "SEMA", 0, S_PRIO);
diff --git a/lib/alchemy/testsuite/task-6.c b/lib/alchemy/testsuite/task-6.c
index 27589ba..5b9a7f0 100644
--- a/lib/alchemy/testsuite/task-6.c
+++ b/lib/alchemy/testsuite/task-6.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
 
@@ -58,8 +57,6 @@ int main(int argc, char *const argv[])
 {
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], 0);
 
        ret = rt_task_create(&t_bgnd, "BGND", 0,  20, 0);
diff --git a/lib/alchemy/testsuite/task-7.c b/lib/alchemy/testsuite/task-7.c
index 7517737..33416a2 100644
--- a/lib/alchemy/testsuite/task-7.c
+++ b/lib/alchemy/testsuite/task-7.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
 
@@ -91,8 +90,6 @@ int main(int argc, char *const argv[])
 {
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], 0);
 
        ret = rt_task_create(&t_bgnd, "BGND", 0,  20, 0);
diff --git a/lib/alchemy/testsuite/task-8.c b/lib/alchemy/testsuite/task-8.c
index 4e0360e..ad6accf 100644
--- a/lib/alchemy/testsuite/task-8.c
+++ b/lib/alchemy/testsuite/task-8.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
 #include <alchemy/sem.h>
@@ -41,8 +40,6 @@ int main(int argc, char *const argv[])
 {
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], 0);
 
        ret = rt_sem_create(&sem, "SEMA", 0, S_FIFO);
diff --git a/lib/copperplate/Makefile.am b/lib/copperplate/Makefile.am
index 9825c0c..6145823 100644
--- a/lib/copperplate/Makefile.am
+++ b/lib/copperplate/Makefile.am
@@ -6,16 +6,18 @@ libcopperplate_la_LDFLAGS = @XENO_LIB_LDFLAGS@ -version-info 
0:0:0
 libcopperplate_la_SOURCES =    \
        clockobj.c      \
        cluster.c       \
-       eventobj.c              \
+       eventobj.c      \
        hash.c          \
        init.c          \
        internal.c      \
        internal.h      \
+       main.c          \
        syncobj.c       \
        semobj.c        \
        threadobj.c     \
        timerobj.c      \
-       traceobj.c
+       traceobj.c      \
+       wrappers.c
 
 libcopperplate_la_CPPFLAGS =                           \
        @XENO_USER_CFLAGS@                              \
diff --git a/lib/copperplate/Makefile.in b/lib/copperplate/Makefile.in
index 67c3d60..001c51f 100644
--- a/lib/copperplate/Makefile.in
+++ b/lib/copperplate/Makefile.in
@@ -117,9 +117,10 @@ LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
 libcopperplate_la_DEPENDENCIES = libversion.la $(am__append_3) \
        $(am__append_7)
 am__libcopperplate_la_SOURCES_DIST = clockobj.c cluster.c eventobj.c \
-       hash.c init.c internal.c internal.h syncobj.c semobj.c \
-       threadobj.c timerobj.c traceobj.c notifier.c debug.c \
-       heapobj-pshared.c reference.c heapobj-tlsf.c heapobj-malloc.c
+       hash.c init.c internal.c internal.h main.c syncobj.c semobj.c \
+       threadobj.c timerobj.c traceobj.c wrappers.c notifier.c \
+       debug.c heapobj-pshared.c reference.c heapobj-tlsf.c \
+       heapobj-malloc.c
 @XENO_COBALT_FALSE@am__objects_1 = libcopperplate_la-notifier.lo
 @XENO_DEBUG_TRUE@am__objects_2 = libcopperplate_la-debug.lo
 @XENO_PSHARED_TRUE@am__objects_3 =  \
@@ -130,9 +131,10 @@ am__libcopperplate_la_SOURCES_DIST = clockobj.c cluster.c 
eventobj.c \
 am_libcopperplate_la_OBJECTS = libcopperplate_la-clockobj.lo \
        libcopperplate_la-cluster.lo libcopperplate_la-eventobj.lo \
        libcopperplate_la-hash.lo libcopperplate_la-init.lo \
-       libcopperplate_la-internal.lo libcopperplate_la-syncobj.lo \
-       libcopperplate_la-semobj.lo libcopperplate_la-threadobj.lo \
-       libcopperplate_la-timerobj.lo libcopperplate_la-traceobj.lo \
+       libcopperplate_la-internal.lo libcopperplate_la-main.lo \
+       libcopperplate_la-syncobj.lo libcopperplate_la-semobj.lo \
+       libcopperplate_la-threadobj.lo libcopperplate_la-timerobj.lo \
+       libcopperplate_la-traceobj.lo libcopperplate_la-wrappers.lo \
        $(am__objects_1) $(am__objects_2) $(am__objects_3) \
        $(am__objects_4) $(am__objects_5)
 libcopperplate_la_OBJECTS = $(am_libcopperplate_la_OBJECTS)
@@ -387,9 +389,10 @@ top_srcdir = @top_srcdir@
 lib_LTLIBRARIES = libcopperplate.la
 libcopperplate_la_LDFLAGS = @XENO_LIB_LDFLAGS@ -version-info 0:0:0
 libcopperplate_la_SOURCES = clockobj.c cluster.c eventobj.c hash.c \
-       init.c internal.c internal.h syncobj.c semobj.c threadobj.c \
-       timerobj.c traceobj.c $(am__append_2) $(am__append_5) \
-       $(am__append_6) $(am__append_9) $(am__append_10)
+       init.c internal.c internal.h main.c syncobj.c semobj.c \
+       threadobj.c timerobj.c traceobj.c wrappers.c $(am__append_2) \
+       $(am__append_5) $(am__append_6) $(am__append_9) \
+       $(am__append_10)
 libcopperplate_la_CPPFLAGS = @XENO_USER_CFLAGS@ -I$(top_srcdir) \
        -I$(top_srcdir)/include $(am__append_1)
 libcopperplate_la_LIBADD = libversion.la $(am__append_3) \
@@ -519,6 +522,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ 
@am__quote@./$(DEPDIR)/libcopperplate_la-heapobj-tlsf.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ 
@am__quote@./$(DEPDIR)/libcopperplate_la-init.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ 
@am__quote@./$(DEPDIR)/libcopperplate_la-internal.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ 
@am__quote@./$(DEPDIR)/libcopperplate_la-main.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ 
@am__quote@./$(DEPDIR)/libcopperplate_la-notifier.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ 
@am__quote@./$(DEPDIR)/libcopperplate_la-reference.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ 
@am__quote@./$(DEPDIR)/libcopperplate_la-semobj.Plo@am__quote@
@@ -526,6 +530,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ 
@am__quote@./$(DEPDIR)/libcopperplate_la-threadobj.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ 
@am__quote@./$(DEPDIR)/libcopperplate_la-timerobj.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ 
@am__quote@./$(DEPDIR)/libcopperplate_la-traceobj.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ 
@am__quote@./$(DEPDIR)/libcopperplate_la-wrappers.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ 
@am__quote@./$(DEPDIR)/libregistry_la-registry.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtlsf_la-tlsf.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ 
@am__quote@./$(DEPDIR)/libversion_la-version.Plo@am__quote@
@@ -593,6 +598,13 @@ libcopperplate_la-internal.lo: internal.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) 
$(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) 
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(libcopperplate_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o 
libcopperplate_la-internal.lo `test -f 'internal.c' || echo 
'$(srcdir)/'`internal.c
 
+libcopperplate_la-main.lo: main.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) 
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(libcopperplate_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT 
libcopperplate_la-main.lo -MD -MP -MF $(DEPDIR)/libcopperplate_la-main.Tpo -c 
-o libcopperplate_la-main.lo `test -f 'main.c' || echo '$(srcdir)/'`main.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libcopperplate_la-main.Tpo 
$(DEPDIR)/libcopperplate_la-main.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='main.c' 
object='libcopperplate_la-main.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) 
$(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) 
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(libcopperplate_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o 
libcopperplate_la-main.lo `test -f 'main.c' || echo '$(srcdir)/'`main.c
+
 libcopperplate_la-syncobj.lo: syncobj.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) 
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(libcopperplate_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT 
libcopperplate_la-syncobj.lo -MD -MP -MF 
$(DEPDIR)/libcopperplate_la-syncobj.Tpo -c -o libcopperplate_la-syncobj.lo 
`test -f 'syncobj.c' || echo '$(srcdir)/'`syncobj.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libcopperplate_la-syncobj.Tpo 
$(DEPDIR)/libcopperplate_la-syncobj.Plo
@@ -628,6 +640,13 @@ libcopperplate_la-traceobj.lo: traceobj.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) 
$(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) 
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(libcopperplate_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o 
libcopperplate_la-traceobj.lo `test -f 'traceobj.c' || echo 
'$(srcdir)/'`traceobj.c
 
+libcopperplate_la-wrappers.lo: wrappers.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) 
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(libcopperplate_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT 
libcopperplate_la-wrappers.lo -MD -MP -MF 
$(DEPDIR)/libcopperplate_la-wrappers.Tpo -c -o libcopperplate_la-wrappers.lo 
`test -f 'wrappers.c' || echo '$(srcdir)/'`wrappers.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libcopperplate_la-wrappers.Tpo 
$(DEPDIR)/libcopperplate_la-wrappers.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='wrappers.c' 
object='libcopperplate_la-wrappers.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) 
$(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) 
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(libcopperplate_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o 
libcopperplate_la-wrappers.lo `test -f 'wrappers.c' || echo 
'$(srcdir)/'`wrappers.c
+
 libcopperplate_la-notifier.lo: notifier.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) 
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(libcopperplate_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT 
libcopperplate_la-notifier.lo -MD -MP -MF 
$(DEPDIR)/libcopperplate_la-notifier.Tpo -c -o libcopperplate_la-notifier.lo 
`test -f 'notifier.c' || echo '$(srcdir)/'`notifier.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libcopperplate_la-notifier.Tpo 
$(DEPDIR)/libcopperplate_la-notifier.Plo
diff --git a/lib/copperplate/init.c b/lib/copperplate/init.c
index de17f47..5ccc534 100644
--- a/lib/copperplate/init.c
+++ b/lib/copperplate/init.c
@@ -473,8 +473,15 @@ void copperplate_init(int *argcp, char *const **argvp)
        int ret, largc, base_opt_start;
        struct copperskin *skin;
        struct option *options;
+       static int init_done;
        char **uargv;
 
+       if (init_done) {
+               warning("duplicate call to %s() ignored", __func__);
+               warning("(xeno-config --no-auto-init disables implicit call)");
+               return;
+       }
+
        __RT(clock_gettime(CLOCK_COPPERPLATE, &__init_date));
 
        /* Our node id. is the tid of the main thread. */
@@ -592,6 +599,7 @@ void copperplate_init(int *argcp, char *const **argvp)
         * bail out.
         */
        *argvp = uargv;
+       init_done = 1;
 
        return;
 fail:
diff --git a/lib/copperplate/main.c b/lib/copperplate/main.c
new file mode 100644
index 0000000..561bcf2
--- /dev/null
+++ b/lib/copperplate/main.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2013 Philippe Gerum <r...@xenomai.org>.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+ */
+#include <copperplate/init.h>
+
+int __real_main(int argc, char *const argv[]);
+
+int __wrap_main(int argc, char *const argv[])
+__attribute__((alias("copperplate_main"), weak));
+
+int copperplate_main(int argc, char *const argv[])
+{
+       copperplate_init(&argc, &argv);
+
+       return __real_main(argc, argv);
+}
diff --git a/lib/copperplate/wrappers.c b/lib/copperplate/wrappers.c
new file mode 100644
index 0000000..b031f08
--- /dev/null
+++ b/lib/copperplate/wrappers.c
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2013 Philippe Gerum <r...@xenomai.org>.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+ */
+
+int main(int argc, char *const argv[]);
+
+int __real_main(int argc, char *const argv[]);
+
+__attribute__((weak))
+int __real_main(int argc, char *const argv[])
+{
+       return main(argc, argv);
+}
diff --git a/lib/psos/testsuite/mq-1.c b/lib/psos/testsuite/mq-1.c
index 5406ee1..00f4248 100644
--- a/lib/psos/testsuite/mq-1.c
+++ b/lib/psos/testsuite/mq-1.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -39,8 +38,6 @@ int main(int argc, char *const argv[])
        u_long args[] = { 1, 2, 3, 4 }, _qid;
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], 0);
 
        ret = q_create("QUEUE", 3, Q_LIMIT, &qid);
diff --git a/lib/psos/testsuite/mq-2.c b/lib/psos/testsuite/mq-2.c
index ebe2335..48b4e61 100644
--- a/lib/psos/testsuite/mq-2.c
+++ b/lib/psos/testsuite/mq-2.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -93,8 +92,6 @@ int main(int argc, char *const argv[])
        u_long args[] = { 1, 2, 3, 4 };
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        ret = q_vcreate("VQUEUE", Q_LIMIT, 3, sizeof(u_long[4]), &qid);
diff --git a/lib/psos/testsuite/mq-3.c b/lib/psos/testsuite/mq-3.c
index 2481516..942b1a3 100644
--- a/lib/psos/testsuite/mq-3.c
+++ b/lib/psos/testsuite/mq-3.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -75,8 +74,6 @@ int main(int argc, char *const argv[])
        u_long args[] = { 1, 2, 3, 4 }, msgbuf[4], count;
        int ret, n;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        ret = q_create("QUEUE", Q_NOLIMIT, 0, &qid);
diff --git a/lib/psos/testsuite/pt-1.c b/lib/psos/testsuite/pt-1.c
index 80ed66d..99f93ca 100644
--- a/lib/psos/testsuite/pt-1.c
+++ b/lib/psos/testsuite/pt-1.c
@@ -1,7 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <memory.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -15,8 +14,6 @@ int main(int argc, char *const argv[])
        void *buf, *lbuf;
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], 0);
 
        ret = pt_create("PART", pt_mem, NULL, sizeof(pt_mem), 16, PT_NODEL, 
&ptid, &nbufs);
diff --git a/lib/psos/testsuite/rn-1.c b/lib/psos/testsuite/rn-1.c
index df35720..da136f3 100644
--- a/lib/psos/testsuite/rn-1.c
+++ b/lib/psos/testsuite/rn-1.c
@@ -1,7 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <memory.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -40,8 +39,6 @@ int main(int argc, char *const argv[])
        u_long args[] = { 1, 2, 3, 4 }, asize, _rnid;
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], 0);
 
        ret = rn_create("REGION", rn_mem, sizeof(rn_mem),
diff --git a/lib/psos/testsuite/sem-1.c b/lib/psos/testsuite/sem-1.c
index 5e6e9ce..61fa4b6 100644
--- a/lib/psos/testsuite/sem-1.c
+++ b/lib/psos/testsuite/sem-1.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -128,8 +127,6 @@ int main(int argc, char *const argv[])
        u_long args[] = { 1, 2, 3, 4 };
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        ret = t_create("TSKA", 20, 0, 0, 0, &tidA);
diff --git a/lib/psos/testsuite/sem-2.c b/lib/psos/testsuite/sem-2.c
index c516d42..a15bc38 100644
--- a/lib/psos/testsuite/sem-2.c
+++ b/lib/psos/testsuite/sem-2.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -46,8 +45,6 @@ int main(int argc, char *const argv[])
        u_long args[] = { 1, 2, 3, 4 };
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        ret = t_create("TSKA", 20, 0, 0, 0, &tidA);
diff --git a/lib/psos/testsuite/task-1.c b/lib/psos/testsuite/task-1.c
index 45af79d..f4bb71b 100644
--- a/lib/psos/testsuite/task-1.c
+++ b/lib/psos/testsuite/task-1.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -25,8 +24,6 @@ int main(int argc, char *const argv[])
        u_long args[] = { 1, 2, 3, 4 };
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], 0);
 
        ret = t_create("root", 1, 0, 0, 0, &tid);
diff --git a/lib/psos/testsuite/task-2.c b/lib/psos/testsuite/task-2.c
index a64f38c..d7f9fa0 100644
--- a/lib/psos/testsuite/task-2.c
+++ b/lib/psos/testsuite/task-2.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -66,8 +65,6 @@ int main(int argc, char *const argv[])
        u_long args[] = { 1, 2, 3, 4 };
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        ret = sm_create("SEMA", 0, SM_PRIOR, &sem_id);
diff --git a/lib/psos/testsuite/task-3.c b/lib/psos/testsuite/task-3.c
index 71f85ec..d775f28 100644
--- a/lib/psos/testsuite/task-3.c
+++ b/lib/psos/testsuite/task-3.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -13,8 +12,6 @@ int main(int argc, char *const argv[])
        u_long tid;
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], 0);
 
        ret = t_create("TSKA", 20, 0, 0, 0, &tidA);
diff --git a/lib/psos/testsuite/task-4.c b/lib/psos/testsuite/task-4.c
index 0cf1eb9..3bca002 100644
--- a/lib/psos/testsuite/task-4.c
+++ b/lib/psos/testsuite/task-4.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -52,8 +51,6 @@ int main(int argc, char *const argv[])
        u_long args[] = { 1, 2, 3, 4 };
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        ret = t_create("TASK", 20, 0, 0, 0, &tid);
diff --git a/lib/psos/testsuite/task-5.c b/lib/psos/testsuite/task-5.c
index 253d5c7..e0124c1 100644
--- a/lib/psos/testsuite/task-5.c
+++ b/lib/psos/testsuite/task-5.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -63,8 +62,6 @@ int main(int argc, char *const argv[])
        u_long args[] = { 1, 2, 3, 4 };
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        ret = sm_create("SEMA", 0, SM_FIFO, &sem_id);
diff --git a/lib/psos/testsuite/task-6.c b/lib/psos/testsuite/task-6.c
index b0119bb..13c618c 100644
--- a/lib/psos/testsuite/task-6.c
+++ b/lib/psos/testsuite/task-6.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -72,8 +71,6 @@ int main(int argc, char *const argv[])
        u_long args[] = { 1, 2, 3, 4 };
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        ret = sm_create("SEMA", 0, SM_PRIOR, &sem_id);
diff --git a/lib/psos/testsuite/task-7.c b/lib/psos/testsuite/task-7.c
index 3badcc9..8f5441a 100644
--- a/lib/psos/testsuite/task-7.c
+++ b/lib/psos/testsuite/task-7.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -35,8 +34,6 @@ int main(int argc, char *const argv[])
        u_long args[] = { 1, 2, 3, 4 };
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        ret = t_create("DUP", 20, 0, 0, 0, &tid1);
diff --git a/lib/psos/testsuite/task-8.c b/lib/psos/testsuite/task-8.c
index d04dde4..d7c8fb3 100644
--- a/lib/psos/testsuite/task-8.c
+++ b/lib/psos/testsuite/task-8.c
@@ -1,7 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <xeno_config.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -84,8 +83,6 @@ int main(int argc, char *const argv[])
        u_long args[] = { 1, 2, 3, 4 }, tid, delta, max;
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        ret = t_create("MAIN", 50, 0, 0, 0, &tid);
diff --git a/lib/psos/testsuite/task-9.c b/lib/psos/testsuite/task-9.c
index 0b6a768..5a7c127 100644
--- a/lib/psos/testsuite/task-9.c
+++ b/lib/psos/testsuite/task-9.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -38,8 +37,6 @@ int main(int argc, char *const argv[])
 {
        u_long args[] = { 1, 2, 3, 4 }, ret, tid;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], 0);
 
        ret = t_create("root", 3, 0, 0, 0, &tid);
diff --git a/lib/psos/testsuite/tm-1.c b/lib/psos/testsuite/tm-1.c
index c0da465..b2f38f2 100644
--- a/lib/psos/testsuite/tm-1.c
+++ b/lib/psos/testsuite/tm-1.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -15,8 +14,6 @@ int main(int argc, char *const argv[])
        unsigned long date, time, ticks;
        int ret, tries = 0;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], 0);
 
        for (;;) {
diff --git a/lib/psos/testsuite/tm-2.c b/lib/psos/testsuite/tm-2.c
index 6a416d2..44340f5 100644
--- a/lib/psos/testsuite/tm-2.c
+++ b/lib/psos/testsuite/tm-2.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -48,8 +47,6 @@ int main(int argc, char *const argv[])
        u_long args[] = { 1, 2, 3, 4 };
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        traceobj_mark(&trobj, 5);
diff --git a/lib/psos/testsuite/tm-3.c b/lib/psos/testsuite/tm-3.c
index 0a3c1ca..9be419e 100644
--- a/lib/psos/testsuite/tm-3.c
+++ b/lib/psos/testsuite/tm-3.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -57,8 +56,6 @@ int main(int argc, char *const argv[])
        u_long args[] = { 1, 2, 3, 4 };
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        traceobj_mark(&trobj, 7);
diff --git a/lib/psos/testsuite/tm-4.c b/lib/psos/testsuite/tm-4.c
index 5bf2188..26697c2 100644
--- a/lib/psos/testsuite/tm-4.c
+++ b/lib/psos/testsuite/tm-4.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -54,8 +53,6 @@ int main(int argc, char *const argv[])
        u_long args[] = { 1, 2, 3, 4 };
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        traceobj_mark(&trobj, 4);
diff --git a/lib/psos/testsuite/tm-5.c b/lib/psos/testsuite/tm-5.c
index 803eaf3..0fca7d0 100644
--- a/lib/psos/testsuite/tm-5.c
+++ b/lib/psos/testsuite/tm-5.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -50,8 +49,6 @@ int main(int argc, char *const argv[])
        u_long args[] = { 1, 2, 3, 4 };
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        traceobj_mark(&trobj, 1);
diff --git a/lib/psos/testsuite/tm-6.c b/lib/psos/testsuite/tm-6.c
index 42719d0..9debc49 100644
--- a/lib/psos/testsuite/tm-6.c
+++ b/lib/psos/testsuite/tm-6.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -29,8 +28,6 @@ int main(int argc, char *const argv[])
        unsigned long tid;
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], 0);
 
        ret = t_create("TASK", 20, 0, 0, 0, &tid);
diff --git a/lib/psos/testsuite/tm-7.c b/lib/psos/testsuite/tm-7.c
index 52bde8f..202985d 100644
--- a/lib/psos/testsuite/tm-7.c
+++ b/lib/psos/testsuite/tm-7.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -27,8 +26,6 @@ int main(int argc, char *const argv[])
        unsigned long tid;
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], 0);
 
        ret = t_create("TASK", 20, 0, 0, 0, &tid);
diff --git a/lib/vxworks/testsuite/lst-1.c b/lib/vxworks/testsuite/lst-1.c
index d336f6b..b88a0a4 100644
--- a/lib/vxworks/testsuite/lst-1.c
+++ b/lib/vxworks/testsuite/lst-1.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <vxworks/errnoLib.h>
 #include <vxworks/taskLib.h>
@@ -134,8 +133,6 @@ int main(int argc, char *const argv[])
 {
        TASK_ID tid;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], 0);
 
        tid = taskSpawn("rootTask", 50, 0, 0, rootTask,
diff --git a/lib/vxworks/testsuite/msgQ-1.c b/lib/vxworks/testsuite/msgQ-1.c
index e69322a..97ebc11 100644
--- a/lib/vxworks/testsuite/msgQ-1.c
+++ b/lib/vxworks/testsuite/msgQ-1.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <vxworks/errnoLib.h>
 #include <vxworks/taskLib.h>
@@ -87,8 +86,6 @@ int main(int argc, char *const argv[])
 {
        TASK_ID tid;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], 0);
 
        tid = taskSpawn("rootTask", 50, 0, 0, rootTask,
diff --git a/lib/vxworks/testsuite/msgQ-2.c b/lib/vxworks/testsuite/msgQ-2.c
index 47e43a1..e4a60d3 100644
--- a/lib/vxworks/testsuite/msgQ-2.c
+++ b/lib/vxworks/testsuite/msgQ-2.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <vxworks/errnoLib.h>
 #include <vxworks/taskLib.h>
@@ -101,8 +100,6 @@ int main(int argc, char *const argv[])
 {
        TASK_ID tid;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        tid = taskSpawn("rootTask", 50, 0, 0, rootTask,
diff --git a/lib/vxworks/testsuite/msgQ-3.c b/lib/vxworks/testsuite/msgQ-3.c
index a298cdd..d86df31 100644
--- a/lib/vxworks/testsuite/msgQ-3.c
+++ b/lib/vxworks/testsuite/msgQ-3.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <vxworks/errnoLib.h>
 #include <vxworks/taskLib.h>
@@ -89,8 +88,6 @@ int main(int argc, char *const argv[])
 {
        TASK_ID rtid, ptid;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        traceobj_mark(&trobj, 11);
diff --git a/lib/vxworks/testsuite/rng-1.c b/lib/vxworks/testsuite/rng-1.c
index 1c96f45..e92c107 100644
--- a/lib/vxworks/testsuite/rng-1.c
+++ b/lib/vxworks/testsuite/rng-1.c
@@ -1,7 +1,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <vxworks/errnoLib.h>
 #include <vxworks/taskLib.h>
@@ -203,8 +202,6 @@ int main(int argc, char *const argv[])
 {
        TASK_ID tid;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], 0);
 
        tid = taskSpawn("rootTask", 50, 0, 0, rootTask,
diff --git a/lib/vxworks/testsuite/sem-1.c b/lib/vxworks/testsuite/sem-1.c
index 07df9a5..f4159c8 100644
--- a/lib/vxworks/testsuite/sem-1.c
+++ b/lib/vxworks/testsuite/sem-1.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <vxworks/errnoLib.h>
 #include <vxworks/taskLib.h>
@@ -142,8 +141,6 @@ int main(int argc, char *const argv[])
 {
        TASK_ID rtid, ptid;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        rtid = taskSpawn("rootTask", 50, 0, 0, rootTask,
diff --git a/lib/vxworks/testsuite/sem-2.c b/lib/vxworks/testsuite/sem-2.c
index c672703..5c6cbda 100644
--- a/lib/vxworks/testsuite/sem-2.c
+++ b/lib/vxworks/testsuite/sem-2.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <vxworks/errnoLib.h>
 #include <vxworks/taskLib.h>
@@ -125,8 +124,6 @@ int main(int argc, char *const argv[])
 {
        TASK_ID rtid, ptid;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        rtid = taskSpawn("rootTask", 50, 0, 0, rootTask,
diff --git a/lib/vxworks/testsuite/sem-3.c b/lib/vxworks/testsuite/sem-3.c
index 55aa1d4..03161c0 100644
--- a/lib/vxworks/testsuite/sem-3.c
+++ b/lib/vxworks/testsuite/sem-3.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <vxworks/errnoLib.h>
 #include <vxworks/taskLib.h>
@@ -49,8 +48,6 @@ int main(int argc, char *const argv[])
        TASK_ID tid;
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        tid = taskSpawn("rootTask", 50, 0, 0, rootTask,
diff --git a/lib/vxworks/testsuite/sem-4.c b/lib/vxworks/testsuite/sem-4.c
index da1b72e..7771373 100644
--- a/lib/vxworks/testsuite/sem-4.c
+++ b/lib/vxworks/testsuite/sem-4.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <vxworks/errnoLib.h>
 #include <vxworks/semLib.h>
@@ -61,8 +60,6 @@ int main(int argc, char *const argv[])
        TASK_ID tid;
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], 0);
 
        tid = taskSpawn("rootTask", 50, 0, 0, rootTask,
diff --git a/lib/vxworks/testsuite/task-1.c b/lib/vxworks/testsuite/task-1.c
index 3866f63..a751fba 100644
--- a/lib/vxworks/testsuite/task-1.c
+++ b/lib/vxworks/testsuite/task-1.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <vxworks/errnoLib.h>
 #include <vxworks/taskLib.h>
@@ -34,8 +33,6 @@ int main(int argc, char *const argv[])
 {
        TASK_ID tid;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        tid = taskSpawn("windTask", 70, 0, 0, windTask,
diff --git a/lib/vxworks/testsuite/task-2.c b/lib/vxworks/testsuite/task-2.c
index 0d3d112..0316df8 100644
--- a/lib/vxworks/testsuite/task-2.c
+++ b/lib/vxworks/testsuite/task-2.c
@@ -1,7 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <vxworks/errnoLib.h>
 #include <vxworks/taskLib.h>
@@ -76,8 +75,6 @@ int main(int argc, char *const argv[])
 {
        int ret;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        sem_id = semCCreate(SEM_Q_PRIORITY, 0);
diff --git a/lib/vxworks/testsuite/wd-1.c b/lib/vxworks/testsuite/wd-1.c
index 388d1bd..34a4170 100644
--- a/lib/vxworks/testsuite/wd-1.c
+++ b/lib/vxworks/testsuite/wd-1.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <copperplate/init.h>
 #include <copperplate/traceobj.h>
 #include <vxworks/errnoLib.h>
 #include <vxworks/taskLib.h>
@@ -80,8 +79,6 @@ int main(int argc, char *const argv[])
 {
        TASK_ID tid;
 
-       copperplate_init(&argc, &argv);
-
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
        tid = taskSpawn("rootTask", 50, 0, 0, rootTask,
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 32d445b..cc13a35 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -6,10 +6,15 @@ install-exec-local:
           $(srcdir)/postinstall.sh ; \
        fi
 
-EXTRA_DIST = \
-       bootstrap \
-       prepare-kernel.sh \
-       wrap-link.sh \
-       Kconfig.frag \
-       $(wildcard postinstall.sh) \
+install-data-local:
+       $(mkinstalldirs) $(DESTDIR)$(libdir)
+       $(INSTALL_DATA) $(srcdir)/dynlist.ld $(DESTDIR)$(libdir)
+
+EXTRA_DIST =                           \
+       bootstrap                       \
+       prepare-kernel.sh               \
+       wrap-link.sh                    \
+       dynlist.ld                      \
+       Kconfig.frag                    \
+       $(wildcard postinstall.sh)      \
        histo.gp
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index 56513b9..065896d 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -273,11 +273,12 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 bin_SCRIPTS = xeno-config xeno wrap-link.sh
 EXTRA_DIST = \
-       bootstrap \
-       prepare-kernel.sh \
-       wrap-link.sh \
-       Kconfig.frag \
-       $(wildcard postinstall.sh) \
+       bootstrap                       \
+       prepare-kernel.sh               \
+       wrap-link.sh                    \
+       dynlist.ld                      \
+       Kconfig.frag                    \
+       $(wildcard postinstall.sh)      \
        histo.gp
 
 all: all-am
@@ -454,7 +455,7 @@ info: info-am
 
 info-am:
 
-install-data-am:
+install-data-am: install-data-local
 
 install-dvi: install-dvi-am
 
@@ -505,14 +506,15 @@ uninstall-am: uninstall-binSCRIPTS
 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
        distclean distclean-generic distclean-libtool distdir dvi \
        dvi-am html html-am info info-am install install-am \
-       install-binSCRIPTS install-data install-data-am install-dvi \
-       install-dvi-am install-exec install-exec-am install-exec-local \
-       install-html install-html-am install-info install-info-am \
-       install-man install-pdf install-pdf-am install-ps \
-       install-ps-am install-strip installcheck installcheck-am \
-       installdirs maintainer-clean maintainer-clean-generic \
-       mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
-       ps ps-am uninstall uninstall-am uninstall-binSCRIPTS
+       install-binSCRIPTS install-data install-data-am \
+       install-data-local install-dvi install-dvi-am install-exec \
+       install-exec-am install-exec-local install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       uninstall uninstall-am uninstall-binSCRIPTS
 
 
 install-exec-local:
@@ -521,6 +523,10 @@ install-exec-local:
           $(srcdir)/postinstall.sh ; \
        fi
 
+install-data-local:
+       $(mkinstalldirs) $(DESTDIR)$(libdir)
+       $(INSTALL_DATA) $(srcdir)/dynlist.ld $(DESTDIR)$(libdir)
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/scripts/dynlist.ld b/scripts/dynlist.ld
new file mode 100644
index 0000000..de6eef0
--- /dev/null
+++ b/scripts/dynlist.ld
@@ -0,0 +1,3 @@
+{
+       main;
+};
diff --git a/scripts/xeno-config-cobalt.in b/scripts/xeno-config-cobalt.in
index 2b5e01e..04ae887 100644
--- a/scripts/xeno-config-cobalt.in
+++ b/scripts/xeno-config-cobalt.in
@@ -18,6 +18,8 @@ XENO_BASE_CFLAGS="-I$XENO_INCLUDE_DIR/cobalt 
-I$XENO_INCLUDE_DIR @XENO_USER_APP_
 XENO_POSIX_LDFLAGS="-L${staging}${libdir} -lcobalt -lpthread -lrt 
@XENO_USER_APP_LDFLAGS@"
 XENO_LIBRARY_DIR="${staging}${libdir}"
 LD_FILE_OPTION="@LD_FILE_OPTION@"
+WRAP_MAIN_OPT="-Wl,--wrap=main 
-Wl,--dynamic-list=${XENO_LIBRARY_DIR}/dynlist.ld"
+WRAP_MAIN="$WRAP_MAIN_OPT"
 
 unset prefix exec_prefix libdir datadir datarootdir pkgdatadir includedir 
skin_list
 
@@ -32,7 +34,7 @@ dump_wrappers()
       echo -n "-Wl,@${XENO_LIBRARY_DIR}/${file}"
    else
       wrappers=`while read wrap_option symbol; do      \
-             echo -n "-Wl,$wrap_option,$symbol " ; \
+             echo -n "-Wl,$wrap_option=$symbol " ; \
       done < ${XENO_LIBRARY_DIR}/${file}`
       echo -n "$wrappers"
    fi
@@ -51,6 +53,7 @@ Options :
         --arch
         --prefix
         --[skin=]posix/cobalt|vxworks|psos|alchemy
+        --auto-init|no-auto-init
         --cflags
         --ldflags
         --lib*-dir,--libdir,--user-libdir
@@ -97,6 +100,12 @@ while test $# -gt 0; do
         --prefix)
             echo $XENO_PREFIX
             ;;
+       --no-auto-init)
+           WRAP_MAIN=
+           ;;
+       --auto-init)
+           WRAP_MAIN="$WRAP_MAIN_OPT"
+           ;;
         --lib*-dir|--libdir|--user-libdir)
             echo $XENO_LIBRARY_DIR
             ;;
@@ -143,7 +152,7 @@ while test $# -gt 0; do
                    posix|cobalt)
                        ;;
                    vxworks|psos|alchemy)
-                       copperplate=-lcopperplate
+                       copperplate="$WRAP_MAIN -lcopperplate"
                        ldflags="$ldflags -l$skin"
                        if [ -r ${XENO_LIBRARY_DIR}/${skin}.wrappers ]; then
                            ldflags=" `dump_wrappers ${skin}.wrappers` $ldflags"
diff --git a/scripts/xeno-config-mercury.in b/scripts/xeno-config-mercury.in
index 1d252d5..287639e 100644
--- a/scripts/xeno-config-mercury.in
+++ b/scripts/xeno-config-mercury.in
@@ -17,6 +17,8 @@ XENO_INCLUDE_DIR="${staging}${includedir}"
 XENO_BASE_CFLAGS="-I$XENO_INCLUDE_DIR/mercury -I$XENO_INCLUDE_DIR 
@XENO_USER_APP_CFLAGS@ -D__MERCURY__"
 XENO_BASE_LDFLAGS="-L${staging}${libdir} @XENO_USER_APP_LDFLAGS@ -lcopperplate 
-lpthread -lrt"
 XENO_LIBRARY_DIR="${staging}${libdir}"
+WRAP_MAIN_OPT="-Wl,--wrap=main 
-Wl,--dynamic-list=${XENO_LIBRARY_DIR}/dynlist.ld"
+WRAP_MAIN="$WRAP_MAIN_OPT"
 
 unset prefix exec_prefix libdir datadir datarootdir pkgdatadir includedir 
skin_list
 
@@ -33,6 +35,7 @@ Options :
         --arch
         --prefix
         --[skin=]vxworks|psos|alchemy
+        --auto-init|no-auto-init
         --cflags
         --ldflags
         --lib*-dir,--libdir,--user-libdir
@@ -76,6 +79,12 @@ while test $# -gt 0; do
         --prefix)
             echo $XENO_PREFIX
             ;;
+       --no-auto-init)
+           WRAP_MAIN=
+           ;;
+       --auto-init)
+           WRAP_MAIN="$WRAP_MAIN_OPT"
+           ;;
         --lib*-dir|--libdir|--user-libdir)
             echo $XENO_LIBRARY_DIR
             ;;
@@ -113,7 +122,7 @@ while test $# -gt 0; do
                echo "no skin specified, missing --skin before --ldflags" 1>&2
                exit 1
            fi
-           ldflags="$XENO_BASE_LDFLAGS"
+           ldflags="$WRAP_MAIN $XENO_BASE_LDFLAGS"
            for skin in $skin_list; do
                case "$skin" in
                    vxworks|psos|alchemy)
diff --git a/utils/slackspot/Makefile.in b/utils/slackspot/Makefile.in
index 298ea96..9f387dc 100644
--- a/utils/slackspot/Makefile.in
+++ b/utils/slackspot/Makefile.in
@@ -53,7 +53,7 @@ host_triplet = @host@
 target_triplet = @target@
 sbin_PROGRAMS = slackspot$(EXEEXT)
 subdir = utils/slackspot
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
        $(top_srcdir)/config/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/config/ac_prog_cc_for_build.m4 \


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to