Author Topic: .def & import library names  (Read 17636 times)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9489
Re: .def & import library names
« Reply #15 on: February 14, 2010, 07:55:10 pm »
When/where did Ceniza propose something? There's no proposal in this thread AFAICT.
If it was in this thread I wouldn't ask... I am not that lazy. :lol:

We had that discussion already after the patch was applied in another thread. It got lost on the way as other things were more important to me. However, I cannot find this thread anymore, but it was a fruitful discussion. I think Ceniza just has to look in his history around that time and can pinpoint us easily.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline johne53

  • Regular
  • ***
  • Posts: 253
Re: .def & import library names
« Reply #16 on: February 14, 2010, 08:03:59 pm »
If it was in this thread I wouldn't ask... I am not that lazy. :lol:

No offence meant...  :)

Offline thedmd

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: .def & import library names
« Reply #17 on: February 14, 2010, 09:02:32 pm »
Here it is:
When the user wants to create a non-as-common-as-a-plain-.dll-file (like .Plugin),
Notice that this was only *one* problem.

Even worse was if you tried to create a System.Management.DLL file. This did not work, too. And that's the one I was referring to at most. Because such misbehaviour is in fact not acceptable.

What was wrong with System.Management.DLL again? (I have forget only memory)
If I remember right, it was turned int "System.dll" .

Well... with an extension field you should not have that problem.

Output file name: System.Management (user input)
[ ] Use custom extension (unchecked)
Custom extension: dll (default shown, empty, previous value, ...)
Full output file name: System.Management.dll (read-only)
Full import lib file name: libSystem.Management.a (read-only)

Is it too bad an idea?
"God starts from scratch too"

Offline johne53

  • Regular
  • ***
  • Posts: 253
Re: .def & import library names
« Reply #18 on: February 14, 2010, 10:56:23 pm »
There's an obvious problem with that suggestion.... it seems to apply the custom extension even though the option to Use custom extension was left unckecked. To be honest, If you read my suggestion (from a few posts back) and put some thought into it, I really think it's a much more elegant solution.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9489
Re: .def & import library names
« Reply #19 on: February 15, 2010, 06:43:47 am »
Here it is:
Exactly! That was it. But now that I read it again I also recall the problem I had with this:
Currently we put the prefix and extension automatically to the name of the library for convenience. But doing that and using Ceniza's suggestion would mean that the extension gets added over and over again... :-(

If you read my suggestion (from a few posts back) and put some thought into it, I really think it's a much more elegant solution.
Do you mean this one:
Import library: $(OutDir)$(TargetFileName)$(DefaultImportExtension)
???

Here the problem is: What if a user puts "foo.dll" in the target name field? Would it become foo.dll.a and foo.dll.dll then? If so then I can tell you that we will get "bug reports" on that issue.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline johne53

  • Regular
  • ***
  • Posts: 253
Re: .def & import library names
« Reply #20 on: February 15, 2010, 07:25:16 am »
No, I meant this suggestion....

But there's a check box that allows the user to determine whether or not the extension should be auto-generated. If (s)he checks the box and types "App.Plugin" then (s)he'll get "App.Plugin.dll". If (s)he doesn't check the box there should be an assumption that the typed extension (if there is one) is the intended extension.

If the user types in "foo.dll" amd also checks the box, no further extension would be added (to the dll) because the functionality should be intelligent enough to realise that the extension is already the one that would have been auto-generated. This is the same scenario as if the user had only typed in "foo" (I think... it's quite some time since I looked at what happens if no extension is given but the box is also left unchecked. I might be wrong about that). However, whether I'm right or wrong about the dll naming, any associated files would be called "foo.lib", "foo.def", foo.a" or whatever is appropriate.

However, if the user types in "foo.plugin" and selects auto-generation for the extension, the resulting libraries will be  "foo.plugin.dll", "foo.plugin.lib", "foo.plugin.def", "foo.plugin.a" or whatever.

Final scenario - if the user types in "foo.plugin" but doesn't select auto-generation (for the extension) the resulting libraries will be  "foo.plugin", "foo.lib", "foo.def", "foo.a" etc.

Hope that makes sense.
« Last Edit: February 15, 2010, 07:37:39 am by johne53 »

Offline thedmd

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: .def & import library names
« Reply #21 on: February 15, 2010, 10:35:58 am »
Every suggestion I had encountered there stands for "what if user want...". My idea is quite simple, instead of army of checkboxes let the user type in name prototype.

Output filename:
foobar
Import library filename:
$(TargetName)
Definition file filename:
$(TargetName)
[X]
Auto-generate filename prefix
[X]
Auto-generate filename extension

Output filename
   Auto-prefix    
   Auto-ext    
GCC
DLL
GCC
LIB
GCC
DEF
VC++
DLL
VC++
LIB
VC++
DEF
    foobar    
    X    
    X    
    foobar.dll         libfoobar.a         libfoobar.def         foobar.dll         foobar.lib         foobar.def    
    foobar.dll    
    X    
    X    
    foobar.dll         libfoobar.a         libfoobar.def         foobar.dll         foobar.lib         foobar.def    
    foo.bar    
    X    
    X    
    foo.bar.dll         libfoo.bar.a         libfoo.bar.def         foo.bar.dll         foo.bar.lib         foo.bar.def    
    foo.bar.dll    
    X    
    X    
    foo.bar.dll         libfoo.bar.a         libfoo.bar.def         foo.bar.dll         foo.bar.lib         foo.bar.def    
    foobar              
    X    
    foobar.dll         foobar.a         foobar.def         foobar.dll         foobar.lib         foobar.def    
    foobar.dll              
    X    
    foobar.dll         foobar.a         foobar.def         foobar.dll         foobar.lib         foobar.def    
    foo.bar              
    X    
    foo.bar.dll         foo.bar.a         foo.bar.def         foo.bar.dll         foo.bar.lib         foo.bar.def    
    foo.bar.dll              
    X    
    foo.bar.dll         foo.bar.a         foo.bar.def         foo.bar.dll         foo.bar.lib         foo.bar.def    
    foobar    
    X    
              foobar         libfoobar         libfoobar         foobar         foobar         foobar    
    foobar.dll    
    X    
              foobar.dll         libfoobar         libfoobar         foobar.dll         foobar         foobar    
    foo.bar    
    X    
              foo.bar         libfoo.bar         libfoo.bar         foo.bar         foo.bar         foo.bar    
    foo.bar.dll    
    X    
              foo.bar.dll         libfoo.bar         libfoo.bar         foo.bar.dll         foo.bar         foo.bar    
    foobar                             foobar         foobar         foobar         foobar         foobar         foobar    
    foobar.dll                             foobar.dll         foobar         foobar         foobar.dll         foobar         foobar    
    foo.bar                             foo.bar         foo.bar         foo.bar         foo.bar         foo.bar         foo.bar    
    foo.bar.dll                             foo.bar.dll         foo.bar         foo.bar         foo.bar.dll         foo.bar         foo.bar    

Replace import library filename with $(TargetFileName) and we got:
Target name
Target file name
   Auto-prefix    
   Auto-ext    
GCC
LIB
VC++
LIB
    foobar         foobar.dll    
    X    
    X    
    libfoobar.dll.a         foobar.dll.lib    
    foobar.dll         foobar.dll    
    X    
    X    
    libfoobar.dll.a         foobar.dll.lib    
    foo.bar         foo.bar.dll    
    X    
    X    
    libfoo.bar.dll.a         foo.bar.dll.lib    
    foo.bar.dll         foo.bar.dll    
    X    
    X    
    libfoo.bar.dll.a         foo.bar.dll.lib    
    foobar         foobar.dll              
    X    
    foobar.dll.a         foobar.dll.lib    
    foobar.dll         foobar.dll              
    X    
    foobar.dll.a         foobar.dll.lib    
    foo.bar         foo.bar.dll              
    X    
    foo.bar.dll.a         foo.bar.dll.lib    
    foo.bar.dll         foo.bar.dll              
    X    
    foo.bar.dll.a         foo.bar.dll.lib    
    foobar         foobar    
    X    
              libfoobar         foobar    
    foobar.dll         foobar.dll    
    X    
              libfoobar.dll         foobar.dll    
    foo.bar         foo.bar    
    X    
              libfoo.bar         foo.bar    
    foo.bar.dll         foo.bar.dll    
    X    
              libfoo.bar.dll         foo.bar.dll    
    foobar         foobar                             foobar         foobar    
    foobar.dll         foobar.dll                             foobar.dll         foobar.dll    
    foo.bar         foo.bar                             foo.bar         foo.bar    
    foo.bar.dll         foo.bar.dll                             foo.bar.dll         foo.bar.dll    

$(TargetName) - file name without extension (default extension is always stripped, .dll for examle)
$(TargetFileName) - file name with extension (if auto-ext is checked and ext is different from default one, ext is appended)

Is it sufficient?
"God starts from scratch too"

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9489
Re: .def & import library names
« Reply #22 on: February 15, 2010, 11:41:37 am »
Is it sufficient?
I guess so... :lol:
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline thedmd

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: .def & import library names
« Reply #23 on: February 15, 2010, 11:54:16 am »
Do you agree to implement this solution in C::B? It is rather simple. I'm not sure where those changes have to be introduced, becouse I allready found a few places where the target name is computed.
"God starts from scratch too"

Offline thedmd

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: .def & import library names
« Reply #24 on: February 18, 2010, 04:52:24 am »
BUMP
"God starts from scratch too"

Offline Seronis

  • Almost regular
  • **
  • Posts: 197
Re: .def & import library names
« Reply #25 on: February 18, 2010, 05:09:12 am »
dont bump threads unless you are adding more to the discussion.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9489
Re: .def & import library names
« Reply #26 on: February 18, 2010, 07:16:38 am »
Do you agree to implement this solution in C::B?
What did I say:
Is it sufficient?
I guess so... :lol:
???

I am awaiting a patch accordingly.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline thedmd

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: .def & import library names
« Reply #27 on: February 18, 2010, 08:12:05 am »
I have bumped this thread since I don’t believe discussion is over. Yes, we agree to that solution, but this don’t close the topic. Nothing was said about possible implementation details.

I had asked Morten if he is willing to implement this feature, because I believe he is best for this job. My changes may hit parts of C::B that I’m unaware of and my knowledge about C::B source code is very limited at the moment.

I believe “I guess so...” don’t carry the information: “This is a reasonable solution, please prepare a patch so we can be able to test it and give you a feedback.”. I’s tempting to place here some smiling emoticon, but I’m trying to avoid them for a while now, so you can read this comment instead.

I still have one question unanswered. Why target name is computed in more than one place in C::B? This information will be definitely helpful.

P.S. In case of doubts, please look at the left side of this post.
« Last Edit: February 18, 2010, 08:13:44 am by thedmd »
"God starts from scratch too"

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9489
Re: .def & import library names
« Reply #28 on: February 18, 2010, 09:21:08 am »
I had asked Morten if he is willing to implement this feature, because I believe he is best for this job.
I don't exactly recall this question, but I guess it'll take time then. I am quite busy atm and in addition I won't start with work on something that works but doesn't look nice. Other things that really don't work have a higher priority for me.

I think this discussion lead to a proposal how to do it. Now it's time to get the hands on. But this is really nothing hard to do, most work comes with testing every combination I guess. So I am hereby asking for volunteers - it's a nice and easy job to do, just right for people that want to help with C::B development and are just at the beginning.

Just start in compilercommandgenerator.cpp, method:
Code: [Select]
wxString CompilerCommandGenerator::SetupOutputFilenames(Compiler* compiler, ProjectBuildTarget* target)
The other places should not be of interest.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline thedmd

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: .def & import library names
« Reply #29 on: February 18, 2010, 09:36:29 am »
My earlier question may be misinterpreted. I see that it can be missed.

In my opinion we have a problem and we need to solve it, not just discuss. Now we know what each other thinking about this. We finally agreed to solve the issue and topic is going to be closed. Nice and smooth.

I will try to prepare appropriate patch soon. Thanks for hint, it will be helpful.
"God starts from scratch too"