Operating System - OpenVMS
1748111 Members
3513 Online
108758 Solutions
New Discussion юеВ

Re: Create library question

 
YE LIU_1
Frequent Advisor

Create library question

Dear VMS Users,

How can I do it in a command line if I have an object file: foo.obj and I want to add foo.obj to test.olb with name bar?

Thanks,

YE LIU
8 REPLIES 8
Hoff
Honored Contributor

Re: Create library question

Set the module name within foo.whatever source as bar. Syntax varies by language.

If you want both foo and bar together, you'll likely have symbol name collisions.
Volker Halle
Honored Contributor

Re: Create library question

YE LIU,

what problem are you trying to solve ?

The name of the module (in case of an object module) is derived from the object module header inside the .OBJ file (see ANAL/OBJ)and not from the filename of the .OBJ file or from some other qualifier given to the LIBR command when inserting the .OBJ file into the .OLB library.

Volker.
YE LIU_1
Frequent Advisor

Re: Create library question

Hi, All

Thanks for your reply. I thought I need to do this when I saw in the original MMS file, there is a line:

libraries:-
$(CFTSD_OLB)(cvt_price_d=$(OBJDIR)cvtpd_fsm.obj)

I think cvtpd_fsm.obj will be module cvt_price_d in library $(CFSD_OLB). Am I right?

Also, I have question on MMS: it seems that MMS allows different module of a library as an entity like:

TEST.OLB(foo=foo.obj): foo.obj

but in make, you can only use the library as an entity. How to convert this case to make from MMS.

Thanks,

YE LIU





Steven Schweda
Honored Contributor

Re: Create library question

> I think cvtpd_fsm.obj will be module
> cvt_price_d in library $(CFSD_OLB). Am I
> right?

Sounds about right. It's possible to have a
module name which differs from the name of
the object file. ("rename x.obj y.obj" or
"cc /object = y.obj x.c", for example.)

> but in make, you can only use the library
> as an entity.

Is this true? Perhaps there's a reason to
use MMS. (Did you ever say which "make" you
were using?)

> How to convert this case to make from MMS.

I still don't know why you're doing this. It
seems like much work, and I don't know what
the reward is supposed to be.
YE LIU_1
Frequent Advisor

Re: Create library question

hi, Steve

The make is GNU make.

YE LIU
Steven Schweda
Honored Contributor

Re: Create library question

> The make is GNU make.

Well, that's one question answered. Does it
have a version number?
Pramod Kumar M
Advisor

Re: Create library question

Hi,

First you need to change the module name of the object using the appropriate language directive

For example in C language, "#pragma module" directive would do it

#pragma module bar
main()
{
printf("hello");
}

Here is the MMS equivalent you need to create the object library from this module

$ type descrip.mms
test.olb : test.olb(bar=hello.obj)
libr/repl test.olb hello.obj

Are you trying to do the same using Make utility.

Regards,
Pramod.
H.Becker
Honored Contributor

Re: Create library question

>>> but in make, you can only use the library as an entity. How to convert this case to make from MMS.

Gnu make allows "archive" members as target, see the manual, as in
http://www.cs.utah.edu/dept/old/texinfo/make/make.html#SEC101

For example

$ ty makefile.
test.olb(bar): foo.obj
$(AR) $@ $<
$
$ gmake -v
GNU Make 3.81rc2
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for VMS
$
$ libr /cre test
$
$ gmake
library/obj test.olb foo.obj
$
$ libr/list test
Directory of ELF OBJECT library SYS$SYSDEVICE:[HB.Y]TEST.OLB;1 on 22-JUN-2009 17
:37:42
Creation date: 22-JUN-2009 17:37:26 Creator: Librarian I01-42
Revision date: 22-JUN-2009 17:37:29 Library format: 6.0
Number of modules: 1 Max. key length: 1024
Other entries: 1 Preallocated index blocks: 213
Recoverable deleted blocks: 0 Total index blocks used: 2
Max. Number history records: 20 Library history records: 1

BAR
$