1

It seems like my compiler is not adapted to the syntax on the file config.guess and it keeps getting errors. The URL from which I downloaded the source is llvm project or more specifically problematic source file, svn command svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm

\r seems to mean new line

I also had problems with some blank lines, then just commenting them solved it but that issue on line 71 persisted. It seems like on the line there is a positional parameter not being compiled: $1

/home/computador/gsrc/independent/llvm/cmake/config.guess: linha 71: erro de sintaxe próximo ao token inesperado $'in\r'' /home/computador/gsrc/independent/llvm/cmake/config.guess: linha 71: case $1 'n CMake Error at cmake/modules/GetHostTriple.cmake:27 (message): Failed to execute /home/computador/gsrc/independent/llvm/cmake/config.guess Call Stack (most recent call first): cmake/config-ix.cmake:380 (get_host_triple) CMakeLists.txt:611 (include)

-- Configuring incomplete, errors occurred! See also "/home/computador/gsrc/independent/llvm_build/build/CMakeFiles/CMakeOutput.log". See also "/home/computador/gsrc/independent/llvm_build/build/CMakeFiles/CMakeError.log".

The block I am having problems with:

while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
   echo "$timestamp" ; exit ;;
--version | -v )
   echo "$version" ; exit ;;
--help | --h* | -h )
   echo "$usage"; exit ;;
-- )     # Stop option processing
   shift; break ;;
- ) # Use stdin as input.
   break ;;
-* )
   echo "$me: invalid option $1$help" >&2
   exit 1 ;;
* )
   break ;;
esac
done

How can I edit this code so that I can compile it on my machine? my cmake generator is unix makefiles

2 Answers2

6

I had the same problem, and it turns out it was because of some DOS line endings in the config.guess file.

I resolved it by replacing them with unix line endings:

dos2unix path/to/config.guess
ChrisG
  • 161
0

getting the code from git resolved the issue, they have the last revisions there, actually they say that downloading from svn is deprecated on getting started documentation. Also I followed the instructions on installing clang and made the build folder inside the source one. Now it is compilling without error. I got informations from an unofficial page but did not knew about the migration they were doing to git