Link against libm

Fixes compilation of libproxy against duktape.

https://github.com/svaarala/duktape/issues/2464
This commit is contained in:
David King 2023-05-16 16:42:23 +01:00
parent d4c8d2d140
commit 8f5201384d
2 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,28 @@
From d898ad3920cb08d6918d11d9678bae28393a82d1 Mon Sep 17 00:00:00 2001
From: tinywrkb <tinywrkb@gmail.com>
Date: Thu, 17 Mar 2022 03:55:51 +0200
Subject: [PATCH] dist-files/Makefile.sharedlibrary: link against libm
Closes #2464.
---
Makefile.sharedlibrary | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Makefile.sharedlibrary b/Makefile.sharedlibrary
index 3a6c7cacc..4e20084e3 100644
--- a/Makefile.sharedlibrary
+++ b/Makefile.sharedlibrary
@@ -71,11 +71,11 @@ all: libduktape.$(SO_REALNAME_SUFFIX) libduktaped.$(SO_REALNAME_SUFFIX) duktape.
libduktape.$(SO_REALNAME_SUFFIX):
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fPIC -Wall -Wextra -Os -Wl,$(LD_SONAME_ARG),libduktape.$(SO_SONAME_SUFFIX) \
- -o $@ $(DUKTAPE_SRCDIR)/duktape.c
+ -o $@ $(DUKTAPE_SRCDIR)/duktape.c -lm
libduktaped.$(SO_REALNAME_SUFFIX):
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fPIC -g -Wall -Wextra -Os -Wl,$(LD_SONAME_ARG),libduktaped.$(SO_SONAME_SUFFIX) \
- -o $@ $(DUKTAPE_SRCDIR)/duktape.c
+ -o $@ $(DUKTAPE_SRCDIR)/duktape.c -lm
duktape.pc:
sed -e "s|@PREFIX@|$(INSTALL_PREFIX)|" \

View File

@ -2,9 +2,12 @@ Name: duktape
Version: 2.7.0
Release: %autorelease
Summary: Embeddable Javascript engine
License: MIT
Url: http://duktape.org/
Source0: http://duktape.org/%{name}-%{version}.tar.xz
Patch0: duktape-2.7.0-link-against-libm.patch
BuildRequires: gcc
BuildRequires: pkgconfig
BuildRequires: make
@ -24,7 +27,7 @@ This package contains header files and libraries needed to develop
application that use %{name}.
%prep
%setup -q
%autosetup -p1
%build
%make_build -f Makefile.sharedlibrary INSTALL_PREFIX=%{_prefix} LIBDIR=/%{_lib}