diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 74 |
1 files changed, 44 insertions, 30 deletions
diff --git a/configure.ac b/configure.ac index 64fefda3..90df7609 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -192,6 +192,7 @@ AC_ARG_WITH(glade, | |||
192 | 192 | ||
193 | if test "x$glade" == "x0" -a ! "x$lookin" == "x" | 193 | if test "x$glade" == "x0" -a ! "x$lookin" == "x" |
194 | then | 194 | then |
195 | AC_MSG_CHECKING(for Glade3 in $lookin) | ||
195 | backup_LIBS="$LIBS" | 196 | backup_LIBS="$LIBS" |
196 | backup_CFLAGS="$CFLAGS" | 197 | backup_CFLAGS="$CFLAGS" |
197 | backup_CPPFLAGS="$CPPFLAGS" | 198 | backup_CPPFLAGS="$CPPFLAGS" |
@@ -238,58 +239,73 @@ AC_SUBST(GLADE_LIBS) | |||
238 | 239 | ||
239 | # test for GNUnet core | 240 | # test for GNUnet core |
240 | gnunet=0 | 241 | gnunet=0 |
242 | lookin=${prefix} | ||
243 | GNUNET_CFLAGS="" | ||
244 | GNUNET_CPPFLAGS="" | ||
245 | GNUNET_LIBS="" | ||
241 | AC_MSG_CHECKING(for GNUnet core) | 246 | AC_MSG_CHECKING(for GNUnet core) |
242 | AC_ARG_WITH(gnunet, | 247 | AC_ARG_WITH(gnunet, |
243 | [ --with-gnunet=PFX Base of GNUnet installation], | 248 | [ --with-gnunet=PFX Base of GNUnet installation], |
244 | [AC_MSG_RESULT([$with_gnunet]) | 249 | [AC_MSG_RESULT([$with_gnunet]) |
245 | case $with_gnunet in | 250 | case $with_gnunet in |
246 | no) | 251 | no) |
252 | lookin="" | ||
247 | ;; | 253 | ;; |
248 | yes) | 254 | yes) |
249 | LDFLAGS="-L/usr/lib $LDFLAGS" | 255 | lookin="${prefix}" |
250 | CPPFLAGS="-I/usr/include $CPPFLAGS" | ||
251 | AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_util_lib.h], | ||
252 | AC_CHECK_LIB([gnunetutil], [GNUNET_xfree_], | ||
253 | gnunet=1)) | ||
254 | ;; | 256 | ;; |
255 | *) | 257 | *) |
256 | LDFLAGS="-L$with_gnunet/lib $LDFLAGS" | 258 | lookin="$with_gnunet" |
257 | CPPFLAGS="-I$with_gnunet/include $CPPFLAGS" | ||
258 | AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_util_lib.h], | ||
259 | AC_CHECK_LIB([gnunetutil], [GNUNET_xfree_], | ||
260 | EXT_LIB_PATH="-L$with_gnunet/lib $EXT_LIB_PATH" | ||
261 | gnunet=1)) | ||
262 | ;; | 259 | ;; |
263 | esac | 260 | esac |
264 | ], | 261 | ], |
265 | [AC_MSG_RESULT([--with-gnunet not specified]) | 262 | [ |
266 | LDFLAGS="-L/usr/lib $LDFLAGS" | 263 | AC_MSG_RESULT([--with-gnunet not specified]) |
267 | CPPFLAGS="-I/usr/include $CPPFLAGS" | 264 | PKG_CHECK_MODULES([GNUNET], [gnunetutil >= 0.9.0], gnunet=1) |
268 | AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_util_lib.h], | 265 | ] |
269 | AC_CHECK_LIB([gnunetutil], [GNUNET_xfree_], | 266 | ) |
270 | gnunet=1))]) | ||
271 | 267 | ||
272 | # if GNUnet was not found, try in /usr/local | 268 | if test "x$gnunet" == "x0" -a ! "x$lookin" == "x" |
273 | if test "$gnunet" != 1 | ||
274 | then | 269 | then |
275 | AC_MSG_CHECKING(for GNUnet core in /usr/local) | 270 | AC_MSG_CHECKING(for GNUnet util library in $lookin) |
276 | with_gnunet=/usr/local | 271 | backup_LIBS="$LIBS" |
277 | LDFLAGS="-L$with_gnunet/lib $LDFLAGS" | 272 | backup_CFLAGS="$CFLAGS" |
278 | CPPFLAGS="-I$with_gnunet/include $CPPFLAGS" | 273 | backup_CPPFLAGS="$CPPFLAGS" |
274 | GNUNET_LIBS="-L${lookin}/lib" | ||
275 | GNUNET_CFLAGS="-I${lookin}/include" | ||
276 | GNUNET_CPPFLAGS="-I${lookin}/include" | ||
277 | LIBS="$GNUNET_LIBS $backup_LIBS" | ||
278 | CFLAGS="$GNUNET_CFLAGS $backup_CFLAGS" | ||
279 | CPPFLAGS="$GNUNET_CPPFLAGS $backup_CPPFLAGS" | ||
279 | AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_util_lib.h], | 280 | AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_util_lib.h], |
280 | AC_CHECK_LIB([gnunetutil], [GNUNET_xfree_], | 281 | AC_CHECK_LIB([gnunetutil], [GNUNET_xfree_], |
281 | EXT_LIB_PATH="-L$with_gnunet/lib $EXT_LIB_PATH" | 282 | [ |
282 | gnunet=1)) | 283 | gnunet=1 |
284 | EXT_LIB_PATH="-L${lookin}/lib $EXT_LIB_PATH" | ||
285 | ] | ||
286 | ) | ||
287 | ) | ||
288 | LIBS="$backup_LIBS" | ||
289 | CFLAGS="$backup_CFLAGS" | ||
290 | CPPFLAGS="$backup_CPPFLAGS" | ||
283 | fi | 291 | fi |
284 | 292 | ||
285 | if test "$gnunet" != 1 | 293 | if test "x$gnunet" == "x0" |
286 | then | 294 | then |
287 | AC_MSG_ERROR([gnunet-gtk requires GNUnet]) | 295 | AC_MSG_ERROR([gnunet-gtk requires GNUnet]) |
288 | fi | 296 | fi |
297 | |||
298 | AC_SUBST(GNUNET_CFLAGS) | ||
299 | AC_SUBST(GNUNET_LIBS) | ||
300 | |||
301 | backup_CPPFLAGS="$CPPFLAGS" | ||
302 | CPPFLAGS="$GNUNET_CPPFLAGS $backup_CPPFLAGS" | ||
289 | AC_CHECK_HEADERS([gnunet/gnunet_fs_service.h gnunet/gnunet_statistics_service.h gnunet/gnunet_core_service.h], [], | 303 | AC_CHECK_HEADERS([gnunet/gnunet_fs_service.h gnunet/gnunet_statistics_service.h gnunet/gnunet_core_service.h], [], |
290 | AC_MSG_ERROR([compiling gnunet-gtk requires GNUnet core headers])) | 304 | AC_MSG_ERROR([compiling gnunet-gtk requires GNUnet core headers])) |
305 | CPPFLAGS="$backup_CPPFLAGS" | ||
291 | 306 | ||
292 | SAVELIBS=$LIBS | 307 | SAVELIBS=$LIBS |
308 | LIBS="$GNUNET_LIBS $LIBS" | ||
293 | AC_CHECK_LIB(gnunetutil,GNUNET_log,, | 309 | AC_CHECK_LIB(gnunetutil,GNUNET_log,, |
294 | AC_MSG_ERROR([gnunet-gtk requires libgnunetutil])) | 310 | AC_MSG_ERROR([gnunet-gtk requires libgnunetutil])) |
295 | AC_CHECK_LIB(gnunetfs,GNUNET_FS_uri_to_string,, | 311 | AC_CHECK_LIB(gnunetfs,GNUNET_FS_uri_to_string,, |
@@ -306,8 +322,6 @@ AC_CHECK_LIB(gladeui-1,glade_xml_node_new, [], | |||
306 | ) | 322 | ) |
307 | LIBS=$SAVELIBS | 323 | LIBS=$SAVELIBS |
308 | 324 | ||
309 | AC_SUBST(GNUNETGTK_CFLAGS) | ||
310 | AC_SUBST(GNUNETGTK_LIBS) | ||
311 | AC_DEFINE_DIR([PACKAGE_DATA], [datarootdir], [The directory for installing read-only architecture-independent data]) | 325 | AC_DEFINE_DIR([PACKAGE_DATA], [datarootdir], [The directory for installing read-only architecture-independent data]) |
312 | 326 | ||
313 | # Set PACKAGE_SOURCE_DIR in gnunet_gtk_config.h. | 327 | # Set PACKAGE_SOURCE_DIR in gnunet_gtk_config.h. |