Changeset 599 for CMT


Ignore:
Timestamp:
Dec 23, 2011, 5:47:15 PM (12 years ago)
Author:
rybkin
Message:

See C.L. 476

Location:
CMT/HEAD
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r598 r599  
     12011-12-23    <rybkin@lal.in2p3.fr> 476
     2
     3        * source/cmt_commands.cxx: In class ArgParser function do_create, check if
     4        at least 2 arguments specified and set error otherwise
     5        * source/cmt_symbol.cxx: In class SymbolValueList function print, add
     6        comments only if Verbose level (of diagnostic messages) is activated so as
     7        to make Requirements mode setup output shorter
     8        * source/cmt_system.h: In class CmtSystem, make functions file_separator,
     9        path_separator, command_separator inline, remove function cwd_variable
     10        * source/cmt_system.cxx: Introduce and make use of cwd_env_var preprocessor
     11        macro, on Windows, use _unlink, _chmod, _putenv instead of deprecated -
     12        beginning in Visual C++ 2005 - POSIX names functions
     13        * source/cmt_generators.cxx: In class PackagesMakefileGenerator function
     14        build, add template PACKAGEPREFIX for package_fragment
     15        * source/cmt_parser.cxx: In class Cmt function do_build_broadcast_config,
     16        add <package>_offset, <PACKAGE>VERSION macros to broadcast tags file
     17        * mgr/fragments/packages_header: Include broadcast tags file
     18        * mgr/fragments/nmake/packages_header: idem
     19        * mgr/fragments/nmake/package: Add package info (name, version, offset) to
     20        diagnostic messages, making use of added macros in tags file
     21        * mgr/fragments/package: idem, use redirection operator (rather than touch)
     22        to create empty or truncate existing package log file
     23        * mgr/fragments/nmake/library: For clean target, remove constituent
     24        directory and manifest file
     25        * mgr/fragments/nmake/library_no_static: idem
     26        * mgr/fragments/nmake/library_no_share: For clean target, remove
     27        constituent directory
     28        * mgr/fragments/nmake/cleanup_application: For clean target, remove
     29        manifest file
     30       
    1312011-12-11    <rybkin@lal.in2p3.fr> 475
    232
  • CMT/HEAD/mgr/fragments/nmake/cleanup_application

    r11 r599  
    11        -$(cleanup_echo) ${CONSTITUENT}$(application_suffix)
    22        -$(cleanup_silent) if exist $(bin)${CONSTITUENT}$(application_suffix) del $(bin)${CONSTITUENT}$(application_suffix)
     3        -$(cleanup_silent) if exist $(bin)${CONSTITUENT}$(application_suffix).manifest del $(bin)${CONSTITUENT}$(application_suffix).manifest
  • CMT/HEAD/mgr/fragments/nmake/library

    r492 r599  
    1919        $(cleanup_echo) #objects
    2020        $(cleanup_silent) for %f in (${OBJS}) do $(cleanup_silent)if exist %f del %f
     21        $(cleanup_silent) if exist $(bin)${CONSTITUENT} rmdir /S /Q $(bin)${CONSTITUENT}
    2122        $(cleanup_silent) if exist $(bin)${CONSTITUENT}.arc del $(bin)${CONSTITUENT}.arc
    2223        $(cleanup_silent) if exist $(bin)${CONSTITUENT}.lib del $(bin)${CONSTITUENT}.lib
     
    2425        $(cleanup_silent) if exist $(bin)${CONSTITUENT}.exp del $(bin)${CONSTITUENT}.exp
    2526        $(cleanup_silent) if exist $(bin)${CONSTITUENT}.dll del $(bin)${CONSTITUENT}.dll
     27        $(cleanup_silent) if exist $(bin)${CONSTITUENT}.dll.manifest del $(bin)${CONSTITUENT}.dll.manifest
    2628        $(cleanup_silent) if exist $(bin)${CONSTITUENT}.pdb del $(bin)${CONSTITUENT}.pdb
    2729
  • CMT/HEAD/mgr/fragments/nmake/library_no_share

    r492 r599  
    1414        $(cleanup_echo) #objects
    1515        $(cleanup_silent) for %f in (${OBJS}) do $(cleanup_silent)if exist %f del %f
     16        $(cleanup_silent) if exist $(bin)${CONSTITUENT} rmdir /S /Q $(bin)${CONSTITUENT}
    1617        $(cleanup_silent) if exist $(${CONSTITUENT}lib) del $(${CONSTITUENT}lib)
    1718
  • CMT/HEAD/mgr/fragments/nmake/library_no_static

    r545 r599  
    3838        $(cleanup_echo) #objects
    3939        $(cleanup_silent) for %f in (${OBJS}) do $(cleanup_silent)if exist %f del %f
     40        $(cleanup_silent) if exist $(bin)${CONSTITUENT} rmdir /S /Q $(bin)${CONSTITUENT}
    4041        $(cleanup_silent) if exist $(bin)${CONSTITUENT}.arc del $(bin)${CONSTITUENT}.arc
    4142        $(cleanup_silent) if exist $(bin)${CONSTITUENT}.lib del $(bin)${CONSTITUENT}.lib
     
    4344        $(cleanup_silent) if exist $(bin)${CONSTITUENT}.exp del $(bin)${CONSTITUENT}.exp
    4445        $(cleanup_silent) if exist $(bin)${CONSTITUENT}.dll del $(bin)${CONSTITUENT}.dll
     46        $(cleanup_silent) if exist $(bin)${CONSTITUENT}.dll.manifest del $(bin)${CONSTITUENT}.dll.manifest
    4547        $(cleanup_silent) if exist $(bin)${CONSTITUENT}.pdb del $(bin)${CONSTITUENT}.pdb
    4648
  • CMT/HEAD/mgr/fragments/nmake/package

    r595 r599  
    2222!if "$(cmt_${PACKAGE}_is_local)" != ""
    2323        @echo "#--------------------------------------------------------------" \
    24           && echo "# Now trying [$(BCAST_CMD)] in $(${PACKAGE}MgrPath)" \
     24          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD)] in $(${PACKAGE}MgrPath)" \
    2525          && echo "#--------------------------------------------------------------"
    2626!if "$(LOG_LOCATION)" != ""
    2727        $(silent) type nul > $(LOG_LOCATION)\$(${PACKAGE}FullName)$(LOG_SUFFIX)
    2828        @( echo "#--------------------------------------------------------------" \
    29           && echo "# Now trying [$(BCAST_CMD)] in $(${PACKAGE}MgrPath)" \
     29          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD)] in $(${PACKAGE}MgrPath)" \
    3030          && echo "#--------------------------------------------------------------" ) $(${PACKAGE}OutErr)
    3131!endif
     
    4545!if "$(BCAST_GLOBAL)" != ""
    4646        @echo "#--------------------------------------------------------------" \
    47           && echo "# Now trying [$(BCAST_CMD)] in $(${PACKAGE}MgrPath)" \
     47          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD)] in $(${PACKAGE}MgrPath)" \
    4848          && echo "#--------------------------------------------------------------"
    4949!if "$(LOG_LOCATION)" != ""
    5050        $(silent) type nul > $(LOG_LOCATION)\$(${PACKAGE}FullName)$(LOG_SUFFIX)
    5151        @( echo "#--------------------------------------------------------------" \
    52           && echo "# Now trying [$(BCAST_CMD)] in $(${PACKAGE}MgrPath)" \
     52          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD)] in $(${PACKAGE}MgrPath)" \
    5353          && echo "#--------------------------------------------------------------" ) $(${PACKAGE}OutErr)
    5454!endif
     
    9494!if "$(cmt_${PACKAGE}_is_local)" != ""
    9595        @echo "#--------------------------------------------------------------" \
    96           && echo "# Now trying [$(BCAST_CMD) clean] in $(${PACKAGE}MgrPath)" \
     96          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) clean] in $(${PACKAGE}MgrPath)" \
    9797          && echo "#--------------------------------------------------------------"
    9898        $(silent) cd /d $(${PACKAGE}MgrPath) && $(BCAST_CMD) clean
     
    100100!if "$(BCAST_GLOBAL)" != ""
    101101        @echo "#--------------------------------------------------------------" \
    102           && echo "# Now trying [$(BCAST_CMD) clean] in $(${PACKAGE}MgrPath)" \
     102          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) clean] in $(${PACKAGE}MgrPath)" \
    103103          && echo "#--------------------------------------------------------------"
    104104        $(silent) cd /d $(${PACKAGE}MgrPath) && $(BCAST_CMD) clean
     
    111111!if "$(cmt_${PACKAGE}_is_local)" != ""
    112112        @echo "#--------------------------------------------------------------" \
    113           && echo "# Now trying [$(BCAST_CMD) binclean] in $(${PACKAGE}MgrPath)" \
     113          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) binclean] in $(${PACKAGE}MgrPath)" \
    114114          && echo "#--------------------------------------------------------------"
    115115        $(silent) cd /d $(${PACKAGE}MgrPath) && $(BCAST_CMD) binclean
     
    117117!if "$(BCAST_GLOBAL)" != ""
    118118        @echo "#--------------------------------------------------------------" \
    119           && echo "# Now trying [$(BCAST_CMD) binclean] in $(${PACKAGE}MgrPath)" \
     119          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) binclean] in $(${PACKAGE}MgrPath)" \
    120120          && echo "#--------------------------------------------------------------"
    121121        $(silent) cd /d $(${PACKAGE}MgrPath) && $(BCAST_CMD) binclean
     
    128128!if "$(cmt_${PACKAGE}_is_local)" != ""
    129129        @echo "#--------------------------------------------------------------" \
    130           && echo "# Now trying [$(BCAST_CMD) uninstall] in $(${PACKAGE}MgrPath)" \
     130          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) uninstall] in $(${PACKAGE}MgrPath)" \
    131131          && echo "#--------------------------------------------------------------"
    132132        $(silent) cd /d $(${PACKAGE}MgrPath) && $(BCAST_CMD) uninstall
     
    134134!if "$(BCAST_GLOBAL)" != ""
    135135        @echo "#--------------------------------------------------------------" \
    136           && echo "# Now trying [$(BCAST_CMD) uninstall] in $(${PACKAGE}MgrPath)" \
     136          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) uninstall] in $(${PACKAGE}MgrPath)" \
    137137          && echo "#--------------------------------------------------------------"
    138138        $(silent) cd /d $(${PACKAGE}MgrPath) && $(BCAST_CMD) uninstall
     
    145145!if "$(cmt_${PACKAGE}_is_local)" != ""
    146146        @echo "#--------------------------------------------------------------" \
    147           && echo "# Now trying [$(BCAST_CMD) check] in $(${PACKAGE}MgrPath)" \
     147          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) check] in $(${PACKAGE}MgrPath)" \
    148148          && echo "#--------------------------------------------------------------"
    149149        $(silent) cd /d $(${PACKAGE}MgrPath) && $(BCAST_CMD) check
     
    151151!if "$(BCAST_GLOBAL)" != ""
    152152        @echo "#--------------------------------------------------------------" \
    153           && echo "# Now trying [$(BCAST_CMD) check] in $(${PACKAGE}MgrPath)" \
     153          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) check] in $(${PACKAGE}MgrPath)" \
    154154          && echo "#--------------------------------------------------------------"
    155155        $(silent) cd /d $(${PACKAGE}MgrPath) && $(BCAST_CMD) check
  • CMT/HEAD/mgr/fragments/nmake/packages_header

    r595 r599  
    22
    33#!include $(CMTROOT)\src\NMakefile.core
    4 #!include $(cmt_broadcast_tagfile)
     4!include $(cmt_broadcast_tagfile)
    55
    66!if "$(BCAST_CMD)" == ""
  • CMT/HEAD/mgr/fragments/package

    r595 r599  
    2222ifdef cmt_${PACKAGE}_is_local
    2323        @echo "#--------------------------------------------------------------" \
    24           && echo "# Now trying [$(BCAST_CMD)] in $(${PACKAGE}MgrPath)" \
     24          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD)] in $(${PACKAGE}MgrPath)" \
    2525          && echo "#--------------------------------------------------------------"
    2626ifdef LOG_LOCATION
    27         $(silent) touch $(LOG_LOCATION)/$(${PACKAGE}FullName)$(LOG_SUFFIX)
     27        $(silent) > $(LOG_LOCATION)/$(${PACKAGE}FullName)$(LOG_SUFFIX)
    2828        @{ echo "#--------------------------------------------------------------" \
    29           && echo "# Now trying [$(BCAST_CMD)] in $(${PACKAGE}MgrPath)" \
     29          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD)] in $(${PACKAGE}MgrPath)" \
    3030          && echo "#--------------------------------------------------------------"; } $(${PACKAGE}OutErr)
    3131endif
     
    4343ifdef BCAST_GLOBAL
    4444        @echo "#--------------------------------------------------------------" \
    45           && echo "# Now trying [$(BCAST_CMD)] in $(${PACKAGE}MgrPath)" \
     45          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD)] in $(${PACKAGE}MgrPath)" \
    4646          && echo "#--------------------------------------------------------------"
    4747ifdef LOG_LOCATION
    48         $(silent) touch $(LOG_LOCATION)/$(${PACKAGE}FullName)$(LOG_SUFFIX)
     48        $(silent) > $(LOG_LOCATION)/$(${PACKAGE}FullName)$(LOG_SUFFIX)
    4949        @{ echo "#--------------------------------------------------------------" \
    50           && echo "# Now trying [$(BCAST_CMD)] in $(${PACKAGE}MgrPath)" \
     50          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD)] in $(${PACKAGE}MgrPath)" \
    5151          && echo "#--------------------------------------------------------------"; } $(${PACKAGE}OutErr)
    5252endif
     
    9090ifdef cmt_${PACKAGE}_is_local
    9191        @echo "#--------------------------------------------------------------" \
    92           && echo "# Now trying [$(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@)] in $(${PACKAGE}MgrPath)" \
     92          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@)] in $(${PACKAGE}MgrPath)" \
    9393          && echo "#--------------------------------------------------------------"
    9494        +$(silent) cd $(${PACKAGE}MgrPath) && $(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@)
     
    9696ifdef BCAST_GLOBAL
    9797        @echo "#--------------------------------------------------------------" \
    98           && echo "# Now trying [$(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@)] in $(${PACKAGE}MgrPath)" \
     98          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@)] in $(${PACKAGE}MgrPath)" \
    9999          && echo "#--------------------------------------------------------------"
    100100        +$(silent) cd $(${PACKAGE}MgrPath) && $(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@)
  • CMT/HEAD/mgr/fragments/packages_header

    r595 r599  
    22
    33include ${CMTROOT}/src/Makefile.core
     4
     5#
     6#  Basic tag management
     7#
     8ifdef tag
     9CMTEXTRATAGS = $(tag)
     10else
     11tag       = $(CMTCONFIG)
     12endif
     13
     14tags      = $(tag),$(CMTEXTRATAGS)
     15
     16#cmt_local_tagfile = $(bin)$(tag).make
     17cmt_broadcast_tagfile = $(bin)$(tag)_broadcast.make
     18
     19include $(cmt_broadcast_tagfile)
    420
    521ifndef BCAST_CMD
     
    5470#--------------------------------------------------------
    5571
     72${CMTROOT}/src/Makefile.core : ;
     73$(cmt_broadcast_tagfile) : ;
     74ifdef use_requirements
     75$(use_requirements) : ;
     76endif
     77
    5678ifndef PEDANTIC
    5779.DEFAULT :
    58         $(echo) "(uses.make) $@: No rule for such target" >&2
     80        $(echo) "(packages) $@: No rule for such target" >&2
    5981endif
    6082
  • CMT/HEAD/source/cmt_commands.cxx

    r590 r599  
    10141014void ArgParser::do_create ()
    10151015{
    1016   if (argc > 0)
     1016  if (argc >= 2)
     1017    //if (argc > 0)
    10171018    {
    10181019      fill_arguments ();
     
    10211022  else
    10221023    {
    1023       CmtMessage::error ("syntax: create arguments missing");
    1024       //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : create arguments missing" << endl;
     1024      CmtError::set (CmtError::syntax_error, "arguments missing");
     1025      //CmtMessage::error ("syntax: create arguments missing");
    10251026      help_action = action_help;
    10261027      cmt.m_action = action_create;
  • CMT/HEAD/source/cmt_generators.cxx

    r595 r599  
    29132913
    29142914          m_PACKAGE = use->get_package_name ();
     2915          m_PACKAGEPREFIX = use->prefix;
    29152916
    29162917          Use::UsePtrVector subuses;
     
    29442945            }
    29452946
    2946           if (!package_fragment.copy (m_output_file, 5,
    2947                                       &m_PACKAGE, &m_DEPENDENCIES,
     2947          if (!package_fragment.copy (m_output_file, 6,
     2948                                      &m_PACKAGE, &m_PACKAGEPREFIX,
     2949                                      &m_DEPENDENCIES,
    29482950                                      &m_PACKAGEMGRPATH, &m_PACKAGEFULLNAME,
    29492951                                      &m_ISLOCAL)) return;
  • CMT/HEAD/source/cmt_parser.cxx

    r598 r599  
    25542554//      symbol->show_macro (Make, t);
    25552555//      const cmt_string pattern = "^use_requirements$|.*_root$|.*_cmtpath$|.*_offset$";
    2556       const cmt_string pattern = "^use_requirements$|.*_root$";
     2556//      const cmt_string pattern = "^use_requirements$|.*_root$";
     2557      const cmt_string pattern = "^use_requirements$|.*_root$|.*_offset$|.*VERSION$";
    25572558      print_macros (Make, pattern, t);
    25582559      t.close (); // ios_base::failbit
  • CMT/HEAD/source/cmt_symbol.cxx

    r588 r599  
    31343134  else define_text = "overrides";
    31353135
    3136   cout << "# Package ";
     3136  if (CmtMessage::active (Verbose))
     3137    cout << "# Package " << (use != 0 ? use->get_package_name () + " " + use->version : "");
     3138  /*
    31373139  if (use != 0)
    31383140    {
    31393141      cout << use->get_package_name () << " " << use->version;
    31403142    }
     3143  */
    31413144
    31423145  switch (command_type)
    31433146    {
    31443147      case CommandSet :
    3145         cout << " " << define_text << " set " << symbol.name << " as " << endl;
     3148        if (CmtMessage::active (Verbose))
     3149          cout << " " << define_text << " set " << symbol.name << " as " << endl;
    31463150        //        cout << " " << define_text << " set " << symbol.name << " as ";
    31473151        cout << "set " << symbol.name;
     
    31503154        break;
    31513155      case CommandSetAppend :
    3152         cout << " appends to set " << symbol.name << " : " << endl;;
     3156        if (CmtMessage::active (Verbose))
     3157          cout << " appends to set " << symbol.name << " : " << endl;
    31533158        //        cout << " appends to set " << symbol.name << " : ";
    31543159        cout << "set_append " << symbol.name;
     
    31563161        break;
    31573162      case CommandSetPrepend :
    3158         cout << " prepends to set " << symbol.name << " : " << endl;
     3163        if (CmtMessage::active (Verbose))
     3164          cout << " prepends to set " << symbol.name << " : " << endl;
    31593165        //        cout << " prepends to set " << symbol.name << " : ";
    31603166        cout << "set_prepend " << symbol.name;
     
    31623168        break;
    31633169      case CommandSetRemove :
    3164         cout << " removes from set " << symbol.name << " : " << endl;
     3170        if (CmtMessage::active (Verbose))
     3171          cout << " removes from set " << symbol.name << " : " << endl;
    31653172        //        cout << " removes from set " << symbol.name << " : ";
    31663173        cout << "set_remove " << symbol.name;
     
    31683175        break;
    31693176      case CommandSetRemoveRegexp :
    3170         cout << " removes RE from set " << symbol.name << " : " << endl;
     3177        if (CmtMessage::active (Verbose))
     3178          cout << " removes RE from set " << symbol.name << " : " << endl;
    31713179        //        cout << " removes RE from set " << symbol.name << " : ";
    31723180        cout << "set_remove_regexp " << symbol.name;
     
    31743182        break;
    31753183      case CommandAlias :
    3176         cout << " " << define_text << " alias " << symbol.name << endl;
     3184        if (CmtMessage::active (Verbose))
     3185          cout << " " << define_text << " alias " << symbol.name << endl;
    31773186        //        cout << " " << define_text << " alias " << symbol.name << " as ";
    31783187        cout << "alias " << symbol.name;
     
    31813190        break;
    31823191      case CommandPath :
    3183         cout << " " << define_text << " path " << symbol.name << endl;
     3192        if (CmtMessage::active (Verbose))
     3193          cout << " " << define_text << " path " << symbol.name << endl;
    31843194        //        cout << " " << define_text << " path " << symbol.name << " as ";
    31853195        cout << "path " << symbol.name;
     
    31883198        break;
    31893199      case CommandPathAppend :
    3190         cout << " appends to path " << symbol.name << endl;
     3200        if (CmtMessage::active (Verbose))
     3201          cout << " appends to path " << symbol.name << endl;
    31913202        //        cout << " appends to path " << symbol.name << " : ";
    31923203        cout << "path_append " << symbol.name;
     
    31943205        break;
    31953206      case CommandPathPrepend :
    3196         cout << " prepends to path " << symbol.name << " : " << endl;
     3207        if (CmtMessage::active (Verbose))
     3208          cout << " prepends to path " << symbol.name << " : " << endl;
    31973209        //        cout << " prepends to path " << symbol.name << " : ";
    31983210        cout << "path_prepend " << symbol.name;
     
    32003212        break;
    32013213      case CommandPathRemove :
    3202         cout << " removes from path " << symbol.name << " : " << endl;
     3214        if (CmtMessage::active (Verbose))
     3215          cout << " removes from path " << symbol.name << " : " << endl;
    32033216        //        cout << " removes from path " << symbol.name << " : ";
    32043217        cout << "path_remove " << symbol.name;
     
    32063219        break;
    32073220      case CommandPathRemoveRegexp :
    3208         cout << " removes RE from path " << symbol.name << " : " << endl;
     3221        if (CmtMessage::active (Verbose))
     3222          cout << " removes RE from path " << symbol.name << " : " << endl;
    32093223        //        cout << " removes RE from path " << symbol.name << " : ";
    32103224        cout << "path_remove_regexp " << symbol.name;
     
    32123226        break;
    32133227      case CommandMacro :
    3214         cout << " " << define_text << " macro " << symbol.name << " as " << endl;
     3228        if (CmtMessage::active (Verbose))
     3229          cout << " " << define_text << " macro " << symbol.name << " as " << endl;
    32153230        //        cout << " " << define_text << " macro " << symbol.name << " as ";
    32163231        cout << "macro " << symbol.name;
     
    32183233        break;
    32193234      case CommandMacroPrepend :
    3220         cout << " prepends to macro " << symbol.name << " : " << endl;
     3235        if (CmtMessage::active (Verbose))
     3236          cout << " prepends to macro " << symbol.name << " : " << endl;
    32213237        //        cout << " prepends to macro " << symbol.name << " : ";
    32223238        cout << "macro_prepend " << symbol.name;
     
    32243240        break;
    32253241      case CommandMacroAppend :
    3226         cout << " appends to macro " << symbol.name << " : " << endl;
     3242        if (CmtMessage::active (Verbose))
     3243          cout << " appends to macro " << symbol.name << " : " << endl;
    32273244        //        cout << " appends to macro " << symbol.name << " : ";
    32283245        cout << "macro_append " << symbol.name;
     
    32303247        break;
    32313248      case CommandMacroRemove :
    3232         cout << " remove from macro " << symbol.name << " : " << endl;
     3249        if (CmtMessage::active (Verbose))
     3250          cout << " remove from macro " << symbol.name << " : " << endl;
    32333251        //        cout << " remove from macro " << symbol.name << " : ";
    32343252        cout << "macro_remove " << symbol.name;
     
    32363254        break;
    32373255      case CommandMacroRemoveRegexp :
    3238         cout << " remove RE from macro " << symbol.name << " : " << endl;
     3256        if (CmtMessage::active (Verbose))
     3257          cout << " remove RE from macro " << symbol.name << " : " << endl;
    32393258        //        cout << " remove RE from macro " << symbol.name << " : ";
    32403259        cout << "macro_remove_regexp " << symbol.name;
     
    32423261        break;
    32433262      case CommandMacroRemoveAll :
    3244         cout << " remove all from macro " << symbol.name << " : " << endl;
     3263        if (CmtMessage::active (Verbose))
     3264          cout << " remove all from macro " << symbol.name << " : " << endl;
    32453265        //        cout << " remove all from macro " << symbol.name << " : ";
    32463266        cout << "macro_remove_all " << symbol.name;
     
    32483268        break;
    32493269      case CommandMacroRemoveAllRegexp :
    3250         cout << " remove all RE from macro " << symbol.name << " : " << endl;
     3270        if (CmtMessage::active (Verbose))
     3271          cout << " remove all RE from macro " << symbol.name << " : " << endl;
    32513272        //        cout << " remove all RE from macro " << symbol.name << " : ";
    32523273        cout << "macro_remove_all_regexp " << symbol.name;
     
    32543275        break;
    32553276      case CommandSetupScript :
    3256         cout << " " << define_text << " setup script " << symbol.name << endl;
     3277        if (CmtMessage::active (Verbose))
     3278          cout << " " << define_text << " setup script " << symbol.name << endl;
    32573279        //       cout << " " << define_text << " action " << symbol.name << " as ";
    32583280        cout << "setup_script" /* << symbol.name */;
  • CMT/HEAD/source/cmt_system.cxx

    r597 r599  
    2020#define S_IFDIR _S_IFDIR
    2121#define USE_GETCWD 1
    22 
     22#define cwd_env_var "CD"
    2323#include <sys/types.h>
    2424#include <sys/stat.h>
     
    2828
    2929#define stat _stat
     30#define unlink _unlink
     31#define chmod _chmod
     32//#define putenv _putenv
    3033#define WEXITSTATUS(w) (w)
    31 #include <stdlib.h>
    3234#define PATH_MAX _MAX_PATH
    3335
     
    4042#include <sys/utsname.h>
    4143#include <limits.h> // define PATH_MAX
     44#define cwd_env_var "PWD"
    4245#endif
    4346
     
    7982  char* pwd_env = 0;
    8083
    81   pwd_env = ::getenv (cwd_variable ()); 
     84  pwd_env = ::getenv (cwd_env_var); 
    8285  //  pwd_env = ::getenv ("PWD"); 
    8386
     
    157160    {
    158161#ifndef WIN32
    159       if (putenv (cwd_variable (), s_dir))
     162      if (putenv (cwd_env_var, s_dir))
    160163        //      if (putenv ("PWD", s_dir))
    161164        return (true);
     
    739742
    740743//--------------------------------------------------
     744/*
    741745char CmtSystem::file_separator ()
    742746{
     
    747751#endif
    748752}
    749 
     753*/
    750754/**
    751755 *  Transform all / or \ characters in the text into the current file_separator
     
    773777
    774778//--------------------------------------------------
     779/*
    775780char CmtSystem::path_separator ()
    776781{
     
    781786#endif
    782787}
    783 
     788*/
    784789//--------------------------------------------------
     790 /*
    785791char CmtSystem::command_separator ()
    786792{
     
    791797#endif
    792798}
    793 
     799 */
     800/*
    794801//--------------------------------------------------
    795802const char * CmtSystem::cwd_variable ()
     
    801808#endif
    802809}
    803 
     810*/
    804811//--------------------------------------------------
    805812const cmt_string& CmtSystem::ev_open ()
     
    15501557    //cerr << "#CmtSystem::putenv> name=" << name << " &v=" << &v << endl;
    15511558
     1559#ifdef WIN32
     1560    int status = ::_putenv ((char*) v.c_str ());
     1561#else
    15521562    int status = ::putenv ((char*) v.c_str ());
     1563#endif
    15531564
    15541565    if (status == 0) return (true);
  • CMT/HEAD/source/cmt_system.h

    r595 r599  
    8080                                        const cmt_string& name2);
    8181  static int file_size (const cmt_string& name);
    82   static char file_separator ();
     82  inline static char file_separator ()
     83    {
     84#ifdef WIN32
     85      return ('\\');
     86#else
     87      return ('/');
     88#endif
     89    }
    8390  static void reduce_file_separators (cmt_string& text);
    84   static char path_separator ();
    85   static char command_separator ();
    86   static const char* cwd_variable ();
     91  inline static char path_separator ()
     92    {
     93#ifdef WIN32
     94      return (';');
     95#else
     96      return (':');
     97#endif
     98    }
     99  inline static char command_separator ()
     100    {
     101#ifdef WIN32
     102      return ('&');
     103#else
     104      return (';');
     105#endif
     106    }
     107  //static const char* cwd_variable ();
    87108  static const cmt_string& ev_open ();
    88109  static const cmt_string& ev_close ();
Note: See TracChangeset for help on using the changeset viewer.