summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <teuf@gnome.org>2011-03-23 17:42:45 +0100
committerHans de Goede <hdegoede@redhat.com>2011-04-04 13:59:48 +0200
commit120cbb77fddaca117db1d4e900a1f225053a0497 (patch)
treeaa48882af9d228409ad30c0ecedbff40b48dc7d8
parenta85f799463c0141f025c7dba2ea0085d3ae8e582 (diff)
autotools: add autotools support
-rw-r--r--Makefile54
-rw-r--r--Makefile.am24
-rwxr-xr-xautogen.sh4
-rw-r--r--configure.ac22
4 files changed, 50 insertions, 54 deletions
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 3c5d8c9..0000000
--- a/Makefile
+++ /dev/null
@@ -1,54 +0,0 @@
-VERSION = 0.6.3
-
-DESTDIR ?=
-sbindir ?= /usr/sbin
-bindir ?= /usr/bin
-initdir ?= /etc/rc.d/init.d
-xdgautostartdir ?= /etc/xdg/autostart
-gdmautostartdir ?= /usr/share/gdm/autostart/LoginWindow
-socketdir ?= /var/run/spice-vdagentd
-logdir ?= /var/log/spice-vdagentd
-
-CFLAGS ?= -O2 -g -Wall
-CPPFLAGS = $(shell pkg-config --cflags spice-protocol)
-CPPFLAGS += $(shell pkg-config --cflags dbus-1)
-CPPFLAGS += -D_GNU_SOURCE
-
-TARGETS := spice-vdagentd spice-vdagent
-
-build: $(TARGETS)
-
-install: build
- install -d $(DESTDIR)$(bindir)
- install -d $(DESTDIR)$(sbindir)
- install -d $(DESTDIR)$(socketdir)
- install -d $(DESTDIR)$(logdir)
- install -p -m 755 spice-vdagent $(DESTDIR)$(bindir)
- install -p -m 755 spice-vdagentd $(DESTDIR)$(sbindir)
- install -d $(DESTDIR)$(initdir)
- install -p -m 755 spice-vdagentd.sh $(DESTDIR)$(initdir)/spice-vdagentd
- install -d $(DESTDIR)$(xdgautostartdir)
- install -d $(DESTDIR)$(gdmautostartdir)
- desktop-file-install --dir=$(DESTDIR)$(xdgautostartdir) \
- spice-vdagent.desktop
- desktop-file-install --dir=$(DESTDIR)$(gdmautostartdir) \
- spice-vdagent.desktop
-
-clean:
- rm -f $(TARGETS) *.o *~
-
-spice-vdagentd: vdagentd.o vdagentd-uinput.o udscs.o vdagent-virtio-port.o console-kit.o
- $(CC) -o $@ $^ $(shell pkg-config --libs dbus-1)
-
-spice-vdagent: vdagent.o vdagent-x11.o udscs.o
- $(CC) -o $@ $^ -lX11 -lXrandr -lXfixes
-
-tag:
- @git tag -a -m "Tag as spice-vdagent-$(VERSION)" spice-vdagent-$(VERSION)
- @echo "Tagged as spice-vdagent-$(VERSION)"
-
-archive-no-tag:
- @git archive --format=tar --prefix=spice-vdagent-$(VERSION)/ spice-vdagent-$(VERSION) > spice-vdagent-$(VERSION).tar
- @bzip2 -f spice-vdagent-$(VERSION).tar
-
-archive: clean tag archive-no-tag
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..634db79
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,24 @@
+ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
+
+bin_PROGRAMS = spice-vdagent
+sbin_PROGRAMS = spice-vdagentd
+
+spice_vdagent_CFLAGS = $(X_CFLAGS) $(SPICE_CFLAGS)
+spice_vdagent_LDADD = $(X_LIBS) $(SPICE_LIBS)
+spice_vdagent_SOURCES = src/vdagent.c src/vdagent-x11.c src/udscs.c
+
+spice_vdagentd_CFLAGS = $(DBUS_CFLAGS) $(SPICE_CFLAGS)
+spice_vdagentd_LDADD = $(DBUS_LIBS) $(SPICE_LIBS)
+spice_vdagentd_SOURCES = vdagentd.c \
+ vdagentd-uinput.c \
+ vdagent-virtio-port.c \
+ console-kit.c \
+ udscs.c
+
+noinst_HEADERS = console-kit.h \
+ vdagentd-proto-strings.h \
+ vdagent-x11.h \
+ udscs.h \
+ vdagentd-uinput.h \
+ vdagentd-proto.h \
+ vdagent-virtio-port.h
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..52083e5
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+autoreconf -fi
+./configure $@
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..300fbcb
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,22 @@
+AC_PREREQ(2.65)
+AC_INIT([vd-agent], [0.6.3])
+AC_CONFIG_SRCDIR([configure.ac])
+
+AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip subdir-objects])
+m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
+
+AC_PROG_CC
+AC_HEADER_STDC
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_DEFINE(_GNU_SOURCE)
+
+PKG_PROG_PKG_CONFIG
+PKG_CHECK_MODULES(X, [xfixes xrandr x11])
+PKG_CHECK_MODULES(DBUS, [dbus-1])
+PKG_CHECK_MODULES(SPICE, [spice-protocol])
+
+AC_CONFIG_FILES([
+Makefile
+])
+AC_OUTPUT