From 29013cba153b482bc8f80756e544ccfffee31919 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 19 Oct 2013 02:20:21 +0200 Subject: [PATCH] Don't add -lm on haiku. * configure.ac: Define BUILD_LIBM to -lm on most platforms and empty on haiku. * grub-core/Makefile.am (gentrigtables): Use $(BUILD_LIBM) rather than -lm. --- ChangeLog | 9 +++++++++ configure.ac | 6 ++++++ grub-core/Makefile.am | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 272f4d6c5..485953736 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2013-10-18 Vladimir Serbinenko + + Don't add -lm on haiku. + + * configure.ac: Define BUILD_LIBM to -lm on most platforms + and empty on haiku. + * grub-core/Makefile.am (gentrigtables): Use $(BUILD_LIBM) rather than + -lm. + 2013-10-18 Vladimir Serbinenko * configure.ac: Use -melf_*_haiku as target on haiku. diff --git a/configure.ac b/configure.ac index c9ee9f842..e08aecb6c 100644 --- a/configure.ac +++ b/configure.ac @@ -405,6 +405,10 @@ AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc]) test -z "$BUILD_CC" && AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.]) BUILD_CPP="$BUILD_CC -E" +case "$build_os" in + haiku*) BUILD_LIBM= ;; + *) BUILD_LIBM=-lm ;; +esac # For gnulib. gl_INIT @@ -793,6 +797,8 @@ AC_SUBST(HOST_LDFLAGS) AC_SUBST(HOST_CPPFLAGS) AC_SUBST(HOST_CCASFLAGS) +AC_SUBST(BUILD_LIBM) + # Set them to their new values for the tests below. CC="$TARGET_CC" if test "x$TARGET_APPLE_CC" = x1 ; then diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am index 7d8449606..6a987442d 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -35,7 +35,7 @@ build-grub-pe2elf: $(top_srcdir)/util/grub-pe2elf.c $(top_srcdir)/grub-core/kern # gentrigtables gentrigtables: gentrigtables.c - $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -lm + $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< $(BUILD_LIBM) CLEANFILES += gentrigtables # trigtables.c