Skip to content

Commit 3ad0ffe

Browse files
author
daniel
committed
build: Fix linkage for Darwin
1 parent fe22371 commit 3ad0ffe

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

examples/test_abort_buffer/Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#=======================================================================
44
include ../make.inc
55

6+
UNAME = $(shell uname)
7+
68
PY_MOD = pywrapper
79
WRAPFLAGS = -v
810
F2PY = f2py-f90wrap
@@ -13,10 +15,9 @@ F90WRAP_OBJ = $(F90WRAP_SRC:.f90=.o)
1315
SRC_LIB = src
1416
F90WRAP_LIB = f90wrap
1517
ifeq ($(UNAME),Darwin)
16-
LDFLAGS := -bundle -undefined dynamic_lookup -lgfortran
17-
else
18-
LDFLAGS := -shared -lgfortran
18+
LDFLAGS = -Wl,-undefined,dynamic_lookup
1919
endif
20+
2021
.PHONY: all clean
2122

2223
all: test
@@ -51,8 +52,8 @@ f90wrap_%.o: f90wrap_%.f90
5152
lib${SRC_LIB}.so: ${OBJ}
5253
${F90} ${F90FLAGS} -shared -o lib${SRC_LIB}.so ${OBJ} ${LDFLAGS}
5354

54-
lib${F90WRAP_LIB}.so: ${F90WRAP_OBJ}
55-
${F90} ${F90FLAGS} -shared -o lib${F90WRAP_LIB}.so ${F90WRAP_OBJ} ${LDFLAGS}
55+
lib${F90WRAP_LIB}.so: ${F90WRAP_OBJ} lib${SRC_LIB}.so
56+
${F90} ${F90FLAGS} -shared -o lib${F90WRAP_LIB}.so ${F90WRAP_OBJ} -L. -l${SRC_LIB} ${LDFLAGS}
5657

5758
test: f2py_main_A f2py_main_B
5859
LD_LIBRARY_PATH=. ${PYTHON} tests.py

0 commit comments

Comments
 (0)