Reorganize stlink-gui and update README, add building gui with Travis CI on linux

pull/410/head
Jerry Jacobs 2016-05-11 07:33:41 +02:00 zatwierdzone przez Jerry Jacobs
rodzic 1b447ae3ef
commit 742eba2cd6
9 zmienionych plików z 24 dodań i 19 usunięć

Wyświetl plik

@ -1,7 +1,7 @@
#!/bin/bash
if [ "$TRAVIS_OS_NAME" != "osx" ]; then
sudo apt-get update -qq || true
sudo apt-get install -qq -y --no-install-recommends libusb-1.0.0-dev
sudo apt-get install -qq -y --no-install-recommends libusb-1.0.0-dev libgtk-3-dev
else
brew install libusb
fi
@ -13,6 +13,10 @@ if [ "$BUILD_SYSTEM" == "cmake" ]; then
make
else
./autogen.sh
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
./configure
else
./configure --with-gtk-gui
fi
make
fi

Wyświetl plik

@ -97,8 +97,8 @@ endif()
if(gtk_FOUND)
include_directories(${gtk_INCLUDE_DIRS})
set(GUI_SOURCES gui/stlink-gui.c
gui/stlink-gui.h)
set(GUI_SOURCES src/tools/gui/stlink-gui.c
src/tools/gui/stlink-gui.h)
add_executable(stlink-gui-local ${GUI_SOURCES})
set_target_properties(stlink-gui-local PROPERTIES
@ -113,6 +113,6 @@ if(gtk_FOUND)
install(TARGETS stlink-gui
RUNTIME DESTINATION bin)
install(FILES gui/stlink-gui.ui
install(FILES src/tools/gui/stlink-gui.ui
DESTINATION ${INSTALLED_UI_DIR})
endif()

Wyświetl plik

@ -1,6 +1,6 @@
# Makefile.am -- Process this file with automake to produce Makefile.in
SUBDIRS = . $(MAYBE_GUI)
SUBDIRS = . $(STLINK_HAS_GUI)
AUTOMAKE_OPTIONS = subdir-objects

3
README
Wyświetl plik

@ -21,6 +21,7 @@ Two different transport layers are used:
* `pkg-config`
* `libusb-1.0` (plus development headers for building, on debian based distros `libusb-1.0.0-dev` package)
* (optional) for `stlink-gui` we need libgtk-3-dev
## For STLINKv1
@ -48,7 +49,7 @@ following steps will build the project for you.
```
$ ./autogen.sh
$ ./configure
$ ./configure --with-gtk-gui
$ make
```

Wyświetl plik

@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT([stlink],[0.5.6],[davem@devkitpro.org])
AC_INIT([stlink],[1.2.0],[davem@devkitpro.org])
AC_CONFIG_SRCDIR([src/common.c])
AC_CONFIG_LIBOBJ_DIR([src])
AM_INIT_AUTOMAKE([1.10])
@ -44,15 +44,15 @@ case "${host}" in
AM_CONDITIONAL(MINGW, false)
esac
MAYBE_GUI=
AC_ARG_WITH([gtk], AS_HELP_STRING([--with-gtk], [enable GTK+ gui]))
if test "x$with_gtk" = "xyes"; then
PKG_CHECK_MODULES([GTK], [gtk+-3.0])
STLINK_HAS_GUI=
AC_ARG_WITH([gtk_gui], AS_HELP_STRING([--with-gtk-gui], [enable GTK3+ gui]))
if test "x$with_gtk_gui" = "xyes"; then
PKG_CHECK_MODULES([GTK3], [gtk+-3.0])
PKG_CHECK_MODULES([GLIB], [glib-2.0 > 2.32.0])
MAYBE_GUI=gui
AC_CONFIG_FILES([gui/Makefile])
STLINK_HAS_GUI=src/tools/gui
AC_CONFIG_FILES([src/tools/gui/Makefile])
fi
AC_SUBST([MAYBE_GUI])
AC_SUBST([STLINK_HAS_GUI])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

Wyświetl plik

@ -5,10 +5,10 @@ stlink_gui_SOURCES = \
stlink-gui.h
stlink_gui_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/include \
$(AM_CPPFLAGS) \
-I$(top_srcdir)/src \
@GTK_CFLAGS@
@GTK3_CFLAGS@
stlink_gui_CFLAGS = \
$(WARN_CFLAGS) \
@ -21,7 +21,7 @@ stlink_gui_LDFLAGS = \
stlink_gui_LDADD = \
$(INTLLIBS) \
$(top_builddir)/libstlink.a \
@GTK_LIBS@
@GTK3_LIBS@
uidir = $(pkgdatadir)/ui
ui_DATA = stlink-gui.ui

Wyświetl plik

@ -3,7 +3,7 @@
#include <errno.h>
#include <gtk/gtk.h>
#include "stlink-common.h"
#include <stlink.h>
#include "stlink-gui.h"
#define MEM_READ_SIZE 1024