File: configure.ac

package info (click to toggle)
gnome-user-share 3.18.3-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,724 kB
  • ctags: 259
  • sloc: sh: 4,094; ansic: 769; makefile: 117
file content (200 lines) | stat: -rw-r--r-- 5,626 bytes parent folder | download
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
AC_INIT([gnome-user-share],
        [3.18.3],
        [http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-user-share],
        [gnome-user-share])

AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])

AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz tar-ustar check-news])

# Enable silent build when available (Automake 1.11)
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

AM_SANITY_CHECK
AM_MAINTAINER_MODE([enable])

GNOME_DEBUG_CHECK
GNOME_COMPILE_WARNINGS([maximum])

# Check for programs
AC_C_CONST
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PATH_XTRA
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)

# Initialize libtool
LT_INIT([disable-static])

AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_UID_T

# Documentation
YELP_HELP_INIT

AC_ARG_WITH([httpd],
	    [AS_HELP_STRING([--with-httpd],[Specify the binary used for the Apache httpd binary (default: httpd)])],
	    [HTTPD=$withval])
if test -z "$HTTPD" ; then
	AC_PATH_PROG([HTTPD], [httpd],,
		     [$PATH:/usr/sbin])
	if test -z "$HTTPD" ; then
		# As used in SUSE
		AC_PATH_PROG([HTTPD], [apache2],,
			     [$PATH:/usr/sbin])
	fi
	if test -z "$HTTPD" ; then
		# As used in Ubuntu
		AC_PATH_PROG([HTTPD], [httpd2],,
			     [$PATH:/usr/sbin])
	fi
fi

AC_SUBST(HTTPD)

PKG_CHECK_MODULES(USER_SHARE, glib-2.0 >= 2.28 gio-2.0 >= 2.26 gtk+-3.0 libnotify libcanberra-gtk3)
AC_SUBST(USER_SHARE_CFLAGS)
AC_SUBST(USER_SHARE_LIBS)

AC_CHECK_LIB(socket, socket)

have_socket=no
AC_CHECK_FUNCS(socket, have_socket=yes)
if test $have_socket = no; then
  # socket is not in the default libraries.  See if it's in some other.
  for lib in bsd socket inet; do
    AC_CHECK_LIB($lib, socket, [
	  LIBS="$LIBS -l$lib"
	  have_socket=yes
	  AC_DEFINE(HAVE_SOCKET)
	  break])
  done
fi

GLIB_GSETTINGS

dnl where to install the gnome-user-share binary
if test "x$prefix" = "xNONE"; then
  prefix=$ac_default_prefix
fi
if test "x$exec_prefix" = "xNONE"; then
   exec_prefix=$prefix
fi

dnl ==========================================================================
IT_PROG_INTLTOOL([0.35.0])

GETTEXT_PACKAGE=gnome-user-share
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],"$GETTEXT_PACKAGE", [The gettext package])

AM_GLIB_GNU_GETTEXT

dnl ==========================================================================
dnl systemd user unit directory
AC_ARG_WITH([systemduserunitdir],
	    AS_HELP_STRING([--with-systemduserunitdir=DIR], [Directory for systemd user service files]),
	    [],
	    [with_systemduserunitdir=$($PKG_CONFIG --variable=systemduserunitdir systemd)])
AC_SUBST([systemduserunitdir], [$with_systemduserunitdir])
AM_CONDITIONAL([HAVE_SYSTEMD], [test -n "$with_systemduserunitdir" -a "x$with_systemduserunitdir" != xno])

dnl ==========================================================================
dnl Check for SELinux

AC_CHECK_LIB(selinux, is_selinux_enabled, [ SELINUX_LIBS=-lselinux
  AC_DEFINE(HAVE_SELINUX,[1],[Found Selinux]) ])
AC_SUBST(SELINUX_LIBS)

dnl ==========================================================================
dnl Check for the HTTPD modules path

AC_ARG_WITH([modules-path],
	    [AS_HELP_STRING([--with-modules-path],[Path where the httpd modules are located (default: /etc/httpd/modules/)])],
	    [with_modules_path=$withval])

MODULES_PATH=$with_modules_path
AC_SUBST(MODULES_PATH)

dnl===========================================================================
dnl Check for nautilus for the share bar

AC_ARG_WITH(nautilusdir,
	    AS_HELP_STRING([--with-nautilusdir=DIR],[Installation path for Nautilus extension @<:@auto@:>@]),
	    [ac_with_nautilusdir=$withval],
	    [ac_with_nautilusdir=""])

PKG_CHECK_MODULES(EXTENSION, libnautilus-extension >= 2.91.7)
if test "${ac_with_nautilusdir}" = ""; then
	ac_with_nautilusdir=`pkg-config --variable=extensiondir libnautilus-extension`
fi
AC_SUBST(NAUTILUSDIR)
AC_MSG_NOTICE([installing nautilus plugin in ${ac_with_nautilusdir}])
AC_SUBST([NAUTILUSDIR],[${ac_with_nautilusdir}])

dnl ==========================================================================

dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.

AC_ARG_ENABLE(more-warnings,
[  --enable-more-warnings  Maximum compiler warnings],
set_more_warnings="$enableval",[
if test -f $srcdir/CVSVERSION; then
	is_cvs_version=true
	set_more_warnings=yes
else
	set_more_warnings=no
fi
])
AC_MSG_CHECKING(for more warnings, including -Werror)
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
	AC_MSG_RESULT(yes)
	CFLAGS="\
	-Wall \
	-Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
	-Wnested-externs -Wpointer-arith \
	-Wcast-align -Wsign-compare \
	-Werror \
	$CFLAGS"

	for option in -Wno-strict-aliasing -Wno-sign-compare; do
		SAVE_CFLAGS="$CFLAGS"
		CFLAGS="$CFLAGS $option"
		AC_MSG_CHECKING([whether gcc understands $option])
		AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
                                  [has_option=yes],
                                  [has_option=no])
		if test $has_option = no; then
			CFLAGS="$SAVE_CFLAGS"
		fi
		AC_MSG_RESULT($has_option)
		unset has_option
		unset SAVE_CFLAGS
	done
	unset option
else
	AC_MSG_RESULT(no)
fi

AC_CONFIG_FILES([
Makefile
data/Makefile
data/org.gnome.desktop.file-sharing.gschema.xml.in
po/Makefile.in
src/Makefile
])
AC_OUTPUT

AC_MSG_NOTICE([gnome-user-share was configured with the following options:])
AC_MSG_NOTICE([** httpd location: $HTTP])
AC_MSG_NOTICE([** httpd modules path: $MODULES_PATH])
AC_MSG_NOTICE([** nautilus extension path: $ac_with_nautilusdir])

echo "
Do note Apache 2.2 and mod_dnssd 0.6 are required to use gnome-user-share.
"