Changeset 466 for CMT


Ignore:
Timestamp:
Sep 22, 2008, 5:45:45 PM (16 years ago)
Author:
rybkin
Message:

See C.L. 367

Location:
CMT/HEAD
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r465 r466  
     12008-09-22    <rybkin@lal.in2p3.fr> 367
     2       
     3        * source/cmt_generators.cxx: Implement the -no_static option for libraries
     4        * source/cmt_generators.h: idem
     5        * source/cmt_parser.cxx: idem
     6        * source/cmt_commands.cxx: idem. Add the help text for the enhanced
     7        cmt build windefs command which now accepts multiple object and/or library
     8        files on the command line and/or via command file(s) and has an option
     9        to specify the library name
     10        * source/cmt_generator.h: In the build_windefs function, implement the
     11        enhanced functionality of the cmt build windefs command
     12        * source/cmt_generator.cxx: idem
     13        * mgr/fragments/constituent_lock: Minor code cleanup
     14        * mgr/requirements: Add the c option for the ar utility on Linux to avoid
     15        the warning. Declare the library_no_static make fragment
     16        * mgr/fragments/library_no_static: Introduce the make fragment to use with
     17        the -no_static option
     18        * mgr/fragments/nmake/library_no_static: idem for Windows
     19       
    1202008-07-30    <rybkin@lal.in2p3.fr> 366
    221       
  • CMT/HEAD/mgr/fragments/constituent_lock

    r459 r466  
    5858${CONSTITUENT} :: $(${CONSTITUENT}_dependencies) $(cmt_local_${CONSTITUENT}_makefile)
    5959        $(echo) "(constituents.make) Creating ${CONSTITUENT}${lock_suffix} and Starting ${CONSTITUENT}"
    60         @{ ${lock_command} ${CONSTITUENT}${lock_suffix} || exit $$?; } ; \
     60        @${lock_command} ${CONSTITUENT}${lock_suffix} || exit $$?; \
    6161          retval=$$?; \
    6262          trap '${unlock_command} ${CONSTITUENT}${lock_suffix}; exit $${retval}' 1 2 15; \
  • CMT/HEAD/mgr/requirements

    r459 r466  
    350350      LynxOS          "ar clr" \
    351351      RIO806X         "ar clr" \
    352       Linux           "ar r" \
     352      Linux           "ar cr" \
    353353      VisualC         "lib.exe /nologo "
    354354
     
    493493make_fragment library
    494494make_fragment library_no_share
     495make_fragment library_no_static
    495496make_fragment application
    496497make_fragment jar
  • CMT/HEAD/source/cmt_commands.cxx

    r459 r466  
    696696          if (argc > 0)
    697697            {
    698               fill_one_argument ();
     698              //              fill_one_argument ();
     699              fill_arguments ();
    699700              cmt.m_action = action_build_windefs;
    700701            }
     
    21842185  help_texts.add () =  "build temporary_name    : generate a name for a temprary file";
    21852186  help_texts.add () =  "build triggers <constituent> : generate library trigger file";
    2186   help_texts.add () =  "build windefs <library_name> : generate def file for Windows shared libraries";
     2187  help_texts.add () =  "build windefs [-name=NAME] [@commandfile] (objectfile|library)... : generate def file for Windows shared library [NAME]";
    21872188  help_texts.add () =  "check <option>          : check actions. (Try cmt help check)";
    21882189  help_texts.add () =  "check configuration     : check configuration";
  • CMT/HEAD/source/cmt_generator.cxx

    r459 r466  
    839839
    840840//--------------------------------------------------
    841 void Generator::build_windefs (const cmt_string& library_name)
    842 {
    843   cmt_string bin;
     841//void Generator::build_windefs (const cmt_string& library_name)
     842void Generator::build_windefs (const CmtSystem::cmt_string_vector& arguments)
     843{
    844844  cmt_string name;
    845   cmt_string suffix;
    846 
    847   CmtSystem::dirname (library_name, bin);
    848   CmtSystem::get_dot_suffix (library_name, suffix);
    849   CmtSystem::basename (library_name, suffix, name);
     845  CmtSystem::cmt_string_vector files;
     846
     847  for (int i = 0; i < arguments.size (); i++)
     848    {
     849      const cmt_string& w = arguments[i];
     850      if (w.substr (0, 6) == "-name=" || w.substr (0, 6) == "-name:" ||
     851          w.substr (0, 6) == "/name:" || w.substr (0, 6) == "/name=")
     852        w.substr (6, name);
     853      else if (w.substr (0, 1) == "@" && w.size () > 1)
     854        {
     855          cmt_string commandfile;
     856          w.substr (1, commandfile);
     857          if (!CmtSystem::test_file (commandfile))
     858            {
     859              CmtMessage::warning ("No such file `" + commandfile + "'.");
     860              continue;
     861            }
     862          cmt_string text;
     863          if (!text.read (commandfile))
     864            {
     865              CmtMessage::warning ("Could not read `" + commandfile + "'.");
     866              continue;
     867            }
     868          text.replace_all ("\r", " ");
     869          text.replace_all ("\n", " ");
     870          CmtSystem::cmt_string_vector words;
     871          CmtSystem::split (text, " \t", words);
     872          for (int i = 0; i < words.size (); i++)
     873            {
     874              files.push_back (words[i]);
     875            }
     876        }
     877      else
     878        files.push_back (w);
     879    }
     880
     881  if (files.size () == 0)
     882    {
     883      CmtMessage::error ("build_windefs: no files specified");
     884      return;
     885    }
     886  if (name == "")
     887    {
     888      cmt_string suffix;
     889      CmtSystem::get_dot_suffix (files[0], suffix);
     890      CmtSystem::basename (files[0], suffix, name);
     891    }
     892  if (name == "")
     893    {
     894      CmtMessage::error ("build_windefs: cannot determine library name");
     895      return;
     896    }
     897
     898  //  cmt_string bin;
     899
     900  //  CmtSystem::dirname (library_name, bin);
     901  //  CmtSystem::get_dot_suffix (library_name, suffix);
     902  //  CmtSystem::basename (library_name, suffix, name);
    850903 
    851   if (!CmtSystem::cd (bin)) return;
     904  //  if (!CmtSystem::cd (bin)) return;
    852905 
    853   cmt_string text;
    854   cmt_string command;
     906  //  cmt_string command;
    855907 
    856   command = "dumpbin /symbols ";
    857   command += library_name;
     908  cmt_string command ("dumpbin /symbols");
     909  //  command += library_name;
     910  for (int i = 0; i < files.size (); i++)
     911    {
     912      command += " " + files[i];
     913    }
    858914       
    859915  WinDefAwk filter (name);
  • CMT/HEAD/source/cmt_generator.h

    r428 r466  
    177177
    178178    // Build def files for Windows shared libraries
    179   static void build_windefs (const cmt_string& library_name);
     179  //  static void build_windefs (const cmt_string& library_name);
     180  static void build_windefs (const CmtSystem::cmt_string_vector& arguments);
    180181};
    181182
  • CMT/HEAD/source/cmt_generators.cxx

    r459 r466  
    4747  library_fragment.set ("library");
    4848  library_no_share_fragment.set ("library_no_share");
     49  library_no_static_fragment.set ("library_no_static");
    4950  application_fragment.set ("application");
    5051  jar_fragment.set ("jar");
     
    7172  library_fragment.reset ();
    7273  library_no_share_fragment.reset ();
     74  library_no_static_fragment.reset ();
    7375  jar_fragment.reset ();
    7476  application_fragment.reset ();
     
    670672          if (is_library)
    671673            {
    672               if (constituent.no_share)
     674              if (constituent.no_share && constituent.no_static)
     675                {
     676                  CmtMessage::warning (constituent.name + ": No shared or static library");
     677                }
     678              else if (constituent.no_share)
    673679                {
    674680                  library_no_share_fragment.copy (m_output_file, constituent.variables, 3,
     681                                                  &m_CONSTITUENT,
     682                                                  &m_CONSTITUENTSUFFIX,
     683                                                  &m_OBJS);
     684                }
     685              else if (constituent.no_static)
     686                {
     687                  library_no_static_fragment.copy (m_output_file, constituent.variables, 3,
    675688                                                  &m_CONSTITUENT,
    676689                                                  &m_CONSTITUENTSUFFIX,
  • CMT/HEAD/source/cmt_generators.h

    r429 r466  
    7070  FragmentHandle library_fragment;
    7171  FragmentHandle library_no_share_fragment;
     72  FragmentHandle library_no_static_fragment;
    7273  FragmentHandle application_fragment;
    7374  FragmentHandle jar_fragment;
  • CMT/HEAD/source/cmt_parser.cxx

    r463 r466  
    22532253    {
    22542254      set_standard_macros ();
    2255       Generator::build_windefs (ap.arguments[0]);
     2255      //      Generator::build_windefs (ap.arguments[0]);
     2256      Generator::build_windefs (ap.arguments);
    22562257    }
    22572258}
Note: See TracChangeset for help on using the changeset viewer.