August 13, 2010 [dmd-internals] Shouldn't there be a dmd switch to specify search paths for libraries? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | > -L-Lpath
> works for me on Linux.
Well good old friend optlink doesn't support something like that. And the LIB variable is overwritten by the content specified in sc.ini I think.
|
August 13, 2010 [dmd-internals] Shouldn't there be a dmd switch to specify search paths for libraries? | ||||
---|---|---|---|---|
| ||||
Posted in reply to mrmocool at gmx.de |
mrmocool at gmx.de wrote:
>> -L-Lpath
>> works for me on Linux.
>
> Well good old friend optlink doesn't support something like that. And the LIB variable is overwritten by the content specified in sc.ini I think.
>
dmd will pass any switch directly to the linker with the -L command. I know optlink has a problem with lib paths, but such is not fixable by enhancing pragmas, but by enhancing optlink.
|
August 13, 2010 [dmd-internals] Shouldn't there be a dmd switch to specify search paths for libraries? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | I don't agree. While often the library name is known, where it is stored on the user's machine can be anywhere. The user shouldn't be modifying the code to customize it for his paths.
Andrei Alexandrescu wrote:
> The idea is that pragma(lib, ...) is useless if it's not a single point of modification. If a library requires an extra command line artifact, it may as well give up on the pragma and require two command line artifacts.
>
> Andrei
>
> Walter Bright wrote:
>> -L-Lpath
>>
>> works for me on Linux.
>>
>> mrmocool at gmx.de wrote:
>>> pragma(lib, ..) is pretty useless without a dmd switch to specify search paths for it.
>>>
>> _______________________________________________
>> dmd-internals mailing list
>> dmd-internals at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/dmd-internals
> _______________________________________________
> dmd-internals mailing list
> dmd-internals at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-internals
>
>
|
August 13, 2010 [dmd-internals] Shouldn't there be a dmd switch to specify search paths for libraries? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | That's a good argument too. I think both situations are possible (i.e. relative paths etc.)
Andrei
Walter Bright wrote:
> I don't agree. While often the library name is known, where it is stored on the user's machine can be anywhere. The user shouldn't be modifying the code to customize it for his paths.
>
> Andrei Alexandrescu wrote:
>> The idea is that pragma(lib, ...) is useless if it's not a single point of modification. If a library requires an extra command line artifact, it may as well give up on the pragma and require two command line artifacts.
>>
>> Andrei
>>
>> Walter Bright wrote:
>>> -L-Lpath
>>>
>>> works for me on Linux.
>>>
>>> mrmocool at gmx.de wrote:
>>>> pragma(lib, ..) is pretty useless without a dmd switch to specify search paths for it.
>>>>
>>> _______________________________________________
>>> dmd-internals mailing list
>>> dmd-internals at puremagic.com
>>> http://lists.puremagic.com/mailman/listinfo/dmd-internals
>> _______________________________________________
>> dmd-internals mailing list
>> dmd-internals at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/dmd-internals
>>
>>
> _______________________________________________
> dmd-internals mailing list
> dmd-internals at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-internals
|
August 13, 2010 [dmd-internals] Shouldn't there be a dmd switch to specify search paths for libraries? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright, el 13 de agosto a las 14:19 me escribiste: > > > mrmocool at gmx.de wrote: > >> -L-Lpath > >>works for me on Linux. > > > >Well good old friend optlink doesn't support something like that. And the LIB variable is overwritten by the content specified in sc.ini I think. > > dmd will pass any switch directly to the linker with the -L command. I know optlink has a problem with lib paths, but such is not fixable by enhancing pragmas, but by enhancing optlink. I don't mind having an option to set a search path too, it might be useful for big projects using libraries internally. What I do think is important is an option to ignore pragma(lib) entirely, because even when is not very common, users might want to link against an specific custom library name. For example in Debian sometimes there are packages for the same library but configured in different ways, like libcurl and libcurl-gnutls. I opened a bug report: http://d.puremagic.com/issues/show_bug.cgi?id=4642 -- Leandro Lucarella (AKA luca) http://llucax.com.ar/ ---------------------------------------------------------------------- GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) ---------------------------------------------------------------------- Fitter, happier, more productive, comfortable, not drinking too much, regular exercise at the gym (3 days a week), getting on better with your associate employee contemporaries, |
August 13, 2010 [dmd-internals] Shouldn't there be a dmd switch to specify search paths for libraries? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Leandro Lucarella | Leandro Lucarella wrote: > > > What I do think is important is an option to ignore pragma(lib) entirely, because even when is not very common, users might want to link against an specific custom library name. For example in Debian sometimes there are packages for the same library but configured in different ways, like libcurl and libcurl-gnutls. > > I opened a bug report: http://d.puremagic.com/issues/show_bug.cgi?id=4642 > > http://www.digitalmars.com/ctg/ctgLinkSwitches.html#defaultlibrarysearch |
August 14, 2010 [dmd-internals] Shouldn't there be a dmd switch to specify search paths for libraries? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright, el 13 de agosto a las 18:46 me escribiste: > Leandro Lucarella wrote: > > > > > >What I do think is important is an option to ignore pragma(lib) entirely, because even when is not very common, users might want to link against an specific custom library name. For example in Debian sometimes there are packages for the same library but configured in different ways, like libcurl and libcurl-gnutls. > > > >I opened a bug report: http://d.puremagic.com/issues/show_bug.cgi?id=4642 > > > > http://www.digitalmars.com/ctg/ctgLinkSwitches.html#defaultlibrarysearch As stated in the bug report, you either don't understand me, or I don't understand you. I'm not talking about library search, I'm talking about automatic linking against libraries. -- Leandro Lucarella (AKA luca) http://llucax.com.ar/ ---------------------------------------------------------------------- GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) ---------------------------------------------------------------------- A can of diet coke will float in water While a can of regular coke will sink |
August 14, 2010 [dmd-internals] Shouldn't there be a dmd switch to specify search paths for libraries? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Leandro Lucarella |
Leandro Lucarella wrote:
> Walter Bright, el 13 de agosto a las 18:46 me escribiste:
>
>> Leandro Lucarella wrote:
>>
>>> What I do think is important is an option to ignore pragma(lib) entirely, because even when is not very common, users might want to link against an specific custom library name. For example in Debian sometimes there are packages for the same library but configured in different ways, like libcurl and libcurl-gnutls.
>>>
>>> I opened a bug report: http://d.puremagic.com/issues/show_bug.cgi?id=4642
>>>
>>>
>> http://www.digitalmars.com/ctg/ctgLinkSwitches.html#defaultlibrarysearch
>>
>
> As stated in the bug report, you either don't understand me, or I don't understand you. I'm not talking about library search, I'm talking about automatic linking against libraries.
>
>
The switch causes the linker to ignore library names embedded in the object file. I believe this is exactly what you asked for.
|
August 14, 2010 [dmd-internals] Shouldn't there be a dmd switch to specify search paths for libraries? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Am 13.08.2010, 23:19 Uhr, schrieb Walter Bright <walter at digitalmars.com>:
> dmd will pass any switch directly to the linker with the -L command. I know optlink has a problem with lib paths, but such is not fixable by enhancing pragmas, but by enhancing optlink.
Well then optlink should get -Lpath to use it via -L-Lpath I guess. At least there should be some platform-independent way to add a search path for libraries (no matter if they are included via pragma or commandline).
|
August 14, 2010 [dmd-internals] Shouldn't there be a dmd switch to specify search paths for libraries? | ||||
---|---|---|---|---|
| ||||
Posted in reply to mrmocool at gmx.de |
mrmocool at gmx.de wrote:
> Am 13.08.2010, 23:19 Uhr, schrieb Walter Bright <walter at digitalmars.com>:
>
>> dmd will pass any switch directly to the linker with the -L command. I know optlink has a problem with lib paths, but such is not fixable by enhancing pragmas, but by enhancing optlink.
>
> Well then optlink should get -Lpath to use it via -L-Lpath I guess. At least there should be some platform-independent way to add a search path for libraries (no matter if they are included via pragma or commandline).
>
Search paths are never platform-independent.
|
Copyright © 1999-2021 by the D Language Foundation