Potential problem in Makefile for libdivecomputer

Dirk Hohndel dirk at hohndel.org
Fri Mar 1 16:13:11 PST 2013


Pablo Wolter <pwolter at gmail.com> writes:

> I think I found an issue with the manual installation of the libdivecomputer in Mac 10.8.
>
> I got this during the make:
>
> Pablos-MacBook-Pro:subsurface pwolter$ PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"
> Pablos-MacBook-Pro:subsurface pwolter$ echo $PKG_CONFIG_PATH
> /usr/local/lib/pkgconfig/
> Pablos-MacBook-Pro:subsurface pwolter$ make
> updating version.h to 3.0.1-37-g36422d2f9ee1
> Package libdivecomputer was not found in the pkg-config search path.
> Perhaps you should add the directory containing `libdivecomputer.pc'
> to the PKG_CONFIG_PATH environment variable
> No package 'libdivecomputer' found
>     CC main.c
> Package libdivecomputer was not found in the pkg-config search path.
> Perhaps you should add the directory containing `libdivecomputer.pc'
> to the PKG_CONFIG_PATH environment variable
> No package 'libdivecomputer' found
[...]
>
> I checked the Makefile and found this:
>
[...]
> else ifeq ($(UNAME), darwin)
[...]
>
> If you do a "uname" in Mac the name of the Os is Darwin … not darwin … so I changed it to capitol D and it did run make without any issue:

Yes - but look earlier in the Makefile. We don't run "uname" - we run
gcc -dumpmachine

Now it is of course possible that gcc changes in 10.8 (need to reboot
this system in order to find out - maybe later), but for 10.6 and 10.7
and the respective versions of Xcode / gcc it certainly is 'darwin'.

Now one could argue that we should just ignore case :-)
The fact that your fix works (I can tell - macos.c is being compiled)
seems to indicate that this may be the way to go... just out of
curiosity, could you send the output of gcc -dumpmachine ?

> Pablos-MacBook-Pro:subsurface pwolter$ make
>     CC profile.c
>     CC info.c
[...]
>     CC gps.c
>     CC macos.c
>
> Sorry I don't know how to fix the Makefile and submit it but the OS check has to be case insensitive or changed to capitol D in case in Mac the output of the uname command capitalize the first letter all the time.

git diff

shows you what you changed

once you are happy with this do

git commit -s -a

this creates a commit with a correct Signed-off-by: line

git format-patch HEAD^

creates a patch against the previous version (in a file named
0001-<commit subject>.patch

Send that to the mailing list :-)

/D


More information about the subsurface mailing list