[BACK]Return to patch-native_Makefile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / devel / py-angr / patches

File: [cvs.NetBSD.org] / pkgsrc / devel / py-angr / patches / patch-native_Makefile (download)

Revision 1.2, Thu Jan 9 14:02:31 2020 UTC (5 months, 3 weeks ago) by wiz
Branch: MAIN
CVS Tags: pkgsrc-2020Q2-base, pkgsrc-2020Q2, pkgsrc-2020Q1-base, pkgsrc-2020Q1, HEAD
Changes since 1.1: +16 -12 lines

py-angr: update py-angr and dependencies (all from the angr project) to 8.20.1.7

This now only supports python 3.x.

Other changes not documented.

$NetBSD: patch-native_Makefile,v 1.2 2020/01/09 14:02:31 wiz Exp $

Add support for anything like Linux.

--- native/Makefile.orig	2019-12-20 06:32:04.000000000 +0000
+++ native/Makefile
@@ -1,30 +1,38 @@
 UNAME := $(shell uname)
 ifeq ($(UNAME), Darwin)
 	LIB_ANGR_NATIVE=angr_native.dylib
-endif
-ifeq ($(UNAME), Linux)
+else
 	LIB_ANGR_NATIVE=angr_native.so
 endif
 
 CC := gcc
 C++C := g++
-CFLAGS := -I "${UNICORN_INCLUDE_PATH}" -I "${PYVEX_INCLUDE_PATH}" \
-	-L "${UNICORN_LIB_PATH}" -L "${PYVEX_LIB_PATH}" \
-	-O3 -fPIC -std=c++11
 ifneq ($(DEBUG), )
 	CFLAGS := $(CFLAGS) -O0 -g
 endif
 
-OBJS := log.o
+OBJS := log.o sim_unicorn.o
 LIBS := -lunicorn -lpyvex
 
+PREFIX?=	/usr/local
+LIBDIR?=	${PREFIX}/lib
+
+CFLAGS += -I ${UNICORN_INCLUDE_PATH} -I ${PYVEX_INCLUDE_PATH} \
+	-O3 -fPIC
+CXXFLAGS += ${CFLAGS} -std=c++11
+LDFLAGS += -shared ${LIBS} -L${LIBDIR} -L${UNICORN_LIB_PATH} -L${PYVEX_LIB_PATH} \
+	-Wl,-rpath,${LIBDIR} -Wl,-rpath,${UNICORN_LIB_PATH} -Wl,-rpath,${PYVEX_LIB_PATH}
+
 all: ${LIB_ANGR_NATIVE}
 
 log.o: log.c log.h
-	${CC} -fPIC -c -O3 -o $@ $<
+	${CC} ${CFLAGS} -o $@ -c $<
+
+sim_unicorn.o: sim_unicorn.cpp
+	${C++C} ${CXXFLAGS} -o $@ -c $^
 
-${LIB_ANGR_NATIVE}: ${OBJS} sim_unicorn.cpp
-	${C++C} ${CFLAGS} -shared -o $@ $^ ${LIBS}
+${LIB_ANGR_NATIVE}: ${OBJS}
+	${C++C} ${LDFLAGS} -o $@ $^
 
 clean:
 	rm -f "${LIB_ANGR_NATIVE}" *.o arch/*.o