On Nov 6, 2013, at 7:40 PM, z...@apache.org wrote:

> TS-2172: cleanup and move mgmt/api/remote up
> 
> for better automake style tidy up, we need to stop compiling the
> files in other directoris, use .a and .la instead.
> 

[snip]

> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8197736c/mgmt/Makefile.am
> ----------------------------------------------------------------------
> diff --git a/mgmt/Makefile.am b/mgmt/Makefile.am
> index 45309a2..f657d17 100644
> --- a/mgmt/Makefile.am
> +++ b/mgmt/Makefile.am
> @@ -69,8 +69,6 @@ libmgmt_p_a_SOURCES = \
>   RecordsConfig.h
> 
> traffic_manager_SOURCES = \
> -  ../proxy/Error.cc \
> -  ../proxy/DiagsConfig.cc \
>   AddConfigFilesHere.cc \
>   Alarms.cc \
>   Alarms.h \
> @@ -96,11 +94,14 @@ traffic_manager_LDADD = \
>   stats/libstats.a \
>   web2/libweb.a \
>   api/libmgmtapilocal.a \
> +  api/libtsmgmtshare.la \
>   utils/libutils_lm.a \
>   $(top_builddir)/proxy/hdrs/libhdrs.a \
>   $(top_builddir)/lib/records/libreclocal.a \
>   $(top_builddir)/lib/ts/libtsutil.la \
> -     $(top_builddir)/iocore/eventsystem/libinkevent.a \
> +  $(top_builddir)/iocore/eventsystem/libinkevent.a \
> +  $(top_builddir)/proxy/liberror.a \
> +  $(top_builddir)/proxy/libdiagsconfig.a \
>   @LIBRESOLV@ @LIBEXPAT@ @LIBPCRE@ @LIBTCL@ @LIBCAP@ \
>   -lm

I believe that this change is broken. If you examine DiagsConfig.cc, you will 
find the following snippet:

    27  #ifdef LOCAL_MANAGER
    28  
    29  #include "mgmt/Main.h"
    30  #define DIAGS_LOG_FILE "manager.log"
    31  
    32  #else
    33  #include "proxy/Main.h"
    34  #include "ProxyConfig.h"
    35  #define DIAGS_LOG_FILE "diags.log"
    36  
    37  #endif

This means that DiagsConfig.cc *must* be built twice. Once for local manager 
subsystems and once for process manager subsystems. traffic_manager requires 
that this be built with LOCAL_MANAGER defined.

I do like the change to move this into a convenience library. I think that the 
right fix here is (at minimum) to pass the log file name into 
DiagsConfig::DiagsConfig.

J

Reply via email to