From fe8bc4e7ebc0e4fd36d0cea63a9903643e4bb1a4 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Fri, 30 Jan 2015 14:42:13 -0800 Subject: [PATCH] debuggers: make the test safe to build without dlopen This is a bit of overkill, but I'm cleaning out a bunch of other libltdl-support assumptions, so I might as well do this one, too. The test isn't built if we don't have libltdl support, but it had half-hearted #if protection in it to make it safe to build even if we didn't have libltdl support. This commit finishes that half-hearted support. --- ompi/debuggers/Makefile.am | 1 + ompi/debuggers/dlopen_test.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ompi/debuggers/Makefile.am b/ompi/debuggers/Makefile.am index c23ec36182..c7e5765584 100644 --- a/ompi/debuggers/Makefile.am +++ b/ompi/debuggers/Makefile.am @@ -44,6 +44,7 @@ headers = \ msgq_interface.h ompi_msgq_dll_defs.h # Simple checks to ensure that the DSOs are functional +# This test is only built if we have libltdl support. dlopen_test_SOURCES = dlopen_test.c dlopen_test_CPPFLAGS = -I$(top_srcdir)/opal/libltdl diff --git a/ompi/debuggers/dlopen_test.c b/ompi/debuggers/dlopen_test.c index 029a4ee381..1cbbd79f58 100644 --- a/ompi/debuggers/dlopen_test.c +++ b/ompi/debuggers/dlopen_test.c @@ -15,19 +15,16 @@ #include "opal/libltdl/ltdl.h" -static int do_test(void); - +#if !OPAL_WANT_LIBLTDL int main(int argc, char *argv[]) { -#if OPAL_WANT_LIBLTDL - return do_test(); -#else /* If OPAL wasn't built with libltdl support, then skip this test */ fprintf(stderr, "OPAL was not built with libltdl support; skipping\n"); return 77; -#endif } +#else /* OPAL_WANT_LIBLTDL */ + static int do_test(void) { FILE *fp; @@ -128,3 +125,9 @@ static int do_test(void) return 2; } + +int main(int argc, char *argv[]) +{ + return do_test(); +} +#endif /* OPAL_WANT_LIBLTDL */