Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
This finds zstd using pkg-config instead of relying on the RUNPATH embedded in llvm-config.
  • Loading branch information
dabrahams committed Feb 28, 2024
1 parent 0e82b3b commit 38ab765
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Tools/make-pkgconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
set -e
set -o pipefail

# Work around https://github.com/hylo-lang/llvm-build/issues/8
zstd_dash_L="$(pkg-config --libs-only-L libzstd)"
export DYLD_LIBRARY_PATH="${zstd_dash_L#-L}:$DYLD_LIBRARY_PATH"

version=$(llvm-config --version)
filename=$1

Expand All @@ -21,7 +25,7 @@ echo Name: LLVM > $filename
echo Description: Low-level Virtual Machine compiler framework >> $filename
echo Version: $(echo ${version} | sed 's/\([0-9.]\+\).*/\1/') >> $filename
echo URL: http://www.llvm.org/ >> $filename
echo Libs: -L$(llvm-config --libdir) $(pkg-config --libs-only-L libzstd) ${libs} $(llvm-config --system-libs --libs analysis bitwriter core native passes target) >> $filename
echo Libs: -L$(llvm-config --libdir) ${zstd_dash_L} ${libs} $(llvm-config --system-libs --libs analysis bitwriter core native passes target) >> $filename
echo Cflags: -I$(llvm-config --includedir) >> $filename

echo "$filename written:"
Expand Down

0 comments on commit 38ab765

Please sign in to comment.