summaryrefslogtreecommitdiff
path: root/usbredirserver
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2011-11-23 14:23:54 +0100
committerHans de Goede <hdegoede@redhat.com>2011-11-25 18:22:53 +0100
commit2bcb9fc8cace35cb82226109192e40cf34369a0c (patch)
treed702451e55f03da66cdd8ea2325ecc9eb4781747 /usbredirserver
parentd25ff6c56673ca572d0b8fdbaf9d55534889689e (diff)
Switch to autotools build system
Replace the current build system with an autotools based one. HdG, 3 small changes: 1) LIBUSBREDIRPARSER_SO_VERSION 1:0:0 should be 0:0:0, so that the soname does not change by going from Makefiles to autofoo 2) Drop LIBGPOD_SO_VERSION from configure.ac 3) Make libusb pkgconfig check require version >= 1.0.9 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'usbredirserver')
-rw-r--r--usbredirserver/Makefile20
-rw-r--r--usbredirserver/Makefile.am8
-rw-r--r--usbredirserver/usbredirserver.c7
3 files changed, 13 insertions, 22 deletions
diff --git a/usbredirserver/Makefile b/usbredirserver/Makefile
deleted file mode 100644
index 889b839..0000000
--- a/usbredirserver/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-override CPPFLAGS += $(shell pkg-config --cflags libusb-1.0)
-LIBS = $(shell pkg-config --libs libusb-1.0)
-
-USBREDIRSERVER_OBJS = usbredirserver.o
-TARGETS = usbredirserver
-
-all: $(TARGETS)
-
--include *.d
-
-usbredirserver: $(USBREDIRSERVER_OBJS)
-# rpath-link so that usbredirparser (needed by usbredirhost) can be found
-# when building without having a previous version installed
- $(CC) $(LDFLAGS) -Wl,-rpath-link,../usbredirparser -o $@ $^ $(LIBS) -lusbredirhost
-
-install: all
- mkdir -p $(DESTDIR)$(SBINDIR)
- install -m 755 usbredirserver $(DESTDIR)$(SBINDIR)
-
-include ../Make.rules
diff --git a/usbredirserver/Makefile.am b/usbredirserver/Makefile.am
new file mode 100644
index 0000000..6d059f5
--- /dev/null
+++ b/usbredirserver/Makefile.am
@@ -0,0 +1,8 @@
+sbin_PROGRAMS = usbredirserver
+
+usbredirserver_SOURCES = usbredirserver.c
+usbredirserver_LDADD = $(LIBUSB_LIBS) \
+ $(top_builddir)/usbredirhost/libusbredirhost.la
+usbredirserver_CFLAGS = $(LIBUSB_CFLAGS) \
+ -I$(top_srcdir)/usbredirhost \
+ -I$(top_srcdir)/usbredirparser
diff --git a/usbredirserver/usbredirserver.c b/usbredirserver/usbredirserver.c
index 33fa231..5ba3e04 100644
--- a/usbredirserver/usbredirserver.c
+++ b/usbredirserver/usbredirserver.c
@@ -19,6 +19,8 @@
along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+#include "config.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
@@ -35,7 +37,8 @@
#include <netdb.h>
#include "usbredirhost.h"
-#define VERSION "usbredirserver " USBREDIR_VERSION
+
+#define SERVER_VERSION "usbredirserver " PACKAGE_VERSION
static int verbose = usbredirparser_info;
static int client_fd, running = 1;
@@ -350,7 +353,7 @@ int main(int argc, char *argv[])
host = usbredirhost_open(ctx, handle, usbredirserver_log,
usbredirserver_read, usbredirserver_write,
- NULL, VERSION, verbose, 0);
+ NULL, SERVER_VERSION, verbose, 0);
if (!host)
exit(1);
run_main_loop();