From 29457fac9f624e4066704cec520f55675633259a Mon Sep 17 00:00:00 2001 From: "Christopher J. Morrone" Date: Wed, 2 Nov 2011 17:49:43 -0700 Subject: [PATCH] Use autoconf to link against the math library. --- configure.ac | 2 ++ src/Makefile.am | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index ac8665f..18dc892 100644 --- a/configure.ac +++ b/configure.ac @@ -27,6 +27,8 @@ AC_TYPE_SIZE_T # Checks for library functions. AC_FUNC_MALLOC AC_CHECK_FUNCS([getpagesize gettimeofday memset mkdir pow putenv realpath regcomp sqrt strcasecmp strchr strerror strncasecmp strstr uname]) +AC_SEARCH_LIBS([sqrt], [m], [], + [AC_MSG_ERROR([Math library not found])]) # Check for system capabilities AC_SYS_LARGEFILE diff --git a/src/Makefile.am b/src/Makefile.am index 6a2e70e..cbad09a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ bin_PROGRAMS = ior ior_SOURCES = ior.c utilities.c parse_options.c ior_SOURCES += ior.h aiori.h iordef.h defaults.h -ior_LDADD = -lm +ior_LDADD = if USE_POSIX_AIORI ior_SOURCES += aiori-POSIX.c