LibreOffice build problem in ubuntu 13.10

This is what I did in order:

  1. Download dependencies using
    sudo apt-get build-dep libreoffice
    sudo apt-get install libgnome-vfsmm-2.6-dev

  2. downloaded the source code git clone from the core folder
    git clone git://

  3. change directory to that folder and then ./
    Here is where the error occurs

./ line 1: $’:\r’: command not found
’ ‘–srcdir=/home/kediamanav/Desktop/libreoffice’ ‘–enable-option-checking=fatal’
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type:

  • Running LibreOffice build configuration.

configure: error: cannot run /bin/bash ./config.sub
Error running configure at ./ line 209.

Please help me with this