apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1088023 - in /apr/apr/trunk: CHANGES build/apr_rules.mk.in configure.in include/apr.h.in test/Makefile.in
Date Sat, 02 Apr 2011 13:50:07 GMT
Author: trawick
Date: Sat Apr  2 13:50:07 2011
New Revision: 1088023

URL: http://svn.apache.org/viewvc?rev=1088023&view=rev
Log:
MinGW/MSYS:  Support shared builds of APR, other general improvements
to support of this toolchain.

PR: 46175
Submitted by: Carlo Bramini <carlo.bramix libero.it>

Modified:
    apr/apr/trunk/CHANGES
    apr/apr/trunk/build/apr_rules.mk.in
    apr/apr/trunk/configure.in
    apr/apr/trunk/include/apr.h.in
    apr/apr/trunk/test/Makefile.in

Modified: apr/apr/trunk/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/trunk/CHANGES?rev=1088023&r1=1088022&r2=1088023&view=diff
==============================================================================
--- apr/apr/trunk/CHANGES [utf-8] (original)
+++ apr/apr/trunk/CHANGES [utf-8] Sat Apr  2 13:50:07 2011
@@ -1,6 +1,10 @@
                                                      -*- coding: utf-8 -*-
 Changes for APR 2.0.0
 
+  *) MinGW/MSYS:  Support shared builds of APR, other general improvements
+     to support of this toolchain.  PR 46175.  [Carlo Bramini 
+     <carlo.bramix libero.it>]  
+
   *) Support libxml2 as an alternative XML parser to expat [Nick Kew]
 
   *) Hide apr_wait_for_io_or_timeout() from public view and add instead

Modified: apr/apr/trunk/build/apr_rules.mk.in
URL: http://svn.apache.org/viewvc/apr/apr/trunk/build/apr_rules.mk.in?rev=1088023&r1=1088022&r2=1088023&view=diff
==============================================================================
--- apr/apr/trunk/build/apr_rules.mk.in (original)
+++ apr/apr/trunk/build/apr_rules.mk.in Sat Apr  2 13:50:07 2011
@@ -55,6 +55,10 @@ EXTRA_LDFLAGS=@EXTRA_LDFLAGS@
 EXTRA_LIBS=@EXTRA_LIBS@
 EXTRA_INCLUDES=@EXTRA_INCLUDES@
 
+# CPPFLAGS which are used only while building APR itself
+#
+INTERNAL_CPPFLAGS=@INTERNAL_CPPFLAGS@
+
 # NOTEST_* are flags and libraries that can be added by the user without
 # causing them to be used in configure tests (necessary for things like
 # -Werror and other strict warnings that maintainers like to use).
@@ -70,7 +74,7 @@ NOTEST_LIBS=@NOTEST_LIBS@
 # left-to-right precedence and CPPFLAGS may include user-defined overrides.
 #
 ALL_CFLAGS   = $(EXTRA_CFLAGS) $(NOTEST_CFLAGS) $(CFLAGS)
-ALL_CPPFLAGS = $(DEFS) $(EXTRA_CPPFLAGS) $(NOTEST_CPPFLAGS) $(CPPFLAGS)
+ALL_CPPFLAGS = $(DEFS) $(INTERNAL_CPPFLAGS) $(EXTRA_CPPFLAGS) $(NOTEST_CPPFLAGS) $(CPPFLAGS)
 ALL_LDFLAGS  = $(EXTRA_LDFLAGS) $(NOTEST_LDFLAGS) $(LDFLAGS)
 ALL_LIBS     = $(LIBS) $(NOTEST_LIBS) $(EXTRA_LIBS)
 ALL_INCLUDES = $(INCLUDES) $(EXTRA_INCLUDES)

Modified: apr/apr/trunk/configure.in
URL: http://svn.apache.org/viewvc/apr/apr/trunk/configure.in?rev=1088023&r1=1088022&r2=1088023&view=diff
==============================================================================
--- apr/apr/trunk/configure.in (original)
+++ apr/apr/trunk/configure.in Sat Apr  2 13:50:07 2011
@@ -293,7 +293,7 @@ AC_ARG_WITH(libtool, [  --without-libtoo
 if test "x$use_libtool" = "xyes"; then
       lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -o $@ -c $< &&
touch $@'
       LT_VERSION="-version-info `$get_version libtool $version_hdr APR`"
-      link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(LT_LDFLAGS) \$(COMPILE) \$(LT_VERSION)
\$(ALL_LDFLAGS) -o \$@"
+      link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(COMPILE) \$(LT_LDFLAGS) \$(LT_VERSION)
\$(ALL_LDFLAGS) -o \$@"
       so_ext='lo'
       lib_target='-rpath $(libdir) $(OBJECTS)'
       export_lib_target='-rpath \$(libdir) \$(OBJECTS)'
@@ -309,6 +309,9 @@ case $host in
     *-solaris2*)
         apr_platform_runtime_link_flag="-R"
         ;;
+    *-mingw* | *-cygwin*)
+        LT_LDFLAGS="$LT_LDFLAGS -no-undefined"
+        ;;
     *)
         ;;
 esac
@@ -443,6 +446,20 @@ case "$host:$CC" in
 	APR_SETVAR(CC,mwcc)
 	APR_SETVAR(AR,ar)
 	;;
+
+dnl If building static APR, both the APR build and the app build
+dnl need -DAPR_DECLARE_STATIC to generate the right linkage from    
+dnl APR_DECLARE et al.
+dnl If building dynamic APR, the APR build needs APR_DECLARE_EXPORT
+dnl and the app build should have neither define.
+
+    *-mingw* | *-cygwin*)
+    if test "$enable_shared" = "yes"; then
+        APR_ADDTO(INTERNAL_CPPFLAGS, -DAPR_DECLARE_EXPORT)
+    else
+        APR_ADDTO(CPPFLAGS, -DAPR_DECLARE_STATIC)
+    fi
+    ;;
 esac
 
 AC_CACHE_CHECK([whether the compiler provides atomic builtins], [ap_cv_atomic_builtins],
@@ -679,14 +696,8 @@ dnl without the extra " " in that case, 
 dnl end up LIBS="-lm -lcrypt -lnsl  -ldl" which is an annoyance.
 case $host in
    *-mingw*)
-      AC_CHECK_LIB(msvcrt, getpid)
-      APR_CHECK_DLL_FUNC(kernel32, SetErrorMode@4)
-      APR_CHECK_DLL_FUNC(advapi32, GetSecurityInfo@32)
-      APR_CHECK_DLL_FUNC(ws2_32, gethostbyname@4)
-      APR_CHECK_DLL_FUNC(shell32, CommandLineToArgvW@8)
-      APR_CHECK_DLL_FUNC(kernel32,[CreateFileMappingA@24],
-         [ac_cv_func_CreateFileMapping=$ac_cv_lib_kernel32_CreateFileMappingA])
-      APR_CHECK_DLL_FUNC(rpcrt4,[UuidCreate@4])
+      APR_ADDTO(LIBS,[-lshell32 -ladvapi32 -lws2_32 -lrpcrt4 -lmswsock])
+      ac_cv_func_CreateFileMapping=yes
       ;;
    *)
       AC_SEARCH_LIBS(gethostbyname, nsl)
@@ -2668,6 +2679,7 @@ AC_SUBST(NOTEST_INCLUDES)
 
 dnl ----------------------------- Construct the files
 
+AC_SUBST(INTERNAL_CPPFLAGS)
 AC_SUBST(LDLIBS)
 AC_SUBST(INCLUDES)
 AC_SUBST(AR)

Modified: apr/apr/trunk/include/apr.h.in
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr.h.in?rev=1088023&r1=1088022&r2=1088023&view=diff
==============================================================================
--- apr/apr/trunk/include/apr.h.in (original)
+++ apr/apr/trunk/include/apr.h.in Sat Apr  2 13:50:07 2011
@@ -472,6 +472,8 @@ typedef  apr_uint32_t            apr_uin
  */
 #define APR_THREAD_FUNC       @apr_thread_func@
 
+#if defined(DOXYGEN) || !defined(WIN32)
+
 /**
  * The public APR functions are declared with APR_DECLARE(), so they may
  * use the most appropriate calling convention.  Public APR functions with 
@@ -524,6 +526,20 @@ typedef  apr_uint32_t            apr_uin
  */
 #define APR_DECLARE_DATA
 
+#elif defined(APR_DECLARE_STATIC)
+#define APR_DECLARE(type)            type __stdcall
+#define APR_DECLARE_NONSTD(type)     type __cdecl
+#define APR_DECLARE_DATA
+#elif defined(APR_DECLARE_EXPORT)
+#define APR_DECLARE(type)            __declspec(dllexport) type __stdcall
+#define APR_DECLARE_NONSTD(type)     __declspec(dllexport) type __cdecl
+#define APR_DECLARE_DATA             __declspec(dllexport)
+#else
+#define APR_DECLARE(type)            __declspec(dllimport) type __stdcall
+#define APR_DECLARE_NONSTD(type)     __declspec(dllimport) type __cdecl
+#define APR_DECLARE_DATA             __declspec(dllimport)
+#endif
+
 #if !defined(WIN32) || defined(APU_MODULE_DECLARE_STATIC)
 /**
  * Declare a dso module's exported module structure as APR_MODULE_DECLARE_DATA.

Modified: apr/apr/trunk/test/Makefile.in
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/Makefile.in?rev=1088023&r1=1088022&r2=1088023&view=diff
==============================================================================
--- apr/apr/trunk/test/Makefile.in (original)
+++ apr/apr/trunk/test/Makefile.in Sat Apr  2 13:50:07 2011
@@ -74,7 +74,7 @@ INCLUDES=-I$(INCDIR) -I$(srcdir)/../incl
 
 # link programs using -no-install to get real executables not
 # libtool wrapper scripts which link an executable when first run.
-LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) \
+LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LT_LDFLAGS) \
 	    @LT_NO_INSTALL@ $(ALL_LDFLAGS) -o $@
 
 # STDTEST_PORTABLE;
@@ -126,10 +126,10 @@ mod_test.lo: $(srcdir)/mod_test.c
 	  -c $(srcdir)/mod_test.c
 
 OBJECTS_mod_test = mod_test.lo
-mod_test.la: $(OBJECTS_mod_test)
+mod_test.la: $(OBJECTS_mod_test) $(LOCAL_LIBS)
 	$(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -module \
 	  -avoid-version $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ \
-	  $(OBJECTS_mod_test)
+	  $(OBJECTS_mod_test) $(LOCAL_LIBS)
 
 OBJECTS_libmod_test = mod_test.lo $(LOCAL_LIBS)
 libmod_test.la: $(OBJECTS_libmod_test)



Mime
View raw message