Search code examples
installationcygwinlibreoffice

Error in building LibreOffice while running ./autogen.sh in cygwin shell


I was following this link to build LibreOffice : https://blog.documentfoundation.org/blog/2019/07/09/start-developing-libreoffice-download-the-source-code-and-build-on-windows/

When I was on the 8th step, I ran ./autogen.sh in the Cygwin shell, it gave the following error :

$src_path must not contain spaces, but it is '$src_path'. (It is the 135th line in the code of autogen.sh)

To remove the error, I removed the spaces in the username which was present at this location - C:\cygwin64\home<username>. It somehow created two usernames inside home, one with spaces and without spaces. Anyways I continued further because all the required files were present in the username without spaces. I ran ./autogen.sh in the Cygwin shell after going to the right directory (i.e username without spaces) but then the following error came up : "cannot find al.exe as /al.exe" (It showed that error is in line 296 of autogen.sh)

I thought I did something wrong and tried to undo the things.

So I again introduced the spaces in the username and it merged the two usernames(It merged the username with spaces and without spaces).

Then I downloaded the raw file of ./autogen.sh from https://github.com/LibreOffice/core/blob/master/autogen.sh and commented out the 135th line which said "die "$src_path must not contain spaces, but it is '$src_path'." if ($src_path =~ / /)"

Then I again ran ./autogen.sh and it gave the following error :

./autogen.sh: line 1: $':\r': command not found
aclocal-1.16: error: non-option arguments are not accepted: 'Khare/libreoffice/m4'.
aclocal-1.16: Try '/usr/bin/aclocal-1.16 --help' for more information.
Failed to run aclocal at ./autogen.sh line 196.

I am stuck. Someone please help.


Solution

  • I removed spaces from Cygwin user name following this:

    Rename/change cygwin username

    And it solved the problem for me.