diff options
| author | Paul Eggert | 2013-07-12 17:01:43 -0700 |
|---|---|---|
| committer | Paul Eggert | 2013-07-12 17:01:43 -0700 |
| commit | c04bbd85c9b5a7db4b7fb62e741563aa848dce67 (patch) | |
| tree | 664e11955f0b6de6a3cd00916f3af53942360f3e | |
| parent | f24e7572fb64c6e70ffebe38ea048bad8c3c7509 (diff) | |
| download | emacs-c04bbd85c9b5a7db4b7fb62e741563aa848dce67.tar.gz emacs-c04bbd85c9b5a7db4b7fb62e741563aa848dce67.zip | |
* configure.ac: Simplify --with-file-notification handling.
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | configure.ac | 99 |
2 files changed, 47 insertions, 56 deletions
| @@ -1,3 +1,7 @@ | |||
| 1 | 2013-07-13 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * configure.ac: Simplify --with-file-notification handling. | ||
| 4 | |||
| 1 | 2013-07-12 Glenn Morris <rgm@gnu.org> | 5 | 2013-07-12 Glenn Morris <rgm@gnu.org> |
| 2 | 6 | ||
| 3 | * configure.ac: If with-file-notification=yes, if gfile not found, | 7 | * configure.ac: If with-file-notification=yes, if gfile not found, |
diff --git a/configure.ac b/configure.ac index 9ab7e971b05..0fdb1699e99 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -2319,63 +2319,50 @@ if test "${with_ns}" = yes && test ${with_file_notification} = yes; then | |||
| 2319 | with_file_notification=no | 2319 | with_file_notification=no |
| 2320 | fi | 2320 | fi |
| 2321 | 2321 | ||
| 2322 | if test "${with_file_notification}" != "no"; then | 2322 | dnl MS Windows native file monitor is available for mingw32 only. |
| 2323 | 2323 | case $with_file_notification,$opsys in | |
| 2324 | dnl MS Windows native file monitor is available for mingw32 only. | 2324 | w32,* | yes,mingw32) |
| 2325 | if test "${with_file_notification}" = "w32" || \ | 2325 | AC_CHECK_HEADER(windows.h) |
| 2326 | ( test "${opsys}" = "mingw32" && \ | 2326 | if test "$ac_cv_header_windows_h" = yes ; then |
| 2327 | test "${with_file_notification}" = "yes" ); then | 2327 | AC_DEFINE(HAVE_W32NOTIFY, 1, [Define to 1 to use w32notify.]) |
| 2328 | AC_CHECK_HEADER(windows.h) | 2328 | NOTIFY_OBJ=w32notify.o |
| 2329 | if test "$ac_cv_header_windows_h" = yes ; then | 2329 | NOTIFY_SUMMARY="yes (w32)" |
| 2330 | AC_DEFINE(HAVE_W32NOTIFY, 1, [Define to 1 to use w32notify.]) | 2330 | fi ;; |
| 2331 | NOTIFY_OBJ=w32notify.o | 2331 | esac |
| 2332 | NOTIFY_SUMMARY="yes (w32)" | ||
| 2333 | with_file_notification=w32 | ||
| 2334 | elif test "${with_file_notification}" = "w32"; then | ||
| 2335 | AC_MSG_ERROR([File notification `w32' requested but requirements not found.]) | ||
| 2336 | elif test "${opsys}" = "mingw32"; then | ||
| 2337 | dnl Do not try any further. | ||
| 2338 | with_file_notification=no | ||
| 2339 | fi | ||
| 2340 | fi | ||
| 2341 | |||
| 2342 | dnl g_file_monitor exists since glib 2.18. G_FILE_MONITOR_EVENT_MOVED | ||
| 2343 | dnl has been added in glib 2.24. It has been tested under | ||
| 2344 | dnl GNU/Linux only. We take precedence over inotify, but this makes | ||
| 2345 | dnl only sense when glib has been compiled with inotify support. How | ||
| 2346 | dnl to check? | ||
| 2347 | if test "${with_file_notification}" = "gfile" || \ | ||
| 2348 | test "${with_file_notification}" = "yes"; then | ||
| 2349 | PKG_CHECK_MODULES(GFILENOTIFY, gio-2.0 >= 2.24, HAVE_GFILENOTIFY=yes, HAVE_GFILENOTIFY=no) | ||
| 2350 | if test "$HAVE_GFILENOTIFY" = "yes"; then | ||
| 2351 | AC_DEFINE(HAVE_GFILENOTIFY, 1, [Define to 1 if using GFile.]) | ||
| 2352 | NOTIFY_OBJ=gfilenotify.o | ||
| 2353 | NOTIFY_SUMMARY="yes -lgio (gfile)" | ||
| 2354 | with_file_notification=gfile | ||
| 2355 | elif test "${with_file_notification}" = "gfile"; then | ||
| 2356 | AC_MSG_ERROR([File notification `gfile' requested but requirements not found.]) | ||
| 2357 | fi | ||
| 2358 | fi | ||
| 2359 | 2332 | ||
| 2360 | dnl inotify is only available on GNU/Linux. | 2333 | dnl g_file_monitor exists since glib 2.18. G_FILE_MONITOR_EVENT_MOVED |
| 2361 | if test "${with_file_notification}" = "inotify" || \ | 2334 | dnl has been added in glib 2.24. It has been tested under |
| 2362 | test "${with_file_notification}" = "yes"; then | 2335 | dnl GNU/Linux only. We take precedence over inotify, but this makes |
| 2363 | AC_CHECK_HEADER(sys/inotify.h) | 2336 | dnl only sense when glib has been compiled with inotify support. How |
| 2364 | if test "$ac_cv_header_sys_inotify_h" = yes ; then | 2337 | dnl to check? |
| 2365 | AC_CHECK_FUNC(inotify_init1) | 2338 | case $with_file_notification,$NOTIFY_OBJ in |
| 2366 | if test "$ac_cv_func_inotify_init1" = yes; then | 2339 | gfile, | yes,) |
| 2367 | AC_DEFINE(HAVE_INOTIFY, 1, [Define to 1 to use inotify.]) | 2340 | PKG_CHECK_MODULES(GFILENOTIFY, gio-2.0 >= 2.24, HAVE_GFILENOTIFY=yes, HAVE_GFILENOTIFY=no) |
| 2368 | NOTIFY_OBJ=inotify.o | 2341 | if test "$HAVE_GFILENOTIFY" = "yes"; then |
| 2369 | NOTIFY_SUMMARY="yes -lglibc (inotify)" | 2342 | AC_DEFINE(HAVE_GFILENOTIFY, 1, [Define to 1 if using GFile.]) |
| 2370 | with_file_notification=inotify | 2343 | NOTIFY_OBJ=gfilenotify.o |
| 2371 | fi | 2344 | NOTIFY_SUMMARY="yes -lgio (gfile)" |
| 2372 | fi | 2345 | fi ;; |
| 2373 | if test "${with_file_notification}" = "inotify" && \ | 2346 | esac |
| 2374 | test -z "${NOTIFY_OBJ}"; then | 2347 | |
| 2375 | AC_MSG_ERROR([File notification `inotify' requested but requirements not found.]) | 2348 | dnl inotify is only available on GNU/Linux. |
| 2376 | fi | 2349 | case $with_file_notification,$NOTIFY_OBJ in |
| 2377 | fi | 2350 | inotify, | yes,) |
| 2378 | fi dnl ${with_file_notification} != no | 2351 | AC_CHECK_HEADER(sys/inotify.h) |
| 2352 | if test "$ac_cv_header_sys_inotify_h" = yes ; then | ||
| 2353 | AC_CHECK_FUNC(inotify_init1) | ||
| 2354 | if test "$ac_cv_func_inotify_init1" = yes; then | ||
| 2355 | AC_DEFINE(HAVE_INOTIFY, 1, [Define to 1 to use inotify.]) | ||
| 2356 | NOTIFY_OBJ=inotify.o | ||
| 2357 | NOTIFY_SUMMARY="yes -lglibc (inotify)" | ||
| 2358 | fi | ||
| 2359 | fi ;; | ||
| 2360 | esac | ||
| 2361 | |||
| 2362 | case $with_file_notification,$NOTIFY_OBJ in | ||
| 2363 | yes,* | no,* | *,?*) ;; | ||
| 2364 | *) AC_MSG_ERROR([File notification `$with_file_notification' requested but requirements not found.]) ;; | ||
| 2365 | esac | ||
| 2379 | 2366 | ||
| 2380 | if test -n "$NOTIFY_OBJ"; then | 2367 | if test -n "$NOTIFY_OBJ"; then |
| 2381 | AC_DEFINE(USE_FILE_NOTIFY, 1, [Define to 1 if using file notifications.]) | 2368 | AC_DEFINE(USE_FILE_NOTIFY, 1, [Define to 1 if using file notifications.]) |