Re: Did anybody ever play with cmake+apr and/or have any advice applicable to cmake+apr?

2013-08-22 Thread Tom Donovan
On 08/22/2013 04:55 PM, Jeff Trawick wrote:
> On Thu, Aug 22, 2013 at 10:49 AM, Tom Donovan  > wrote:
> 
> On 08/20/2013 03:47 PM, Jeff Trawick wrote:
> > I plan to spend some time tilting at that windmill starting later this 
> week, for the purposes of
> > getting a flexible build on Windows.  Enough time to get something 
> working?  Dunno :(
> >
> > --
> > Born in Roswell... married an alien...
> > http://emptyhammock.com/
> 
> I gave it a try last March, but I never found the time to follow up and 
> finish it.
> I was able to build apr and httpd (trunk) on Windows7.
> 
> My Windows-only CMakeLists.txt files for both apr & httpd, along with 
> some notes, are at:
> 
>http://people.apache.org/~tdonovan/cmake/HTTPD_CMake.zip
> 
> Please help yourself to anything here which is useful to your effort.
> 
> -t-
> 
> 
> Hi Tom,
> 
> By chance did you experiment with FindOpenSSL, FindZLIB, etc.?
> 
> -- 
> Born in Roswell... married an alien...
> http://emptyhammock.com/

Hi Jeff,

I looked at them briefly, but no, I didn't experiment much.

On Windows, those CMake modules seem to have an impossible job.  There is 
really no "standard"
location on Windows for OpenSSL, Zlib, et. al. - especially since headers are 
needed in addition to
the runtime libraries.   These modules pose a risk of finding some unrelated 
OpenSSL or Zlib library
which might have been built with a different Windows compiler, and might use a 
different C runtime
library.

I used my own rules instead to locate the eleven prerequisites that APR or 
HTTPD might use on
Windows.  The rules I made for PCRE, ICONV, LUA, LIBXML2 (or EXPAT), ZLIB, 
OPENSSL, SQLITE3, PGSQL,
MYSQL, ORACLE, and BDB (Berkeley DB) were:

*  If the symbol is defined on the CMake command-line, it points to the 
directory that the
prerequisite is installed in.  i.e. the directory containing bin, include, and 
lib subdirectories.

e.g.
CMAKE -D SQLITE3=C:/work/sqlite3 -D PCRE=D:/build/pcre  -D 
ICONV=C:/work/libiconv ...

*  If the symbol is not defined, a check is made for directories named:

srclib\pcre, srclib\libiconv, srclib\lua, srclib\libxml2, srclib\zlib, 
srclib\openssl,
srclib\sqlite3, srclib\postgresql, srclib\mysql, srclib\oracle, or 
srclib\berkeleydb.

*  If the symbol isn't defined and the srclib\XXX subdirectory doesn't exist - 
then the
prerequisite is not present.

-tom-



Re: Did anybody ever play with cmake+apr and/or have any advice applicable to cmake+apr?

2013-08-22 Thread Jeff Trawick
On Thu, Aug 22, 2013 at 10:49 AM, Tom Donovan wrote:

> On 08/20/2013 03:47 PM, Jeff Trawick wrote:
> > I plan to spend some time tilting at that windmill starting later this
> week, for the purposes of
> > getting a flexible build on Windows.  Enough time to get something
> working?  Dunno :(
> >
> > --
> > Born in Roswell... married an alien...
> > http://emptyhammock.com/
>
> I gave it a try last March, but I never found the time to follow up and
> finish it.
> I was able to build apr and httpd (trunk) on Windows7.
>
> My Windows-only CMakeLists.txt files for both apr & httpd, along with some
> notes, are at:
>
>http://people.apache.org/~tdonovan/cmake/HTTPD_CMake.zip
>
> Please help yourself to anything here which is useful to your effort.
>
> -t-
>

Hi Tom,

By chance did you experiment with FindOpenSSL, FindZLIB, etc.?

-- 
Born in Roswell... married an alien...
http://emptyhammock.com/


Re: svn commit: r1516542 - in /apr/apr/trunk: CHANGES CMakeLists.txt include/apr.hwc

2013-08-22 Thread Jeff Trawick
On Thu, Aug 22, 2013 at 3:22 PM,  wrote:

> Author: trawick
> Date: Thu Aug 22 19:22:03 2013
> New Revision: 1516542
>
> URL: http://svn.apache.org/r1516542
> Log:
> Add experimental cmake-based build system for Windows.
>
> include/apr.hwc is almost exactly the same as apr.hw; it uses
> variables for cmake-time feature selection so that cmake
> can easily generate apr.h.
>
> Added:
> apr/apr/trunk/CMakeLists.txt   (with props)
> apr/apr/trunk/include/apr.hwc   (with props)
> Modified:
> apr/apr/trunk/CHANGES
>
> Modified: apr/apr/trunk/CHANGES
> URL:
> http://svn.apache.org/viewvc/apr/apr/trunk/CHANGES?rev=1516542&r1=1516541&r2=1516542&view=diff
>
> ==
> --- apr/apr/trunk/CHANGES [utf-8] (original)
> +++ apr/apr/trunk/CHANGES [utf-8] Thu Aug 22 19:22:03 2013
> @@ -1,6 +1,8 @@
>   -*- coding: utf-8 -*-
>  Changes for APR 2.0.0
>
> +  *) Add experimental cmake-based build system for Windows.  [Jeff
> Trawick]
> +
>
>
Note the list of current bugs/deficiencies in CMakeLists.txt, a lot of
which are handled by Tom's CMakeLists.txt which he posted a couple of hours
ago.  I plan to pull in his stuff as I can understand/test it, but feel
free to pitch in :)

>From CMakeLists.txt:

# . Fix problem where srcdir/include/apr.h (if it exists) is found before
builddir/apr.h
#   (and similar for apu_want.h)
# . Document example 32-bit and 64-bit Windows builds using NMake
# . Build and optionally run gen_test_char
# . Build apr_app.c into libapr-2 properly (what about apr-2.lib?)
# . Options for remaining features, along with finding any necessary
libraries
#   + APR_POOL_DEBUG
#   + APU_DSO_MODULE_BUILD
#   + APU_HAVE_GDBM
#   + APU_HAVE_NDBM
#   + APU_HAVE_DB
#   + APU_HAVE_PGSQL
#   + APU_HAVE_MYSQL
#   + APU_HAVE_SQLITE3
#   + APU_HAVE_SQLITE2
#   + APU_HAVE_ORACLE
#   + APU_HAVE_ODBC
#   + APU_HAVE_CRYPTO
#   + APU_HAVE_OPENSSL
#   + APU_HAVE_NSS
#   + APU_HAVE_COMMONCRYPTO
#   + APU_HAVE_ICONV
#   + APU_USE_LIBXML2 (sketched in, but not working)
# . Support static *or* shared build of Expat
# . Some easier way to run the test suite (not just testall.exe)
# . All the other stuff Jeff doesn't know about yet

If anyone cares about this, the best way to help in the very short term is
to add stuff you know of that I've missed from the bug/missing-feature
list.  Then, of course, pull up your shirt sleeves and pitch in.

Apologies for the programming style in CMakeLists.txt, which is a lot
different than the one Tom had; if you've ever seen the one distributed
with PCRE you might guess (correctly) that I had mainly looked at that one
before starting this one for APR.

I suggest the following as the roadmap for Windows build support:

APR Trunk/2.0:

As soon as multiple developers can use cmake successfully and build bugs
have been resolved, axe any support for specific MS compilers/IDEs/whatever.

(autoconf-/MinGW-based build support remains; I happen to feel very
productive using that for development/debugging, though I don't see enough
interest to finish the work to fully support that for end user builds; no
knowledge here of autoconf-Cygwin-based build support for Windows other
than that there are various pieces of configure code to support that)

Current stable branches of apr 1.x/apr-util 1.x:

Add cmake-based build support as an additional option "before long."

apr-iconv?  I'd rather not think about that for now.  (Somebody remind me
which httpd features need that on Windows and maybe I'll be motivated.)

Implied or required layout of projects:

Traditional builds of httpd/apr*/etc. typically put ASF and other support
libraries in the tree under httpd/srclib, and in fact some unexpected
httpd+Windows dependencies on apr essentially required that.  I haven't
figured out yet if any of that is baked into Tom's cmake work for
apr/httpd, or if srclib/ is simply the default.  I have ZERO
interest in touching such a setup personally, and at present the apr
install will set up private_include/ alongside include/ to work around the
httpd desire for such files.  (I guess there are any number of other
dependencies I don't know about/remember :()

Thanks in advance for the *.

-- 
Born in Roswell... married an alien...
http://emptyhammock.com/


Re: Did anybody ever play with cmake+apr and/or have any advice applicable to cmake+apr?

2013-08-22 Thread Jeff Trawick
On Thu, Aug 22, 2013 at 10:49 AM, Tom Donovan wrote:

> On 08/20/2013 03:47 PM, Jeff Trawick wrote:
> > I plan to spend some time tilting at that windmill starting later this
> week, for the purposes of
> > getting a flexible build on Windows.  Enough time to get something
> working?  Dunno :(
> >
> > --
> > Born in Roswell... married an alien...
> > http://emptyhammock.com/
>
> I gave it a try last March, but I never found the time to follow up and
> finish it.
> I was able to build apr and httpd (trunk) on Windows7.
>
> My Windows-only CMakeLists.txt files for both apr & httpd, along with some
> notes, are at:
>
>http://people.apache.org/~tdonovan/cmake/HTTPD_CMake.zip
>
> Please help yourself to anything here which is useful to your effort.
>
> -t-
>

Wow, you got pretty darn far!  (too bad you didn't go ahead and commit ;) )

I currently anticipate

* fixing a few basic issues in what I have "soon" and then committing
* subsequently pulling in chunks of your stuff as I understand it/can try
it out

-- 
Born in Roswell... married an alien...
http://emptyhammock.com/


Re: Did anybody ever play with cmake+apr and/or have any advice applicable to cmake+apr?

2013-08-22 Thread Tom Donovan
On 08/20/2013 03:47 PM, Jeff Trawick wrote:
> I plan to spend some time tilting at that windmill starting later this week, 
> for the purposes of
> getting a flexible build on Windows.  Enough time to get something working?  
> Dunno :(
> 
> -- 
> Born in Roswell... married an alien...
> http://emptyhammock.com/

I gave it a try last March, but I never found the time to follow up and finish 
it.
I was able to build apr and httpd (trunk) on Windows7.

My Windows-only CMakeLists.txt files for both apr & httpd, along with some 
notes, are at:

   http://people.apache.org/~tdonovan/cmake/HTTPD_CMake.zip

Please help yourself to anything here which is useful to your effort.

-t-


Re: Did anybody ever play with cmake+apr and/or have any advice applicable to cmake+apr?

2013-08-22 Thread William A. Rowe Jr.
The only toggle is to choose RelWithDebInfo as the cmake target (as opposed to 
Release or Debug).  Pretty straightforward.

Re: rough, initial cmake build for apr trunk

2013-08-22 Thread Jeff Trawick
On Thu, Aug 22, 2013 at 8:44 AM, Jeff Trawick  wrote:

> On Wed, Aug 21, 2013 at 5:51 PM, Jeff Trawick  wrote:
>
>> This is barely enough to run testapr.  For now it is intended only for
>> Windows.  include/apr.hwc is just apr.hw with variables for
>> APR_HAS_EXPAT|LIBXML2.  (And sorry about that mixed LF/CR-LF patch.)
>>
>>
> Maybe this is only funny to me but...
>
> I did some further work to build an apr shared library...  I started a
> cmake spec for httpd to use that.  httpd.exe displayed the output of
> gen_test_char on every invocation  As I had just spent some time getting
> gen_test_char to work at the right point in the httpd built to produce
> test_char.h I assumed there was some confusion about the build there.
>  Couldn't find anything.  Created separate project consisting of
> essentially an apr_socket_create().  Ran that, got the gen_test_char
> output.  Why?  apr trunk has gen_test_char.c too (with main(), of course),
> and I had it in the list of files to build libapr.
>
>
Ahh, that's better:

C:\Users\Trawick\httpdbuild>.\httpd -V
Server version: Apache/2.5.0-dev (Win32)
Server built:   Aug 22 2013 09:03:20
Server's Module Magic Number: 20130702:3
Server loaded:  APR 2.0.0-dev
Compiled using: APR 2.0.0-dev
Architecture:   32-bit
Server MPM: WinNT
  threaded: yes (fixed thread count)
forked: no
Server compiled with
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=256
 -D HTTPD_ROOT="/apache"
 -D SUEXEC_BIN="/apache/bin/suexec"
 -D DEFAULT_PIDLOG="httpd.pid"
 -D DEFAULT_SCOREBOARD="apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error.log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

Only about a million things left to handle...

-- 
Born in Roswell... married an alien...
http://emptyhammock.com/


Re: rough, initial cmake build for apr trunk

2013-08-22 Thread Jeff Trawick
On Wed, Aug 21, 2013 at 5:51 PM, Jeff Trawick  wrote:

> This is barely enough to run testapr.  For now it is intended only for
> Windows.  include/apr.hwc is just apr.hw with variables for
> APR_HAS_EXPAT|LIBXML2.  (And sorry about that mixed LF/CR-LF patch.)
>
>
Maybe this is only funny to me but...

I did some further work to build an apr shared library...  I started a
cmake spec for httpd to use that.  httpd.exe displayed the output of
gen_test_char on every invocation  As I had just spent some time getting
gen_test_char to work at the right point in the httpd built to produce
test_char.h I assumed there was some confusion about the build there.
 Couldn't find anything.  Created separate project consisting of
essentially an apr_socket_create().  Ran that, got the gen_test_char
output.  Why?  apr trunk has gen_test_char.c too (with main(), of course),
and I had it in the list of files to build libapr.


Re: Did anybody ever play with cmake+apr and/or have any advice applicable to cmake+apr?

2013-08-22 Thread Jeff Trawick
On Wed, Aug 21, 2013 at 3:49 PM, William A. Rowe Jr. wrote:

> On Tue, 20 Aug 2013 15:47:46 -0400
> Jeff Trawick  wrote:
>
> > I plan to spend some time tilting at that windmill starting later this
> > week, for the purposes of getting a flexible build on Windows.
> > Enough time to get something working?  Dunno :(
>
> Just FYI, RELWITHDEBINFO was a broken model, but that's the model we
> have always aimed for with separate .pdb symbol files for win builds.
> We want several things that the attached patch to cmake 2.8.7 addresses
> (it isn't the most elegant, but it works);
>
> * disable stack corruption^Woptimization so that user crash dumps
>   with no debug info are still nominally decipherable
>
> * a release build is *never* incremental (duh)
>
> * /opt:ref to toss useless/unreferenced debug leftovers for release
>
> * there was a stupid bug where shared lib link flags in RELWITHDEBINFO
>   inherited DEBUG model, not RELWITHDEBINFO model from exe link flags.
>
> I've never worked out how to propagate the actual .pdb file into the
> install lib/ or bin/ dir when performing the .exe / .dll install step.
> Hints on improving the patch would be great.
>
>
>
I guess all of this necessarily goes in the cmake backend, but possibly
with a knob in the APR spec to turn it on?


-- 
Born in Roswell... married an alien...
http://emptyhammock.com/


Re: rough, initial cmake build for apr trunk

2013-08-22 Thread Nick Kew

On 21 Aug 2013, at 22:51, Jeff Trawick wrote:

> I haven't actually tried very hard to use libxml2; the build I have seems to 
> want a GNU iconv??  More work would be required to use that.

My recollection[1] of supporting libxml2 apps on Windows is that it
required both iconv.dll and xlib.dll.  They can of course be downloaded
as binaries, but that doesn't help you with a build system.

[1] It's been a while: nowadays I refer to ApacheLounge, and only dig
any deeper when Steffen occasionally asks me to look at something.

-- 
Nick Kew