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

Generate configure-macros #1051

Closed
wants to merge 1 commit into from
Closed

Generate configure-macros #1051

wants to merge 1 commit into from

Conversation

kddnewton
Copy link
Collaborator

@kddnewton kddnewton commented Jun 22, 2023

Fixes #1041

We now use a configure-macros.in file that generates a configure-macros text file containing the definitions generated by autotools. On my machine that means:

-DPACKAGE_NAME=\"YARP\" -DPACKAGE_TARNAME=\"yarp\" -DPACKAGE_VERSION=\"0.4.0\" -DPACKAGE_STRING=\"YARP\ 0.4.0\" -DPACKAGE_BUGREPORT=\"https://github.com/ruby/yarp/issues/new\" -DPACKAGE_URL=\"https://github.com/ruby/yarp\" -DYP_VERSION_MAJOR=0 -DYP_VERSION_MINOR=4 -DYP_VERSION_PATCH=0 -D_XOPEN_SOURCE=700 -DHAVE_MMAP=1 -DHAVE_STRNCASECMP=1

You can get this by running autoconf && ./configure.

This PR also centralizes some stuff around versioning. For example we now reference PACKAGE_VERSION to try to minimize the places we're stating the version numbers.

@kddnewton kddnewton force-pushed the confdefs branch 3 times, most recently from 31cfb58 to 469691c Compare June 22, 2023 19:42
@kddnewton kddnewton changed the title Copy over confdefs.h into the build directory Generate configure-macros Jun 22, 2023
@kddnewton kddnewton force-pushed the confdefs branch 3 times, most recently from 6a6dea5 to b24ac65 Compare June 22, 2023 21:07
@eregon
Copy link
Member

eregon commented Jun 23, 2023

I'll take a look next week how we can use this in TruffleRuby's build process.

@eregon
Copy link
Member

eregon commented Jun 26, 2023

This is turning out to be quite difficult from a quick look.
Currently, TruffleRuby only imports include/ and src/ (and java/): https://github.com/oracle/truffleruby/blob/master/tool/import-yarp.sh
And mx generates a ninja file to compile everything, and also compile the yarp_bindings.c JNI file all as one .so.

But the autotools stuff is at the root, so it won't be copied and there is no way to run in the TruffleRuby repo while only importing those. We could import more, but it starts to feel more brittle. We could import the whole repo, but that seems a lot of stuff not needed.
I suppose we could import configure* or so, and hope that doesn't need other files.

@eregon
Copy link
Member

eregon commented Jun 28, 2023

Generating a header seems nicer and more consistent, I tried that in #1088

@eregon
Copy link
Member

eregon commented Jun 29, 2023

#1088 works so I'll close this.
TruffleRuby can now use YARP's Makefile, use the static library, and then creates a dynamic library with the JNI bindings + librubyparser.a: oracle/truffleruby#3140

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.

Figure out how to set the HAVE_ macros when using YARP in JRuby & TruffleRuby
2 participants