Commit b409097e authored by Vitaly Chikunov's avatar Vitaly Chikunov Committed by Jan Kiszka

Multi-library support with core suffix in soname

Enable soname suffix with --enable-so-suffix configure option (Mercury
core only).

This will allow (for users) installing both versions of libs into the
same system and (for distributions) having them without conflicts in
the same repository.

Such script is used to change Makefile.am-s:

  for lib in copperplate alchemy psos smokey trank vxworks
  do
    find -name Makefile.am \
    | xargs -r \
      sed -i -e "s/lib${lib}\.la/lib${lib}@CORE@\.la/g" \
             -e "s/lib${lib}\_la/lib${lib}@CORE@\_la/g"
  done
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent e0c5e2cf
......@@ -859,6 +859,22 @@ dnl in-tree executables which require POSIX symbol wrapping.
AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ["$modechk_wrappers $cobalt_wrappers"])
fi
dnl Multi-library support.
AC_MSG_CHECKING([whether to enable soname suffix for libraries])
AC_ARG_ENABLE([so-suffix],
[AS_HELP_STRING([--enable-so-suffix],
[enable soname suffix (for Mercury only)])],
[enable_so_suffix=$enableval],
[enable_so_suffix="no"])
AC_MSG_RESULT(${enable_so_suffix})
if test "$enable_so_suffix" = "yes"; then
if test "$rtcore_type" != mercury; then
AC_MSG_ERROR([soname suffix is only allowed for Mercury core])
else
CORE="_$rtcore_type"
fi
fi
dnl
dnl Build the Makefiles
dnl
......@@ -898,6 +914,7 @@ AC_SUBST(XENO_TEST_DIR)
AC_SUBST(XENO_DEMO_DIR)
AC_SUBST(XENO_BUILD_COMPILER)
AC_SUBST(XENO_BUILD_ARGS)
AC_SUBST(CORE)
AC_CONFIG_FILES([ \
Makefile \
......
......@@ -11,8 +11,8 @@ cppflags = \
-I$(top_srcdir)/include
ldadd = \
../../lib/alchemy/libalchemy.la \
../../lib/copperplate/libcopperplate.la \
../../lib/alchemy/libalchemy@CORE@.la \
../../lib/copperplate/libcopperplate@CORE@.la \
@XENO_CORE_LDADD@ \
@XENO_USER_LDADD@ \
-lpthread -lrt -lm
......
......@@ -11,8 +11,8 @@ cppflags = \
ldadd = \
@XENO_AUTOINIT_LDFLAGS@ \
$(XENO_POSIX_WRAPPERS) \
../../../lib/alchemy/libalchemy.la \
../../../lib/copperplate/libcopperplate.la \
../../../lib/alchemy/libalchemy@CORE@.la \
../../../lib/copperplate/libcopperplate@CORE@.la \
@XENO_CORE_LDADD@ \
@XENO_USER_LDADD@ \
-lrt -lpthread -lm
......
lib_LTLIBRARIES = libalchemy.la
lib_LTLIBRARIES = libalchemy@CORE@.la
libalchemy_la_LDFLAGS = @XENO_LIB_LDFLAGS@ -version-info 0:0:0
libalchemy@CORE@_la_LDFLAGS = @XENO_LIB_LDFLAGS@ -version-info 0:0:0
libalchemy_la_LIBADD = \
libalchemy@CORE@_la_LIBADD = \
@XENO_CORE_LDADD@ \
$(top_builddir)/lib/copperplate/libcopperplate.la
$(top_builddir)/lib/copperplate/libcopperplate@CORE@.la
libalchemy_la_SOURCES = \
libalchemy@CORE@_la_SOURCES = \
init.c \
internal.c \
internal.h \
......@@ -33,12 +33,12 @@ libalchemy_la_SOURCES = \
timer.h
if XENO_COBALT
libalchemy_la_SOURCES += \
libalchemy@CORE@_la_SOURCES += \
pipe.c \
pipe.h
endif
libalchemy_la_CPPFLAGS = \
libalchemy@CORE@_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib
......@@ -48,6 +48,6 @@ EXTRA_DIST = testsuite
SPARSE = sparse
sparse:
@for i in $(libalchemy_la_SOURCES); do \
@for i in $(libalchemy@CORE@_la_SOURCES); do \
$(SPARSE) $(CHECKFLAGS) $(srcdir)/$$i; \
done
lib_LTLIBRARIES = libcopperplate.la
lib_LTLIBRARIES = libcopperplate@CORE@.la
libcopperplate_la_LDFLAGS = @XENO_LIB_LDFLAGS@ -lpthread -lrt -version-info 0:0:0
libcopperplate_la_LIBADD = @XENO_CORE_LDADD@
libcopperplate@CORE@_la_LDFLAGS = @XENO_LIB_LDFLAGS@ -lpthread -lrt -version-info 0:0:0
libcopperplate@CORE@_la_LIBADD = @XENO_CORE_LDADD@
noinst_LTLIBRARIES =
libcopperplate_la_SOURCES = \
libcopperplate@CORE@_la_SOURCES = \
clockobj.c \
cluster.c \
eventobj.c \
......@@ -19,35 +19,35 @@ libcopperplate_la_SOURCES = \
timerobj.c \
traceobj.c
libcopperplate_la_CPPFLAGS = \
libcopperplate@CORE@_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir) \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib
if XENO_REGISTRY
libcopperplate_la_LIBADD += libregistry.la
libcopperplate@CORE@_la_LIBADD += libregistry.la
noinst_LTLIBRARIES += libregistry.la
libregistry_la_SOURCES = registry.c
libregistry_la_CPPFLAGS = \
$(libcopperplate_la_CPPFLAGS) \
$(libcopperplate@CORE@_la_CPPFLAGS) \
@XENO_FUSE_CFLAGS@
endif
if XENO_PSHARED
# The process shareable heap has real-time properties, therefore it
# fits both the cobalt and mercury cores equally. Yummie.
libcopperplate_la_SOURCES += heapobj-pshared.c reference.c
libcopperplate@CORE@_la_SOURCES += heapobj-pshared.c reference.c
endif
if XENO_TLSF
libcopperplate_la_SOURCES += heapobj-tlsf.c
libcopperplate@CORE@_la_SOURCES += heapobj-tlsf.c
else
if XENO_HEAPMEM
libcopperplate_la_SOURCES += heapobj-heapmem.c
libcopperplate@CORE@_la_SOURCES += heapobj-heapmem.c
else
libcopperplate_la_SOURCES += heapobj-malloc.c
libcopperplate@CORE@_la_SOURCES += heapobj-malloc.c
endif
endif
......@@ -62,6 +62,6 @@ DIST_SUBDIRS = regd
SPARSE = sparse
sparse:
@for i in $(libcopperplate_la_SOURCES) ; do \
@for i in $(libcopperplate@CORE@_la_SOURCES) ; do \
$(SPARSE) $(CHECKFLAGS) $(srcdir)/$$i; \
done
......@@ -9,7 +9,7 @@ CPPFLAGS = \
LDFLAGS = $(XENO_POSIX_WRAPPERS)
LDADD = \
../libcopperplate.la \
../libcopperplate@CORE@.la \
@XENO_CORE_LDADD@ \
@XENO_USER_LDADD@ \
-lpthread -lrt
......
lib_LTLIBRARIES = libpsos.la
lib_LTLIBRARIES = libpsos@CORE@.la
libpsos_la_LDFLAGS = @XENO_LIB_LDFLAGS@ -version-info 0:0:0
libpsos@CORE@_la_LDFLAGS = @XENO_LIB_LDFLAGS@ -version-info 0:0:0
libpsos_la_LIBADD = \
libpsos@CORE@_la_LIBADD = \
@XENO_CORE_LDADD@ \
$(top_builddir)/lib/copperplate/libcopperplate.la
$(top_builddir)/lib/copperplate/libcopperplate@CORE@.la
libpsos_la_SOURCES = \
libpsos@CORE@_la_SOURCES = \
init.c \
internal.h \
pt.c \
......@@ -23,7 +23,7 @@ libpsos_la_SOURCES = \
tm.h \
reference.h
libpsos_la_CPPFLAGS = \
libpsos@CORE@_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib
......@@ -33,6 +33,6 @@ EXTRA_DIST = testsuite
SPARSE = sparse
sparse:
@for i in $(libpsos_la_SOURCES); do \
@for i in $(libpsos@CORE@_la_SOURCES); do \
$(SPARSE) $(CHECKFLAGS) $(srcdir)/$$i; \
done
lib_LTLIBRARIES = libsmokey.la
lib_LTLIBRARIES = libsmokey@CORE@.la
libsmokey_la_LDFLAGS = @XENO_LIB_LDFLAGS@ -version-info 0:0:0
libsmokey_la_LIBADD = @XENO_CORE_LDADD@
libsmokey@CORE@_la_LDFLAGS = @XENO_LIB_LDFLAGS@ -version-info 0:0:0
libsmokey@CORE@_la_LIBADD = @XENO_CORE_LDADD@
libsmokey_la_SOURCES = \
libsmokey@CORE@_la_SOURCES = \
helpers.c \
init.c
libsmokey_la_CPPFLAGS = \
libsmokey@CORE@_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib
lib_LTLIBRARIES = libtrank.la
lib_LTLIBRARIES = libtrank@CORE@.la
libtrank_la_LDFLAGS = @XENO_LIB_LDFLAGS@ -version-info 0:0:0
libtrank@CORE@_la_LDFLAGS = @XENO_LIB_LDFLAGS@ -version-info 0:0:0
libtrank_la_LIBADD = \
libtrank@CORE@_la_LIBADD = \
@XENO_CORE_LDADD@ \
$(top_builddir)/lib/alchemy/libalchemy.la
$(top_builddir)/lib/alchemy/libalchemy@CORE@.la
libtrank_la_SOURCES = \
libtrank@CORE@_la_SOURCES = \
init.c \
internal.c \
internal.h \
posix.c \
native.c
libtrank_la_CPPFLAGS = \
libtrank@CORE@_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-D__XENO_COMPAT__ \
-I$(top_srcdir)/include \
......
lib_LTLIBRARIES = libvxworks.la
lib_LTLIBRARIES = libvxworks@CORE@.la
libvxworks_la_LDFLAGS = @XENO_LIB_LDFLAGS@ -version-info 0:0:0
libvxworks@CORE@_la_LDFLAGS = @XENO_LIB_LDFLAGS@ -version-info 0:0:0
libvxworks_la_LIBADD = \
libvxworks@CORE@_la_LIBADD = \
@XENO_CORE_LDADD@ \
$(top_builddir)/lib/copperplate/libcopperplate.la
$(top_builddir)/lib/copperplate/libcopperplate@CORE@.la
libvxworks_la_SOURCES = \
libvxworks@CORE@_la_SOURCES = \
init.c \
errnoLib.c \
intLib.c \
......@@ -32,7 +32,7 @@ libvxworks_la_SOURCES = \
sysLib.c \
reference.h
libvxworks_la_CPPFLAGS = \
libvxworks@CORE@_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib
......@@ -42,6 +42,6 @@ EXTRA_DIST = testsuite
SPARSE = sparse
sparse:
@for i in $(libvxworks_la_SOURCES); do \
@for i in $(libvxworks@CORE@_la_SOURCES); do \
$(SPARSE) $(CHECKFLAGS) $(srcdir)/$$i; \
done
......@@ -8,6 +8,7 @@ datarootdir="@datarootdir@"
datadir="@datadir@"
pkgdatadir="${datadir}/@PACKAGE@"
includedir="@includedir@"
core="@CORE@"
XENO_VERSION="@PACKAGE_VERSION@"
XENO_PREFIX="${staging}${prefix}"
......@@ -264,8 +265,8 @@ if test x$do_ldflags = xy; then
# --[no-]mode-check does.
;;
vxworks|psos|alchemy|smokey)
copperplate="-lcopperplate"
ldflags="$ldflags -l$skin"
copperplate="-lcopperplate$core"
ldflags="$ldflags -l$skin$core"
if [ -r ${XENO_LIBRARY_DIR}/${skin}.wrappers ]; then
ldflags=" `dump_wrappers ${skin}.wrappers` $ldflags"
fi
......
......@@ -8,6 +8,7 @@ datarootdir="@datarootdir@"
datadir="@datadir@"
pkgdatadir="${datadir}/@PACKAGE@"
includedir="@includedir@"
core="@CORE@"
XENO_VERSION="@PACKAGE_VERSION@"
XENO_PREFIX="${staging}${prefix}"
......@@ -195,8 +196,8 @@ if test x$do_ldflags = xy; then
posix|rtdm)
;;
vxworks|psos|alchemy|smokey)
copperplate="-lcopperplate"
ldflags="-l$skin $ldflags"
copperplate="-lcopperplate$core"
ldflags="-l$skin$core $ldflags"
;;
*)
echo "unknown API: $skin" 1>&2
......
......@@ -13,7 +13,7 @@ gpiotest_CPPFLAGS = \
gpiotest_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS)
gpiotest_LDADD = \
../../lib/smokey/libsmokey.la \
../../lib/smokey/libsmokey@CORE@.la \
@XENO_CORE_LDADD@ \
@XENO_USER_LDADD@ \
-lpthread -lrt
......@@ -110,8 +110,8 @@ smokey_LDFLAGS=$(wrappers) @XENO_AUTOINIT_LDFLAGS@ $(undef_list)
smokey_LDADD = \
$(plugin_list) \
../../lib/smokey/libsmokey.la \
../../lib/copperplate/libcopperplate.la \
../../lib/smokey/libsmokey@CORE@.la \
../../lib/copperplate/libcopperplate@CORE@.la \
@XENO_CORE_LDADD@ \
@XENO_USER_LDADD@ \
-lpthread -lrt
......@@ -11,8 +11,8 @@ libalchemy_test_la_LIBADD = \
@XENO_CORE_LDADD@ \
@XENO_USER_LDADD@ \
../../../lib/boilerplate/init/libbootstrap-pic.la \
../../../lib/alchemy/libalchemy.la \
../../../lib/copperplate/libcopperplate.la
../../../lib/alchemy/libalchemy@CORE@.la \
../../../lib/copperplate/libcopperplate@CORE@.la
libalchemy_test_la_SOURCES = libalchemy-test.c
......@@ -29,7 +29,7 @@ libposix_test_la_LIBADD = \
@XENO_CORE_LDADD@ \
@XENO_USER_LDADD@ \
../../../lib/boilerplate/init/libbootstrap-pic.la \
../../../lib/copperplate/libcopperplate.la
../../../lib/copperplate/libcopperplate@CORE@.la
libposix_test_la_SOURCES = libposix-test.c
......
......@@ -13,7 +13,7 @@ spitest_CPPFLAGS = \
spitest_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS)
spitest_LDADD = \
../../lib/smokey/libsmokey.la \
../../lib/smokey/libsmokey@CORE@.la \
@XENO_CORE_LDADD@ \
@XENO_USER_LDADD@ \
-lpthread -lrt
......@@ -42,8 +42,8 @@ cmd_read_SOURCES = cmd_read.c
cmd_read_LDADD = \
@XENO_AUTOINIT_LDFLAGS@ \
../../lib/analogy/libanalogy.la \
../../lib/alchemy/libalchemy.la \
../../lib/copperplate/libcopperplate.la \
../../lib/alchemy/libalchemy@CORE@.la \
../../lib/copperplate/libcopperplate@CORE@.la \
@XENO_CORE_LDADD@ \
@XENO_USER_LDADD@ \
-lrt -lpthread -lm
......@@ -52,8 +52,8 @@ cmd_write_SOURCES = cmd_write.c
cmd_write_LDADD = \
@XENO_AUTOINIT_LDFLAGS@ \
../../lib/analogy/libanalogy.la \
../../lib/alchemy/libalchemy.la \
../../lib/copperplate/libcopperplate.la \
../../lib/alchemy/libalchemy@CORE@.la \
../../lib/copperplate/libcopperplate@CORE@.la \
@XENO_CORE_LDADD@ \
@XENO_USER_LDADD@ \
-lrt -lpthread -lm
......
......@@ -20,8 +20,8 @@ rtcanconfig_LDADD = \
rtcanrecv_SOURCES = rtcanrecv.c
rtcanrecv_LDADD = \
../../lib/alchemy/libalchemy.la \
../../lib/copperplate/libcopperplate.la \
../../lib/alchemy/libalchemy@CORE@.la \
../../lib/copperplate/libcopperplate@CORE@.la \
@XENO_CORE_LDADD@ \
@XENO_USER_LDADD@ \
-lpthread -lrt
......@@ -29,8 +29,8 @@ rtcanrecv_LDADD = \
rtcansend_SOURCES = rtcansend.c
rtcansend_LDADD = \
../../lib/alchemy/libalchemy.la \
../../lib/copperplate/libcopperplate.la \
../../lib/alchemy/libalchemy@CORE@.la \
../../lib/copperplate/libcopperplate@CORE@.la \
@XENO_CORE_LDADD@ \
@XENO_USER_LDADD@ \
-lpthread -lrt
......@@ -9,7 +9,7 @@ hdb_CPPFLAGS = \
hdb_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
hdb_LDADD = \
../../lib/copperplate/libcopperplate.la \
../../lib/copperplate/libcopperplate@CORE@.la \
@XENO_CORE_LDADD@ \
@XENO_USER_LDADD@ \
-lpthread -lrt
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment