add mt flavor that can co-exist with the default non-mt flavor

ok kurt@
This commit is contained in:
todd 2007-03-24 13:46:47 +00:00
parent b2d1109146
commit ae292e2030
11 changed files with 254 additions and 74 deletions

View File

@ -1,9 +1,11 @@
# $OpenBSD: Makefile,v 1.7 2006/11/03 10:56:44 alek Exp $
# $OpenBSD: Makefile,v 1.8 2007/03/24 13:46:47 todd Exp $
COMMENT= "Apache Portable Runtime"
DISTNAME= apr-1.2.7
SHARED_LIBS += apr-1 2.7 # .2.7
PKGNAME= ${DISTNAME}p0
FULLPKGNAME= apr${MT}-1.2.7p0
SHARED_LIBS += apr-1${MT} 2.7 # .2.7
CATEGORIES= devel
@ -22,8 +24,27 @@ MASTER_SITES= ${MASTER_SITE_APACHE:=apr/}
USE_LIBTOOL= Yes
CONFIGURE_STYLE=gnu
CONFIGURE_ARGS= ${CONFIGURE_SHARED} \
--with-installbuilddir=${LOCALBASE}/lib/apr-1/ \
--enable-other-child \
--disable-threads
--includedir=${LOCALBASE}/include/apr-1${MT}/ \
--with-installbuilddir=${LOCALBASE}/lib/apr-1${MT}/ \
--enable-other-child
FLAVORS= mt
FLAVOR?=
SUBST_VARS+= MT
.if ${FLAVOR:L:Mmt}
MT=-mt
CONFIGURE_ARGS+= --enable-threads
post-install:
sed 's/{APR_LIBNAME}/{APR_LIBNAME}-mt/g' ${WRKSRC}/apr-config.out > ${PREFIX}/bin/apr-1-mt-config
.else
MT=
CONFIGURE_ARGS+= --disable-threads
.endif
MAKE_ENV+= MT=${MT}
FAKE_ENV+= MT=${MT}
.include <bsd.port.mk>

View File

@ -0,0 +1,42 @@
$OpenBSD: patch-Makefile_in,v 1.1 2007/03/24 13:46:47 todd Exp $
--- Makefile.in.orig Fri Feb 4 05:55:44 2005
+++ Makefile.in Thu Feb 8 14:25:50 2007
@@ -3,6 +3,7 @@ srcdir=@srcdir@
VPATH=@srcdir@
top_srcdir=@apr_srcdir@
top_blddir=@apr_builddir@
+MT?=
#
# APR (Apache Portable Runtime) library Makefile.
@@ -26,9 +27,10 @@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFO
CLEAN_SUBDIRS= test
INSTALL_SUBDIRS=@INSTALL_SUBDIRS@
-TARGET_LIB = lib@APR_LIBNAME@.la
-APR_PCFILE = apr-$(APR_MAJOR_VERSION).pc
+TARGET_LIB = lib@APR_LIBNAME@${MT}.la
+APR_PCFILE = apr-$(APR_MAJOR_VERSION)${MT}.pc
APR_CONFIG = apr-$(APR_MAJOR_VERSION)-config
+APR_INSTCONFIG = apr-$(APR_MAJOR_VERSION)${MT}-config
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -75,7 +77,7 @@ install: $(TARGET_LIB) apr-config.out bu
done
$(LIBTOOL) --mode=install $(INSTALL) -m 755 $(TARGET_LIB) $(DESTDIR)$(libdir)
$(INSTALL_DATA) apr.exp $(DESTDIR)$(libdir)/apr.exp
- $(INSTALL_DATA) apr.pc $(DESTDIR)$(libdir)/pkgconfig/$(APR_PCFILE)
+ $(INSTALL_DATA) apr${MT}.pc $(DESTDIR)$(libdir)/pkgconfig/$(APR_PCFILE)
for f in libtool shlibtool; do \
if test -f $${f}; then $(INSTALL) -m 755 $${f} $(DESTDIR)$(installbuilddir); fi; \
done
@@ -84,7 +86,7 @@ install: $(TARGET_LIB) apr-config.out bu
$(INSTALL_DATA) $(top_srcdir)/build/$${f} $(DESTDIR)$(installbuilddir); \
done
$(INSTALL_DATA) build/apr_rules.out $(DESTDIR)$(installbuilddir)/apr_rules.mk
- $(INSTALL) -m 755 apr-config.out $(DESTDIR)$(bindir)/$(APR_CONFIG)
+ $(INSTALL) -m 755 apr-config.out $(DESTDIR)$(bindir)/$(APR_INSTCONFIG)
@if [ $(INSTALL_SUBDIRS) != "none" ]; then \
for i in $(INSTALL_SUBDIRS); do \
( cd $$i ; $(MAKE) DESTDIR=$(DESTDIR) install ); \

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-apr-mt_pc_in,v 1.1 2007/03/24 13:46:47 todd Exp $
--- apr-mt.pc.in.orig Thu Feb 8 14:19:40 2007
+++ apr-mt.pc.in Thu Feb 8 14:25:06 2007
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+APR_MAJOR_VERSION=@APR_MAJOR_VERSION@
+includedir=@includedir@
+
+Name: APR
+Description: The Apache Portable Runtime library
+Version: @APR_DOTTED_VERSION@
+Libs: -L${libdir} -l@APR_LIBNAME@-mt @EXTRA_LIBS@
+Cflags: @EXTRA_CPPFLAGS@ @EXTRA_CFLAGS@ -I${includedir}

View File

@ -1,23 +1,51 @@
$OpenBSD: patch-configure,v 1.3 2005/01/20 18:48:54 alek Exp $
--- configure.orig Wed Nov 17 02:17:20 2004
+++ configure Tue Jan 18 16:29:35 2005
@@ -4290,11 +4290,6 @@ if test "x$apr_preload_done" != "xyes" ;
$OpenBSD: patch-configure,v 1.4 2007/03/24 13:46:47 todd Exp $
--- configure.orig Sun Apr 9 16:32:36 2006
+++ configure Fri Feb 9 16:17:35 2007
@@ -4317,6 +4317,11 @@ if test "x$apr_preload_done" != "xyes" ;
;;
*-openbsd*)
- if test "x$CPPFLAGS" = "x"; then
- test "x$silent" != "xyes" && echo " setting CPPFLAGS to \"-D_POSIX_THREADS\""
- CPPFLAGS="-D_POSIX_THREADS"
- else
- apr_addto_bugger="-D_POSIX_THREADS"
for i in $apr_addto_bugger; do
apr_addto_duplicate="0"
for j in $CPPFLAGS; do
@@ -4308,7 +4303,6 @@ if test "x$apr_preload_done" != "xyes" ;
CPPFLAGS="$CPPFLAGS $i"
fi
done
- fi
+ if test -z "$apr_lock_method"; then
+ test "x$silent" != "xyes" && echo " setting apr_lock_method to \"USE_FLOCK_SERIALIZE\""
+ apr_lock_method="USE_FLOCK_SERIALIZE"
+ fi
+
if test "x$CPPFLAGS" = "x"; then
test "x$silent" != "xyes" && echo " setting CPPFLAGS to \"-D_POSIX_THREADS\""
CPPFLAGS="-D_POSIX_THREADS"
@@ -26147,7 +26152,7 @@ if test "${apr_cv_pthreads_lib+set}" = s
else
# binding to an ephemeral port fails on OpenBSD so override
# the test for O_NONBLOCK inheritance across accept().
apr_ptc_libs=$LIBS
- for lib in -lpthread -lpthreads -lc_r; do
+ for lib in -pthread -lpthread -lpthreads -lc_r; do
LIBS="$apr_ptc_libs $lib"
if test "$cross_compiling" = yes; then
@@ -26705,7 +26710,7 @@ if test "${apr_cv_pthreads_lib+set}" = s
else
apr_ptc_libs=$LIBS
- for lib in -lpthread -lpthreads -lc_r; do
+ for lib in -pthread -lpthread -lpthreads -lc_r; do
LIBS="$apr_ptc_libs $lib"
if test "$cross_compiling" = yes; then
@@ -39523,7 +39528,7 @@ for ac_spec in func:semget func:semctl d
done
if test ".$ac_rc" = .yes; then
:
- hassysvser="1"
+ hassysvser="0"
else
:
hassysvser="0"
@@ -43558,7 +43563,7 @@ esac
- ac_config_files="$ac_config_files Makefile include/apr.h build/apr_rules.mk build/pkg/pkginfo apr-$APR_MAJOR_VERSION-config:apr-config.in apr.pc"
+ ac_config_files="$ac_config_files Makefile include/apr.h build/apr_rules.mk build/pkg/pkginfo apr-$APR_MAJOR_VERSION-config:apr-config.in apr.pc apr-mt.pc"
if test -d $srcdir/test; then

View File

@ -0,0 +1,19 @@
$OpenBSD: patch-network_io_unix_sockets_c,v 1.1 2007/03/24 13:46:47 todd Exp $
--- network_io/unix/sockets.c.orig Thu Dec 8 12:24:36 2005
+++ network_io/unix/sockets.c Wed Oct 4 20:17:38 2006
@@ -256,6 +256,15 @@ apr_status_t apr_socket_accept(apr_socke
apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa)
{
int rc;
+/*
+ * OpenBSD doesn't support connect() to INADDR_ANY so convert to
+ * INADDR_LOOPBACK to emulate what is expected.
+ */
+#ifdef __OpenBSD__
+ if (sa->family == APR_INET)
+ if (sa->sa.sin.sin_addr.s_addr == INADDR_ANY)
+ sa->sa.sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+#endif
do {
rc = connect(sock->socketdes,

View File

@ -0,0 +1,29 @@
$OpenBSD: patch-test_Makefile_in,v 1.1 2007/03/24 13:46:47 todd Exp $
--- test/Makefile.in.orig Tue Mar 21 14:29:41 2006
+++ test/Makefile.in Fri Feb 9 15:54:33 2007
@@ -12,12 +12,13 @@ VPATH = @srcdir@
STDTEST_PORTABLE = \
testlockperf@EXEEXT@ \
- testshmproducer@EXEEXT@ \
- testshmconsumer@EXEEXT@ \
testmutexscope@EXEEXT@ \
testall@EXEEXT@
-OTHER_PROGRAMS = sendfile@EXEEXT@
+OTHER_PROGRAMS = \
+ sendfile@EXEEXT@ \
+ testshmproducer@EXEEXT@ \
+ testshmconsumer@EXEEXT@
PROGRAMS = $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) $(OTHER_PROGRAMS)
@@ -26,7 +27,7 @@ TARGETS = $(PROGRAMS)
# bring in rules.mk for standard functionality
@INCLUDE_RULES@
-LOCAL_LIBS=../lib@APR_LIBNAME@.la
+LOCAL_LIBS=../lib@APR_LIBNAME@${MT}.la
CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child@EXEEXT@ occhild@EXEEXT@ \
readchild@EXEEXT@ tryread@EXEEXT@ sockchild@EXEEXT@ \

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-user_unix_groupinfo_c,v 1.1 2007/03/24 13:46:47 todd Exp $
--- user/unix/groupinfo.c.orig Wed Aug 24 04:42:42 2005
+++ user/unix/groupinfo.c Wed Feb 7 18:14:53 2007
@@ -35,7 +35,7 @@ APR_DECLARE(apr_status_t) apr_gid_name_g
#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
struct group grp;
- char grbuf[512];
+ char grbuf[3072];
apr_status_t rv;
/* See comment in getpwnam_safe on error handling. */
@@ -63,7 +63,7 @@ APR_DECLARE(apr_status_t) apr_gid_get(ap
#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRNAM_R)
struct group grp;
- char grbuf[512];
+ char grbuf[3072];
apr_status_t rv;
/* See comment in getpwnam_safe on error handling. */

View File

@ -0,0 +1,2 @@
@comment $OpenBSD: PFRAG.mt-shared,v 1.1 2007/03/24 13:46:47 todd Exp $
@lib lib/libapr-1-mt.so.${LIBapr-1-mt_VERSION}

View File

@ -0,0 +1,2 @@
@comment $OpenBSD: PFRAG.no-mt-shared,v 1.1 2007/03/24 13:46:47 todd Exp $
@lib lib/libapr-1.so.${LIBapr-1_VERSION}

View File

@ -1,2 +1,3 @@
@comment $OpenBSD: PFRAG.shared,v 1.2 2006/01/06 13:14:28 bernd Exp $
@lib lib/libapr-1.so.${LIBapr-1_VERSION}
@comment $OpenBSD: PFRAG.shared,v 1.3 2007/03/24 13:46:47 todd Exp $
%%mt%%
!%%mt%%

View File

@ -1,51 +1,51 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2004/11/28 14:27:38 alek Exp $
@comment $OpenBSD: PLIST,v 1.2 2007/03/24 13:46:47 todd Exp $
%%SHARED%%
bin/apr-1-config
include/apr-1/
include/apr-1/apr.h
include/apr-1/apr_allocator.h
include/apr-1/apr_atomic.h
include/apr-1/apr_dso.h
include/apr-1/apr_env.h
include/apr-1/apr_errno.h
include/apr-1/apr_file_info.h
include/apr-1/apr_file_io.h
include/apr-1/apr_fnmatch.h
include/apr-1/apr_general.h
include/apr-1/apr_getopt.h
include/apr-1/apr_global_mutex.h
include/apr-1/apr_hash.h
include/apr-1/apr_inherit.h
include/apr-1/apr_lib.h
include/apr-1/apr_mmap.h
include/apr-1/apr_network_io.h
include/apr-1/apr_poll.h
include/apr-1/apr_pools.h
include/apr-1/apr_portable.h
include/apr-1/apr_proc_mutex.h
include/apr-1/apr_random.h
include/apr-1/apr_ring.h
include/apr-1/apr_shm.h
include/apr-1/apr_signal.h
include/apr-1/apr_strings.h
include/apr-1/apr_support.h
include/apr-1/apr_tables.h
include/apr-1/apr_thread_cond.h
include/apr-1/apr_thread_mutex.h
include/apr-1/apr_thread_proc.h
include/apr-1/apr_thread_rwlock.h
include/apr-1/apr_time.h
include/apr-1/apr_user.h
include/apr-1/apr_version.h
include/apr-1/apr_want.h
lib/apr-1/
lib/apr-1/apr_rules.mk
lib/apr-1/libtool
lib/apr-1/make_exports.awk
lib/apr-1/make_var_export.awk
lib/apr-1/mkdir.sh
bin/apr-1${MT}-config
include/apr-1${MT}/
include/apr-1${MT}/apr.h
include/apr-1${MT}/apr_allocator.h
include/apr-1${MT}/apr_atomic.h
include/apr-1${MT}/apr_dso.h
include/apr-1${MT}/apr_env.h
include/apr-1${MT}/apr_errno.h
include/apr-1${MT}/apr_file_info.h
include/apr-1${MT}/apr_file_io.h
include/apr-1${MT}/apr_fnmatch.h
include/apr-1${MT}/apr_general.h
include/apr-1${MT}/apr_getopt.h
include/apr-1${MT}/apr_global_mutex.h
include/apr-1${MT}/apr_hash.h
include/apr-1${MT}/apr_inherit.h
include/apr-1${MT}/apr_lib.h
include/apr-1${MT}/apr_mmap.h
include/apr-1${MT}/apr_network_io.h
include/apr-1${MT}/apr_poll.h
include/apr-1${MT}/apr_pools.h
include/apr-1${MT}/apr_portable.h
include/apr-1${MT}/apr_proc_mutex.h
include/apr-1${MT}/apr_random.h
include/apr-1${MT}/apr_ring.h
include/apr-1${MT}/apr_shm.h
include/apr-1${MT}/apr_signal.h
include/apr-1${MT}/apr_strings.h
include/apr-1${MT}/apr_support.h
include/apr-1${MT}/apr_tables.h
include/apr-1${MT}/apr_thread_cond.h
include/apr-1${MT}/apr_thread_mutex.h
include/apr-1${MT}/apr_thread_proc.h
include/apr-1${MT}/apr_thread_rwlock.h
include/apr-1${MT}/apr_time.h
include/apr-1${MT}/apr_user.h
include/apr-1${MT}/apr_version.h
include/apr-1${MT}/apr_want.h
lib/apr-1${MT}/
lib/apr-1${MT}/apr_rules.mk
lib/apr-1${MT}/libtool
lib/apr-1${MT}/make_exports.awk
lib/apr-1${MT}/make_var_export.awk
lib/apr-1${MT}/mkdir.sh
@comment lib/apr.exp
lib/libapr-1.a
lib/libapr-1.la
lib/libapr-1${MT}.a
lib/libapr-1${MT}.la
lib/pkgconfig/
lib/pkgconfig/apr-1.pc
lib/pkgconfig/apr-1${MT}.pc