aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/xinput-calibrator/xinput-calibrator-0.5.0/0001-switch-to-autotools-based-build-system.patch
blob: adec40314742445dff47d4f6fd628ed84661cf1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
From 1a85be450fba4585c64b3178316603a5ad7dd4e6 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Petr=20=C5=A0tetiar?= <ynezz@true.cz>
Date: Tue, 19 Jan 2010 18:59:52 +0100
Subject: [PATCH] switch to autotools based build system
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

This patch autotoolize xinput_calibrator for easier (cross)compiling.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
---
 Makefile     |   11 -----------
 Makefile.am  |   41 +++++++++++++++++++++++++++++++++++++++++
 autogen.sh   |   12 ++++++++++++
 configure.ac |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 102 insertions(+), 11 deletions(-)
 delete mode 100644 Makefile
 create mode 100644 Makefile.am
 create mode 100755 autogen.sh
 create mode 100644 configure.ac

diff --git a/Makefile b/Makefile
deleted file mode 100644
index c6eabed..0000000
--- a/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-all: x11 gtkmm
-
-x11: main_x11.cpp gui_x11.cpp
-	g++ -Wall main_x11.cpp -lX11 -lXi -o xinput_calibrator.x11
-	cp xinput_calibrator.x11 xinput_calibrator
-
-gtkmm: main_gtkmm.cpp gui_gtkmm.cpp
-	g++ -Wall main_gtkmm.cpp `pkg-config --cflags --libs gtkmm-2.4` -o xinput_calibrator.gtkmm
-
-clean:
-	rm -f xinput_calibrator xinput_calibrator.x11 xinput_calibrator.gtkmm
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..ef8f531
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,41 @@
+#
+# Copyright (c) 2010 Petr Stetiar <ynezz@true.cz>
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following
+# conditions:
+# 
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+#
+
+#AM_CFLAGS = -Wall -ansi -pedantic -W -Wmissing-prototypes -Wmissing-declarations -Werror -std=gnu99
+
+if BUILD_GTKMM
+bin_PROGRAMS = xinput_calibrator_x11 xinput_calibrator_gtkmm
+xinput_calibrator_gtkmm_SOURCES = main_gtkmm.cpp
+xinput_calibrator_gtkmm_CXXFLAGS = $(GTKMM_CFLAGS)
+xinput_calibrator_gtkmm_LDADD = $(GTKMM_LIBS)
+else
+bin_PROGRAMS = xinput_calibrator_x11
+endif
+
+xinput_calibrator_x11_LDADD = $(XORG_LIBS)
+xinput_calibrator_x11_CFLAGS = $(XORG_CFLAGS)
+xinput_calibrator_x11_SOURCES = main_x11.cpp
+
+EXTRA_DIST = autogen.sh
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..904cd67
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..13257b4
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,49 @@
+#
+# Copyright (c) 2010 Petr Stetiar <ynezz@true.cz>
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following
+# conditions:
+# 
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+#
+
+AC_PREREQ([2.57])
+AC_INIT(xinput_calibrator,[0.5.0], [http://github.com/tias/xinput_calibrator])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_INSTALL
+
+AC_ARG_ENABLE([gtkmm], AS_HELP_STRING([--enable-gtkmm], [Enable GTKMM GUI]))
+AS_IF([test "x$enable_gtkmm" = "xyes"], [
+	PKG_CHECK_MODULES(GTKMM, [gtkmm-2.4])
+	AC_SUBST(GTKMM_CFLAGS)
+	AC_SUBST(GTKMM_LIBS)
+])
+
+AM_CONDITIONAL([BUILD_GTKMM], [test "x$enable_gtkmm" = "xyes"])
+
+PKG_CHECK_MODULES(XORG, [x11 xi])
+AC_SUBST(XORG_CFLAGS)
+AC_SUBST(XORG_LIBS)
+
+AC_CONFIG_FILES(Makefile)
+AC_OUTPUT
-- 
1.6.0.4