Skip to content

Commit

Permalink
fix pkgconfig libdir for multi arch build #76
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Nov 7, 2024
1 parent 2666d8f commit 68b1ba0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions avbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ export LIB="$VC_LTL_LIB;$VCDIR_LIB;$WindowsSdkDir/Lib/$WindowsSDKVersion/ucrt/${
export AR=$LLVM_AR
export NM=$LLVM_NM
#export V=1 # FFmpeg BUG: AR is overriden in common.mak and becomes an invalid command in makedef(@printf works in makefiles but not sh scripts)
export PKG_CONFIG_PATH=${THIS_DIR}/tools/dep/windows-desktop/${MACHINE/86_/}/lib/pkgconfig:${THIS_DIR}/tools/dep_gpl/windows-desktop/${MACHINE/86_/}/lib/pkgconfig:${THIS_DIR}/tools/dep/windows-desktop/lib/pkgconfig:${THIS_DIR}/tools/dep_gpl/windows-desktop/lib/pkgconfig:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=${THIS_DIR}/tools/dep/windows/${MACHINE/86_/}/lib/pkgconfig:${THIS_DIR}/tools/dep_gpl/windows/${MACHINE/86_/}/lib/pkgconfig:${THIS_DIR}/tools/dep/windows/lib/pkgconfig:${THIS_DIR}/tools/dep_gpl/windows/lib/pkgconfig:$PKG_CONFIG_PATH
EOF
# [ expr1 ] && ... at end returns error if expr1 is false
}
Expand Down Expand Up @@ -692,7 +692,7 @@ setup_vc_env() {
[ -n "$LIBPATH_arch" ] && echo "export LIBPATH=$LIBPATH_arch" >>"$BDIR/.env.sh"
[ -n "$INCLUDE_arch" ] && echo "export INCLUDE=$INCLUDE_arch" >>"$BDIR/.env.sh"
cat >> "$BDIR/.env.sh" <<EOF
export PKG_CONFIG_PATH=${THIS_DIR}/tools/dep/windows-desktop/lib/pkgconfig:${THIS_DIR}/tools/dep_gpl/windows-desktop/lib/pkgconfig:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=${THIS_DIR}/tools/dep/windows/lib/pkgconfig:${THIS_DIR}/tools/dep_gpl/windows/lib/pkgconfig:$PKG_CONFIG_PATH
EOF
}

Expand Down Expand Up @@ -1669,7 +1669,7 @@ build1(){
# patch config.sh used by pkgconfig_generate.sh. you can use this ffmpeg sdk like this: PKG_CONFIG_PATH=$ffmpeg_sdk_dir/lib/pkgconfig pkg-config --libs libavutil
cat >>$FFBUILD/config.sh <<'EOF'
prefix=\${pcfiledir}/../..
libdir=\${prefix}/lib
libdir=\${pcfiledir}/..
incdir=\${prefix}/include
EOF
[ -f .env.sh ] && . .env.sh
Expand Down Expand Up @@ -1849,6 +1849,7 @@ make_universal()
lipo -info $OUT_DIR/bin/$b
}
done
cp -avf ${dirs[0]}/lib/pkgconfig $OUT_DIR/lib/
for d in ${dirs[@]}; do
cat $d/config.txt >>$OUT_DIR/config.txt
done
Expand All @@ -1875,6 +1876,7 @@ make_universal()
cp -af $d/include $OUT_DIR
cp -af $d/bin/* $OUT_DIR/bin/$arch
cp -af $d/lib/* $OUT_DIR/lib/$arch
sed -i $sed_bak 's,^prefix=.*,prefix=\${pcfiledir}\/\.\.\/\.\.\/\.\.,' $OUT_DIR/lib/$arch/pkgconfig/*.pc
cat $d/config.txt >$OUT_DIR/config-$arch.txt
cat $d/config.log >$OUT_DIR/config-$arch.log
cp -af "$FFSRC/Changelog" $OUT_DIR
Expand Down

0 comments on commit 68b1ba0

Please sign in to comment.