Re: [MERGE] SourceLayout: src/base, take 0

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Fri, 20 Feb 2009 00:16:59 +1300

Alex Rousskov wrote:
> Hello,
>
> In preparation for src/{ICAP,eCAP} move to src/adaptation, I needed
> to move AsyncJob.* files away from src/ICAP/. I have decided to put them
> into the new src/base directory until a better place is found. While
> adding src/base, I discovered and started to fix a few problems with
> adding more src/ subdirectories.
>
> These changes are small steps towards a nice layout. I wanted to post
> them anyway because they affect a couple of strange places in our
> Makefiles (e.g., src/ip found in the top-level Makefile and seemingly
> bogus cf_gen dependencies).
>
> I also wanted to ask whether AsyncJob and related Async* classes belong
> to src/base/ or their own subdirectory. If we want a separate dir,
> should we use src/jobs/ or perhaps src/calls (keeping in mind that not
> all calls are between jobs and that jobs do more than just async calls)?
> Probably not src/async as that clashes with I/O APIs.
>
> Detailed change log is below.
>
> Thank you,
>
> Alex.
>
> === modified file 'Makefile.am'
>
> Removed src/ip from the top-level SUBDIRS list. That directory is not
> a top-level subdirectory and it is already listed in src/Makefile.am.
>
> The commit message introducing the change talked about libip being a "POD
> library". I do not know what that is,

A library which provides Plain-old-data symbols. Not requiring any
external symbols from within Squid.

> but, hopefully, we do not really
> need to
> make this kind of exceptions for any src/ libraries.

I could not get cf_gen to actually run without having it built first.
I'd like to know how you managed it if you have. Reading your patch has
still left me clueless.

I could not get cf_gen to build with just: cf_gen_SOURCES = cf_gen.cc
Will have to test this patch

>
>
> === added file 'src/common.am'
>
> Copied common Makefile.am stuff seen in a few Makefile.ams to a single
> Makefile "header". This avoids evil code duplication. This file should be
> included by most Makefile.ams inside src/. Needs more work as some of the
> copied code is questionable and more code can probably be extracted
> here. See
> XXXs.
>
> TODO: The .h dependency test script part seems pretty universal, but if
> many subdirs need to customize it, we may want to put it into a separate
> Makefile "header".
>

Most if not all of the subdirs which contain child subdirs themselves
for module includes perform some custom magic with the parameters passed
to the test script.

The subdirs which perform local-only magic are:
  lib/, src/fs/, src/auth/, src/diskio/ and their children.

I think a custom headertests.am is probably needed for the simple
subdirs which can get away with only a ./*.h scan.

>
> === modified file 'src/AsyncJobCalls.h'
> === modified file 'src/BodyPipe.h'
> === modified file 'src/Server.h'
> === modified file 'src/adaptation/AccessCheck.h'
> === modified file 'src/adaptation/Initiate.h'
> === modified file 'src/adaptation/Initiator.h'
> === modified file 'src/client_side.h'
> === modified file 'src/client_side_request.h'
>
> Moved src/ICAP/AsyncJob.* to src/base/ to prepare for the src/ICAP move to
> src/adaptation/icap.
>
>
> === added dir 'src/base'
> === added dir 'src/base/Makefile.am'
> === modified file 'src/Makefile.am'
> === modified file 'configure.in'
>
> Added src/base directory for fundamental, commonly-used code pieces that are
> not large enough to warrant their own directories. Currently base/ contains
> the beginning of AsyncCalls hierarchy, which may eventually get its own
> directory.
>
>
> === modified file 'src/Makefile.am'
>
> Reduced cf_gen dependencies so that it can be built before subdirectories,
> as, apparently, required by BUILT_SOURCES.
>
> Moved some libraries that are used by virtually all executables to
> COMMON_LIBS.
> The list will probably grow as we try to reduce the insane complexity of the
> current Makefile.am.
>

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE6 or 3.0.STABLE13
   Current Beta Squid 3.1.0.5
Received on Thu Feb 19 2009 - 11:16:45 MST

This archive was generated by hypermail 2.2.0 : Thu Feb 19 2009 - 12:00:03 MST