You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-cvs@tcl.apache.org by pe...@apache.org on 2017/08/04 23:51:57 UTC

svn commit: r1804165 - in /tcl/rivet/branches/cmake: ./ cmake/ cmake/cmake_extra_modules/ src/mod_rivet_ng/ src/parser/

Author: petasis
Date: Fri Aug  4 23:51:57 2017
New Revision: 1804165

URL: http://svn.apache.org/viewvc?rev=1804165&view=rev
Log:
Fix Windows compilation errors

Modified:
    tcl/rivet/branches/cmake/ChangeLog
    tcl/rivet/branches/cmake/cmake/CMakeLists.txt
    tcl/rivet/branches/cmake/cmake/cmake_extra_modules/FindAPR.cmake
    tcl/rivet/branches/cmake/src/mod_rivet_ng/TclWebapache.c
    tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet.c
    tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet.h
    tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet_cache.c
    tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet_common.c
    tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet_generator.c
    tcl/rivet/branches/cmake/src/mod_rivet_ng/rivetCore.c
    tcl/rivet/branches/cmake/src/parser/rivetParser.c

Modified: tcl/rivet/branches/cmake/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/cmake/ChangeLog?rev=1804165&r1=1804164&r2=1804165&view=diff
==============================================================================
--- tcl/rivet/branches/cmake/ChangeLog (original)
+++ tcl/rivet/branches/cmake/ChangeLog Fri Aug  4 23:51:57 2017
@@ -1,3 +1,16 @@
+2017-08-04 Georgios Petasis <pe...@apache.org>
+	* cmake\CMakeLists.txt:
+	* cmake\cmake_extra_modules\FindAPR.cmake:
+	* src\mod_rivet_ng\TclWebapache.c:
+	* src\mod_rivet_ng\mod_rivet.c:
+	* src\mod_rivet_ng\mod_rivet.h:
+	* src\mod_rivet_ng\mod_rivet_cache.c:
+	* src\mod_rivet_ng\mod_rivet_common.c:
+	* src\mod_rivet_ng\mod_rivet_generator.c:
+	* src\mod_rivet_ng\rivetCore.c:
+	* src\parser\rivetParser.c: Changes for fixing compilation errors under
+	Windows.
+
 2017-08-04 Massimo Manghi <mx...@apache.org>
     * src/mod_rivet_ng/rivetCore.c: changes demanded by windows compiler
     * rivet/pkgIndex.tcl: recreated with a up to date list of packages

Modified: tcl/rivet/branches/cmake/cmake/CMakeLists.txt
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/cmake/cmake/CMakeLists.txt?rev=1804165&r1=1804164&r2=1804165&view=diff
==============================================================================
--- tcl/rivet/branches/cmake/cmake/CMakeLists.txt (original)
+++ tcl/rivet/branches/cmake/cmake/CMakeLists.txt Fri Aug  4 23:51:57 2017
@@ -228,6 +228,18 @@ target_include_directories(mod_rivet
 target_link_libraries(rivetparser        ${TCL_STUB_LIBRARY})
 target_link_libraries(rivetlib           ${TCL_STUB_LIBRARY})
 target_link_libraries(mod_rivet          ${TCL_LIBRARY})
+if(WIN32)
+  # Under Windows, we need to link with all libraries, even libhttpd.lib
+  MESSAGE ( STATUS "Searching for libhttpd.lib (Windows)..." )
+  FIND_LIBRARY(APACHE_HTTPD_LIBRARY libhttpd libhttpd.lib
+    NAMES ${APACHE_HTTPD_NAMES}
+    PATHS ${APACHE_HTTPD_LIBRARY_HINTS}
+          ${APACHE_ROOT}/lib
+  )
+  MESSAGE ( STATUS "  APACHE_HTTPD_LIBRARY:    " ${APACHE_HTTPD_LIBRARY} )
+
+  target_link_libraries(mod_rivet ${APR_LIBRARY} ${APACHE_HTTPD_LIBRARY})
+endif(WIN32)
 
 #  Handle user options...
 # ===========================================================================

Modified: tcl/rivet/branches/cmake/cmake/cmake_extra_modules/FindAPR.cmake
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/cmake/cmake/cmake_extra_modules/FindAPR.cmake?rev=1804165&r1=1804164&r2=1804165&view=diff
==============================================================================
--- tcl/rivet/branches/cmake/cmake/cmake_extra_modules/FindAPR.cmake (original)
+++ tcl/rivet/branches/cmake/cmake/cmake_extra_modules/FindAPR.cmake Fri Aug  4 23:51:57 2017
@@ -36,7 +36,7 @@ FIND_PATH(APR_INCLUDE_DIR apr.h
   ${APACHE_ROOT}/include
 )
 
-SET(APR_NAMES ${APR_NAMES} apr-1 apr-1.lib)
+SET(APR_NAMES ${APR_NAMES} libapr-1 apr-1)
 FIND_LIBRARY(APR_LIBRARY
   NAMES ${APR_NAMES}
   PATHS /usr/lib /usr/local/lib
@@ -83,7 +83,7 @@ FIND_PATH(APRUTIL_INCLUDE_DIR apu.h
   ${APACHE_ROOT}/include
 )
 
-SET(APRUTIL_NAMES ${APRUTIL_NAMES} aprutil-1 aprutil-1.lib)
+SET(APRUTIL_NAMES ${APRUTIL_NAMES} libaprutil-1 aprutil-1 )
 FIND_LIBRARY(APRUTIL_LIBRARY
   NAMES ${APRUTIL_NAMES}
   PATHS /usr/lib /usr/local/lib

Modified: tcl/rivet/branches/cmake/src/mod_rivet_ng/TclWebapache.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/cmake/src/mod_rivet_ng/TclWebapache.c?rev=1804165&r1=1804164&r2=1804165&view=diff
==============================================================================
--- tcl/rivet/branches/cmake/src/mod_rivet_ng/TclWebapache.c (original)
+++ tcl/rivet/branches/cmake/src/mod_rivet_ng/TclWebapache.c Fri Aug  4 23:51:57 2017
@@ -29,7 +29,9 @@
 
 #include <tcl.h>
 #include <sys/types.h>
+#ifndef WIN32
 #include <pwd.h>
+#endif /* WIN32 */
 
 #include <httpd.h>
 #include <http_request.h>

Modified: tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet.c?rev=1804165&r1=1804164&r2=1804165&view=diff
==============================================================================
--- tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet.c (original)
+++ tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet.c Fri Aug  4 23:51:57 2017
@@ -48,12 +48,21 @@
 #include <tcl.h>
 
 /* as long as we need to emulate ap_chdir_file we need to include unistd.h */
+#ifdef RIVET_HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* RIVET_HAVE_UNISTD_H */
 
 #include "rivet_types.h"
 #include "mod_rivet.h"
 #include "apache_config.h"
 #include "rivet.h"
+
+/* Function prototypes are defined with EXTERN. Since we are in the same DLL,
+ * no need to keep this extern... */
+#ifdef EXTERN
+#   undef EXTERN
+#   define EXTERN
+#endif /* EXTERN */
 #include "mod_rivet_common.h"
 #include "mod_rivet_generator.h"
 

Modified: tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet.h
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet.h?rev=1804165&r1=1804164&r2=1804165&view=diff
==============================================================================
--- tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet.h (original)
+++ tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet.h Fri Aug  4 23:51:57 2017
@@ -235,12 +235,18 @@ typedef struct _rivet_interp_globals {
 
 rivet_server_conf *Rivet_GetConf(request_rec *r);
 
+/*
+ * Petasis, 04/08/2017: I think the following is wrong, as both "functions" are
+ * defined through preprocessor definitions in http_config.h. At least under
+ * windows, they do not exist as functions in libhttpd.lib.
+ *
 #ifdef ap_get_module_config
 #undef ap_get_module_config
 #endif
 #ifdef ap_set_module_config
 #undef ap_set_module_config
 #endif
+*/
 
 #define RIVET_SERVER_CONF(module) (rivet_server_conf *)ap_get_module_config(module, &rivet_module)
 #define RIVET_NEW_CONF(p)         (rivet_server_conf *)apr_pcalloc(p, sizeof(rivet_server_conf))

Modified: tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet_cache.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet_cache.c?rev=1804165&r1=1804164&r2=1804165&view=diff
==============================================================================
--- tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet_cache.c (original)
+++ tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet_cache.c Fri Aug  4 23:51:57 2017
@@ -23,6 +23,13 @@
 #include <apr_strings.h>
 
 #include "mod_rivet.h"
+
+/* Function prototypes are defined with EXTERN. Since we are in the same DLL,
+ * no need to keep this extern... */
+#ifdef EXTERN
+#   undef EXTERN
+#   define EXTERN
+#endif /* EXTERN */
 #include "mod_rivet_cache.h"
 
 extern mod_rivet_globals* module_globals;

Modified: tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet_common.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet_common.c?rev=1804165&r1=1804164&r2=1804165&view=diff
==============================================================================
--- tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet_common.c (original)
+++ tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet_common.c Fri Aug  4 23:51:57 2017
@@ -28,20 +28,33 @@
 #include <apr_env.h>
 #include <ap_mpm.h>
 /* as long as we need to emulate ap_chdir_file we need to include unistd.h */
+#ifdef RIVET_HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* RIVET_HAVE_UNISTD_H */
+#ifdef WIN32
+#include <direct.h> // provides POSIX _chdir
+#endif /* WIN32 */
 
 #include <apr_file_io.h>
 #include <apr_file_info.h>
 
 #include "mod_rivet.h"
-#include "mod_rivet_cache.h"
 #include "rivetChannel.h"
-#include "mod_rivet_common.h"
 #include "TclWeb.h"
 #include "rivetParser.h"
 #include "rivet.h"
 #include "apache_config.h"
 #include "rivetCore.h"
+#include <mpm_common.h>
+
+/* Function prototypes are defined with EXTERN. Since we are in the same DLL,
+ * no need to keep this extern... */
+#ifdef EXTERN
+#   undef EXTERN
+#   define EXTERN
+#endif /* EXTERN */
+#include "mod_rivet_common.h"
+#include "mod_rivet_cache.h"
 
 extern apr_threadkey_t*   rivet_thread_key;
 extern mod_rivet_globals* module_globals;
@@ -289,7 +302,6 @@ void Rivet_PerInterpInit(rivet_thread_in
 
 rivet_thread_interp* Rivet_NewVHostInterp(apr_pool_t *pool,server_rec* server)
 {
-    extern int              ap_max_requests_per_child;
     rivet_thread_interp*    interp_obj = apr_pcalloc(pool,sizeof(rivet_thread_interp));
     rivet_server_conf*      rsc;
 
@@ -750,11 +762,19 @@ int Rivet_chdir_file (const char *file)
 
     x = strrchr(file, '/');
     if (x == NULL) {
+#ifdef WIN32
+        chdir_retval = _chdir(file);
+#else
         chdir_retval = chdir(file);
+#endif
     } else if (x - file < sizeof(chdir_buf) - 1) {
         memcpy(chdir_buf, file, x - file);
         chdir_buf[x - file] = '\0';
+#ifdef WIN32
+        chdir_retval = _chdir(chdir_buf);
+#else
         chdir_retval = chdir(chdir_buf);
+#endif
     }
         
     return chdir_retval;

Modified: tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet_generator.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet_generator.c?rev=1804165&r1=1804164&r2=1804165&view=diff
==============================================================================
--- tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet_generator.c (original)
+++ tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet_generator.c Fri Aug  4 23:51:57 2017
@@ -26,13 +26,20 @@
 #include <apr_strings.h>
 
 #include "mod_rivet.h"
-#include "mod_rivet_common.h"
-#include "mod_rivet_cache.h"
 #include "rivetParser.h"
 #include "rivetCore.h"
 #include "apache_config.h"
 #include "TclWeb.h"
 
+/* Function prototypes are defined with EXTERN. Since we are in the same DLL,
+ * no need to keep this extern... */
+#ifdef EXTERN
+#   undef EXTERN
+#   define EXTERN
+#endif /* EXTERN */
+#include "mod_rivet_common.h"
+#include "mod_rivet_cache.h"
+
 extern mod_rivet_globals* module_globals;
 extern apr_threadkey_t*   rivet_thread_key;
 

Modified: tcl/rivet/branches/cmake/src/mod_rivet_ng/rivetCore.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/cmake/src/mod_rivet_ng/rivetCore.c?rev=1804165&r1=1804164&r2=1804165&view=diff
==============================================================================
--- tcl/rivet/branches/cmake/src/mod_rivet_ng/rivetCore.c (original)
+++ tcl/rivet/branches/cmake/src/mod_rivet_ng/rivetCore.c Fri Aug  4 23:51:57 2017
@@ -48,9 +48,15 @@
 
 #include "apache_request.h"
 #include "mod_rivet.h"
-#include "mod_rivet_cache.h"
 #include "rivet.h"
 #include "TclWeb.h"
+/* Function prototypes are defined with EXTERN. Since we are in the same DLL,
+ * no need to keep this extern... */
+#ifdef EXTERN
+#   undef EXTERN
+#   define EXTERN
+#endif /* EXTERN */
+#include "mod_rivet_cache.h"
 #include "rivetParser.h"
 
 #define ENV_ARRAY_NAME     "::request::env"

Modified: tcl/rivet/branches/cmake/src/parser/rivetParser.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/cmake/src/parser/rivetParser.c?rev=1804165&r1=1804164&r2=1804165&view=diff
==============================================================================
--- tcl/rivet/branches/cmake/src/parser/rivetParser.c (original)
+++ tcl/rivet/branches/cmake/src/parser/rivetParser.c Fri Aug  4 23:51:57 2017
@@ -30,6 +30,13 @@
 
 #include <string.h>
 #include <tcl.h>
+
+/* Function prototypes are defined with EXTERN. Since we are in the same DLL,
+ * no need to keep this extern... */
+#ifdef EXTERN
+#   undef EXTERN
+#   define EXTERN
+#endif /* EXTERN */
 #include "rivetParser.h"
 
 int Rivet_Parser(Tcl_Obj *outbuf, Tcl_Obj *inbuf);



---------------------------------------------------------------------
To unsubscribe, e-mail: site-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: site-cvs-help@tcl.apache.org