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

windows: add .rc support to autotools builds #9521

Closed
wants to merge 2 commits into from

Conversation

vszakats
Copy link
Member

@vszakats vszakats commented Sep 16, 2022

After this update autotools builds will compile and link .rc resources
to Windows executables. Bringing this feature on par with CMake
and Makefile.m32 builds. And also making it unnecessary to improvise
these steps manually, while monkey patching build files, e.g. [0].

You can customize the resource compiler via the RC envvar, and its
options via RCFLAGS.

This harmless warning may appear throughout the build, even though the
autotools manual documents [1] RC as a valid tag:
libtool: error: ignoring unknown tag RC

[0] https://github.com/curl/curl-for-win/blob/535f19060d4b708f72e75dd849409ce50baa1b84/curl-autotools.sh#L376-L382
[1] https://www.gnu.org/software/libtool/manual/html_node/Tags.html

Closes #9521

@vszakats vszakats added build Windows Windows-specific labels Sep 16, 2022
@vszakats vszakats marked this pull request as draft Sep 16, 2022
@vszakats vszakats changed the title windows: add .rc support to autotools builds [WIP] windows: add .rc support to autotools builds Sep 16, 2022
@vszakats
Copy link
Member Author

vszakats commented Sep 16, 2022

There is a warning libtool: error: ignoring unknown tag RC. Seems harmless. Reason undiscovered.

@vszakats vszakats changed the title [WIP] windows: add .rc support to autotools builds windows: add .rc support to autotools builds Sep 16, 2022
@vszakats vszakats marked this pull request as ready for review Sep 17, 2022
@vszakats
Copy link
Member Author

vszakats commented Sep 18, 2022

CI seems fine now, with two unrelated (flaky?) single-test failures @ AppVeyor, and curl/check (@ Zuul) failing, which does fail with mostly all commits these days.

@vszakats
Copy link
Member Author

vszakats commented Sep 18, 2022

FWIW, tried removing --tag=RC to avoid the nonsense libtool warning error: ignoring unknown tag RC, which resulted in this:

libtool: compile: unable to infer tagged configuration
libtool:   error: specify a tag with '--tag'

¯\(ツ)

@vszakats vszakats closed this in 6de7322 Sep 18, 2022
@vszakats vszakats deleted the am-rc branch Sep 18, 2022
@monnerat
Copy link
Contributor

monnerat commented Sep 23, 2022

A side effect of this commit is new warning messages from autoreconf -fi:

configure.ac:125: warning: AC_PROG_CC was called before XC_CHECK_PROG_CC
m4/xc-cc-check.m4:86: XC_CHECK_PROG_CC is expanded from...
configure.ac:125: the top level
configure.ac:352: warning: LT_LANG was called before LT_INIT
/usr/share/aclocal/libtool.m4:61: LT_INIT is expanded from...
m4/xc-lt-iface.m4:442: XC_LIBTOOL is expanded from...
configure.ac:352: the top level
configure.ac:125: warning: AC_PROG_CC was called before XC_CHECK_PROG_CC
m4/xc-cc-check.m4:86: XC_CHECK_PROG_CC is expanded from...
configure.ac:125: the top level
configure.ac:352: warning: LT_LANG was called before LT_INIT
/usr/share/aclocal/libtool.m4:61: LT_INIT is expanded from...
m4/xc-lt-iface.m4:442: XC_LIBTOOL is expanded from...
configure.ac:352: the top level
configure.ac:125: warning: AC_PROG_CC was called before XC_CHECK_PROG_CC
m4/xc-cc-check.m4:86: XC_CHECK_PROG_CC is expanded from...
configure.ac:125: the top level
configure.ac:352: warning: LT_LANG was called before LT_INIT
aclocal.m4:83: LT_INIT is expanded from...
m4/xc-lt-iface.m4:442: XC_LIBTOOL is expanded from...
configure.ac:352: the top level

I tried locally to move the LT_LANG([Windows Resource]) after the XC_LIBTOOL and it does suppress the warnings. However I am not sure it doesn't break your commit. Can you investigate? Thanks.

@vszakats
Copy link
Member Author

vszakats commented Sep 23, 2022

@monnerat: Great find! This also fixes the odd warning noted here earlier, and in my tests the .rc files continue to compile and link fine.

Do you want to commit the fix?

[ Strangely, I'm not getting those autoreconf -fi warnings on my system. ]

@monnerat
Copy link
Contributor

monnerat commented Sep 23, 2022

Do you want to commit the fix?

No, I let you care of your baby !

Strangely, I'm not getting those autoreconf -fi warnings on my system.

libtool or autotools version dependent ? OS dependent ? who knows !

vszakats added a commit to vszakats/curl that referenced this issue Sep 23, 2022
Follow up to 6de7322
Ref: curl#9521 (comment)

Suggested-by: Patrick Monnerat
Closes #xxxx
vszakats added a commit to vszakats/curl that referenced this issue Sep 23, 2022
- Fix warnings when running `autoreconf -fi`.
- Fix warning when compiling .rc files:
  ```
  libtool: compile: unable to infer tagged configuration
  libtool:   error: specify a tag with '--tag'
  ```

Follow up to 6de7322
Ref: curl#9521 (comment)

Suggested-by: Patrick Monnerat
Closes #xxxx
vszakats added a commit to vszakats/curl that referenced this issue Sep 23, 2022
Move `LT_LANG([Windows Resource])` after `XC_LIBTOOL`. This fixes:

- Warnings when running `autoreconf -fi`.

- Warning when compiling .rc files:
  libtool: compile: unable to infer tagged configuration
  libtool:   error: specify a tag with '--tag'

Follow up to 6de7322
Ref: curl#9521 (comment)

Suggested-by: Patrick Monnerat
Closes #xxxx
vszakats added a commit to vszakats/curl that referenced this issue Sep 23, 2022
Move `LT_LANG([Windows Resource])` after `XC_LIBTOOL`, fixing:

- Warnings when running `autoreconf -fi`.

- Warning when compiling .rc files:
  libtool: compile: unable to infer tagged configuration
  libtool:   error: specify a tag with '--tag'

Follow up to 6de7322
Ref: curl#9521 (comment)

Suggested-by: Patrick Monnerat
Closes #xxxx
@vszakats
Copy link
Member Author

vszakats commented Sep 23, 2022

Sure, I've opened a PR.

libtool or autotools version dependent ? OS dependent ? who knows !

The perfect motto for autotools :) (to be fair: for build systems in general)

vszakats added a commit that referenced this issue Sep 23, 2022
Move `LT_LANG([Windows Resource])` after `XC_LIBTOOL`, fixing:

- Warnings when running `autoreconf -fi`.

- Warning when compiling .rc files:
  libtool: compile: unable to infer tagged configuration
  libtool:   error: specify a tag with '--tag'

Follow up to 6de7322
Ref: #9521 (comment)

Suggested-by: Patrick Monnerat
Closes #9582
@monnerat
Copy link
Contributor

monnerat commented Sep 23, 2022

Thanks for fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Windows Windows-specific
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants