diff options
author | Stanislaw Kardach <skardach@marvell.com> | 2020-05-22 12:29:13 +0200 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2020-08-26 09:27:34 +0300 |
commit | 5c2e18459b9aebd378ac186cfde55e17dccfa527 (patch) | |
tree | 63c18e7333e7154c53f26e07688766a064717439 /configure.ac | |
parent | 71e5202739aace88652449712142c16c7f17bd8a (diff) |
build: explicitly list dependency libraries
Debian-based Linux distributions have introduced a while ago a very
specific patch to libtool generation which disables libtool generating
dependent libraries list to the linker (distribution libtool.m4 has
link_all_deplibs forced to no). This causes issues when cross-compiling
while using dependent libraries compiled and installed manually to
non-sysroot location (see [1]).
To reproduce the issue, one has to fetch a toolchain which does not
contain pkg-config in it. Debian/Ubuntu aarch64 toolchains do contain
version of that tool (aarch64-linux-gnu-pkg-config) which does not have
the change in question.
There are several solutions to fix this, however this patch opts for
explicitly listing dependent libraries in examples and tests.
It is done by adding the PLAT_DEP_LIBS variable which platform should
fill with libraries that can be added from non-standard locations (such
as libconfig and libcrypto for linux-generic).
Additionally move the non-platform specific autoconf definitions prior
to the platform's configure.m4 so that platforms may adapt to argument
customizations passed by the user.
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=297726
Signed-off-by: Stanislaw Kardach <skardach@marvell.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 90 |
1 files changed, 49 insertions, 41 deletions
diff --git a/configure.ac b/configure.ac index 400a797d1..8fcc21f7a 100644 --- a/configure.ac +++ b/configure.ac @@ -272,31 +272,6 @@ AC_SUBST(ODP_LTO_FLAGS) ODP_CFLAGS="$ODP_CFLAGS $ODP_LTO_FLAGS" ########################################################################## -# Determine which platform to build for -########################################################################## -AC_ARG_WITH([platform], - [AS_HELP_STRING([--with-platform=platform], - [select platform to be used, default linux-generic])], - [], - [with_platform=linux-generic - ]) - -AC_SUBST([with_platform]) - -########################################################################## -# Run platform specific checks and settings -########################################################################## -AS_IF([test "${with_platform}" = "linux-generic"], - [m4_include([./platform/linux-generic/m4/configure.m4])], - [AC_MSG_ERROR([UNSUPPORTED PLATFORM: ${with_platform}])]) - -AC_DEFINE_UNQUOTED([_ODP_IMPLEMENTATION_NAME], ["$ODP_IMPLEMENTATION_NAME"], - [Define to the name of the implementation]) - -AM_CONDITIONAL([ODP_USE_CONFIG], [test "x$odp_use_config" = "xtrue"]) -AC_SUBST([ODP_LIB_NAME]) - -########################################################################## # Build examples/tests dynamically ########################################################################## AC_ARG_ENABLE([static-applications], @@ -352,22 +327,6 @@ AM_CONDITIONAL([ARCH_IS_X86_32], [test "x${ARCH_ABI}" = "xx86_32-linux"]) AM_CONDITIONAL([ARCH_IS_X86_64], [test "x${ARCH_ABI}" = "xx86_64-linux"]) ########################################################################## -# Setup doxygen documentation -########################################################################## -DX_HTML_FEATURE(ON) -DX_PDF_FEATURE(OFF) -DX_PS_FEATURE(OFF) -DX_ENV_APPEND(WITH_PLATFORM, $with_platform) - -DX_INIT_DOXYGEN($PACKAGE_NAME, - ${srcdir}/doc/application-api-guide/Doxyfile, - ${builddir}/doc/application-api-guide/output, - ${srcdir}/doc/helper-guide/Doxyfile, - ${builddir}/doc/helper-guide/output, - ${srcdir}/doc/platform-api-guide/Doxyfile, - ${builddir}/doc/platform-api-guide/output) - -########################################################################## # Enable/disable ODP_DEBUG ########################################################################## AC_ARG_ENABLE([debug], @@ -427,6 +386,54 @@ AC_ARG_ENABLE([deprecated], AC_SUBST(ODP_DEPRECATED_API) ########################################################################## +# Determine which platform to build for +########################################################################## +AC_ARG_WITH([platform], + [AS_HELP_STRING([--with-platform=platform], + [select platform to be used, default linux-generic])], + [], + [with_platform=linux-generic + ]) + +AC_SUBST([with_platform]) + +########################################################################## +# Run platform specific checks and settings +########################################################################## +# Placeholder for platform dependency libraries which might come from custom +# paths. Platform should fill it in configure.m4 with AS_VAR_APPEND. +# This works around a bug in libtool.m4 on some systems: +# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=297726 +PLAT_DEP_LIBS= +AC_SUBST([PLAT_DEP_LIBS]) + +AS_IF([test "${with_platform}" = "linux-generic"], + [m4_include([./platform/linux-generic/m4/configure.m4])], + [AC_MSG_ERROR([UNSUPPORTED PLATFORM: ${with_platform}])]) + +AC_DEFINE_UNQUOTED([_ODP_IMPLEMENTATION_NAME], ["$ODP_IMPLEMENTATION_NAME"], + [Define to the name of the implementation]) + +AM_CONDITIONAL([ODP_USE_CONFIG], [test "x$odp_use_config" = "xtrue"]) +AC_SUBST([ODP_LIB_NAME]) + +########################################################################## +# Setup doxygen documentation +########################################################################## +DX_HTML_FEATURE(ON) +DX_PDF_FEATURE(OFF) +DX_PS_FEATURE(OFF) +DX_ENV_APPEND(WITH_PLATFORM, $with_platform) + +DX_INIT_DOXYGEN($PACKAGE_NAME, + ${srcdir}/doc/application-api-guide/Doxyfile, + ${builddir}/doc/application-api-guide/output, + ${srcdir}/doc/helper-guide/Doxyfile, + ${builddir}/doc/helper-guide/output, + ${srcdir}/doc/platform-api-guide/Doxyfile, + ${builddir}/doc/platform-api-guide/output) + +########################################################################## # Default include setup ########################################################################## CFLAGS="$CFLAGS $ODP_CFLAGS" @@ -482,6 +489,7 @@ AC_MSG_RESULT([ ld: ${LD} ldflags: ${LDFLAGS} libs: ${LIBS} + dependency libs: ${PLAT_DEP_LIBS} defs: ${DEFS} static libraries: ${enable_static} shared libraries: ${enable_shared} |