@@ -9,7 +9,7 @@ YICES_SRC=$(REPONAME)
9
9
YICES_INST =$(abspath $(PWD ) /$(REPONAME ) -inst)
10
10
11
11
ifeq ($(OSTYPE ) , Darwin)
12
- # On macOS we need to work around two yices build issues:
12
+ # On macOS we need to work around three yices build issues:
13
13
# 1. yices explicitly sets the install_name for libyices.2.dylib to be
14
14
# the absolute install path. For cases where yices knows the correct
15
15
# install path of the library, this makes sense, but for bsc, we don't want
@@ -20,7 +20,19 @@ ifeq ($(OSTYPE), Darwin)
20
20
# depend on Homebrew. Instead, statically link libgmp into libyices.
21
21
# Note that we must statically link by using the archive file as Apple's ld
22
22
# doesn't understand -Bstatic.
23
- LIBGMPA =$(shell pkg-config --variable=libdir gmp) /libgmp.a
23
+ # 3. yices searches a hard-coded list of paths, which does not include
24
+ # /opt/homebrew as used on Arm-based Macs, so we must manually pass the
25
+ # directories to configure so it doesn't fail. Note that --with-static-gmp
26
+ # is broken; the initial check succeeds, but it later unconditionally tries
27
+ # an AC_CHECK_LIB(gmp, ...) and so tries to link with -lgmp, which will fail
28
+ # if the library search path doesn't include the library, at which point
29
+ # passing the option serves no purpose.
30
+ INCLUDEDIRGMP =$(shell pkg-config --variable=includedir gmp)
31
+ LIBDIRGMP =$(shell pkg-config --variable=libdir gmp)
32
+ CONFIGURE_ENV = \
33
+ CPPFLAGS="$${CPPFLAGS:+$$CPPFLAGS }-I$(INCLUDEDIRGMP ) " \
34
+ LDFLAGS="$${LDFLAGS:+$$LDFLAGS }-L$(LIBDIRGMP ) "
35
+ LIBGMPA =$(LIBDIRGMP ) /libgmp.a
24
36
BUILD_ARGS=libyices_install_name =libyices.2.dylib LIBS=$(LIBGMPA )
25
37
endif
26
38
@@ -32,7 +44,7 @@ install:
32
44
ifeq ($(YICES_STUB ) ,)
33
45
(cd $(YICES_SRC) ; \
34
46
autoconf ; \
35
- ./configure --prefix=$(YICES_INST) ; \
47
+ $(CONFIGURE_ENV) ./configure --prefix=$(YICES_INST) ; \
36
48
$(MAKE) $(BUILD_ARGS); \
37
49
$(MAKE) install \
38
50
)
0 commit comments