You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ic...@apache.org on 2018/10/19 11:35:44 UTC

svn commit: r1844330 - in /httpd/test/mod_h2/trunk: README.md clients/Makefile.am configure.ac nghttp2/Makefile.am

Author: icing
Date: Fri Oct 19 11:35:44 2018
New Revision: 1844330

URL: http://svn.apache.org/viewvc?rev=1844330&view=rev
Log:
work on configure to avoid local installs when system provides necessary components

Modified:
    httpd/test/mod_h2/trunk/README.md
    httpd/test/mod_h2/trunk/clients/Makefile.am
    httpd/test/mod_h2/trunk/configure.ac
    httpd/test/mod_h2/trunk/nghttp2/Makefile.am

Modified: httpd/test/mod_h2/trunk/README.md
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/README.md?rev=1844330&r1=1844329&r2=1844330&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/README.md (original)
+++ httpd/test/mod_h2/trunk/README.md Fri Oct 19 11:35:44 2018
@@ -13,6 +13,34 @@ without warranty of any kind. See LICENS
 This repository contains a setup and test cases for the HTTP/2 implementation
 inside [Apache httpd](https://httpd.apache.org).
 
+##how to install/setup
+
+This test suite is designed to run a against a httpd installation, including the ```apxs``` command. On a checkout
+you run:
+
+```
+> autoreconf -i
+> ./configure --with-apxs=/opt/httpd-trunk
+```
+
+by giving the full path to your apxs. It will check if the necessary libraries and tools are
+in place: ```openssl```, ```nghttp2``` and ```curl``` and if they support the necessary
+features (e.g. HTTP2).
+
+If not, it will setup the Makefiles to download, build and install them. This might not be what
+you want, if you have httpd installed in your system prefix, e.g. ```/usr```. But it is handy if
+you test several httpds installed in various ```$prefix``` locations.
+
+If you want to force such a local installation, or if you want to test a specific version, you may
+invoke ```configure``` with any of the following arguments:
+
+  * ```-with-local-nghttp2```
+  * ```-with-local-openssl```
+  * ```-with-local-curl```
+
+If you give no specific version, the configure will choose a predefined one. Otherwise, give
+the version as a parameter, as in  ```-with-local-openssl=1.1.1``` 
+
 ##how to use it
 
 Take a release, run `configure` and specify the `apxs` to use via `--with-apxs=<path to binary>` if it is not in any default location.
@@ -36,7 +64,9 @@ to your `/etc/hosts` file.
 
 You have checked out the `httpd/trunk` and build the server against prefix `/opt/httpd-trunk`. Then get mod_h2\_test and run
 
-`> ./configure --with-apxs=/opt/httpd-trunk`
+```
+> ./configure --with-apxs=/opt/httpd-trunk
+```
 
 and you can run h2 test cases using the `httpd` and all the modules from `/opt/httpd-trunk`. Binary and modules are not copy, so if you update your httpd installation, you can rerun the tests right away.
 
@@ -45,4 +75,4 @@ and you can run h2 test cases using the
 
 * `make restart`: stops and then starts the server again
 * `make stop`: stop a running server
-* `make loadtest`: run a series of load pressuring tests against your server 
\ No newline at end of file
+* `make loadtest`: run a series of load pressuring tests against your server 

Modified: httpd/test/mod_h2/trunk/clients/Makefile.am
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/clients/Makefile.am?rev=1844330&r1=1844329&r2=1844330&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/clients/Makefile.am (original)
+++ httpd/test/mod_h2/trunk/clients/Makefile.am Fri Oct 19 11:35:44 2018
@@ -22,7 +22,7 @@ GEN          = gen
 
 CURL_CONF    = @CURL_CONF@
 
-all: install-curl
+all: @CLIENT_TARGETS@
 
 dirs:
 	@mkdir -p $(GEN)/build

Modified: httpd/test/mod_h2/trunk/configure.ac
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/configure.ac?rev=1844330&r1=1844329&r2=1844330&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/configure.ac (original)
+++ httpd/test/mod_h2/trunk/configure.ac Fri Oct 19 11:35:44 2018
@@ -44,6 +44,17 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_R
 
 OS=$( uname -s )
 
+# Version of things we try to install when missing
+NGHTTP2_VERSION=1.33.0
+CURL_VERSION=7.61.1
+OPENSSL_VERSION=1.1.1
+LIBEVENT_VERSION=2.0.22-stable
+LIBEV_VERSION=4.24
+ZLIB_VERSION=1.2.11
+SPDYLAY_VERSION=1.3.2
+CARES_VERSION=1.12.0
+
+
 AC_ARG_WITH([apxs], [AS_HELP_STRING([--with-apxs],
     [Use APXS executable [default=check]])],
     [request_apxs=$withval], [request_apxs=check])
@@ -52,19 +63,21 @@ AC_ARG_WITH([serverdir], [AS_HELP_STRING
     [Use serverdir directory for setup [default=gen/apache]])],
     [request_serverdir=$withval], [request_serverdir=$PWD/gen/apache])
 
-NGHTTP2_VERSION=1.33.0
-
-AC_ARG_WITH([nghttp2-version], [AS_HELP_STRING([--with-nghttp2-version],
+AC_ARG_WITH([local-nghttp2], [AS_HELP_STRING([--with-local-nghttp2],
     [Use nghttp2 of specified version [default=<ignore>]])],
-    [NGHTTP2_VERSION_EXACT=$withval], [NGHTTP2_VERSION_EXACT=])
+    [LOCAL_NGHTTP2=${withval:-$NGHTTP2_VERSION}], [LOCAL_NGHTTP2=])
 
 AC_ARG_WITH([local-openssl], [AS_HELP_STRING([--with-local-openssl],
     [Use a locally built OpenSSL library [default=<ignore>]])],
-    [LOCAL_OPENSSL=$withval], [LOCAL_OPENSSL=])
+    [LOCAL_OPENSSL=${withval:-$OPENSSL_VERSION}], [LOCAL_OPENSSL=])
 
-AC_ARG_WITH([macos-ok], [AS_HELP_STRING([--with-macos-ok],
-    [macOS setup is OK [default=<ignore>]])],
-    [MACOS_OK=$withval], [MACOS_OK=])
+AC_ARG_WITH([local-curl], [AS_HELP_STRING([--with-local-curl],
+    [Use a locally built curl+libcurl [default=<ignore>]])],
+    [LOCAL_CURL=${withval:-$CURL_VERSION}], [LOCAL_CURL=])
+
+if test "x$LOCAL_NGHTTP2" = "xyes"; then LOCAL_NGHTTP2="$NGHTTP2_VERSION"; fi
+if test "x$LOCAL_OPENSSL" = "xyes"; then LOCAL_OPENSSL="$OPENSSL_VERSION"; fi
+if test "x$LOCAL_CURL" = "xyes"; then LOCAL_CURL="$CURL_VERSION"; fi
 
 export BUILD_SUBDIRS="clients mh2fuzz"
 
@@ -132,10 +145,12 @@ TEST_DEP=""
 ################################################################################
 # curl 
 ################################################################################
-CURL_VERSION=7.61.1
 
+# Use an installed curl iff it supports nghttp2
+# Unless a specific local version is requested, then check
+# if there is a local curl of the given version
+#
 AC_PATH_PROG([CURL], [curl])
-#CURL=""
 if test "x${CURL}" != "x"; then
     feats="$( ${CURL} -V | grep 'Features:.*HTTP2' )"
     if test "x$feats" = "x"; then
@@ -144,21 +159,31 @@ if test "x${CURL}" != "x"; then
     fi
 fi
 
-if test -x "${prefix}/bin/curl"; then
-    feats="$( ${prefix}/bin/curl -V | grep 'Features:.*HTTP2' )"
-    if test "x$feats" != "x"; then
-        CURL="${prefix}/bin/curl"
-        AC_MSG_NOTICE([$CURL however implements HTTP2])
+# No (suitable) installed curl, we need a local one
+if test "x$CURL" = "x" -a "x$LOCAL_CURL" = "x"; then
+    LOCAL_CURL="$CURL_VERSION"
+fi
+
+# If we need a local one, and one is there, does it have the version we want?
+if test "x$LOCAL_CURL" != "x"; then
+    CURL_VERSION="${LOCAL_CURL}"
+    CURL=""
+    if test -x "${prefix}/bin/curl"; then
+        x=$( ${prefix}/bin/curl -V); 
+        x=${x%%(*}; 
+        x=${x##curl }
+        if "$x" = "$CURL_VERSION"; then
+            CURL="${prefix}/bin/curl"
+        fi
     fi
 fi
 
-# force a local curl
 if test "x${CURL}" = "x"; then
-#if test "x" = "x"; then
     CURL="${prefix}/bin/curl"
     INSTALL_DEP="install-client"
     INSTALL_ADDITIONAL="$INSTALL_ADDITIONAL curl($CURL_VERSION)"
     CURL_CONF="--without-brotli"
+    CLIENT_TARGETS=install-curl
 else
     CURL_VERSION="$( $CURL --version )"
     CURL_VERSION="${CURL_VERSION#*curl }"
@@ -240,13 +265,14 @@ if test "x$ac_cv_nghttp2" = "xyes"; then
     fi
 fi
 
-if test "x$ac_cv_nghttp2" = "xyes" -a "x$NGHTTP2_VERSION_EXACT" != "x"; then
-    AC_MSG_CHECKING([if nghttp2 has version == $NGHTTP2_VERSION_EXACT])
-    if test $NGHTTP2_VERSION = $NGHTTP2_VERSION_EXACT; then
+if test "x$ac_cv_nghttp2" = "xyes" -a "x$LOCAL_NGHTTP2" != "x"; then
+    AC_MSG_CHECKING([if nghttp2 has version == $LOCAL_NGHTTP2])
+    if test $NGHTTP2_VERSION = $LOCAL_NGHTTP2; then
         AC_MSG_RESULT(OK)
     else
         AC_MSG_RESULT([no, installed is $NGHTTP2_VERSION])
-        NGHTTP2_VERSION=$NGHTTP2_VERSION_EXACT
+        NGHTTP2_VERSION=$LOCAL_NGHTTP2
+        NGHTTP_INSTALLED=""
         ac_cv_nghttp2=no
     fi
 fi
@@ -275,12 +301,6 @@ fi
 # openssl 
 ################################################################################
 
-#OPENSSL_VERSION=1.0.2l
-OPENSSL_VERSION=1.1.1
-LIBEVENT_VERSION=2.0.22-stable
-LIBEV_VERSION=4.24
-ZLIB_VERSION=1.2.11
-
 AC_PATH_PROG([OPENSSL], [openssl])
 if test "x${LOCAL_OPENSSL}" != "x"; then
     OPENSSL_VERSION_PRESENT="na"
@@ -289,11 +309,11 @@ if test "x${LOCAL_OPENSSL}" != "x"; then
 elif test "x${OPENSSL}" = "x"; then
     OPENSSL_VERSION_PRESENT="na"
 else 
-    OPENSSL_VERSION_PRESENT=$( ${OPENSSL} version -v | sed -e 's/OpenSSL *//g' -e 's/[a-z]* .*//g')
+    OPENSSL_VERSION_PRESENT=$( ${OPENSSL} version )
 fi
 
 case "$OPENSSL_VERSION_PRESENT" in
-    1.0.2*|1.1.*)
+    "OpenSSL 1.0.2"*|"OpenSSL 1.1."*|"LibreSSL 2.6."*)
         # acceptable
         CURL_CONF="$CURL_CONF "'--with-nghttp2=$(prefix)'
         ;;
@@ -313,10 +333,10 @@ case "$OPENSSL_VERSION_PRESENT" in
         ;;
 esac
 
-if test "$OS" = "Darwin" -a "x$MACOS_OK" != "xyes"; then
-    NGHTTP2_DEPS="$NGHTTP2_DEPS gen/.zlib-installed gen/.libev-installed"
-    INSTALL_ADDITIONAL="$INSTALL_ADDITIONAL libev($LIBEV_VERSION) zlib($ZLIB_VERSION)"
-fi
+#if test "$OS" = "Darwin" -a "x$MACOS_OK" != "xyes"; then
+#    NGHTTP2_DEPS="$NGHTTP2_DEPS gen/.zlib-installed gen/.libev-installed"
+#    INSTALL_ADDITIONAL="$INSTALL_ADDITIONAL libev($LIBEV_VERSION) zlib($ZLIB_VERSION)"
+#fi
 
 INSTALL_ADDITIONAL="${INSTALL_ADDITIONAL# }"
 
@@ -324,8 +344,6 @@ INSTALL_ADDITIONAL="${INSTALL_ADDITIONAL
 # spdylay 
 ################################################################################
 
-SPDYLAY_VERSION=1.3.2
-
 if test "x$ac_cv_nghttp2" != "xyes"; then
 
     NGHTTP2_DEPS="$NGHTTP2_DEPS gen/.spdylay-installed"
@@ -338,8 +356,6 @@ INSTALL_ADDITIONAL="${INSTALL_ADDITIONAL
 # c-ares 
 ################################################################################
 
-CARES_VERSION=1.12.0
-
 if test "x$ac_cv_nghttp2" != "xyes"; then
 
     NGHTTP2_DEPS="$NGHTTP2_DEPS gen/.cares-installed"
@@ -386,6 +402,7 @@ AC_SUBST(NGHTTP2_VERSION)
 AC_SUBST(NGHTTP)
 AC_SUBST(H2LOAD)
 AC_SUBST(CARES_VERSION)
+AC_SUBST(CLIENT_TARGETS)
 AC_SUBST(CURL_VERSION)
 AC_SUBST(OPENSSL_VERSION)
 AC_SUBST(LIBEV_VERSION)

Modified: httpd/test/mod_h2/trunk/nghttp2/Makefile.am
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/nghttp2/Makefile.am?rev=1844330&r1=1844329&r2=1844330&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/nghttp2/Makefile.am (original)
+++ httpd/test/mod_h2/trunk/nghttp2/Makefile.am Fri Oct 19 11:35:44 2018
@@ -69,7 +69,7 @@ OPENSSL_CONF     = @OPENSSL_CONF@
 
 
 NGHTTP2_CONF_ENV += PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig \
-    LDFLAGS=-L$(prefix)/lib CFLAGS=-I$(prefix)/include
+    LDFLAGS=-L$(prefix)/lib CFLAGS="-I$(prefix)/include" LIBXML2_CPPFLAGS="-I/usr/include/libxml2"
 
 
 all: install