AM_CONDITIONAL([HAVE_CUNIT], [ test "x${have_cunit}" = "xyes" ])
# libev (for src)
- # libev does not have pkg-config file. Check it in an old way.
- save_LIBS=$LIBS
- # android requires -lm for floor
- AC_CHECK_LIB([ev], [ev_time], [have_libev=yes], [have_libev=no], [-lm])
- if test "x${have_libev}" = "xyes"; then
- AC_CHECK_HEADER([ev.h], [have_libev=yes], [have_libev=no])
- if test "x${have_libev}" = "xyes"; then
- LIBEV_LIBS=-lev
- LIBEV_CFLAGS=
- AC_SUBST([LIBEV_LIBS])
- AC_SUBST([LIBEV_CFLAGS])
+ have_libev=no
+ if test "x${request_libev}" != "xno"; then
+ if test "x${LIBEV_LIBS}" = "x" && test "x${LIBEV_CFLAGS}" = "x"; then
+ # libev does not have pkg-config file. Check it in an old way.
+ save_LIBS=$LIBS
+ # android requires -lm for floor
+ AC_CHECK_LIB([ev], [ev_time], [have_libev=yes], [have_libev=no], [-lm])
+ if test "x${have_libev}" = "xyes"; then
+ AC_CHECK_HEADER([ev.h], [have_libev=yes], [have_libev=no])
+ if test "x${have_libev}" = "xyes"; then
+ LIBEV_LIBS=-lev
+ LIBEV_CFLAGS=
+ fi
+ fi
+ LIBS=$save_LIBS
+ else
+ have_libev=yes
fi
fi
- LIBS=$save_LIBS
+
+ if test "x${request_libev}" = "xyes" &&
+ test "x${have_libev}" != "xyes"; then
+ AC_MSG_ERROR([libev was requested (--with-libev) but not found])
+ fi
# openssl (for src)
- PKG_CHECK_MODULES([OPENSSL], [openssl1.1 >= 1.0.1],
- [have_openssl=yes], [have_openssl=no])
- if test "x${have_openssl}" = "xno"; then
- AC_MSG_NOTICE($OPENSSL_PKG_ERRORS)
+ have_openssl=no
+ if test "x${request_openssl}" != "xno"; then
- PKG_CHECK_MODULES([OPENSSL], [openssl >= 1.0.1],
++ PKG_CHECK_MODULES([OPENSSL], [openssl1.1 >= 1.0.1],
+ [have_openssl=yes], [have_openssl=no])
+ if test "x${have_openssl}" = "xno"; then
+ AC_MSG_NOTICE($OPENSSL_PKG_ERRORS)
+ else
+ save_CFLAGS="$CFLAGS"
+ save_LIBS="$LIBS"
+ CFLAGS="$OPENSSL_CFLAGS $CFLAGS"
+ LIBS="$OPENSSL_LIBS $LIBS"
+
+ # quictls/openssl has SSL_is_quic.
+ have_ssl_is_quic=no
+ AC_MSG_CHECKING([for SSL_is_quic])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ #include <openssl/ssl.h>
+ ]], [[
+ SSL *ssl = NULL;
+ SSL_is_quic(ssl);
+ ]])],
+ [AC_MSG_RESULT([yes]); have_ssl_is_quic=yes],
+ [AC_MSG_RESULT([no]); have_ssl_is_quic=no])
+
+ # boringssl has SSL_set_quic_early_data_context.
+ AC_MSG_CHECKING([for SSL_set_quic_early_data_context])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ #include <openssl/ssl.h>
+ ]], [[
+ SSL *ssl = NULL;
+ SSL_set_quic_early_data_context(ssl, NULL, 0);
+ ]])],
+ [AC_MSG_RESULT([yes]); have_boringssl_quic=yes],
+ [AC_MSG_RESULT([no]); have_boringssl_quic=no])
+
+ CFLAGS="$save_CFLAGS"
+ LIBS="$save_LIBS"
+ fi
+ fi
+
+ if test "x${request_openssl}" = "xyes" &&
+ test "x${have_openssl}" != "xyes"; then
+ AC_MSG_ERROR([openssl was requested (--with-openssl) but not found])
fi
# c-ares (for src)
--- /dev/null
- Version: 1.41.0
+%define _unpackaged_files_terminate_build 0
+Prefix: %{_usr}
+Name: nghttp2
++Version: 1.46.0
+Release: 1
+Summary: This is an experimental implementation of Hypertext Transfer Protocol version 2.
+Group: System Environment/Libraries
+License: MIT
+URL: https://nghttp2.org/
+Source0: %{name}-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildRequires: pkgconfig >= 0.20, zlib >= 1.2.3, gcc, gcc-c++, make
+BuildRequires: libopenssl1.1-devel
+BuildRequires: libxml2-devel
+%if "%{tizen_profile_name}" != "tv"
+BuildRequires: boost-devel
+BuildRequires: libcares-devel
+BuildRequires: zlib-devel
+BuildRequires: libev-devel
+%endif
+
+%description
+
+%package devel
+Summary: Development files for %{name}
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+The %{name}-devel package contains libraries and header files for
+developing applications that use %{name}.
+
+%if "%{tizen_profile_name}" != "tv"
+%package tools
+Summary: Tool files for %{name}
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description tools
+The %{name}-tools package contains tool files for %{name}.
+%endif
+
+
+%prep
+%setup -q
+
+%build
+autoreconf -i
+%{__automake}
+%{__autoconf}
+%configure \
+%if "%{tizen_profile_name}" != "tv"
+ --enable-asio-lib \
+ --enable-app \
+%endif
+ --disable-xmltest \
+ --disable-static
+%{__make} %{?_smp_mflags}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%{__make} install DESTDIR=$RPM_BUILD_ROOT
+
+find %{buildroot}%{_bindir}/ -type f -not -name 'nghttpx' -delete
+%{remove_docs}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%manifest %{name}.manifest
+%{_libdir}/*.so*
+%exclude %{_libdir}/*.la
+%license COPYING
+
+%if "%{tizen_profile_name}" != "tv"
+%files tools
+%defattr(-,root,root,-)
+%{_bindir}/nghttpx
+%endif
+
+%files devel
+%defattr(-,root,root,-)
+%{_includedir}/*
+%{_libdir}/*.so
+%{_libdir}/pkgconfig/*.pc
@OPENSSL_CFLAGS@ \
@LIBCARES_CFLAGS@ \
@JANSSON_CFLAGS@ \
+ @LIBBPF_CFLAGS@ \
@ZLIB_CFLAGS@ \
- @DEFS@
+ @EXTRA_DEFS@ \
+ @DEFS@ \
+ -fPIE
+ AM_LDFLAGS = @LIBTOOL_LDFLAGS@
LDADD = $(top_builddir)/lib/libnghttp2.la \
$(top_builddir)/third-party/liburl-parser.la \
asio_client_stream.cc asio_client_stream.h \
asio_client_tls_context.cc asio_client_tls_context.h
-libnghttp2_asio_la_CPPFLAGS = ${AM_CPPFLAGS} ${BOOST_CPPFLAGS}
-libnghttp2_asio_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-info 1:0:0
++
+libnghttp2_asio_la_CPPFLAGS = ${AM_CPPFLAGS} ${BOOST_CPPFLAGS} -fPIE
- libnghttp2_asio_la_LDFLAGS = -no-undefined -version-info 1:0:0 -pie
++libnghttp2_asio_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-info 1:0:0 -pie
libnghttp2_asio_la_LIBADD = \
$(top_builddir)/lib/libnghttp2.la \
$(top_builddir)/third-party/liburl-parser.la \