mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Merge branch 'forlinus' of git://git.hohndel.org/subsurface
* 'forlinus' of git://git.hohndel.org/subsurface: Improve Makefile for MacOS Add reasonable default device names for divecomputer import More intuitive label for "not saving" when exiting
This commit is contained in:
commit
b0759feef8
6 changed files with 28 additions and 11 deletions
18
Makefile
18
Makefile
|
@ -25,11 +25,10 @@ DESKTOPFILE = $(NAME).desktop
|
||||||
MANFILES = $(NAME).1
|
MANFILES = $(NAME).1
|
||||||
XSLTFILES = xslt/*.xslt
|
XSLTFILES = xslt/*.xslt
|
||||||
|
|
||||||
MACOSXINSTALL = /Applications/Subsurface.app
|
UNAME := $(shell $(CC) -dumpmachine 2>&1 | grep -E -o "linux|darwin|win")
|
||||||
MACOSXFILES = packaging/macosx
|
|
||||||
|
|
||||||
# find libdivecomputer
|
# find libdivecomputer
|
||||||
# First deal with the cross compile environment.
|
# First deal with the cross compile environment and with Mac.
|
||||||
# For the native case, Linus doesn't want to trust pkg-config given
|
# For the native case, Linus doesn't want to trust pkg-config given
|
||||||
# how young libdivecomputer still is - so we check the typical
|
# how young libdivecomputer still is - so we check the typical
|
||||||
# subdirectories of /usr/local and /usr and then we give up. You can
|
# subdirectories of /usr/local and /usr and then we give up. You can
|
||||||
|
@ -37,13 +36,14 @@ MACOSXFILES = packaging/macosx
|
||||||
#
|
#
|
||||||
ifeq ($(CC), i686-w64-mingw32-gcc)
|
ifeq ($(CC), i686-w64-mingw32-gcc)
|
||||||
# ok, we are cross building for Windows
|
# ok, we are cross building for Windows
|
||||||
LIBDIVECOMPUTERDIR = /usr/i686-w64-mingw32/sys-root/mingw/include/libdivecomputer
|
|
||||||
LIBDIVECOMPUTERINCLUDES = `$(PKGCONFIG) --cflags libdivecomputer`
|
LIBDIVECOMPUTERINCLUDES = `$(PKGCONFIG) --cflags libdivecomputer`
|
||||||
LIBDIVECOMPUTERARCHIVE = `$(PKGCONFIG) --libs libdivecomputer`
|
LIBDIVECOMPUTERARCHIVE = `$(PKGCONFIG) --libs libdivecomputer`
|
||||||
RESFILE = packaging/windows/subsurface.res
|
RESFILE = packaging/windows/subsurface.res
|
||||||
LDFLAGS += -Wl,-subsystem,windows
|
LDFLAGS += -Wl,-subsystem,windows
|
||||||
|
else ifeq ($(UNAME), darwin)
|
||||||
|
LIBDIVECOMPUTERINCLUDES = `$(PKGCONFIG) --cflags libdivecomputer`
|
||||||
|
LIBDIVECOMPUTERARCHIVE = `$(PKGCONFIG) --libs libdivecomputer`
|
||||||
else
|
else
|
||||||
|
|
||||||
libdc-local := $(wildcard /usr/local/lib/libdivecomputer.a)
|
libdc-local := $(wildcard /usr/local/lib/libdivecomputer.a)
|
||||||
libdc-local64 := $(wildcard /usr/local/lib64/libdivecomputer.a)
|
libdc-local64 := $(wildcard /usr/local/lib64/libdivecomputer.a)
|
||||||
libdc-usr := $(wildcard /usr/lib/libdivecomputer.a)
|
libdc-usr := $(wildcard /usr/lib/libdivecomputer.a)
|
||||||
|
@ -87,9 +87,6 @@ GLIB2CFLAGS = $(shell $(PKGCONFIG) --cflags glib-2.0)
|
||||||
GTK2CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-2.0)
|
GTK2CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-2.0)
|
||||||
CFLAGS += $(shell $(XSLCONFIG) --cflags)
|
CFLAGS += $(shell $(XSLCONFIG) --cflags)
|
||||||
|
|
||||||
UNAME := $(shell $(CC) -dumpmachine 2>&1 | grep -E -o "linux|darwin|win")
|
|
||||||
|
|
||||||
|
|
||||||
ifeq ($(UNAME), linux)
|
ifeq ($(UNAME), linux)
|
||||||
LIBGCONF2 = $(shell $(PKGCONFIG) --libs gconf-2.0)
|
LIBGCONF2 = $(shell $(PKGCONFIG) --libs gconf-2.0)
|
||||||
GCONF2CFLAGS = $(shell $(PKGCONFIG) --cflags gconf-2.0)
|
GCONF2CFLAGS = $(shell $(PKGCONFIG) --cflags gconf-2.0)
|
||||||
|
@ -98,6 +95,9 @@ ifeq ($(UNAME), linux)
|
||||||
else ifeq ($(UNAME), darwin)
|
else ifeq ($(UNAME), darwin)
|
||||||
OSSUPPORT = macos
|
OSSUPPORT = macos
|
||||||
OSSUPPORT_CFLAGS = $(GTK2CFLAGS)
|
OSSUPPORT_CFLAGS = $(GTK2CFLAGS)
|
||||||
|
MACOSXINSTALL = /Applications/Subsurface.app
|
||||||
|
MACOSXFILES = packaging/macosx
|
||||||
|
EXTRALIBS = -framework CoreFoundation
|
||||||
else
|
else
|
||||||
OSSUPPORT = windows
|
OSSUPPORT = windows
|
||||||
OSSUPPORT_CFLAGS = $(GTK2CFLAGS)
|
OSSUPPORT_CFLAGS = $(GTK2CFLAGS)
|
||||||
|
@ -110,7 +110,7 @@ ifneq ($(strip $(LIBXSLT)),)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LIBS = $(LIBXML2) $(LIBXSLT) $(LIBGTK) $(LIBGCONF2) $(LIBDIVECOMPUTER) -lpthread
|
LIBS = $(LIBXML2) $(LIBXSLT) $(LIBGTK) $(LIBGCONF2) $(LIBDIVECOMPUTER) $(EXTRALIBS) -lpthread
|
||||||
|
|
||||||
OBJS = main.o dive.o profile.o info.o equipment.o divelist.o \
|
OBJS = main.o dive.o profile.o info.o equipment.o divelist.o \
|
||||||
parse-xml.o save-xml.o libdivecomputer.o print.o uemis.o \
|
parse-xml.o save-xml.o libdivecomputer.o print.o uemis.o \
|
||||||
|
|
|
@ -32,6 +32,8 @@ extern void subsurface_set_conf(char *name, pref_type_t type, const void *value)
|
||||||
extern const void *subsurface_get_conf(char *name, pref_type_t type);
|
extern const void *subsurface_get_conf(char *name, pref_type_t type);
|
||||||
extern void subsurface_close_conf(void);
|
extern void subsurface_close_conf(void);
|
||||||
|
|
||||||
|
extern const char *subsurface_USB_name(void);
|
||||||
|
|
||||||
extern visible_cols_t visible_cols;
|
extern visible_cols_t visible_cols;
|
||||||
|
|
||||||
extern const char *divelist_font;
|
extern const char *divelist_font;
|
||||||
|
|
|
@ -162,7 +162,7 @@ static void ask_save_changes()
|
||||||
dialog = gtk_dialog_new_with_buttons("Save Changes?",
|
dialog = gtk_dialog_new_with_buttons("Save Changes?",
|
||||||
GTK_WINDOW(main_window), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
|
GTK_WINDOW(main_window), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||||
GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
|
GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
|
||||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
GTK_STOCK_NO, GTK_RESPONSE_NO,
|
||||||
NULL);
|
NULL);
|
||||||
content = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
|
content = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
|
||||||
label = gtk_label_new ("You have unsaved changes\nWould you like to save those before exiting the program?");
|
label = gtk_label_new ("You have unsaved changes\nWould you like to save those before exiting the program?");
|
||||||
|
@ -913,7 +913,7 @@ static GtkEntry *dive_computer_device(GtkWidget *vbox)
|
||||||
|
|
||||||
entry = gtk_entry_new();
|
entry = gtk_entry_new();
|
||||||
gtk_container_add(GTK_CONTAINER(frame), entry);
|
gtk_container_add(GTK_CONTAINER(frame), entry);
|
||||||
gtk_entry_set_text(GTK_ENTRY(entry), "/dev/ttyUSB0");
|
gtk_entry_set_text(GTK_ENTRY(entry), subsurface_USB_name());
|
||||||
|
|
||||||
return GTK_ENTRY(entry);
|
return GTK_ENTRY(entry);
|
||||||
}
|
}
|
||||||
|
|
5
linux.c
5
linux.c
|
@ -46,3 +46,8 @@ void subsurface_close_conf(void)
|
||||||
{
|
{
|
||||||
/* this is a no-op */
|
/* this is a no-op */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *subsurface_USB_name()
|
||||||
|
{
|
||||||
|
return("/dev/ttyUSB0");
|
||||||
|
}
|
||||||
|
|
5
macos.c
5
macos.c
|
@ -89,3 +89,8 @@ void subsurface_close_conf(void)
|
||||||
CFRelease(xmlData);
|
CFRelease(xmlData);
|
||||||
CFRelease(propertyList);
|
CFRelease(propertyList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *subsurface_USB_name()
|
||||||
|
{
|
||||||
|
return("/dev/tty.SLAB_USBtoUART");
|
||||||
|
}
|
||||||
|
|
|
@ -78,3 +78,8 @@ void subsurface_close_conf(void)
|
||||||
printf("RegFlushKey failed \n");
|
printf("RegFlushKey failed \n");
|
||||||
RegCloseKey(hkey);
|
RegCloseKey(hkey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *subsurface_USB_name()
|
||||||
|
{
|
||||||
|
return("COM3");
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue