Skip to content

Enable build of ch32fun and minichlink on FreeBSD#790

Open
adventureloop wants to merge 2 commits intocnlohr:masterfrom
adventureloop:freebsd-port
Open

Enable build of ch32fun and minichlink on FreeBSD#790
adventureloop wants to merge 2 commits intocnlohr:masterfrom
adventureloop:freebsd-port

Conversation

@adventureloop
Copy link

No description provided.

ifneq ($(shell $(WHICH) riscv64-unknown-elf-gcc 2>$(NULLDEV)),)
PREFIX_DEFAULT:=riscv64-unknown-elf
else ifneq ($(shell $(WHICH) riscv32-unknown-elf-gcc 2>$(NULLDEV)),)
PREFIX_DEFAULT:=riscv32-unknown-elf
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to have another fallback


clangd :
make clean
$(MAKE) clean
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put a MAKE?=make earlier? so on old Windows Make versions it still works?


minichlink : $(C_S) $(H_S) Makefile
gcc -o $@ $(C_S) $(LDFLAGS) $(CFLAGS) $(INCS)
cc -o $@ $(C_S) $(LDFLAGS) $(CFLAGS) $(INCS)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may not work on some Windows crossdev systems.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad, I will add platform detection

{
fprintf( stderr, "Found WCH Link\n" );
}
#ifndef __FreeBSD__
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please try to add support for these. Disabling functionality on specific platforms should only be done as a later "I give up"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

esp32 and b0003 need "hidapi_thread_pthread.h" which isn't provided by the port (package basically) right now. The header doesn't seem to be in the public hidapi interface, I'm not sure if other platforms package this with their hidapi package, I need to get a debian machine to check.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what you are referring to. hidapi.c/.h is provided alongside minichlink. They contain all of hidapi on all supported platforms.

@adventureloop
Copy link
Author

Ah ha, I got it by updating hidapi in minichlink and pulling in the missing header.

I'll create a different review for that, do you know if a hidapi update is safe?

@cnlohr
Copy link
Owner

cnlohr commented Nov 27, 2025

Ah ha, I got it by updating hidapi in minichlink and pulling in the missing header.

I'll create a different review for that, do you know if a hidapi update is safe?

There should be no additional header. the provided hidapi.h/.c are fully merged for all platforms.

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.

2 participants