Solved Building Kodi on Windows: "make: command not found"
#1
I've cloned the Leia branch and I think I've followed the Windows build guide to a tee but I can't seem to build FFmpeg.

Upon executing make-mingwlibs.bat, I get the following errors:
Code:

-------------------------------------------------------------------------------
 compiling mingw libs x64

 NOPROMPT  = 0
 MAKECLEAN = clean
 WORKSPACE =

-------------------------------------------------------------------------------
-------------------------------------------------
 building FFmpeg x64
-------------------------------------------------
ffmpeg (x64) .................................................... [Removing]
Applying patch /xbmc/tools/buildsteps/windows/patches/0001-ffmpeg-detect-openssl.patch
/usr/bin/patch: **** Can't create temporary file /tmp/ppQhFgze : Permission denied
Applying patch /xbmc/tools/buildsteps/windows/patches/0002-ffmpeg-zlib-config-conflict.patch
/usr/bin/patch: **** Can't create temporary file /tmp/ppQRBOfd : Permission denied
Applying patch /xbmc/tools/buildsteps/windows/patches/0003-ffmpeg-static.patch
/usr/bin/patch: **** Can't create temporary file /tmp/ppx4903c : Permission denied
ffmpeg-4.0.4-Leia-18.4 (x64) ................................. [Configuring]
./buildffmpeg.sh: line 123: /build/src/ffmpeg-6b98091152/configure: No such file or directory
ffmpeg-4.0.4-Leia-18.4 (x64) ................................... [Compiling]
./buildhelpers.sh: line 47: make: command not found
./buildhelpers.sh: line 48: make: command not found
ffmpeg-4.0.4-Leia-18.4 (x64) ....................................... [Error]
failed to compile /xbmc/project/BuildDependencies/mingwlibs/x64/lib/avcodec.lib

I saw that download-msys2.bat installed gcc, etc. so I'd have thought it would install build tools like make as well.
I figured I'd ask here to see if I did something wrong before hunting down how to install make.

Thanks in advance.
Reply
#2
the correct build howto for leia is https://github.com/xbmc/xbmc/blob/Leia/d...Windows.md
Reply
#3
Oh jeez... Thanks  Blush
Reply
#4
The issue occurred after following the Leia instructions as well (they weren't much different up to the point I was stuck). 
This time I noticed that the shell script invoked by download-msys2.bat had errors acquiring some packages and, as a result, aborted the entire operation (which explains why make was missing even though it is installed as part of that script). Running download-msys2.bat again solved the issue.

Note for anyone reading this in the future, cmd did not indicate any errors in the process so the mintty window needs to be watched closely, especially since its closes right after it finishes (whether it succeeds or fails).
Reply
#5
FWIW my attempts at compiling kodi Win x64 on a Win 10 / VS system has always failed due to unable to build ffmpeg; have never figured it out.

scott s.
.
Reply
#6
(2021-02-12, 22:49)scott967 Wrote: FWIW my attempts at compiling kodi Win x64 on a Win 10 / VS system has always failed due to unable to build ffmpeg; have never figured it out.

scott s.
.

I was ultimately able to build FFmpeg and Kodi. Do you recall the issue you encountered?
Reply
#7
I am having this exact same error. The first two scripts seem to go smoothly, but I can't build ffmpeg, and thus the BuildSetup.bat fails as well.
Reply
#8
(2021-03-23, 05:20)drinfernoo Wrote: I am having this exact same error. The first two scripts seem to go smoothly, but I can't build ffmpeg, and thus the BuildSetup.bat fails as well.

What happens when building FFmpeg? Do you get a specific error message?
Reply
#9
What I remember is first I got an error about unpacking the ffmpeg sources (something about an illegal command switch option), then it couldn't apply the patches and the script stopped at that point.  Rerunning the script did nothing.  I don't know how to get rid of the partial build and start over without blowing away my entire local xbmc repo.

scott s.
.
Reply
#10
(2021-03-23, 18:44)bejhan Wrote:
(2021-03-23, 05:20)drinfernoo Wrote: I am having this exact same error. The first two scripts seem to go smoothly, but I can't build ffmpeg, and thus the BuildSetup.bat fails as well.

What happens when building FFmpeg? Do you get a specific error message?

Looks to be almost exactly the same thing that was happening to OP:
Code:
-------------------------------------------------------------------------------
 compiling mingw libs win32

 NOPROMPT  = 0
 MAKECLEAN = clean
 WORKSPACE =

-------------------------------------------------------------------------------
-------------------------------------------------
 building FFmpeg win32
-------------------------------------------------
Applying patch /xbmc/tools/buildsteps/windows/patches/0001-ffmpeg-detect-openssl.patch
./buildhelpers.sh: line 131: patch: command not found
Applying patch /xbmc/tools/buildsteps/windows/patches/0002-ffmpeg-zlib-config-conflict.patch
./buildhelpers.sh: line 131: patch: command not found
Applying patch /xbmc/tools/buildsteps/windows/patches/0003-ffmpeg-static.patch
./buildhelpers.sh: line 131: patch: command not found
Applying patch /xbmc/tools/buildsteps/windows/patches/0005-ffmpeg-detect-dav1d.patch
./buildhelpers.sh: line 131: patch: command not found
ffmpeg-4.3.1-Matrix-Beta1 (win32) ............................ [Configuring]
./buildffmpeg.sh: line 123: /build/src/ffmpeg-3136f41e6d/configure: No such file or directory
ffmpeg-4.3.1-Matrix-Beta1 (win32) .............................. [Compiling]
./buildhelpers.sh: line 47: make: command not found
./buildhelpers.sh: line 48: make: command not found
ffmpeg-4.3.1-Matrix-Beta1 (win32) .................................. [Error]
failed to compile /xbmc/project/BuildDependencies/mingwlibs/win32/lib/avcodec.lib
Reply
#11
Sounds like your PATH isnt setup right. patch.exe is available via Git for windows at C:\Program Files\Git\usr\bin, or wherever you installed Git too.

Check your PATH env var (command prompt echo %PATH%), and if the Git location isnt in there, add it.

As an example, a VM windows dev instance i have returns the following

cpp:

C:\Users\user>echo %PATH%
C:\Program Files (x86)\Parallels\Parallels Tools\Applications;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\CMake\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\dotnet\;C:\Program Files (x86)\IncrediBuild;C:\Users\brent\AppData\Local\Microsoft\WindowsApps;
Reply
#12
Ok, well I've gotten as far as `make-mingwlibs.bat` asking me which patches to apply... is this normal?
Code:

-------------------------------------------------------------------------------
 compiling mingw libs win32

 NOPROMPT  = 0
 MAKECLEAN = clean
 WORKSPACE =

-------------------------------------------------------------------------------
-------------------------------------------------
 building FFmpeg win32
-------------------------------------------------
Applying patch /xbmc/tools/buildsteps/windows/patches/0001-ffmpeg-detect-openssl.patch
(Stripping trailing CRs from patch; use --binary to disable.)
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/configure b/configure
|index 8569a60bf8..42f5a3ada4 100755
|--- a/configure
|+++ b/configure
--------------------------
File to patch:

And which options am I supposed to choose?
Reply
#13
(2021-03-26, 22:50)drinfernoo Wrote: Ok, well I've gotten as far as `make-mingwlibs.bat` asking me which patches to apply... is this normal?
Code:

-------------------------------------------------------------------------------
 compiling mingw libs win32

 NOPROMPT  = 0
 MAKECLEAN = clean
 WORKSPACE =

-------------------------------------------------------------------------------
-------------------------------------------------
 building FFmpeg win32
-------------------------------------------------
Applying patch /xbmc/tools/buildsteps/windows/patches/0001-ffmpeg-detect-openssl.patch
(Stripping trailing CRs from patch; use --binary to disable.)
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/configure b/configure
|index 8569a60bf8..42f5a3ada4 100755
|--- a/configure
|+++ b/configure
--------------------------
File to patch:

And which options am I supposed to choose?

If you read my previous posts, you'll recall that my problem was due to download-msys2.bat failing to complete successfully, with the solution being simply running it again until it was successful.
I seem to recall I ran into this patch situation when I'd run make-mingwlibs.bat after download-msys2.bat had failed, with it persisting even after I'd re-run download-msys2.bat to success.
I believe blowing away the kodi-build directory and starting from scratch solved it for me.
Reply
#14
(2021-03-26, 23:06)bejhan Wrote:
(2021-03-26, 22:50)drinfernoo Wrote: Ok, well I've gotten as far as `make-mingwlibs.bat` asking me which patches to apply... is this normal?
Code:

-------------------------------------------------------------------------------
 compiling mingw libs win32

 NOPROMPT  = 0
 MAKECLEAN = clean
 WORKSPACE =

-------------------------------------------------------------------------------
-------------------------------------------------
 building FFmpeg win32
-------------------------------------------------
Applying patch /xbmc/tools/buildsteps/windows/patches/0001-ffmpeg-detect-openssl.patch
(Stripping trailing CRs from patch; use --binary to disable.)
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/configure b/configure
|index 8569a60bf8..42f5a3ada4 100755
|--- a/configure
|+++ b/configure
--------------------------
File to patch:

And which options am I supposed to choose?

If you read my previous posts, you'll recall that my problem was due to download-msys2.bat failing to complete successfully, with the solution being simply running it again until it was successful.
I seem to recall I ran into this patch situation when I'd run make-mingwlibs.bat after download-msys2.bat had failed, with it persisting even after I'd re-run download-msys2.bat to success.
I believe blowing away the kodi-build directory and starting from scratch solved it for me.
I'll attempt it again, but in this instance, download-msys2.bat did appear to complete successfully, so I'm really not sure what's failing...
Reply

Logout Mark Read Team Forum Stats Members Help
Building Kodi on Windows: "make: command not found"0