]> granicus.if.org Git - libevent/commitdiff
Add configure options to disable installation, regression tests
authorDave Hart <hart@ntp.org>
Sun, 13 Feb 2011 07:05:04 +0000 (02:05 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 22 Feb 2011 05:28:37 +0000 (00:28 -0500)
The main reason for disabling installation is if you're building
libevent as a subpackage for embedding: you want to have your main
package's "make all" build libevent, but you don't want your main
package's "make install" to install libevent.

Makefile.am
configure.in
test/Makefile.am
test/test.sh

index 46f6d34e123c546cc02b2f4f50c51418daf77f71..3a7bc2b80b5be2ddcf11b08797eed3ffe709784a 100644 (file)
@@ -72,7 +72,7 @@ VERSION_INFO = 5:1:0
 dist_bin_SCRIPTS = event_rpcgen.py
 
 pkgconfigdir=$(libdir)/pkgconfig
-pkgconfig_DATA=libevent.pc
+LIBEVENT_PKGCONFIG=libevent.pc
 
 # These sources are conditionally added by configure.in or conditionally
 # included from other files.
@@ -89,14 +89,21 @@ EXTRA_DIST = \
        Makefile.nmake test/Makefile.nmake \
        $(PLATFORM_DEPENDENT_SRC)
 
-lib_LTLIBRARIES = libevent.la libevent_core.la libevent_extra.la
+LIBEVENT_LIBS_LA = libevent.la libevent_core.la libevent_extra.la
 if PTHREADS
-lib_LTLIBRARIES += libevent_pthreads.la
-pkgconfig_DATA += libevent_pthreads.pc
+LIBEVENT_LIBS_LA += libevent_pthreads.la
+LIBEVENT_PKGCONFIG += libevent_pthreads.pc
 endif
 if OPENSSL
-lib_LTLIBRARIES += libevent_openssl.la
-pkgconfig_DATA += libevent_openssl.pc
+LIBEVENT_LIBS_LA += libevent_openssl.la
+LIBEVENT_PKGCONFIG += libevent_openssl.pc
+endif
+
+if INSTALL_LIBEVENT
+lib_LTLIBRARIES = $(LIBEVENT_LIBS_LA)
+pkgconfig_DATA = $(LIBEVENT_PKGCONFIG)
+else
+noinst_LTLIBRARIES =  $(LIBEVENT_LIBS_LA)
 endif
 
 SUBDIRS = . include sample test
index 3c76cfa3a42674e44ade7e3ef88d26fdbca64408..d924016ded4848ca380cec6e8df1692200685bc0 100644 (file)
@@ -42,6 +42,9 @@ if test "$GCC" = "yes" ; then
        CFLAGS="$CFLAGS -fno-strict-aliasing"
 fi
 
+enable_libevent_install_def=yes
+enable_libevent_regress_def=yes
+
 AC_ARG_ENABLE(gcc-warnings,
      AS_HELP_STRING(--enable-gcc-warnings, enable verbose warnings with GCC))
 AC_ARG_ENABLE(thread-support,
@@ -56,6 +59,12 @@ AC_ARG_ENABLE(openssl,
 AC_ARG_ENABLE(debug-mode,
      AS_HELP_STRING(--disable-debug-mode, disable support for running in debug mode),
         [], [enable_debug_mode=yes])
+AC_ARG_ENABLE([libevent-install],
+     AS_HELP_STRING([--disable-libevent-install, disable installation of libevent]),
+       [], [enable_libevent_install=$enable_libevent_install_def])
+AC_ARG_ENABLE([libevent-regress],
+     AS_HELP_STRING([--disable-libevent-regress, skip regress in  make check]),
+       [], [enable_libevent_regress=$enable_libevent_regress_def])
 
 AC_PROG_LIBTOOL
 
@@ -65,6 +74,14 @@ dnl   the command line with --enable-shared and --disable-shared.
 dnl AC_DISABLE_SHARED
 AC_SUBST(LIBTOOL_DEPS)
 
+AM_CONDITIONAL([BUILD_REGRESS], [test "$enable_libevent_regress" = "yes"])
+if test "$enable_libevent_regress" = "yes" ; then
+    CHECK_REGRESS=regress
+else
+    CHECK_REGRESS=
+fi
+AC_SUBST([CHECK_REGRESS])
+
 dnl Checks for libraries.
 AC_SEARCH_LIBS([inet_ntoa], [nsl])
 AC_SEARCH_LIBS([socket], [socket])
@@ -672,5 +689,7 @@ if test "$GCC" = yes ; then
 fi
 AC_SUBST([LIBEVENT_GC_SECTIONS])
 
+AM_CONDITIONAL([INSTALL_LIBEVENT], [test "$enable_libevent_install" = "yes"])
+
 AC_CONFIG_FILES( [libevent.pc libevent_openssl.pc libevent_pthreads.pc] )
 AC_OUTPUT(Makefile include/Makefile test/Makefile sample/Makefile)
index b9fb8d04ca027cf7f43fbb24c538a2d004d1be39..6d8bf5e7224f7ab67f7ef86339917a2831350d41 100644 (file)
@@ -4,14 +4,19 @@ AM_CFLAGS = -I$(top_srcdir) -I$(top_srcdir)/compat -I$(top_srcdir)/include -I../
 
 EXTRA_DIST = regress.rpc regress.gen.h regress.gen.c test.sh
 
-noinst_PROGRAMS = test-init test-eof test-weof test-time regress \
+noinst_PROGRAMS = test-init test-eof test-weof test-time @CHECK_REGRESS@ \
        bench bench_cascade bench_http bench_httpclient test-ratelim \
        test-changelist
+EXTRA_PROGRAMS = regress
 noinst_HEADERS = tinytest.h tinytest_macros.h regress.h tinytest_local.h
 
 TESTS = $(top_srcdir)/test/test.sh
 
-BUILT_SOURCES = regress.gen.c regress.gen.h
+BUILT_SOURCES =
+if BUILD_REGRESS
+BUILT_SOURCES += regress.gen.c regress.gen.h
+endif
+
 test_init_SOURCES = test-init.c
 test_init_LDADD = ../libevent_core.la
 test_eof_SOURCES = test-eof.c
index 0054faee5ea5ed7cd2f956f71ea6bdf10e6c1587..6460306f58168114149380d0876113b229693297 100755 (executable)
@@ -97,6 +97,7 @@ run_tests () {
                announce FAILED ;
                FAILED=yes
        fi
+       test -x $TEST_DIR/regress || return
        announce_n " regress: "
        if test "$TEST_OUTPUT_FILE" = "/dev/null" ;
        then