Skip to content

Conversation

robmusial
Copy link

Hey Daniel,

Sorry for another/different pull request, I closed the last one. I was using multiple .git environments on my different test machines and it was creating noisy commits with old contact info stored in different scripts. Also, I wanted to update some added new distros to README.

(from the previous pull request, the last line is different now...)
Where we left off I was able to get mbpfan to compile under clang by
adding the missing return to the function in minunit.c. Our next goal
was to clean up the Makefile so you didn't have to edit it to use a
different compiler, and also clean it up since it was using a C++
compiler when all the code is C.

I think I figured out why it was using a C++ compiler. First the old C
standard didn't support boolean data types. The new standard does
but you have to include stdbool.h. So that was added to the
appropriate .c files. Second, C needs an explicit type def, and daemon.c
did not have that, so the appropriate structs were added.

Finally the Windows NT stuff was removed from the Makefile, and I have
updated my personal information.

The Makefile still needs work before it is pretty, but it works in GCC and Clang compilers. It is tested and working on the previously used distros of Debian 8, Ubuntu 16.04 and 16.10, Fedora 25 and CentOS 7.3.

!NEW! distros added/tested Trisquel 7 (trisquel.info) and Alpine Linux 3.5.2 (alpinelinux.org). This was built using Alpine Linux's musl C library.

Robert Musial and others added 21 commits March 19, 2017 13:43
	modified:   AUTHORS
Updated personal info.

	modified:   Makefile
Beginning work to clean up Makefile. The original makefile appeared
to be checking if the system was Windows NT. Since this is for GNU/
Linux, that was removed. Also all of the code is C, but the
Makefile was calling the C++ compiler to hide bool issues and
missing typedefs (which C++ is ok with but C is not).

	modified:   src/daemon.c
Added structs, added stdbool.h

	modified:   src/main.c
Added stdbool.h

	modified:   src/mbpfan.c
Added stdbool.h

	modified:   src/minunit.c
Added stdbool.h
	modified:   README.md
Changed instructions for how to use Clang. It is much easier
since the Makefile now just uses the system's compiler, and
correctly uses C instead of C++
@robmusial
Copy link
Author

I did some more Makefile cleanup today, and tested on Clang 4.0 along with using the new LLVM linker lld.

@dgraziotin dgraziotin merged commit 32256bc into linux-on-mac:master Apr 2, 2017
@dgraziotin
Copy link
Collaborator

I'm terribly slow, but I get the job done :-) thank you again for the PR, much appreciated. I reverted to the old legacy kernel detection because I want to test it a little bit.

@dgraziotin dgraziotin mentioned this pull request Apr 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants