From: Frank Lahm Date: Wed, 24 Oct 2012 10:18:43 +0000 (+0200) Subject: --with-libevent-header|lib requires a path X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=d4fdc0119a3fd21571e27aad6c3e6ff5c56ac880 --with-libevent-header|lib requires a path Throw an error if any either configure option is passed without a path. Add libevent to library configure summary. --- diff --git a/macros/netatalk.m4 b/macros/netatalk.m4 index 7040eb04..51dbdcab 100644 --- a/macros/netatalk.m4 +++ b/macros/netatalk.m4 @@ -15,24 +15,28 @@ AC_DEFUN([AC_DEVELOPER], [ dnl Whether to disable bundled libevent AC_DEFUN([AC_NETATALK_LIBEVENT], [ - use_bundled_libevent=no - AC_MSG_CHECKING([whether to use bundled or installed libevent]) + AC_MSG_CHECKING([whether to use bundled libevent]) + AC_ARG_WITH( + libevent, + [AS_HELP_STRING([--with-libevent],[whether to use the bundled libevent (default: yes)])], + use_bundled_libevent=$withval, + use_bundled_libevent=yes + ) AC_ARG_WITH( libevent-header, [AS_HELP_STRING([--with-libevent-header],[path to libevent header files])], - LIBEVENT_CFLAGS=-I$withval, - use_bundled_libevent=yes + [use_bundled_libevent=no; LIBEVENT_CFLAGS=-I$withval] ) AC_ARG_WITH( libevent-lib, - [AS_HELP_STRING([--with-libevent-lib],[path to libevent header library])], - LIBEVENT_LDFLAGS=-L$withval, - use_bundled_libevent=yes + [AS_HELP_STRING([--with-libevent-lib],[path to libevent library])], + [use_bundled_libevent=no; LIBEVENT_LDFLAGS=-L$withval] ) - AC_MSG_RESULT([$use_bundled_libevent]) - if test x"$use_bundled_libevent" = x"yes" ; then - AC_CONFIG_SUBDIRS([libevent]) + if test x"$LIBEVENT_CFLAGS" = x"-Iyes" -o x"$LIBEVENT_LDFLAGS" = x"-Lyes" ; then + AC_MSG_ERROR([--with-libevent requires a path]) fi + AC_MSG_RESULT([$use_bundled_libevent]) + AC_CONFIG_SUBDIRS([libevent]) AC_SUBST(LIBEVENT_CFLAGS) AC_SUBST(LIBEVENT_LDFLAGS) AM_CONDITIONAL(USE_BUILTIN_LIBEVENT, test x"$use_bundled_libevent" = x"yes") diff --git a/macros/summary.m4 b/macros/summary.m4 index 94e84ac9..8d9abc50 100644 --- a/macros/summary.m4 +++ b/macros/summary.m4 @@ -116,4 +116,11 @@ AC_DEFUN([AC_NETATALK_LIBS_SUMMARY], [ AC_MSG_RESULT([ LIBS = $LDAP_LDLFLAGS $LDAP_LIBS]) AC_MSG_RESULT([ CFLAGS = $LDAP_CFLAGS]) fi + AC_MSG_RESULT([ LIBEVENT:]) + if test x"$use_bundled_libevent" = x"yes"; then + AC_MSG_RESULT([ bundled]) + else + AC_MSG_RESULT([ LIBS = $LIBEVENT_CFLAGS]) + AC_MSG_RESULT([ CFLAGS = $LIBEVENT_LDFLAGS]) + fi ])