summaryrefslogtreecommitdiffhomepage
path: root/mixgtk
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2008-03-17 01:12:35 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2008-03-17 01:12:35 +0100
commit974444c6417490ce9cb6bb35ecf1c64d9b446044 (patch)
tree484c6a248d052e201e622a5018709fcef2946040 /mixgtk
parent5f74041ed9f69a065b675f738e3ecbb0cea067ae (diff)
downloadmdk-974444c6417490ce9cb6bb35ecf1c64d9b446044.tar.gz
mdk-974444c6417490ce9cb6bb35ecf1c64d9b446044.tar.bz2
Properly set external commands, taking into account the host type
Diffstat (limited to 'mixgtk')
-rw-r--r--mixgtk/Makefile.am10
-rw-r--r--mixgtk/mixgtk_external.c8
2 files changed, 12 insertions, 6 deletions
diff --git a/mixgtk/Makefile.am b/mixgtk/Makefile.am
index 9fc5b49..ff69759 100644
--- a/mixgtk/Makefile.am
+++ b/mixgtk/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
-# Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2004, 2006, 2008 Free Software Foundation, Inc.
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
@@ -18,6 +18,12 @@ else
GUILED =
endif
+if DARWIN_SYSTEM
+EDITOR_CMD = "/usr/bin/open -a TextEdit %s"
+else
+EDITOR_CMD = "/usr/bin/xterm -e vi %s"
+endif
+
if MAKE_GUI
pkgdata_DATA = mixgtk.glade
@@ -25,6 +31,8 @@ pkgdata_DATA = mixgtk.glade
INCLUDES = -I$(includedir) -I$(top_srcdir) \
-DGLADE_FILE=\""$(pkgdatadir)/mixgtk.glade"\"\
-DLOCAL_GLADE_FILE=\""$(srcdir)/mixgtk.glade"\"\
+ -DDEFAULT_EDITOR_CMD=\"$(EDITOR_CMD)\"\
+ -DDEFAULT_ASM_CMD="\"$(bindir)/mixasm"\"\
$(GUILED)
LDADD = $(top_builddir)/mixlib/libmix.a $(top_builddir)/lib/libreplace.a\
$(top_builddir)/mixguile/libmixguile.a $(INTLLIBS)
diff --git a/mixgtk/mixgtk_external.c b/mixgtk/mixgtk_external.c
index 299382e..efe7f8d 100644
--- a/mixgtk/mixgtk_external.c
+++ b/mixgtk/mixgtk_external.c
@@ -1,7 +1,7 @@
/* -*-c-*- -------------- mixgtk_cmd_dispatcher.c :
* Implementation of the functions declared in mixgtk_external.h
* ------------------------------------------------------------------
- * Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+ * Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -44,8 +44,6 @@ static const gchar *ext_wdg_names_[] = {
static const gchar *EDITOR_KEY_ = "Editor";
static const gchar *MIXASM_KEY_ = "Mixasm";
-static const gchar *DEFAULT_EDITOR_CMD_ = "/usr/bin/xterm -e vi %s";
-static const gchar *DEFAULT_ASM_CMD_ = "/usr/bin/mixasm";
static mix_vm_cmd_dispatcher_t *dispatcher_;
@@ -139,7 +137,7 @@ read_config_ (void)
while (!edit && ENV[k]) edit = getenv (ENV[k++]);
if (edit) edit = g_strconcat (edit, " %s", NULL);
- else edit = g_strdup (DEFAULT_EDITOR_CMD_);
+ else edit = g_strdup (DEFAULT_EDITOR_CMD);
update_editor_ (edit);
@@ -150,7 +148,7 @@ read_config_ (void)
update_editor_ (editor);
}
- update_asm_ (assem? assem : DEFAULT_ASM_CMD_);
+ update_asm_ (assem? assem : DEFAULT_ASM_CMD);
}
void