-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.ac
124 lines (108 loc) · 3.27 KB
/
configure.ac
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
# Copyright 2016 James Geboski <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_INIT(
[libg710p],
[0.1.0],
[https://github.com/jgeboski/libg710p/issues],
[libg710p],
[https://github.com/jgeboski/libg710p],
[]
)
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([no-define])
AC_PROG_CC
AM_PROG_CC_C_O
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
m4_ifdef([AC_PROG_CC_C99], [AC_PROG_CC_C99])
# Define PKG_CHECK_VAR() for pkg-config < 0.28
m4_define_default(
[PKG_CHECK_VAR],
[AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])
AS_IF([test -z "$$1"], [$1=`$PKG_CONFIG --variable="$3" "$2"`])
AS_IF([test -n "$$1"], [$4], [$5])]
)
AC_ARG_ENABLE(
[tools],
[AS_HELP_STRING(
[--enable-tools],
[Enable the building and installing of sample tools]
)],
[ENABLE_TOOLS="$enableval"],
[ENABLE_TOOLS="no"]
)
AC_ARG_ENABLE(
[pulseaudio-tool],
[AS_HELP_STRING(
[--enable-pulseaudio-tool],
[Enable the building and installing of the PulseAudio tool]
)],
[ENABLE_PULSEAUDIO_TOOL="$enableval"],
[ENABLE_PULSEAUDIO_TOOL="no"]
)
AC_ARG_ENABLE(
[warnings],
[AS_HELP_STRING(
[--enable-warnings],
[Enable additional compile-time (GCC) warnings]
)],
[ENABLE_WARNINGS="$enableval"],
[ENABLE_WARNINGS="no"]
)
AC_ARG_WITH(
[udev-dir],
[AS_HELP_STRING(
[--with-udev-dir],
[Path of the base udev directory. If 'no', udev files are disabled.]
)],
[UDEV_DIR="$withval"],
[UDEV_DIR="\$(prefix)/lib/udev"]
)
AS_IF(
[test "x$ENABLE_PULSEAUDIO_TOOL" == "xyes"],
[PKG_CHECK_MODULES([LIBPULSE], [libpulse])
AC_CHECK_HEADER([argp.h], [], [AC_MSG_ERROR([argp.h missing.])])
AC_CHECK_FUNCS([argp_parse], [], [AC_MSG_ERROR([argp_parse() missing.])])]
)
AS_IF(
[test "x$ENABLE_WARNINGS" == "xyes"],
[CFLAGS="$CFLAGS -Wall -Wextra \
-Waggregate-return \
-Wdeclaration-after-statement \
-Wfloat-equal \
-Wformat \
-Winit-self \
-Wmissing-declarations \
-Wmissing-prototypes \
-Wno-unused-parameter \
-Wpointer-arith"]
)
AC_SUBST([UDEV_DIR])
AM_CONDITIONAL([ENABLE_TOOLS], [test "x$ENABLE_TOOLS" == "xyes"])
AM_CONDITIONAL([ENABLE_PULSEAUDIO_TOOL], [test "x$ENABLE_PULSEAUDIO_TOOL" == "xyes"])
AM_CONDITIONAL([WITH_UDEV_DIR], [test "x$UDEV_DIR" != "xno"])
PKG_CHECK_MODULES([HIDAPI_HIDRAW], [hidapi-hidraw])
PKG_CHECK_MODULES([HIDAPI_LIBUSB], [hidapi-libusb])
AC_CONFIG_FILES([
Makefile
data/Makefile
libg710p/libg710p-hidraw.pc
libg710p/libg710p-libusb.pc
libg710p/Makefile
tools/Makefile
])
AC_OUTPUT