Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build for MSW #4

Closed
umlaeute opened this issue Nov 7, 2022 · 10 comments · Fixed by #5
Closed

build for MSW #4

umlaeute opened this issue Nov 7, 2022 · 10 comments · Fixed by #5

Comments

@umlaeute
Copy link
Contributor

umlaeute commented Nov 7, 2022

@Lucarda used to patch the flite-sources to allow for the windows builds.

now I have incorporated all of lucardas changes except for the bundled (and patched) libflite, I would like to investigate why the patch was needed in the first place (and if there's a fix that could be upstreamed)

@umlaeute umlaeute changed the title build for msvc build for MSW Nov 7, 2022
@Lucarda
Copy link
Collaborator

Lucarda commented Nov 7, 2022

IIRC __declspec(dllexport) needs to be out. if it is there the pd functions don't get exported in the dll and the object won't load.

@umlaeute
Copy link
Contributor Author

umlaeute commented Nov 8, 2022

i've submitted a fix for upstream: festvox/flite#84

@umlaeute
Copy link
Contributor Author

umlaeute commented Nov 8, 2022

@Lucarda: could you test whether my ugly hack in 9af1e16 allows you to build (and use) the external on Windows?

(it appears to be working when running a cross-compiled external under wine)

@Lucarda
Copy link
Collaborator

Lucarda commented Nov 8, 2022

yes it works here.

NOTE: i got:

<command-line>: warning: "__declspec" redefined
<built-in>: note: this is the location of the previous definition

on almost all .c files. every message stops compilation for 3 or 4 sec. But yeah, it works :)

@umlaeute
Copy link
Contributor Author

umlaeute commented Nov 8, 2022

cool that it works.
bad that it has such a performance penalty at compile-time.

the other option would be to just patch the upstream-sources on the fly (possibly as part of the build-process), by running the following cmd:

sed -e 's|\(#define GLOBALVARDEF\) __declspec(dllexport)|\1|' -i deps/flite/include/flite.h deps/flite/src/synth/flite.c

(we could just put that into a script in extra/ and mention it in the README)

what do you think?

@Lucarda
Copy link
Collaborator

Lucarda commented Nov 8, 2022

the other option would be to just patch the upstream-sources on the fly

the other day I had come to something similar Lucarda/pd-hidraw#2

I think the penalty is not so bad as the flite files are build just one time. If you edit the pd-flite.c all the .o files are ready and compiling is fast (from what I remember).

I think the hack is more simple but I leave this decision to you.

@Lucarda
Copy link
Collaborator

Lucarda commented Nov 8, 2022

I'm totally glad that flite comes back to its original repo here. It was in my plans but i did't want to bother.

I think once this is settled I'll delete my repo. Here is the best place. :)

@umlaeute
Copy link
Contributor Author

umlaeute commented Nov 9, 2022

i was going to suggest to make you maintainer of this here repo, so you can keep doing your good work :-)

@Lucarda
Copy link
Collaborator

Lucarda commented Nov 9, 2022

Good.

I don't have anything on the list for pd-flite but yes add me as maintainer.

@Lucarda
Copy link
Collaborator

Lucarda commented Jan 6, 2023

Reopening for myself:

When I find time I'll try this right before flite_setup:

#if defined(_WIN32)
__declspec(dllexport)
#else
__attribute__((visibility("default")))
#endif
void flite_setup(void) {

To avoid hack:

flite/Makefile

Line 27 in 85f47ba

w32_cflags += \

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 a pull request may close this issue.

2 participants