From be92ea1bc0e15ffea68d46e09f4ebf7ddcc020e4 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Sat, 5 Mar 2016 07:51:47 -0500 Subject: [PATCH] libfabric.map: use m4 to generate libfabric.map * Use AC_SUBST_FILE to import the provider's map file into the main libfabric.map file. * Make the logic for checking for $enable_direct sligthly more straightforward. * Double check for the existence of the provider's .map file during configure. Signed-off-by: Jeff Squyres --- Makefile.am | 6 ------ configure.ac | 26 +++++++++++++++----------- libfabric.map.cpp => libfabric.map.in | 5 +---- 3 files changed, 16 insertions(+), 21 deletions(-) rename libfabric.map.cpp => libfabric.map.in (71%) diff --git a/Makefile.am b/Makefile.am index 129c24c0563..3b95fc13965 100644 --- a/Makefile.am +++ b/Makefile.am @@ -265,9 +265,6 @@ dummy_man_pages = \ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libfabric.pc -libfabric.map: libfabric.map.cpp - @$(CPP) $(CPPFLAGS) -I$(top_builddir) -P -C $< -o $@ - nroff: @for file in $(real_man_pages); do \ source=`echo $$file | sed -e 's@/man[0-9]@@'`; \ @@ -284,8 +281,6 @@ test: rpm: dist rpmbuild -ta libfabric-*.tar.bz2 -CLEANFILES = libfabric.map - prov_install_man_pages= prov_dist_man_pages= @@ -302,7 +297,6 @@ man_MANS = $(real_man_pages) $(prov_install_man_pages) $(dummy_man_pages) EXTRA_DIST = \ NEWS.md \ - libfabric.map.cpp \ libfabric.spec.in \ config/distscript.pl \ $(real_man_pages) $(prov_dist_man_pages) $(dummy_man_pages) diff --git a/configure.ac b/configure.ac index fe0dd3c08a0..4e0467bb07b 100644 --- a/configure.ac +++ b/configure.ac @@ -233,20 +233,24 @@ FI_PROVIDER_SETUP_PC # If the user requested to build in direct mode, but # we have more than one provider, error. +PROVIDER_DIRECT=no +FI_DIRECT_PROVIDER_API_10=/dev/null AS_IF([test x"$enable_direct" != x"no"], - [AS_IF([test "$PROVIDERS_COUNT" -eq "1"], - [AC_SUBST(PROVIDER_DIRECT, "$enable_direct")] - [AC_DEFINE_UNQUOTED([FI_DIRECT_PROVIDER_API_10], - ["prov/$enable_direct/provider_FABRIC_1.0.map"], - [Define location of provider symbol script])] - AC_DEFINE([FABRIC_DIRECT_ENABLED], 1, - [Define to 1 if building for fi_direct support]), - [AC_MSG_NOTICE([Only one provider can be chosen when using --enable-direct]) - AC_MSG_ERROR(Cannot continue)])]) - + [AS_IF([test "$PROVIDERS_COUNT" -gt 1], + [AC_MSG_WARN([Only one provider can be chosen when using --enable-direct]) + AC_MSG_ERROR(Cannot continue)]) + + PROVIDER_DIRECT=$enable_direct + FI_DIRECT_PROVIDER_API_10="prov/$enable_direct/provider_FABRIC_1.0.map" + AS_IF([test ! -r "$FI_DIRECT_PROVIDER_API_10"], + [AC_MSG_WARN([--enable-direct=$enable_direct specified, but $FI_DIRECT_PROVIDER_API_10 does not exist]) + AC_MSG_ERROR([Cannot continue])])]) + +AC_SUBST(PROVIDER_DIRECT) +AC_SUBST_FILE(FI_DIRECT_PROVIDER_API_10) AM_CONDITIONAL([HAVE_DIRECT], [test x"$enable_direct" != x"no"]) -AC_CONFIG_FILES([Makefile libfabric.spec]) +AC_CONFIG_FILES([Makefile libfabric.spec libfabric.map]) AC_OUTPUT dnl helpful output diff --git a/libfabric.map.cpp b/libfabric.map.in similarity index 71% rename from libfabric.map.cpp rename to libfabric.map.in index 219b298fe21..a0fc9952e8f 100644 --- a/libfabric.map.cpp +++ b/libfabric.map.in @@ -1,4 +1,3 @@ -#include "config.h" FABRIC_1.0 { global: fi_getinfo; @@ -14,8 +13,6 @@ FABRIC_1.0 { fi_param_get; fi_getparams; fi_freeparams; -#ifdef FABRIC_DIRECT_ENABLED -#include FI_DIRECT_PROVIDER_API_10 -#endif + @FI_DIRECT_PROVIDER_API_10@ local: *; };