Skip to content

Commit 8756e33

Browse files
committed
Improve usage of Mac ports
1 parent bb80cae commit 8756e33

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

scripts/001-binutils.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ if [ "$(uname -s)" = "Darwin" ]; then
4242
## Check if using brew
4343
if command -v brew &> /dev/null; then
4444
TARG_XTRA_OPTS="--with-gmp=$(brew --prefix gmp) --with-mpfr=$(brew --prefix mpfr)"
45-
fi
45+
elif command -v port &> /dev/null; then
4646
## Check if using MacPorts
47-
if command -v port &> /dev/null; then
48-
TARG_XTRA_OPTS="--with-gmp=$(port -q prefix gmp) --with-mpfr=$(port -q prefix mpfr)"
47+
MACPORT_BASE=$(dirname `port -q contents gmp|grep gmp.h`|sed s#/include##g)
48+
echo Macport base is $MACPORT_BASE
49+
TARG_XTRA_OPTS="--with-gmp=$MACPORT_BASE --with-mpfr=$MACPORT_BASE"
4950
fi
5051
fi
5152

scripts/002-gcc-stage1.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ if [ "$(uname -s)" = "Darwin" ]; then
4343
## Check if using brew
4444
if command -v brew &> /dev/null; then
4545
TARG_XTRA_OPTS="--with-gmp=$(brew --prefix gmp) --with-mpfr=$(brew --prefix mpfr) --with-mpc=$(brew --prefix libmpc)"
46-
fi
46+
elif command -v port &> /dev/null; then
4747
## Check if using MacPorts
48-
if command -v port &> /dev/null; then
49-
TARG_XTRA_OPTS="--with-gmp=$(port -q prefix gmp) --with-mpfr=$(port -q prefix mpfr) --with-mpc=$(port -q prefix libmpc)"
48+
MACPORT_BASE=$(dirname `port -q contents gmp|grep gmp.h`|sed s#/include##g)
49+
echo Macport base is $MACPORT_BASE
50+
TARG_XTRA_OPTS="--with-gmp=$MACPORT_BASE --with-mpfr=$MACPORT_BASE --with-mpc=$MACPORT_BASE"
5051
fi
5152
fi
5253

0 commit comments

Comments
 (0)