diff --git a/Makefile.am b/Makefile.am index bb0b155f..f7369ce3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,11 +1,16 @@ AUTOMAKE_OPTIONS = foreign no-dependencies +SUBDIRS = . sample + EXTRA_DIST = acconfig.h lib_LIBRARIES = libevent.a -libevent_a_SOURCES = event.c select.c @EVSRCS@ +libevent_a_SOURCES = event.c +libevent_a_LIBADD = @LIBOBJS@ include_HEADERS = event.h man_MANS = event.3 + +DISTCLEANFILES = *~ diff --git a/configure.in b/configure.in index ee4ed647..2268a327 100644 --- a/configure.in +++ b/configure.in @@ -53,10 +53,10 @@ AC_HEADER_TIME dnl Checks for library functions. AC_CHECK_FUNCS(gettimeofday) -AC_SUBST(EVSRCS) +AC_SUBST(LIBOBJS) AC_CHECK_FUNCS(select, [haveselect=yes], ) if test "x$haveselect" = "xyes" ; then - EVSRCS="select.c" + LIBOBJS="$LIBOBJS select.o" fi havekqueue=no @@ -111,8 +111,8 @@ main(int argc, char **argv) exit(0); }, [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_WORKING_KQUEUE) - EVSRCS="$EVSRCS kqueue.c"], AC_MSG_RESULT(no), AC_MSG_RESULT(no)) + LIBOBJS="$LIBOBJS kqueue.o"], AC_MSG_RESULT(no), AC_MSG_RESULT(no)) fi fi -AC_OUTPUT(Makefile test/Makefile) +AC_OUTPUT(Makefile test/Makefile sample/Makefile) diff --git a/sample/Makefile.am b/sample/Makefile.am new file mode 100644 index 00000000..f66bda38 --- /dev/null +++ b/sample/Makefile.am @@ -0,0 +1,11 @@ +AUTOMAKE_OPTIONS = foreign no-dependencies + +LDADD = -L.. -levent +CPPFPLAGS = -I.. + +bin_PROGRAMS = event-test time-test + +event_test_sources = event-test.c +time_test_sources = time-test.c + +DISTCLEANFILES = *~