[gnome-builder] libide: Replace amd64 with x86_64 when constructing host system type
- From: Ting-Wei Lan <lantw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide: Replace amd64 with x86_64 when constructing host system type
- Date: Sat, 9 Jan 2016 13:47:12 +0000 (UTC)
commit 04b572c50639caf96fbdc6c79091d3ef3c05bd83
Author: Ting-Wei Lan <lantw src gnome org>
Date: Sat Jan 9 18:03:04 2016 +0800
libide: Replace amd64 with x86_64 when constructing host system type
FreeBSD uname returns amd64 instead of x86_64, which is not accepted
by autoconf config.sub without specifying the vendor.
https://bugzilla.gnome.org/show_bug.cgi?id=760334
libide/local/ide-local-device.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/libide/local/ide-local-device.c b/libide/local/ide-local-device.c
index 092b8c0..b80a22c 100644
--- a/libide/local/ide-local-device.c
+++ b/libide/local/ide-local-device.c
@@ -16,6 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <string.h>
#include <sys/utsname.h>
#include "ide-local-device.h"
@@ -32,6 +33,7 @@ static gchar *
get_system_type (void)
{
g_autofree gchar *os_lower = NULL;
+ const gchar *machine = NULL;
struct utsname u;
if (uname (&u) < 0)
@@ -39,6 +41,9 @@ get_system_type (void)
os_lower = g_utf8_strdown (u.sysname, -1);
+ /* config.sub doesn't accept amd64-OS */
+ machine = strcmp (u.machine, "amd64") ? u.machine : "x86_64";
+
/*
* TODO: Clearly we want to discover "gnu", but that should be just fine
* for a default until we try to actually run on something non-gnu.
@@ -48,9 +53,9 @@ get_system_type (void)
*/
#ifdef __GLIBC__
- return g_strdup_printf ("%s-%s-%s", u.machine, os_lower, "gnu");
+ return g_strdup_printf ("%s-%s-%s", machine, os_lower, "gnu");
#else
- return g_strdup_printf ("%s-%s", u.machine, os_lower);
+ return g_strdup_printf ("%s-%s", machine, os_lower);
#endif
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]