Skip to content
Snippets Groups Projects
Verified Commit cc910224 authored by Willi Mutschler's avatar Willi Mutschler
Browse files

macOS installer: improve sed command to get GCC version

parent 6e98e984
No related branches found
No related tags found
No related merge requests found
...@@ -55,7 +55,7 @@ LIB64="$ROOTDIR"/macOS/deps/"$PKG_ARCH"/lib64 ...@@ -55,7 +55,7 @@ LIB64="$ROOTDIR"/macOS/deps/"$PKG_ARCH"/lib64
## - the macOS linker is different from GNU ld and does not have the equivalent of -Bstatic/-Bdynamic ## - the macOS linker is different from GNU ld and does not have the equivalent of -Bstatic/-Bdynamic
## - libgfortran.spec does not include --as-needed on macOS, hence it will link the library anyways ## - libgfortran.spec does not include --as-needed on macOS, hence it will link the library anyways
## Also, it does not seem possible to override libgfortran.spec with the --specs option. ## Also, it does not seem possible to override libgfortran.spec with the --specs option.
GCC_VERSION=$(sed -n "s|c = '$(BREWDIR)/bin/gcc-\([0-9]*\)'|\1|p" "$ROOTDIR"/scripts/homebrew-native-$PKG_ARCH.ini) GCC_VERSION=$(sed -En "/^c[[:space:]]*=/s/c[[:space:]]*=[[:space:]]*'.*gcc-([0-9]+)'/\1/p" "$ROOTDIR"/scripts/homebrew-native-"$PKG_ARCH".ini)
QUADMATH_DIR=$(mktemp -d) QUADMATH_DIR=$(mktemp -d)
ln -s $BREWDIR/opt/gcc/lib/gcc/$GCC_VERSION/libquadmath.a $QUADMATH_DIR ln -s $BREWDIR/opt/gcc/lib/gcc/$GCC_VERSION/libquadmath.a $QUADMATH_DIR
......
...@@ -22,7 +22,7 @@ DEPS_ARCH ?= x86_64 # use x86_64 by default ...@@ -22,7 +22,7 @@ DEPS_ARCH ?= x86_64 # use x86_64 by default
BREWDIR := $(if $(filter arm64,$(DEPS_ARCH)),/opt/homebrew,/usr/local) BREWDIR := $(if $(filter arm64,$(DEPS_ARCH)),/opt/homebrew,/usr/local)
GCC_VERSION = $(shell sed -n "s|c = '$(BREWDIR)/bin/gcc-\([0-9]*\)'|\1|p" ../../scripts/homebrew-native-$(DEPS_ARCH).ini) GCC_VERSION = $(shell sed -En "/^c[[:space:]]*=/s/c[[:space:]]*=[[:space:]]*'.*gcc-([0-9]+)'/\1/p" ../../scripts/homebrew-native-$(DEPS_ARCH).ini)
ROOT_PATH = $(realpath .) ROOT_PATH = $(realpath .)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment