[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: static linking (Re: COB_PRE_LOAD)
From: |
Ron Norman |
Subject: |
Re: static linking (Re: COB_PRE_LOAD) |
Date: |
Tue, 19 May 2020 08:12:07 -0400 |
I just static link the COBOL programs all the time. This reduces dependency
when the binary executable gets moved to other systems.
Cheers,
Ron Norman
(Sent from my iPhone)
> On May 19, 2020, at 06:48, Simon Sobisch <address@hidden> wrote:
>
> Am 19.05.2020 um 01:27 schrieb James K. Lowden:
>> Is there a static alternative to COB_PRE_LOAD?
>>
>> I would like to compile my Cobol program, linked to Cobol libraries,
>> without relying on any runtime configuration.
>>
>> [...]
>>
>> i would like the user to use the program without requiring runtime
>> configuration that is simply a by-product of the fact that the program
>> was written in Cobol.
>>
>> --jkl
>>
>
> The common way to link COBOL to COBOL is to use statically linking and
> only produce one executable. This *should* be covered in the GnuCOBOL
> manual.
>
> Either something like
> cobc -static bar.cob foo.cob
>
> or (likely more reasonable with bigger environments using make)
> something like the following
>
> all: foobar
>
> SUFFIXES = .cob .$(COB_OBJECT_EXT)
> FOOBAR_OBJECTS = foo.$(COB_OBJECT_EXT) bar.$(COB_OBJECT_EXT)
>
> .cob.$(COB_OBJECT_EXT):
> cobc -static -c $<
> foobar: $(FOOBAR_OBJECTS)
> cobc -static $(FOOBAR_OBJECTS) $<
>
> Simon
>