Changeset 8625 for trunk/configure.ac


Ignore:
Timestamp:
Jun 5, 2009, 1:45:21 PM (13 years ago)
Author:
charles
Message:

(trunk) #2167 improve the autoconf libevent test: don't use the OS copy unless it's got evutil_vsnprintf()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r8623 r8625  
    171171dnl AM_CONDITIONAL + AC_CONFIG_SUBDIRS don't seem to play nice
    172172AC_CONFIG_SUBDIRS([third-party/libevent])
    173 
     173libevent_source=bundled
     174AC_CHECK_LIB([event],[evutil_vsnprintf],
     175             [libevent_found=yes],
     176             [libevent_found=no],
     177             [-levent])
    174178AC_CHECK_HEADER([event-config.h],
    175                 [libevent_source=system
    176                  LIBEVENT_CPPFLAGS=""
    177                  LIBEVENT_LIBS="-levent -lrt"],
    178                 [libevent_source=bundled
    179                  AC_MSG_NOTICE([couldn't find event-config.h, so using our own copy of libevent from third-party/libevent/.])
    180                  AC_MSG_NOTICE([if you are cross-compiling this is probably NOT what you want.])
    181                  LIBEVENT_CPPFLAGS="-I\$(top_srcdir)/third-party/libevent -I\$(top_builddir)/third-party/libevent"
    182                  LIBEVENT_LIBS="\$(top_builddir)/third-party/libevent/libevent.la"])
     179                [libevent_headers_found=yes],
     180                [libevent_headers_found=no])
     181libevent_source=bundled
     182if test "x$libevent_found" = "xyes" ; then
     183    if test "x$libevent_headers_found" = "xyes"; then
     184      libevent_source=system
     185    fi
     186fi
     187if test "x$libevent_source" = "xbundled"; then
     188    AC_MSG_NOTICE([couldn't find event-config.h, so using our own copy of libevent from third-party/libevent/.])
     189    AC_MSG_NOTICE([if you are cross-compiling this is probably NOT what you want.])
     190    LIBEVENT_CPPFLAGS="-I\$(top_srcdir)/third-party/libevent -I\$(top_builddir)/third-party/libevent"
     191    LIBEVENT_LIBS="\$(top_builddir)/third-party/libevent/libevent.la"
     192else
     193    LIBEVENT_CPPFLAGS=""
     194    LIBEVENT_LIBS="-levent -lrt"
     195fi
    183196AC_SUBST(LIBEVENT_CPPFLAGS)
    184197AC_SUBST(LIBEVENT_LIBS)
Note: See TracChangeset for help on using the changeset viewer.