Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1From 0f48e046f44624f4d4d8255ac5bd26397a38f16c Mon Sep 17 00:00:00 2001
2From: Keshav Kini <keshav.kini@gmail.com>
3Date: Sun, 23 Feb 2020 14:09:30 -0800
4Subject: [PATCH] Support shared library build
5
6Patch taken from [the ACL2 Books documentation][1].
7
8- Add " -fPIC" to the CXXFLAGS to build position-independent code,
9 required for shared libraries.
10
11- Add the line "export CXXFLAGS" below the setting of CXXFLAGS, so that
12 those flags apply to the recursive make of the core solver library.
13
14- Fix a typo: replace the occurrence of "CXXLAGS" with "CXXFLAGS".
15
16[1]: http://www.cs.utexas.edu/users/moore/acl2/v8-2/combined-manual/index.html?topic=IPASIR____BUILDING-AN-IPASIR-SOLVER-LIBRARY
17---
18 makefile | 5 +++--
19 1 file changed, 3 insertions(+), 2 deletions(-)
20
21diff --git a/makefile b/makefile
22index 07121de..4e85c4b 100755
23--- a/makefile
24+++ b/makefile
25@@ -29,7 +29,8 @@ TARGET=libipasir$(SIG).a
26
27 CXX=g++
28
29-CXXFLAGS= -g -std=c++11 -Wall -DNDEBUG -O3
30+CXXFLAGS= -g -std=c++11 -Wall -DNDEBUG -O3 -fPIC
31+export CXXFLAGS
32
33 #-----------------------------------------------------------------------#
34 #- REQUIRED TOP RULES --------------------------------------------------#
35@@ -67,7 +68,7 @@ libipasir$(SIG).a: .FORCE
36 #-----------------------------------------------------------------------#
37
38 ipasir$(NAME)glue.o: ipasir$(NAME)glue.cc ipasir.h makefile
39- $(CXX) -g -std=c++11 $(CXXLAGS) \
40+ $(CXX) -g -std=c++11 $(CXXFLAGS) \
41 -DVERSION=\"$(VERSION)\" \
42 -I$(DIR) -I$(DIR)/core -c ipasir$(NAME)glue.cc
43
44--
452.23.1
46