imitator_x 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/ext/extconf.rb ADDED
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env ruby
2
+ #Encoding: UTF-8
3
+ =begin
4
+ --
5
+ Imitator for X is a library allowing you to fake input to systems using X11.
6
+ Copyright © 2010 Marvin Gülker
7
+
8
+ This file is part of Imitator for X.
9
+
10
+ Imitator for X is free software: you can redistribute it and/or modify
11
+ it under the terms of the GNU Lesser General Public License as published by
12
+ the Free Software Foundation, either version 3 of the License, or
13
+ (at your option) any later version.
14
+
15
+ Imitator for X is distributed in the hope that it will be useful,
16
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
+ GNU Lesser General Public License for more details.
19
+
20
+ You should have received a copy of the GNU Lesser General Public License
21
+ along with Imitator for X. If not, see <http://www.gnu.org/licenses/>.
22
+ ++
23
+ =end
24
+ require "mkmf"
25
+
26
+ if ARGV.include?("-h") or ARGV.include?("--help")
27
+ help =<<HELP
28
+ Creates a makefile for building Imitator for X.
29
+ ==Requirements
30
+ You need the following libraries in order to compile successfully:
31
+ * X11 (X server)
32
+ * Xtst (XTest extension library, for sending input)
33
+ ==Switches
34
+ * --help\t-h\tDisplays this help.
35
+ * --with-X11-dir=DIR\tLook in DIR for the X server libs.
36
+ * --with-Xtst-dir=DIR\tLook in DIR for the XTest lib.
37
+
38
+ By default, the /usr/X11/lib, /usr/X11RC6/lib, /usr/openwin/lib and
39
+ /usr/local/lib directories are searched for the X and XTest libraries.
40
+ HELP
41
+ puts help
42
+ exit 1
43
+ end
44
+
45
+ dir_config("X11")
46
+ dir_config("XTst")
47
+
48
+ unless find_library("X11", "XOpenDisplay", "/usr/X11/lib", "/usr/X11RC6/lib", "/usr/openwin/lib", "/usr/local/lib")
49
+ abort("Couldn't find X Server library!")
50
+ end
51
+ unless find_library("Xtst", "XTestFakeInput", "/usr/X11/lib", "/usr/X11RC6/lib", "/usr/openwin/lib", "/usr/local/lib")
52
+ abort("Couldn't find XTest library!")
53
+ end
54
+
55
+ create_makefile("x")