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

mc.exe could be windmc.exe #1276

Open
Kreijstal opened this issue Dec 30, 2024 · 5 comments · May be fixed by #1279
Open

mc.exe could be windmc.exe #1276

Kreijstal opened this issue Dec 30, 2024 · 5 comments · May be fixed by #1279

Comments

@Kreijstal
Copy link

mc_prog = find_program('mc.exe')

When compiling with mingw from linux or from msys2, mingw provides windmc.exe not mc.exe, maybe look for it to accept non MSVC toolchains?

@kiplingw
Copy link
Member

Thanks @Kreijstal. @dgreatwood handles our recent Windows port. He is a very brave man to have successfully pursued that undertaking. I'm sure he'll look into this.

@Kreijstal
Copy link
Author

Thanks @Kreijstal. @dgreatwood handles our recent Windows port. He is a very brave man to have successfully pursued that undertaking. I'm sure he'll look into this.

Thank you


Just a comment:

The syntax is a bit different.

FAILED: src/pist_winlog.rc src/pist_winlog.h
"E:\msys64\ucrt64\bin/windmc.exe" "-um" "-h" "src" "-r" "src" "../src/winlog/pist_winlog.man"
Usage: E:\msys64\ucrt64\bin/windmc.exe [option(s)] [input-file]
 The options are:
  -a --ascii_in                Read input file as ASCII file
  -A --ascii_out               Write binary messages as ASCII
  -b --binprefix               .bin filename is prefixed by .mc filename_ for uniqueness.
  -c --customflag              Set custom flags for messages
  -C --codepage_in=<val>       Set codepage when reading mc text file
  -d --decimal_values          Print values to text files decimal
  -e --extension=<extension>   Set header extension used on export header file
  -F --target <target>         Specify output target for endianness.
  -h --headerdir=<directory>   Set the export directory for headers
  -u --unicode_in              Read input file as UTF16 file
  -U --unicode_out             Write binary messages as UFT16
  -m --maxlength=<val>         Set the maximal allowed message length
  -n --nullterminate           Automatic add a zero termination to strings
  -o --hresult_use             Use HRESULT definition instead of status code definition
  -O --codepage_out=<val>      Set codepage used for writing text file
  -r --rcdir=<directory>       Set the export directory for rc files
  -x --xdbg=<directory>        Where to create the .dbg C include file
                               that maps message ID's to their symbolic name.
  -H --help                    Print this help message
  -v --verbose                 Verbose - tells you what it's doing
  -V --version                 Print version information

@kiplingw
Copy link
Member

Thank you. If you'd like to propose a PR, it will speed things up. @dgreatwood and I will review. Otherwise it might take a while for @dgreatwood to fix it.

@dgreatwood
Copy link
Collaborator

Thanks @Kreijstal for pointing that out. I will have a look at this when I get the chance.

If you would like to try a PR, as you may already have seen the file src/meson.build is the one that causes mc.exe to be invoked. To deal with mc.exe vs. windmc.exe, you can see how it deals with the similar case of rc.exe vs. windres.exe. Plus deal with syntax adjustments as you said.

There might also need to be an update to gccsetup.ps1 to install windmc.exe and place it on the path if it is not installed by default along with gccsetup.ps1's existing gcc install.

Or if not I'll look at this eventually myself.

Thanks again!

@dgreatwood
Copy link
Collaborator

Hi @Kreijstal,

I took a quick look at this. Currently mc.exe supports both "manifest" files (XML format) and "message test files", whereas, as far as I can make out windmc.exe supports solely "message text files".

The two file formats are quite different, e.g.

Sure enough, when I feed Pistache's logging manifest file, pist_winlog.man, into windmc.exe, it throws an error on the first line.

Unless you know of some other way to deal with the manifest file, I think we're stuck using mc.exe for now.

Also of note - mc.exe supports the command line "-um" option, which means "Generate User Mode logging macros". I don't see an equivalent option on windmc.exe; not surprising since I presume this would be a logging-manifest-specific option.

LMK any additional thoughts...
Thanks.

@Kreijstal Kreijstal linked a pull request Jan 8, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants