-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
83 lines (73 loc) · 2.64 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
AC_PREREQ([2.60])
AC_INIT([tinynotify-send], [1.1])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.6 foreign dist-bzip2 no-dependencies -Wall])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
AC_PROG_CC
AM_PROG_CC_C_O
AC_USE_SYSTEM_EXTENSIONS
LT_INIT([disable-static])
GTK_DOC_CHECK([1.15])
PKG_CHECK_MODULES([LIBTINYNOTIFY], [libtinynotify])
CPPFLAGS="$CPPFLAGS $LIBTINYNOTIFY_CFLAGS"
LIBS="$LIBS $LIBTINYNOTIFY_LIBS"
AC_ARG_ENABLE([library],
[AS_HELP_STRING([--disable-library],
[Disable building libnotify-cli library (use if one is installed already)])])
AS_IF([test x"$enable_library" != x"no"], [
AC_CHECK_FUNCS([getopt],, [
AC_MSG_ERROR([One of the required library functions was not found])
])
AC_CHECK_FUNCS([getopt_long])
], [
PKG_CHECK_MODULES([LIBTINYNOTIFY_CLI], [libtinynotify-cli = $VERSION])
CPPFLAGS="$CPPFLAGS $LIBTINYNOTIFY_CLI_CFLAGS"
LIBS="$LIBS $LIBTINYNOTIFY_CLI_LIBS"
])
AM_CONDITIONAL([ENABLE_LIBRARY], [test x"$enable_library" != x"no"])
AC_ARG_ENABLE([regular],
[AS_HELP_STRING([--disable-regular],
[Disable building regular tinynotify-send])])
AM_CONDITIONAL([ENABLE_REGULAR], [test x"$enable_regular" != x"no"])
AC_ARG_ENABLE([system-wide],
[AS_HELP_STRING([--disable-system-wide],
[Disable building system-wide tinynotify-send (sw-notify-send)])])
AS_IF([test x"$enable_system_wide" != x"no"], [
PKG_CHECK_MODULES([LIBTINYNOTIFY_SYSTEMWIDE], [libtinynotify-systemwide],, [
AC_MSG_WARN([libtinynotify-systemwide not found, disabling system-wide])
enable_system_wide=no
])
])
AM_CONDITIONAL([ENABLE_SYSTEMWIDE], [test x"$enable_system_wide" != x"no"])
AS_IF([test x"$enable_regular-$enable_system_wide" != x"no-no"], [
AC_PROG_SED
AC_FUNC_FORK
])
AS_IF([test x"$enable_regular" != x"no"], [
AC_ARG_WITH([system-wide-exec],
[AS_HELP_STRING([--with-system-wide-exec],
[Enable executing system-wide instance from regular if available (can specify a path)])])
AS_IF([test x"$with_system_wide_exec" = x""], [
AS_IF([test x"$enable_system_wide" != x"no"], [
with_system_wide_exec=yes
], [
with_system_wide_exec=no
])
])
AS_IF([test x"$with_system_wide_exec" != x"no"], [
AC_CHECK_FUNC([execvp],, [
AC_MSG_WARN([execvp() not supported, disabling --with-system-wide-exec])
with_system_wide_exec=no
])
])
AS_IF([test x"$with_system_wide_exec" != x"no"], [
AS_IF([test x"$with_system_wide_exec" = x"yes"], [
with_system_wide_exec=sw-notify-send
])
AC_DEFINE_UNQUOTED([SYSTEMWIDE_EXEC], ["$with_system_wide_exec"], [Define to the path to sw-notify-send if regular should try to exec it])
])
])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_FILES([Makefile libtinynotify-cli.pc])
AC_OUTPUT