From 7065fdf6c5de7886e5789c42d0b089eacaac600a Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Sat, 8 Feb 2014 21:35:14 -0800 Subject: [PATCH 1/3] Remove {cdefs,types}-compat.h from openlibm.h --- src/openlibm.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/openlibm.h b/src/openlibm.h index 5e6ba5d..5a37093 100644 --- a/src/openlibm.h +++ b/src/openlibm.h @@ -17,8 +17,11 @@ #ifndef _MATH_H_ #define _MATH_H_ -#include "cdefs-compat.h" -#include "types-compat.h" +#if (defined(_WIN32) || defined (_MSC_VER)) && !defined(__WIN32__) + #define __WIN32__ +#endif + +#define __pure2 /* * ANSI/POSIX @@ -172,7 +175,10 @@ extern int signgam; * effect of raising floating-point exceptions, so they are not declared * as __pure2. In C99, FENV_ACCESS affects the purity of these functions. */ -__BEGIN_DECLS + +#if defined(__cplusplus) +extern "C" { +#endif /* * ANSI/POSIX */ @@ -490,5 +496,7 @@ long double tgammal(long double); long double truncl(long double); #endif /* __ISO_C_VISIBLE >= 1999 */ -__END_DECLS +#if defined(__cplusplus) +} +#endif #endif /* !_MATH_H_ */ From ea52e04b6d69cef86714e6e406a3202395551b1d Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Sat, 8 Feb 2014 21:36:49 -0800 Subject: [PATCH 2/3] Revert "Install everything in the `include/` directory into `$(prefix)/include/openlibm`." This reverts commit eb2f4d4b44e6ffaede3057d2cb6c6bae77de863f. --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 791984d..a3950c3 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,6 @@ distclean: install: all mkdir -p $(DESTDIR)$(libdir) - mkdir -p $(DESTDIR)$(includedir)/openlibm + mkdir -p $(DESTDIR)$(includedir) cp -a libopenlibm.$(SHLIB_EXT)* libopenlibm.a $(DESTDIR)$(libdir)/ cp -a src/openlibm.h $(DESTDIR)$(includedir)/ - cp -a include/*.h $(DESTDIR)$(includedir)/openlibm/ From 5b16546ddd772b542395efa83112866396267024 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Mon, 19 May 2014 14:38:28 +0100 Subject: [PATCH 3/3] Added pkg-config support --- Makefile | 10 ++++++++-- openlibm.pc.in | 10 ++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 openlibm.pc.in diff --git a/Makefile b/Makefile index 3377b82..789f7d9 100644 --- a/Makefile +++ b/Makefile @@ -44,13 +44,19 @@ distclean: -rm -f $(OBJS) *.a *.$(SHLIB_EXT) libopenlibm.* -$(MAKE) -C test clean -install: all +openlibm.pc: openlibm.pc.in Make.inc Makefile + echo "prefix=${prefix}" > openlibm.pc + echo "version=${VERSION}" >> openlibm.pc + cat openlibm.pc.in >> openlibm.pc + +install: all openlibm.pc mkdir -p $(DESTDIR)$(shlibdir) - mkdir -p $(DESTDIR)$(libdir) + mkdir -p $(DESTDIR)$(libdir)/pkgconfig mkdir -p $(DESTDIR)$(includedir)/openlibm cp -a libopenlibm.$(SHLIB_EXT)* $(DESTDIR)$(shlibdir)/ cp -a libopenlibm.a $(DESTDIR)$(libdir)/ cp -a src/openlibm.h $(DESTDIR)$(includedir)/ + cp -a openlibm.pc $(DESTDIR)$(libdir)/pkgconfig/ ifneq ($(wildcard $(ARCH)/bsd_asm.h),) cp -a $(ARCH)/bsd_asm.h $(DESTDIR)$(includedir)/openlibm/ endif diff --git a/openlibm.pc.in b/openlibm.pc.in new file mode 100644 index 0000000..242d447 --- /dev/null +++ b/openlibm.pc.in @@ -0,0 +1,10 @@ +exec_prefix=${prefix} +includedir=${prefix}/include +libdir=${exec_prefix}/lib + +Name: openlibm +Version: ${version} +URL: https://github.com/JuliaLang/openlibm +Description: High quality system independent, open source libm. +Cflags: -I${includedir} +Libs: -L${libdir} -lopenlibm