configure.in 9.11 KB
Newer Older
Dan Williams's avatar
Dan Williams committed
1
2
AC_PREREQ(2.52)

Dan Williams's avatar
Dan Williams committed
3
AC_INIT(NetworkManager, 0.4.1, dcbw@redhat.com, NetworkManager)
4
AM_INIT_AUTOMAKE([subdir-objects])
5
AM_MAINTAINER_MODE
Dan Williams's avatar
Dan Williams committed
6

7
8
AM_CONFIG_HEADER(config.h)

9
10
11
dnl
dnl Require programs
dnl
Dan Williams's avatar
Dan Williams committed
12
AC_PROG_CC
13
AM_PROG_CC_C_O
14
AC_PROG_INSTALL
15
16
AC_PROG_LIBTOOL

17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
dnl
dnl Required headers
dnl
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h paths.h sys/ioctl.h sys/time.h syslog.h unistd.h)

dnl
dnl Checks for typedefs, structures, and compiler characteristics.
dnl
AC_TYPE_MODE_T
AC_TYPE_PID_T
AC_HEADER_TIME

dnl
dnl Checks for library functions.
dnl
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
AC_CHECK_FUNCS(select socket uname)

37
38
39
dnl
dnl translation support
dnl
40
41
42
GETTEXT_PACKAGE=NetworkManager
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
43
ALL_LINGUAS="bs cs da de el en_CA es fr gu hr hu it ja nb ne nl no pa pt_BR rw sk sq sr sr@Latn sv uk wa zh_CN zh_TW"
44
AC_PROG_INTLTOOL([0.27.2])
45
46
AM_GLIB_GNU_GETTEXT

47
AC_ARG_WITH(distro, AC_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, or slackware]))
48
if test "z$with_distro" = "z"; then
49
	AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat")
50
	AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
51
52
53
	AC_CHECK_FILE(/etc/fedora-release,with_distro="redhat")
	AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
	AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
54
	AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
55
fi
56
with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
57
58

if test "z$with_distro" = "z"; then
59
	echo "Linux distribution autodetection failed, you must specify the distribution to target using --with-distro=DISTRO"
60
61
62
	exit 1
else
	case $with_distro in
63
		redhat|suse|gentoo|debian|slackware) ;;
64
		*)
65
			echo "Your distribution (${with_distro}) is not yet supported!  (patches welcome)"
66
67
68
69
			exit 1
			;;
	esac
fi
70
AM_CONDITIONAL(TARGET_REDHAT, test x"$with_distro" = xredhat)
71
AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
72
73
74
AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
Dan Williams's avatar
Dan Williams committed
75
76
77
78
79
80
81

AC_CHECK_HEADER(iwlib.h, [],
			[AC_MSG_ERROR(iwlib.h not found. Install wireless-tools.)], [])
AC_CHECK_LIB(iw, iw_scan, [ IWLIB=-liw ],
			[AC_MSG_ERROR(wireless-tools 27.pre23 not installed or not functional)], [])
AC_SUBST(IWLIB)

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
PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= 0.22)

##### Find out the version of DBUS we're using
dbus_version=`pkg-config --modversion dbus-1`
DBUS_VERSION_MAJOR=`echo $dbus_version | awk -F. '{print $1}'`
DBUS_VERSION_MINOR=`echo $dbus_version | awk -F. '{print $2}'`
DBUS_VERSION_MICRO=`echo $dbus_version | awk -F. '{print $3}'`
if test "z$DBUS_VERSION_MAJOR" = "z"; then
	DBUS_VERSION_MAJOR="0"
fi
if test "z$DBUS_VERSION_MINOR" = "z"; then
	DBUS_VERSION_MINOR="0"
fi
if test "z$DBUS_VERSION_MICRO" = "z"; then
	DBUS_VERSION_MICRO="0"
fi

if test "z$DBUS_VERSION_MAJOR" = "z0" -a "z$DBUS_VERSION_MINOR" = "z0" -a "z$DBUS_VERSION_MICRO" = "z0"; then
	echo "Error: Couldn't determine the version of your DBUS package."
	echo "  This is probably an error in this script, please report it"
	echo "  along with the following information:"
	echo "      Base DBUS version ='$dbus_version'"
	echo "      DBUS_VERSION_MAJOR='$DBUS_VERSION_MAJOR'"
	echo "      DBUS_VERSION_MINOR='$DBUS_VERSION_MINOR'"
	echo "      DBUS_VERSION_MICRO='$DBUS_VERSION_MICRO'"
	exit 1
else

	echo "Your dbus version is $DBUS_VERSION_MAJOR,$DBUS_VERSION_MINOR,$DBUS_VERSION_MICRO."
	DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MAJOR=$DBUS_VERSION_MAJOR"
	DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MINOR=$DBUS_VERSION_MINOR"
	DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MICRO=$DBUS_VERSION_MICRO"
fi
115
116
117
118
119
120
121
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)

PKG_CHECK_MODULES(GTHREAD, gthread-2.0)
AC_SUBST(GTHREAD_CFLAGS)
AC_SUBST(GTHREAD_LIBS)

122
123
124
125
PKG_CHECK_MODULES(GMODULE, gmodule-2.0)
AC_SUBST(GMODULE_CFLAGS)
AC_SUBST(GMODULE_LIBS)

126
127
128
PKG_CHECK_MODULES(HAL, hal >= 0.2.91)
AC_SUBST(HAL_CFLAGS)
AC_SUBST(HAL_LIBS)
Dan Williams's avatar
Dan Williams committed
129

130
131
132
133
134
135
136
137
PKG_CHECK_MODULES(GTK, gtk+-2.0)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)

PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-2.0)
AC_SUBST(GDK_PIXBUF_CFLAGS)
AC_SUBST(GDK_PIXBUF_LIBS)

138
139
140
141
PKG_CHECK_MODULES(GLADE, libglade-2.0)
AC_SUBST(GLADE_CFLAGS)
AC_SUBST(GLADE_LIBS)

142
143
144
145
PKG_CHECK_MODULES(GCONF, gconf-2.0)
AC_SUBST(GCONF_CFLAGS)
AC_SUBST(GCONF_LIBS)

146
147
148
PKG_CHECK_MODULES(GNOME_KEYRING, gnome-keyring-1)
AC_SUBST(GNOME_KEYRING_CFLAGS)
AC_SUBST(GNOME_KEYRING_LIBS)
149

150
AC_ARG_WITH(gcrypt, AC_HELP_STRING([--with-gcrypt], [Use gcrypt library]), ac_gcrypt=$withval, ac_gcrypt=auto)
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
if test x"$ac_gcrypt" != xno; then
  AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
else
  LIBGCRYPT_CONFIG=no
fi 
if test x"$LIBGCRYPT_CONFIG" = xno; then
   if test x"$ac_gcrypt" = xyes; then
      AC_MSG_ERROR([gcrypt explicitly requested but not found on system])
   fi
   ac_gcrypt=no
else
   if test x"$ac_gcrypt" != xno; then
     AC_DEFINE(HAVE_GCRYPT, 1, [Define if you have libgcrypt])
     LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
     LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
     AC_SUBST(LIBGCRYPT_CFLAGS)
     AC_SUBST(LIBGCRYPT_LIBS)
   fi
fi
AM_CONDITIONAL(WITH_GCRYPT, test x"$ac_gcrypt" != xno)
171

172
173
174
PKG_CHECK_MODULES(PANEL_APPLET, libpanelapplet-2.0)
AC_SUBST(PANEL_APPLET_CFLAGS)
AC_SUBST(PANEL_APPLET_LIBS)
175

176
PKG_CHECK_MODULES(LIBGNOMEUI, libgnomeui-2.0)
177
AC_SUBST(LIBGNOMEUI_CFLAGS) # is this even needed? it was typed incorrectly before
178
179
AC_SUBST(LIBGNOMEUI_LIBS)

180
AC_ARG_WITH(dbus-sys, AC_HELP_STRING([--with-dbus-sys=DIR], [where D-BUS system.d directory is]))
Bryan W. Clark's avatar
Bryan W. Clark committed
181
182
183
184

if ! test -z "$with_dbus_sys" ; then
    DBUS_SYS_DIR="$with_dbus_sys"
else
185
    DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
Bryan W. Clark's avatar
Bryan W. Clark committed
186
187
188
189
fi
AC_SUBST(DBUS_SYS_DIR)
AC_DEFINE_UNQUOTED(DBUS_SYSTEMD_DIR, "$DBUS_SYS_DIR", [Where system.d dir for DBUS is])

190
191
192
AC_ARG_WITH(named, AC_HELP_STRING([--with-named=PATH], [path to the named binary])) 
AC_ARG_WITH(named_dir, AC_HELP_STRING([--with-named-dir=PATH], [path to the named data directory])) 
AC_ARG_WITH(named_user, AC_HELP_STRING([--with-named-user=USERNAME], [named username])) 
193
if test "x${with_named}" = x; then
194
   AC_DEFINE(NM_NO_NAMED,,[Define if you want to disable named support])
195
196
fi
AC_DEFINE_UNQUOTED(NM_NAMED_BINARY_PATH, "$with_named", [Define to path of named binary])
197
AC_DEFINE_UNQUOTED(NM_NAMED_DATA_DIR, "$with_named_dir", [Define to path of named data directory])
198
AC_DEFINE_UNQUOTED(NM_NAMED_USER, "$with_named_user", [Define to named username])
199

200
201
202
203
AC_ARG_WITH(DHCDBD_BINARY_PATH, AC_HELP_STRING([--with-dhcdbd=/path/to/dhcdbd], [path to dhcdbd])) 
if test "x${DHCDBD_BINARY_PATH}" = x; then
  AC_PATH_PROG(DHCDBD_BINARY_PATH, dhcdbd, [], $PATH:/sbin:/usr/sbin)
  if ! test -x "$DHCDBD_BINARY_PATH"; then
204
	AC_MSG_ERROR(dhcdbd was not installed.  See http://people.redhat.com/jvdias/dhcdbd)
205
  fi
206
207
208
fi
AC_SUBST(DHCDBD_BINARY_PATH)

209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
#### find the actual value for $prefix that we'll end up with
##   (I know this is broken and should be done in the Makefile, but
##    that's a major pain and almost nobody actually seems to care)
REAL_PREFIX=
if test "x$prefix" = "xNONE"; then
  REAL_PREFIX=$ac_default_prefix
else
  REAL_PREFIX=$prefix
fi

## temporarily change prefix and exec_prefix
old_prefix=$prefix
prefix=$REAL_PREFIX

if test "x$exec_prefix" = xNONE ; then
   REAL_EXEC_PREFIX=$REAL_PREFIX
else
   REAL_EXEC_PREFIX=$exec_prefix
fi
old_exec_prefix=$exec_prefix
exec_prefix=$REAL_EXEC_PREFIX

BINDIR_TMP="$bindir"
EXPANDED_BINDIR=`eval echo $BINDIR_TMP`
AC_SUBST(EXPANDED_BINDIR)
AC_DEFINE_UNQUOTED(EXPANDED_BINDIR, "$EXPANDED_BINDIR", [Where the executables are installed])

## put prefix and exec_prefix back
prefix=$old_prefix
exec_prefix=$old_exec_prefix

240
AC_ARG_ENABLE(more-warnings,
241
AC_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings]),
242
243
244
245
246
247
248
249
250
251
252
253
set_more_warnings="$enableval",[
if test -d "$srcdir/{arch}" || test -d "$srcdir/CVS"; then
	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 -Werror -std=gnu89 $CFLAGS"

254
	for option in -Wno-unused -Wno-strict-aliasing -Wno-sign-compare -Wdeclaration-after-statement -Wno-pointer-sign ; do
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
		SAVE_CFLAGS="$CFLAGS"
		CFLAGS="$CFLAGS $option"
		AC_MSG_CHECKING([whether gcc understands $option])
		AC_TRY_COMPILE([], [],
			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

Dan Williams's avatar
Dan Williams committed
273
274
AC_OUTPUT([
Makefile
275
utils/Makefile
Dan Williams's avatar
Dan Williams committed
276
src/Makefile
277
278
src/named-manager/Makefile
src/vpn-manager/Makefile
279
src/dhcp-manager/Makefile
280
src/backends/Makefile
281
dispatcher-daemon/Makefile
282
283
284
285
286
gnome/Makefile
gnome/applet/Makefile
gnome/applet/icons/Makefile
gnome/libnm_glib/libnm_glib.pc
gnome/libnm_glib/Makefile
287
gnome/vpn-properties/Makefile
288
test/Makefile
Dan Williams's avatar
Dan Williams committed
289
initscript/Makefile
Seth Nickell's avatar
Seth Nickell committed
290
291
initscript/RedHat/Makefile
initscript/Gentoo/Makefile
j's avatar
j committed
292
initscript/Debian/Makefile
293
initscript/Slackware/Makefile
294
initscript/SUSE/Makefile
295
po/Makefile.in
296
NetworkManager.pc
Dan Williams's avatar
Dan Williams committed
297
])
298
299

echo
300
echo Distribution targeting: ${with_distro}
301
echo 'if this is not correct, please specifiy your distro with --with-distro=DISTRO'