Microtelecom / libperseus-sdr

Perseus Software Defined Radio Control Library for Linux
http://microtelecom.it/perseus/
GNU Lesser General Public License v3.0
16 stars 7 forks source link

Line endings #2

Closed EdFuentetaja closed 9 years ago

EdFuentetaja commented 9 years ago

First of all, thanks for sharing this and congratulations for the excellent Perseus hardware and software.

I tried to compile this code on Fedora and I noticed that the ASCII files need to be converted first to the UNIX line ending format. You can use a tool like dos2unix,

amontefusco commented 9 years ago

I tried to compile this code on Fedora and I noticed that the ASCII files need to be converted first to the UNIX line ending format. You can use a tool like dos2unix,

Which error did you get ? I never noticed that.

amontefusco commented 9 years ago

You are right that the .c and .h files are ending (now always but often) with \r\n sequence instead of \n as usual in *nix. Probably this is why, in origin, Nico wrote them on Windows or using some Windows editor, and I too lately, did some editing directly on Windows. However, in my experience, no one of many Unix tools I use ever complained about that (just some cosmetic ^M on vi is barely visible). Again, let me know exactly which errors you had, otherwise I cannot help.

EdFuentetaja commented 9 years ago

The first error is when executing the bootstrap.sh script:

-bash: ./bootstrap.sh: /bin/sh^M: bad interpreter: No such file or directory

This is coming from the very first line in the file:

!/bin/sh

The ^M is the additional character for line ending on Windows. For some reason the distribution I'm using (actually CentOS 6.6, not Fedora), doesn't like it.

Applying dos2unix to the script files leads to the next error, more tricky:

libtoolize: AC_CONFIG_MACRO_DIR([build-aux]) conflicts with ACLOCAL_AMFLAGS=-I b.ild-aux autoreconf: libtoolize failed with exit status: 1

Here it says that it's related to the line ending on the Makefile.am file: http://pete.akeo.ie/2010/12/that-darn-libtoolize-acconfigmacrodirm4.html

Pete also suggest to configure a .gitattributes file. Please see:

https://help.github.com/articles/dealing-with-line-endings/

amontefusco commented 9 years ago

Did you try with:

git config --global core.autocrlf input

?

amontefusco commented 9 years ago

And/Or, try to add that .gitattributes (as per link you copied above) to your clone repository and let me know if it cures the issue.

I don't have at hand a CentOS 6.6 here, so I cannot test it.

EdFuentetaja commented 9 years ago

Aha. I had a global setting of autocrlf = true. This might be the default on CentOS. Changing it to "input" solves the issue, files come up clean of \r.

Thanks! Didn't occur to me to check this setting.