Bug 103493 - Cross-compile dbus for Windows fails on Mac OS since 1.11.22 (no -e option for echo)
Summary: Cross-compile dbus for Windows fails on Mac OS since 1.11.22 (no -e option fo...
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: Other Mac OS X (All)
: medium normal
Assignee: D-Bus Maintainers
QA Contact: D-Bus Maintainers
URL:
Whiteboard: review+
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-10-28 01:36 UTC by Tony Theodore
Modified: 2017-10-31 13:12 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Tony Theodore 2017-10-28 01:36:28 UTC
Commit: https://cgit.freedesktop.org/dbus/dbus/commit/tools/Makefile.am?id=214fbc6dbfa3547e8cf250c1dd41f1990d98e823

introduced `echo -e` which isn't an option for `echo` on darwin. The below fixes it:


diff --git a/tools/Makefile.in b/tools/Makefile.in
index 1111111..2222222 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -1090,7 +1090,7 @@ uninstall-am: uninstall-binPROGRAMS uninstall-dist_examplesSCRIPTS
 @DBUS_WIN_TRUE@	$(RC) $< -o $@
 
 @DBUS_WIN_TRUE@disable-uac.rc: Win32.Manifest
-@DBUS_WIN_TRUE@	echo -e "1 24 \"$<\"" > $@
+@DBUS_WIN_TRUE@	echo '1 24 "$<"' > $@
 
 # create the /var/lib/dbus directory for dbus-uuidgen
 install-data-local:
Comment 1 Simon McVittie 2017-10-31 13:12:59 UTC
(In reply to Tony Theodore from comment #0)
> -@DBUS_WIN_TRUE@	echo -e "1 24 \"$<\"" > $@
> +@DBUS_WIN_TRUE@	echo '1 24 "$<"' > $@

You're patching a generated file here. In all Autotools build systems, instead of patching Makefile.in, please patch its real source code (Makefile.am) and re-run automake.

The corresponding change to Makefile.am looks fine and obviously correct, so I've converted and applied it. Fixed in git for 1.12.2 and 1.13.0. Thanks!

For any future patches it would be great if you could commit your changes to a git clone of dbus and attach a patch as produced by the "git format-patch" command, so that it can have proper attribution with your preferred name (or pseudonym) and email address. (This would also avoid accidentally patching generated files, because a clean checkout of dbus.git doesn't contain generated files, and even after doing a build .gitignore should ignore most or hopefully all of them.)

I think you're the first person I've heard of doing cross-compilation for Windows on macOS. If you are also able to help with macOS-native (built on macOS for macOS) uses of dbus, please see <https://bugs.freedesktop.org/show_bug.cgi?id=103521#c3>.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.