You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Christopher Schultz <ch...@christopherschultz.net> on 2014/06/13 17:49:21 UTC

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-util>msdev 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

Posted by Jeff Trawick <tr...@gmail.com>.
On Fri, Jun 13, 2014 at 12:29 PM, Christopher Schultz <
chris@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
> > <chris@christopherschultz.net <ma...@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-util>msdev 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

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Jeff,

On 6/13/14, 12:08 PM, Jeff Trawick wrote:
> On Fri, Jun 13, 2014 at 11:49 AM, Christopher Schultz
> <chris@christopherschultz.net <ma...@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-util>msdev 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


Re: Building apr on win32

Posted by Jeff Trawick <tr...@gmail.com>.
On Fri, Jun 13, 2014 at 11:49 AM, Christopher Schultz <
chris@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-util>msdev 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

Posted by Gregg Smith <gl...@gknw.net>.
Christopher,

On 6/18/2014 9:52 AM, Christopher Schultz wrote:
> All,
>
> On 6/18/14, 12:44 PM, Christopher Schultz wrote:
>> Greg,
>>
>> On 6/18/14, 12:11 PM, Christopher Schultz wrote:
>>>> nmake /f makefile.win ARCH="Win32 Release" CRYPTO_LIST="openssl"
>>>> buildall checkall
>>> If I don't need to build libapr statically, then I don't need to do
>>> anything special, right? My understanding is that, when building the
>>> final tcnative artifact, I will only need to build /that/ statically, right?
>>>
>>> Anyhow, I've been making some progress to the point where I have a
>>> scripted up to the point of building APR. I've patched the APR sources
>>> to some extent (e.g. enabling IPV6) and I wanted to know if I still had
>>> to build from apr-util, or if it's possible to simply build apr (without
>>> apr-util and apr-iconv)?
>>>
>>> It appears that I can build apr only, but the files you mentioned
>>> patching above to support OpenSSL are in apr-util.
>> Duh, apr-util is definitely required. I went back and re-read your
>> instructions more carefully and it was clear it is required.
>>
>> APR has built and is running all its tests.
>>
>> We'll see what happens when I get to the tcnative stage ;)
>>
>> Thanks for all the help!
> I've run into a problem with the tests. Can anyone comment on whether or
> not these are spurious test errors, highly environmental, etc.?
>
>
>          [....]
>          [....]
>          [....]
>          link.exe /nologo /debug /subsystem:console /incremental:no
> /out:"Release
> \dbd.exe" Release\dbd.obj ..\..\apr\Release\libapr-1.lib
> ..\Release\libaprutil-1
> .lib kernel32.lib advapi32.lib ws2_32.lib wsock32.lib  ole32.lib
> shell32.lib rpc
> rt4.lib wldap32.lib
>          echo Testing dbd sqlite2&&  Release\dbd.exe sqlite2 || echo Failed
> Testing dbd sqlite2
> Internal error loading sqlite2.
>          echo Testing dbd sqlite3&&  Release\dbd.exe sqlite3 || echo Failed
> Testing dbd sqlite3
> Internal error loading sqlite3.
> Testing Release\testall.exe
> teststrmatch        : SUCCESS
> testuri             : SUCCESS
> testuuid            : SUCCESS
> testbuckets         : SUCCESS
> testpass            : SUCCESS
> testmd4             : SUCCESS
> testmd5             : SUCCESS
> testcrypto          : SUCCESS
> testldap            : SUCCESS
> testdbd             : SUCCESS
> testdate            : SUCCESS
> testmemcache        : -Error 730061 occurred attempting to reach
> memcached on lo
> calhost:11211.  Skipping apr_memcache tests...
> SUCCESS
> testxml             : SUCCESS
> testxlate           : -Line 63: expected<0>, but saw<22>
> FAILED 1 of 1
> testrmm             : SUCCESS
> testdbm             : SUCCESS
> testqueue           : SUCCESS
> testreslist         : SUCCESS
> Failed Tests            Total   Fail    Failed %
> ===================================================
> testxlate                   1      1    100.00%
> Release\testall.exe failed
>          cd ..
>
> The memcached failure is obviously spurious, as I'm not running
> memcached. I can arrange to have it running for future tests, though.
>
> Any thoughts?

The xlate one is normal on Windows. I know there was talk about it long 
ago on this list but I forgot what the conclusion was. I'd have to run 
the test here and look to see what else is "normal to fail" on Win.

As far as static libs vs. dynamic in your previous mail, both are built 
and you should see this test twice. This one shown above (libaprutil-1) 
is for the dll, apr-1/aprutil-1.lib is the static libs located in /libr 
of each tree after build.

Gregg

Re: Building apr on win32

Posted by Christopher Schultz <ch...@christopherschultz.net>.
All,

On 6/18/14, 12:44 PM, Christopher Schultz wrote:
> Greg,
> 
> On 6/18/14, 12:11 PM, Christopher Schultz wrote:
>>> nmake /f makefile.win ARCH="Win32 Release" CRYPTO_LIST="openssl"
>>> buildall checkall
>>
>> If I don't need to build libapr statically, then I don't need to do
>> anything special, right? My understanding is that, when building the
>> final tcnative artifact, I will only need to build /that/ statically, right?
>>
>> Anyhow, I've been making some progress to the point where I have a
>> scripted up to the point of building APR. I've patched the APR sources
>> to some extent (e.g. enabling IPV6) and I wanted to know if I still had
>> to build from apr-util, or if it's possible to simply build apr (without
>> apr-util and apr-iconv)?
>>
>> It appears that I can build apr only, but the files you mentioned
>> patching above to support OpenSSL are in apr-util.
> 
> Duh, apr-util is definitely required. I went back and re-read your
> instructions more carefully and it was clear it is required.
> 
> APR has built and is running all its tests.
> 
> We'll see what happens when I get to the tcnative stage ;)
> 
> Thanks for all the help!

I've run into a problem with the tests. Can anyone comment on whether or
not these are spurious test errors, highly environmental, etc.?


        [....]
        [....]
        [....]
        link.exe /nologo /debug /subsystem:console /incremental:no
/out:"Release
\dbd.exe" Release\dbd.obj ..\..\apr\Release\libapr-1.lib
..\Release\libaprutil-1
.lib kernel32.lib advapi32.lib ws2_32.lib wsock32.lib  ole32.lib
shell32.lib rpc
rt4.lib wldap32.lib
        echo Testing dbd sqlite2 && Release\dbd.exe sqlite2 || echo Failed
Testing dbd sqlite2
Internal error loading sqlite2.
        echo Testing dbd sqlite3 && Release\dbd.exe sqlite3 || echo Failed
Testing dbd sqlite3
Internal error loading sqlite3.
Testing Release\testall.exe
teststrmatch        : SUCCESS
testuri             : SUCCESS
testuuid            : SUCCESS
testbuckets         : SUCCESS
testpass            : SUCCESS
testmd4             : SUCCESS
testmd5             : SUCCESS
testcrypto          : SUCCESS
testldap            : SUCCESS
testdbd             : SUCCESS
testdate            : SUCCESS
testmemcache        : -Error 730061 occurred attempting to reach
memcached on lo
calhost:11211.  Skipping apr_memcache tests...
SUCCESS
testxml             : SUCCESS
testxlate           : -Line 63: expected <0>, but saw <22>
FAILED 1 of 1
testrmm             : SUCCESS
testdbm             : SUCCESS
testqueue           : SUCCESS
testreslist         : SUCCESS
Failed Tests            Total   Fail    Failed %
===================================================
testxlate                   1      1    100.00%
Release\testall.exe failed
        cd ..

The memcached failure is obviously spurious, as I'm not running
memcached. I can arrange to have it running for future tests, though.

Any thoughts?

Thanks,
-chris


Re: Building apr on win32

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Greg,

On 6/18/14, 12:11 PM, Christopher Schultz wrote:
>> nmake /f makefile.win ARCH="Win32 Release" CRYPTO_LIST="openssl"
>> buildall checkall
> 
> If I don't need to build libapr statically, then I don't need to do
> anything special, right? My understanding is that, when building the
> final tcnative artifact, I will only need to build /that/ statically, right?
> 
> Anyhow, I've been making some progress to the point where I have a
> scripted up to the point of building APR. I've patched the APR sources
> to some extent (e.g. enabling IPV6) and I wanted to know if I still had
> to build from apr-util, or if it's possible to simply build apr (without
> apr-util and apr-iconv)?
> 
> It appears that I can build apr only, but the files you mentioned
> patching above to support OpenSSL are in apr-util.

Duh, apr-util is definitely required. I went back and re-read your
instructions more carefully and it was clear it is required.

APR has built and is running all its tests.

We'll see what happens when I get to the tcnative stage ;)

Thanks for all the help!

-chris


Re: Building apr on win32

Posted by Christopher Schultz <ch...@christopherschultz.net>.
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_OPENSSL        0
> 
> 
> 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

If I don't need to build libapr statically, then I don't need to do
anything special, right? My understanding is that, when building the
final tcnative artifact, I will only need to build /that/ statically, right?

Anyhow, I've been making some progress to the point where I have a
scripted up to the point of building APR. I've patched the APR sources
to some extent (e.g. enabling IPV6) and I wanted to know if I still had
to build from apr-util, or if it's possible to simply build apr (without
apr-util and apr-iconv)?

It appears that I can build apr only, but the files you mentioned
patching above to support OpenSSL are in apr-util.

Thanks,
-chris


Re: Building apr on win32

Posted by Gregg Smith <gl...@gknw.net>.
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_OPENSSL        0
> 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 this&that or /D this&that 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

Posted by Christopher Schultz <ch...@christopherschultz.net>.
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


Re: Building apr on win32

Posted by Christopher Schultz <ch...@christopherschultz.net>.
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_ADDR        1
 #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_MEMMOVE        1
 #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


Re: Building apr on win32

Posted by Gregg Smith <gl...@gknw.net>.
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

Posted by Christopher Schultz <ch...@christopherschultz.net>.
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_OPENSSL        0

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


Re: Building apr on win32

Posted by Gregg Smith <gl...@gknw.net>.
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_OPENSSL        0


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

Posted by Christopher Schultz <ch...@christopherschultz.net>.
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


Re: Building apr on win32

Posted by Gregg Smith <gl...@gknw.net>.
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-util>msdev 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
>>
>