Skip to content

Commit

Permalink
x264: Rework configure command
Browse files Browse the repository at this point in the history
Quoting $extra_flags doesn't work. The tailing space is taken into account as part of the option.
```
Building project x264 (git/bfc87b7a330f75f5c9a21e56081e4b20344f139e)
Unknown option --enable-debug , ignored
```

See the space between --enable-debug and the comma. It is not supposed
to be there:
https://code.videolan.org/videolan/x264/-/blob/bfc87b7a330f75f5c9a21e56081e4b20344f139e/configure#L550

Patch inspired by FFmpeg build script:
499ad4a
0947abe
  • Loading branch information
AlessandroBono authored and pbor committed Aug 21, 2023
1 parent b47bfd1 commit 76f419e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions gvsbuild/patches/x264/build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
prefix="$1"
build_type="$2"

extra_flags=""
extra_cflags="-DNO_PREFIX"
declare -a configure_cmd
declare -i idx=0

configure_cmd[idx++]="./configure"
configure_cmd[idx++]="--prefix=\"$prefix\""
configure_cmd[idx++]="--enable-shared"
configure_cmd[idx++]="--extra-cflags=-DNO_PREFIX"

if [ "$build_type" = "debug" ]; then
extra_flags="--enable-debug $extra_flags"
extra_cflags="-MDd -Od -Zi $extra_cflags"
configure_cmd[idx++]="--enable-debug"
configure_cmd[idx++]="--extra-cflags=-MDd -Od -Zi"
fi

CC=cl ./configure --enable-shared --prefix="$prefix" "$extra_flags" --extra-cflags="$extra_cflags"
CC=cl "${configure_cmd[@]}"

make
make install

0 comments on commit 76f419e

Please sign in to comment.