Building apr on win32
Hello, I'm trying to build apr on win32 from the command-line and I'm running into some resistance. I'm using Visual Studio 12 on Windows 8.1. I have installed the Windows SDK as well to try to help, but it doesn't seem to have improved things. I'm following the instructions found here: http://apr.apache.org/compiling_win32.html I have downloaded the ZIP files for apr, apr-util, and apr-iconv and put them into the requisite directories. I've run VS's VC\bin\vcvars32.bat to get the build tools in the path, but I don't have a setenv.bat anywhere (suggested in the above instructions). When I get to the step where I run msdev (which basically /does the build/), I can't find the msdev program: C:\Users\Me\Desktop\apr-utilmsdev aprutil.dsw /MAKE apriconv - Win32 Release 'msdev' is not recognized as an internal or external command, operable program or batch file. I'm no win32 build expert, but I have quite a bit of experience building on *NIX systems. Can anyone help me get things going on Windows? Thanks, -chris
Re: Building apr on win32
On Fri, Jun 13, 2014 at 11:49 AM, Christopher Schultz ch...@christopherschultz.net wrote: Hello, I'm trying to build apr on win32 from the command-line and I'm running into some resistance. I'm using Visual Studio 12 on Windows 8.1. I have installed the Windows SDK as well to try to help, but it doesn't seem to have improved things. I'm following the instructions found here: http://apr.apache.org/compiling_win32.html I have downloaded the ZIP files for apr, apr-util, and apr-iconv and put them into the requisite directories. I've run VS's VC\bin\vcvars32.bat to get the build tools in the path, but I don't have a setenv.bat anywhere (suggested in the above instructions). When I get to the step where I run msdev (which basically /does the build/), I can't find the msdev program: C:\Users\Me\Desktop\apr-utilmsdev aprutil.dsw /MAKE apriconv - Win32 Release 'msdev' is not recognized as an internal or external command, operable program or batch file. I'm no win32 build expert, but I have quite a bit of experience building on *NIX systems. Can anyone help me get things going on Windows? Thanks, -chris The documented APR build system for Windows worked smoothly with a level of MS Visual Studio which is no longer available. Recently a cmake-based build was added; this is documented in README.cmake in the root of the APR source tree. That works with modern levels of Visual Studio (tested with at least 2008-2012). If you are accustomed to building the various pieces on Unix, you can use the cmake-based build in a roughly similar manner. But: The cmake build for APR-util doesn't support all features; there's no cmake build for APR-iconv yet, so you won't have the apr_xlate APIs (required by httpd's mod_charset_lite and perhaps some third-party code). In essence: * install cmake* * unpack apr 1.5.latest anywhere you want * open a Visual Studio command prompt and add the cmake bin directory to PATH * in empty directory: cmake -G NMake Makefiles -DCMAKE_INSTALL_PREFIX=/path/to/install /path/to/apr-1.5-source and similar for apr-util *What version? This build is untested with cmake 3 AFAIK. Also, some accommodation is needed in the APR-Util build for the most recent cmake 2.x release. See https://issues.apache.org/bugzilla/show_bug.cgi?id=56616 for a workaround. If you have issues with the cmake-based build, I'm motivated to help. I expect that this will be the basis of the Windows build for the long term. Unfortunately, at present it does not support some features that I and some others didn't need for our httpd builds. -- Born in Roswell... married an alien... http://emptyhammock.com/ http://edjective.org/
Re: Building apr on win32
Ugg, this list and using reply in thunderbird. On 6/13/2014 9:24 AM, Gregg Smith wrote: Hello Christopher, Old instrucions for building in IDE really. If you want to build in the IDE just open apr-util.dsw and allow VC to convert. If you want to build at the command line; On 6/13/2014 8:49 AM, Christopher Schultz wrote: Hello, I'm trying to build apr on win32 from the command-line and I'm running into some resistance. I'm using Visual Studio 12 on Windows 8.1. I have installed the Windows SDK as well to try to help, but it doesn't seem to have improved things. I'm following the instructions found here: http://apr.apache.org/compiling_win32.html I have downloaded the ZIP files for apr, apr-util, and apr-iconv and put them into the requisite directories. I've run VS's VC\bin\vcvars32.bat to get the build tools in the path, From here cd to c:\work\apr-util then nmake /f makefile.win ARCH=Win32 Release buildall checkall See the makefile.win file for all possible options. VC11 (2012) does not like precompiled headers in apr-iconv, you will need to edit c:\work\apr-iconv\build\modules.mk.win and remove; /Yciconv.h /Yuiconv.h from the file, save and then build. Regards, Gregg but I don't have a setenv.bat anywhere (suggested in the above instructions). When I get to the step where I run msdev (which basically /does the build/), I can't find the msdev program: C:\Users\Me\Desktop\apr-utilmsdev aprutil.dsw /MAKE apriconv - Win32 Release 'msdev' is not recognized as an internal or external command, operable program or batch file. I'm no win32 build expert, but I have quite a bit of experience building on *NIX systems. Can anyone help me get things going on Windows? Thanks, -chris
Re: Building apr on win32
Jeff, On 6/13/14, 12:08 PM, Jeff Trawick wrote: On Fri, Jun 13, 2014 at 11:49 AM, Christopher Schultz ch...@christopherschultz.net mailto:ch...@christopherschultz.net wrote: Hello, I'm trying to build apr on win32 from the command-line and I'm running into some resistance. I'm using Visual Studio 12 on Windows 8.1. I have installed the Windows SDK as well to try to help, but it doesn't seem to have improved things. I'm following the instructions found here: http://apr.apache.org/compiling_win32.html I have downloaded the ZIP files for apr, apr-util, and apr-iconv and put them into the requisite directories. I've run VS's VC\bin\vcvars32.bat to get the build tools in the path, but I don't have a setenv.bat anywhere (suggested in the above instructions). When I get to the step where I run msdev (which basically /does the build/), I can't find the msdev program: C:\Users\Me\Desktop\apr-utilmsdev aprutil.dsw /MAKE apriconv - Win32 Release 'msdev' is not recognized as an internal or external command, operable program or batch file. I'm no win32 build expert, but I have quite a bit of experience building on *NIX systems. Can anyone help me get things going on Windows? Thanks, -chris The documented APR build system for Windows worked smoothly with a level of MS Visual Studio which is no longer available. Recently a cmake-based build was added; this is documented in README.cmake in the root of the APR source tree. That works with modern levels of Visual Studio (tested with at least 2008-2012). If you are accustomed to building the various pieces on Unix, you can use the cmake-based build in a roughly similar manner.But: The cmake build for APR-util doesn't support all features; there's no cmake build for APR-iconv yet, so you won't have the apr_xlate APIs (required by httpd's mod_charset_lite and perhaps some third-party code). That might be okay. I'm building it for use in a statically-linked version of Tomcat's tcnative (essentially OpenSSL + libapr + Tomcat wrappers). I'll give it a shot. In essence: * install cmake* * unpack apr 1.5.latest anywhere you want * open a Visual Studio command prompt and add the cmake bin directory to PATH * in empty directory: cmake -G NMake Makefiles -DCMAKE_INSTALL_PREFIX=/path/to/install /path/to/apr-1.5-source and similar for apr-util *What version? This build is untested with cmake 3 AFAIK. Also, some accommodation is needed in the APR-Util build for the most recent cmake 2.x release. See https://issues.apache.org/bugzilla/show_bug.cgi?id=56616 for a workaround. If you have issues with the cmake-based build, I'm motivated to help. I expect that this will be the basis of the Windows build for the long term. Unfortunately, at present it does not support some features that I and some others didn't need for our httpd builds. I don't have cmake installed, in spite of both VS12 and Windows SDK packages installed. Are you talking about http://www.cmake.org/cmake/resources/software.html? Looks like the newest pre-3.0 release is 2.8.12.2. Is that likely to work? Thanks, -chris signature.asc Description: OpenPGP digital signature
Re: Building apr on win32
Greg, On 6/13/14, 12:24 PM, Gregg Smith wrote: Old instrucions for building in IDE really. If you want to build in the IDE just open apr-util.dsw and allow VC to convert. If you want to build at the command line; Yeah, I'd like something that I can script. Right now, there's basically one guy who knows how to build tcnative on win32. We're trying to change that ;) On 6/13/2014 8:49 AM, Christopher Schultz wrote: Hello, I'm trying to build apr on win32 from the command-line and I'm running into some resistance. I'm using Visual Studio 12 on Windows 8.1. I have installed the Windows SDK as well to try to help, but it doesn't seem to have improved things. I'm following the instructions found here: http://apr.apache.org/compiling_win32.html I have downloaded the ZIP files for apr, apr-util, and apr-iconv and put them into the requisite directories. I've run VS's VC\bin\vcvars32.bat to get the build tools in the path, From here cd to c:\work\apr-util then nmake /f makefile.win ARCH=Win32 Release buildall checkall See the makefile.win file for all possible options. Okay, that seems to get started, but I haven't told it where to find OpenSSL. I'd like to make sure that the crypto routines get built, and makefile.win doesn't really make it clear (to me, anyway) how to specify where the OpenSSL libraries, headers, etc. exist. It looks like ../crypto/[cryptos] should exist and perhaps it will automatically look for ../crypto/openssl/stuff. Do I have that right? VC11 (2012) does not like precompiled headers in apr-iconv, you will need to edit c:\work\apr-iconv\build\modules.mk.win and remove; /Yciconv.h /Yuiconv.h from the file, save and then build. I'll try with a stock check-out. If I run across any errors, I'll remove those files and rebuild. Thanks, -chris signature.asc Description: OpenPGP digital signature
Re: Building apr on win32
On 6/13/2014 9:36 AM, Christopher Schultz wrote: Greg, On 6/13/14, 12:24 PM, Gregg Smith wrote: Old instrucions for building in IDE really. If you want to build in the IDE just open apr-util.dsw and allow VC to convert. If you want to build at the command line; Yeah, I'd like something that I can script. Right now, there's basically one guy who knows how to build tcnative on win32. We're trying to change that ;) On 6/13/2014 8:49 AM, Christopher Schultz wrote: Hello, I'm trying to build apr on win32 from the command-line and I'm running into some resistance. I'm using Visual Studio 12 on Windows 8.1. I have installed the Windows SDK as well to try to help, but it doesn't seem to have improved things. I'm following the instructions found here: http://apr.apache.org/compiling_win32.html I have downloaded the ZIP files for apr, apr-util, and apr-iconv and put them into the requisite directories. I've run VS's VC\bin\vcvars32.bat to get the build tools in the path, From here cd to c:\work\apr-util then nmake /f makefile.win ARCH=Win32 Release buildall checkall See the makefile.win file for all possible options. Okay, that seems to get started, but I haven't told it where to find OpenSSL. I'd like to make sure that the crypto routines get built, and makefile.win doesn't really make it clear (to me, anyway) how to specify where the OpenSSL libraries, headers, etc. exist. It looks like ../crypto/[cryptos] should exist and perhaps it will automatically look for ../crypto/openssl/stuff. Do I have that right? Crypto, here's what you'll have to do; Edit apr-util\include\apu.hw and change the 0 to 1 for #define APU_HAVE_CRYPTO 0 #ifndef APU_DSO_MODULE_BUILD #define APU_HAVE_OPENSSL0 If you look at apr-util\crypto\apr_crypto_openssl.mak you will notice it looks for needed headers in ../../openssl/inc32 and libs in ..\..\openssl\out32dll which translates to c:\work\openssl\inc32 and c:\work\openssl\out32dll You mentioned compiling in openssl statically (in your reply to Jeff I believe), in windows we normally compile and use DLLs, you would have to modify apr_crypto_openssl.mak to build using the openssl static lib. and to build it's nmake /f makefile.win ARCH=Win32 Release CRYPTO_LIST=openssl buildall checkall VC11 (2012) does not like precompiled headers in apr-iconv, you will need to edit c:\work\apr-iconv\build\modules.mk.win and remove; /Yciconv.h /Yuiconv.h from the file, save and then build. I'll try with a stock check-out. If I run across any errors, I'll remove those files and rebuild. Regards, Gregg
Re: Building apr on win32
On Fri, Jun 13, 2014 at 12:29 PM, Christopher Schultz ch...@christopherschultz.net wrote: Jeff, On 6/13/14, 12:08 PM, Jeff Trawick wrote: On Fri, Jun 13, 2014 at 11:49 AM, Christopher Schultz ch...@christopherschultz.net mailto:ch...@christopherschultz.net wrote: Hello, I'm trying to build apr on win32 from the command-line and I'm running into some resistance. I'm using Visual Studio 12 on Windows 8.1. I have installed the Windows SDK as well to try to help, but it doesn't seem to have improved things. I'm following the instructions found here: http://apr.apache.org/compiling_win32.html I have downloaded the ZIP files for apr, apr-util, and apr-iconv and put them into the requisite directories. I've run VS's VC\bin\vcvars32.bat to get the build tools in the path, but I don't have a setenv.bat anywhere (suggested in the above instructions). When I get to the step where I run msdev (which basically /does the build/), I can't find the msdev program: C:\Users\Me\Desktop\apr-utilmsdev aprutil.dsw /MAKE apriconv - Win32 Release 'msdev' is not recognized as an internal or external command, operable program or batch file. I'm no win32 build expert, but I have quite a bit of experience building on *NIX systems. Can anyone help me get things going on Windows? Thanks, -chris The documented APR build system for Windows worked smoothly with a level of MS Visual Studio which is no longer available. Recently a cmake-based build was added; this is documented in README.cmake in the root of the APR source tree. That works with modern levels of Visual Studio (tested with at least 2008-2012). If you are accustomed to building the various pieces on Unix, you can use the cmake-based build in a roughly similar manner.But: The cmake build for APR-util doesn't support all features; there's no cmake build for APR-iconv yet, so you won't have the apr_xlate APIs (required by httpd's mod_charset_lite and perhaps some third-party code). That might be okay. I'm building it for use in a statically-linked version of Tomcat's tcnative (essentially OpenSSL + libapr + Tomcat wrappers). I'll give it a shot. In essence: * install cmake* * unpack apr 1.5.latest anywhere you want * open a Visual Studio command prompt and add the cmake bin directory to PATH * in empty directory: cmake -G NMake Makefiles -DCMAKE_INSTALL_PREFIX=/path/to/install /path/to/apr-1.5-source and similar for apr-util *What version? This build is untested with cmake 3 AFAIK. Also, some accommodation is needed in the APR-Util build for the most recent cmake 2.x release. See https://issues.apache.org/bugzilla/show_bug.cgi?id=56616 for a workaround. If you have issues with the cmake-based build, I'm motivated to help. I expect that this will be the basis of the Windows build for the long term. Unfortunately, at present it does not support some features that I and some others didn't need for our httpd builds. I don't have cmake installed, in spite of both VS12 and Windows SDK packages installed. Are you talking about http://www.cmake.org/cmake/resources/software.html? Looks like the newest pre-3.0 release is 2.8.12.2. Is that likely to work? Thanks, -chris Yes. I think you only care about building libapr. -- Born in Roswell... married an alien... http://emptyhammock.com/ http://edjective.org/
Re: Building apr on win32
Greg, On 6/13/14, 12:57 PM, Gregg Smith wrote: On 6/13/2014 9:36 AM, Christopher Schultz wrote: Greg, On 6/13/14, 12:24 PM, Gregg Smith wrote: Old instrucions for building in IDE really. If you want to build in the IDE just open apr-util.dsw and allow VC to convert. If you want to build at the command line; Yeah, I'd like something that I can script. Right now, there's basically one guy who knows how to build tcnative on win32. We're trying to change that ;) On 6/13/2014 8:49 AM, Christopher Schultz wrote: Hello, I'm trying to build apr on win32 from the command-line and I'm running into some resistance. I'm using Visual Studio 12 on Windows 8.1. I have installed the Windows SDK as well to try to help, but it doesn't seem to have improved things. I'm following the instructions found here: http://apr.apache.org/compiling_win32.html I have downloaded the ZIP files for apr, apr-util, and apr-iconv and put them into the requisite directories. I've run VS's VC\bin\vcvars32.bat to get the build tools in the path, From here cd to c:\work\apr-util then nmake /f makefile.win ARCH=Win32 Release buildall checkall See the makefile.win file for all possible options. Okay, that seems to get started, but I haven't told it where to find OpenSSL. I'd like to make sure that the crypto routines get built, and makefile.win doesn't really make it clear (to me, anyway) how to specify where the OpenSSL libraries, headers, etc. exist. It looks like ../crypto/[cryptos] should exist and perhaps it will automatically look for ../crypto/openssl/stuff. Do I have that right? Crypto, here's what you'll have to do; Edit apr-util\include\apu.hw and change the 0 to 1 for #define APU_HAVE_CRYPTO 0 #ifndef APU_DSO_MODULE_BUILD #define APU_HAVE_OPENSSL0 Can I specify that stuff on the command-line like with -DAPU_HAVE_CRYPTO=1 and -DAPU_HAVE_OPENSSL=1, or are those values clobbered during the make? If you look at apr-util\crypto\apr_crypto_openssl.mak you will notice it looks for needed headers in ../../openssl/inc32 and libs in ..\..\openssl\out32dll which translates to c:\work\openssl\inc32 and c:\work\openssl\out32dll Okay, I can see both of those directories under ..\openssl-1.0.1h. I'll re-name the openssl directory accordingly. Are these things that could be parameterized? I noticed the no exceptions note on the Building on win32 page, but it seems like NMAKE should be able to use paths defined on the CLI, no? You mentioned compiling in openssl statically (in your reply to Jeff I believe), in windows we normally compile and use DLLs, you would have to modify apr_crypto_openssl.mak to build using the openssl static lib. Yeah, we do a statically-compiled tcnative because ... honestly I don't really know. It's not that I need a static libapr... I need a static tcnative. So as long as I produce linkable objects from libapr, I should be able to statically-link tcnative (which itself is a .dll). and to build it's nmake /f makefile.win ARCH=Win32 Release CRYPTO_LIST=openssl buildall checkall Awesome. I'll give all that a try. Thanks, -chris signature.asc Description: OpenPGP digital signature
Re: Building apr on win32
On 6/13/2014 10:16 AM, Christopher Schultz wrote: Greg, On 6/13/14, 12:57 PM, Gregg Smith wrote: On 6/13/2014 9:36 AM, Christopher Schultz wrote: Greg, On 6/13/14, 12:24 PM, Gregg Smith wrote: Old instrucions for building in IDE really. If you want to build in the IDE just open apr-util.dsw and allow VC to convert. If you want to build at the command line; Yeah, I'd like something that I can script. Right now, there's basically one guy who knows how to build tcnative on win32. We're trying to change that ;) On 6/13/2014 8:49 AM, Christopher Schultz wrote: Hello, I'm trying to build apr on win32 from the command-line and I'm running into some resistance. I'm using Visual Studio 12 on Windows 8.1. I have installed the Windows SDK as well to try to help, but it doesn't seem to have improved things. I'm following the instructions found here: http://apr.apache.org/compiling_win32.html I have downloaded the ZIP files for apr, apr-util, and apr-iconv and put them into the requisite directories. I've run VS's VC\bin\vcvars32.bat to get the build tools in the path, From here cd to c:\work\apr-util then nmake /f makefile.win ARCH=Win32 Release buildall checkall See the makefile.win file for all possible options. Okay, that seems to get started, but I haven't told it where to find OpenSSL. I'd like to make sure that the crypto routines get built, and makefile.win doesn't really make it clear (to me, anyway) how to specify where the OpenSSL libraries, headers, etc. exist. It looks like ../crypto/[cryptos] should exist and perhaps it will automatically look for ../crypto/openssl/stuff. Do I have that right? Crypto, here's what you'll have to do; Edit apr-util\include\apu.hw and change the 0 to 1 for #define APU_HAVE_CRYPTO 0 #ifndef APU_DSO_MODULE_BUILD #define APU_HAVE_OPENSSL0 Can I specify that stuff on the command-line like with -DAPU_HAVE_CRYPTO=1 and -DAPU_HAVE_OPENSSL=1, or are those values clobbered during the make? If you look at apr-util\crypto\apr_crypto_openssl.mak you will notice it looks for needed headers in ../../openssl/inc32 and libs in ..\..\openssl\out32dll which translates to c:\work\openssl\inc32 and c:\work\openssl\out32dll Okay, I can see both of those directories under ..\openssl-1.0.1h. I'll re-name the openssl directory accordingly. Are these things that could be parameterized? I noticed the no exceptions note on the Building on win32 page, but it seems like NMAKE should be able to use paths defined on the CLI, no? No, because makefile.win is calling nmake multiple times for each and every .mak file and quickly looking I do not see anything to propagate your /I thisthat or /D thisthat to each evocation of nmake. You mentioned compiling in openssl statically (in your reply to Jeff I believe), in windows we normally compile and use DLLs, you would have to modify apr_crypto_openssl.mak to build using the openssl static lib. Yeah, we do a statically-compiled tcnative because ... honestly I don't really know. It's not that I need a static libapr... I need a static tcnative. So as long as I produce linkable objects from libapr, I should be able to statically-link tcnative (which itself is a .dll). and to build it's nmake /f makefile.win ARCH=Win32 Release CRYPTO_LIST=openssl buildall checkall Awesome. I'll give all that a try. Thanks, -chris Have fun! Gregg
Re: Building apr on win32
On 6/13/2014 10:16 AM, Christopher Schultz wrote: Yeah, I'd like something that I can script. Right now, there's basically one guy who knows how to build tcnative on win32. We're trying to change that ;) I'm going to blindly assume scripting using a batch file which something I forgot to think about was dealing with the files that need to be changed. In this case there's always sed and being a *nix person I'm sure you know how to use it better than I and that can be done in the batch file. Something I forgot to mention, if you need APR IPv6 compatible you will have to flip that switch in apr\include\apr.hw #define APR_HAVE_IPV6 0 Cheers, Gregg
Re: Building apr on win32
Gregg, On 6/13/14, 2:04 PM, Gregg Smith wrote: On 6/13/2014 10:16 AM, Christopher Schultz wrote: Yeah, I'd like something that I can script. Right now, there's basically one guy who knows how to build tcnative on win32. We're trying to change that ;) I'm going to blindly assume scripting using a batch file which something I forgot to think about was dealing with the files that need to be changed. In this case there's always sed and being a *nix person I'm sure you know how to use it better than I and that can be done in the batch file. Something I forgot to mention, if you need APR IPv6 compatible you will have to flip that switch in apr\include\apr.hw #define APR_HAVE_IPV6 0 Very good to know: we /do/ need that. Thanks, -chris signature.asc Description: OpenPGP digital signature
Re: Building apr on win32
Gregg, On 6/13/14, 2:04 PM, Gregg Smith wrote: On 6/13/2014 10:16 AM, Christopher Schultz wrote: Yeah, I'd like something that I can script. Right now, there's basically one guy who knows how to build tcnative on win32. We're trying to change that ;) I'm going to blindly assume scripting using a batch file which something I forgot to think about was dealing with the files that need to be changed. In this case there's always sed and being a *nix person I'm sure you know how to use it better than I and that can be done in the batch file. I'll already have 'patch' available. It seems cleaner and will catch more errors. Something I forgot to mention, if you need APR IPv6 compatible you will have to flip that switch in apr\include\apr.hw #define APR_HAVE_IPV6 0 Looks like we already have a patch for that in tcnative: $ cat native/srclib/apr/apr-enable-ipv6.patch --- include/apr.hw +++ include/apr.hw @@ -276,7 +276,7 @@ #define APR_HAVE_IN_ADDR1 #define APR_HAVE_INET_ADDR 1 #define APR_HAVE_INET_NETWORK 0 -#define APR_HAVE_IPV6 0 +#define APR_HAVE_IPV6 1 #define APR_HAVE_MEMMOVE1 #define APR_HAVE_SETRLIMIT 0 #define APR_HAVE_SIGACTION 0 @@ -340,7 +340,7 @@ /* If we have a TCP implementation that can be corked, what flag * do we use? */ -#define APR_TCP_NOPUSH_FLAG @apr_tcp_nopush_flag@ +#define APR_TCP_NOPUSH_FLAG 0 /* Is the TCP_NODELAY socket option inherited from listening sockets? */ Thanks again! -chris signature.asc Description: OpenPGP digital signature