Patching configure.ac fails while building with vlc
Hi,
I am trying to compile vlc.js on Ubuntu 20.04 LTS, yet the compilation fails while trying to patch configure.ac. Unluckily I do not know how to fix the configure.ac, I would be grateful if someone helps me.
Compilation log
Building tools
You are ready to build VLC and its contribs
Setting the environment
Adding directories to PATH:
PATH += /home/compile/Source/vlc.js/emsdk
PATH += /home/compile/Source/vlc.js/emsdk/upstream/emscripten
PATH += /home/compile/Source/vlc.js/emsdk/node/14.15.5_64bit/bin
Setting environment variables:
PATH = /home/compile/Source/vlc.js/emsdk:/home/compile/Source/vlc.js/emsdk/upstream/emscripten:/home/compile/Source/vlc.js/emsdk/node/14.15.5_64bit/bin:/home/compile/Source/vlc.js/vlc/extras/tools/build/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
EMSDK = /home/compile/Source/vlc.js/emsdk
EM_CONFIG = /home/compile/Source/vlc.js/emsdk/.emscripten
EM_CACHE = /home/compile/Source/vlc.js/emsdk/upstream/emscripten/cache
EMSDK_NODE = /home/compile/Source/vlc.js/emsdk/node/14.15.5_64bit/bin/node
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Patching
Applying: contrib: add emscripten target
Using index info to reconstruct a base tree...
M contrib/bootstrap
M contrib/src/main.mak
Falling back to patching base and 3-way merge...
Auto-merging contrib/src/main.mak
Auto-merging contrib/bootstrap
No changes -- Patch already applied.
Applying: contrib: add ffmpeg configuration options for wasm-emscripten
Using index info to reconstruct a base tree...
M contrib/src/ffmpeg/rules.mak
.git/rebase-apply/patch:33: trailing whitespace.
.git/rebase-apply/patch:43: trailing whitespace.
--
.git/rebase-apply/patch:45: new blank line at EOF.
+
warning: 3 lines add whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging contrib/src/ffmpeg/rules.mak
No changes -- Patch already applied.
Applying: contrib: delete empty variable
Using index info to reconstruct a base tree...
M contrib/src/main.mak
Falling back to patching base and 3-way merge...
Auto-merging contrib/src/main.mak
No changes -- Patch already applied.
Applying: configure: Create a target for emscripten in the configure.ac
Using index info to reconstruct a base tree...
M configure.ac
Falling back to patching base and 3-way merge...
Auto-merging configure.ac
CONFLICT (content): Merge conflict in configure.ac
error: Failed to merge in the changes.
Patch failed at 0001 configure: Create a target for emscripten in the configure.ac
hint: Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
git am --show-current-patch inside vlc folder
rom 3468bd741f19ff68d1017c374fdec6955bb5454e Mon Sep 17 00:00:00 2001
From: Etienne Brateau <etienne.brateau@gmail.com>
Date: Thu, 6 Jul 2017 14:50:28 +0200
Subject: [PATCH 06/15] configure: Create a target for emscripten in the
configure.ac
---
configure.ac | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/configure.ac b/configure.ac
index 210b4ca537..c9d04253cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -322,6 +322,19 @@ case "${host_os}" in
AC_LIBOBJ([recvmsg])
AC_LIBOBJ([sendmsg])
;;
+ *emscripten*)
+ SYS=emscripten
+ CC=emcc
+ LD=emcc
+ LDSHARED=emcc
+ NM=llvm-nm
+ CPP=emcc
+ CXX=em++
+ AR=emar
+ RANLIB=emranlib
+ CFLAGS="${CFLAGS} -D__NEED_ssize_t -pthread"
+ CXXFLAGS="${CXXFLAGS}"
+ ;;
*)
SYS="${host_os}"
;;
@@ -388,6 +401,8 @@ AM_COND_IF([HAVE_X86ASM], [
AC_SUBST([X86ASMFLAGS])
AC_SUBST([X86ASMDEFS])
+AM_CONDITIONAL([HAVE_EMSCRIPTEN], [test "${SYS}" = "emscripten"])
+
dnl
dnl Sadly autoconf does not think about testing foo.exe when ask to test
dnl for program foo on win32
--
2.23.0
Contents of configure.ac
*nacl*)
SYS=nacl
AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
AC_LIBOBJ([sigwait])
AC_LIBOBJ([recvmsg])
AC_LIBOBJ([sendmsg])
;;
*emscripten*)
SYS=emscripten
<<<<<<< HEAD
AC_LIBOBJ([sigwait])
AC_LIBOBJ([clock_nanosleep])
=======
>>>>>>> configure: Create a target for emscripten in the configure.ac
CC=emcc
LD=emcc
LDSHARED=emcc
NM=llvm-nm
CPP=emcc
CXX=em++
AR=emar
RANLIB=emranlib
CFLAGS="${CFLAGS} -D__NEED_ssize_t -pthread"
CXXFLAGS="${CXXFLAGS}"
<<<<<<< HEAD
;;
=======
;;
>>>>>>> configure: Create a target for emscripten in the configure.ac
*)
SYS="${host_os}"
;;
esac
Edited by Federico Di Marco