Bug 103493

Summary: Cross-compile dbus for Windows fails on Mac OS since 1.11.22 (no -e option for echo)
Product: dbus Reporter: Tony Theodore <tonyt>
Component: coreAssignee: D-Bus Maintainers <dbus>
Status: RESOLVED FIXED QA Contact: D-Bus Maintainers <dbus>
Severity: normal    
Priority: medium Keywords: patch
Version: unspecified   
Hardware: Other   
OS: Mac OS X (All)   
Whiteboard: review+
i915 platform: i915 features:

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.