Skip to content

Conversation

@toriningen
Copy link

@toriningen toriningen commented Dec 22, 2024

Fixes #2241

Signed-off-by: Alex Tori <toriningen.me@gmail.com>
@toriningen toriningen changed the title Enable install of .exe binaries in dtc package Enable install of .exe binaries in dtc package [WIP] Dec 22, 2024
@toriningen toriningen changed the title Enable install of .exe binaries in dtc package [WIP] Enable install of .exe binaries in dtc package Dec 22, 2024
@QBos07
Copy link
Contributor

QBos07 commented Dec 22, 2024

Maybe consider upstreaming this

+ for bin in $(BIN); do \
+ if [ -f "$$bin" ]; then \
+ $(INSTALL_PROGRAM) $$bin $(DESTDIR)$(BINDIR); \
+ elif [ -f "$$bin.exe" ]; then \
Copy link
Contributor

Choose a reason for hiding this comment

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

The way this is usually done would involve having a variable (e.g. EXEEXT) that is defined to nothing on Linux/BSD/etc and defined to .exe on msys/windows. Regardless see what you can land upstream first then ct-ng can carry a backport.

Copy link
Author

Choose a reason for hiding this comment

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

The way this is usually done would involve having a variable (e.g. EXEEXT) that is defined to nothing on Linux/BSD/etc and defined to .exe on msys/windows. Regardless see what you can land upstream first then ct-ng can carry a backport.

That's the route I wanted to go, but the challenge is that technically this is happening on Linux, we are cross-compiling for Windows, so uname won't match the extension.

I suppose it's configure's job to detect EXEEXT, but I can in theory do this in Makefile myself with something like this?

EXEEXT := $(shell echo | "$(CC)" -x c - '-###' -o foobar 2>&1 | \
	    sed -En '/-o foobar[^ ]*/s/.*-o foobar([^ ]*).*?/\1/p' | \
	    head -1)

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.

Installing dtc in Canadian MinGW build fails

3 participants