Re: CC compiler under CMS - LSEARCH option

2022-08-15 Thread Paul Gilmartin
On Mon, 15 Aug 2022 21:44:57 -0500, Alan Altmark wrote:
>
>>o A BFS member?
>
>#include "/usr/alan/src/include/my.macro"
> 
Must ot be fully qualified, or can it be relative to current working directory?

>LSEARCH(/usr/alan/src/include)
>
Same question.

-- 
Thanks,
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: CC compiler under CMS - LSEARCH option

2022-08-15 Thread Alan Altmark
On Mon, 15 Aug 2022 12:40:57 -0500, Paul Gilmartin  wrote:

>How can the programmer indicate:
>
>o A SFS member with a directory path?
>  (Must it be accessed with a mode letter?)

There is no such capability; the directory must be accessed.  You can use 
LSEARCH(A,B,D),  for example, to restrict where the compiler looks for user 
include files.

>o A BFS member?

#include "/usr/alan/src/include/my.macro"

LSEARCH(/usr/alan/src/include)

And I should point out that the SEARCH option is how you change the search 
order for *system* include files.

The compiler behaves differently with/without the OE option.  All of this is 
thoroughly documented in the XL C/C++ for z/VM: User's Guide.  I've only 
scratched the surface.

Alan Altmark
IBM

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: CC compiler under CMS - LSEARCH option

2022-08-15 Thread Paul Gilmartin
On Mon, 15 Aug 2022 10:55:17 -0500, Alan Altmark wrote:
>>...
>You specified
>#include 
>instead of
>#include "my.macro"
>
><> are for system include files.  These are always H files or members of a 
>MACLIB.
>
>Quotes are for *user* include files.  They can be any name.  If not found, the 
>LSEARCH option/default is used, ignoring the ft and fm.
> 
How can the programmer indicate:

o A SFS member with a directory path?
  (Must it be accessed with a mode letter?)

o A BFS member?

-- 
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: CC compiler under CMS - LSEARCH option

2022-08-15 Thread Alan Altmark
On Sun, 14 Aug 2022 00:49:20 +0300, Binyamin Dissen 
 wrote:

>I am trying to tell the C compiler to use MACRO file types for #include.
> :
>I have tried multiple versions of LSEARCH with no luck.
>
>cc **name** c * (lsearch(*.macro)
>WARNING CCN3261 Suboption *.macro is not valid for option LSEARCH.
>
>cc **name** c * (lsearch(*.*.*)
>WARNING CCN3261 Suboption *.*.* is not valid for option LSEARCH.
>
>I can simply rename the MACRO to H and it works, but this is a bug in my
>bonnet.

You specified
#include 
instead of
#include "my.macro"

<> are for system include files.  These are always H files or members of a 
MACLIB.

Quotes are for *user* include files.  They can be any name.  If not found, the 
LSEARCH option/default is used, ignoring the ft and fm.

And your syntax for LSEARCH is wrong.  It would be
   LSEARCH((*.macro)=(LIB(.), .))
That is, you are mapping a specific pattern to a specific set of MACLIBs.

My test program that has
   #include "my.macro"
compiles just fine without any LSEARCH specification.

Alan Altmark
z/VM Consultant
IBM

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: CC compiler under CMS - LSEARCH option

2022-08-14 Thread Paul Gilmartin
On Sun, 14 Aug 2022 22:17:02 +0800, David Crayford wrote:

>You will have to use macro file extension in the C code. 
>
>#include “file.macro”
> 
So the source code must be dual-path for CMS?:
#if CMS
#include “file.macro”
#else
#include "file.h"
#endif

Ugh!  (Will the CMS C compiler accept your typographer's quotes?)

>> On 14 Aug 2022, at 8:09 am, Paul Gilmartin  wrote:
>> 
>> ..., consider BFS.  Its directory structure may be more similar to what
>> exists in the real world.

-- 
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: CC compiler under CMS - LSEARCH option

2022-08-14 Thread David Crayford
You will have to use macro file extension in the C code. 

#include “file.macro”

> On 14 Aug 2022, at 8:09 am, Paul Gilmartin 
> <042bfe9c879d-dmarc-requ...@listserv.ua.edu> wrote:
> 
> On Sun, 14 Aug 2022 00:49:20 +0300, Binyamin Dissen wrote:
> 
>> I am trying to tell the C compiler to use MACRO file types for #include.
>> 
> Are you the author or are you working from FOSS or other distributed source?
> 
> If the latter, consider BFS.  Its directory structure may be more similar to 
> what
> exists in the real world.
> 
> on MVS-z/OS, I found it easier to build from HFS than struggle with Classic 
> PDS.
> 
> One other thing I found invaluable was gmake's VPATH for building for 
> disparate
> targets (MVS, Solaris) from a single NFS source tree.
> 
> 
>> The doc states:
>> ==
>> COMMANDS CC All Help Information
>> LSEarch(opt)|NOLSEarch NOLSEARCH is the default. The LSEARCH option
>> directs the preprocessor to
>>   look for the user include files in the specified libraries or MACLIBs,
>> on the specified minidisks, or in the specified BFS directories. The
>> format of the LSEARCH option is:LSEARCH (opt,opt,...)
>> where:   opt may be one of the following:-  A CMS 
>> filemode
>> -  A BFS path name-  (fname.suffix) = (subopt,subopt,...) where:
>> - fname is the name of the include file or *   - suffix is the
>> suffix of the include file or *   - subopt can be a filemode,
>> LIB(maclib_name,maclib_name,...), or NOLIB.
>> ==
>> 
>> I have tried multiple versions of LSEARCH with no luck.
>> 
>> cc **name** c * (lsearch(*.macro)
>> WARNING CCN3261 Suboption *.macro is not valid for option LSEARCH.
>> 
>> cc **name** c * (lsearch(*.*.*)
>> WARNING CCN3261 Suboption *.*.* is not valid for option LSEARCH.
>> 
>> I can simply rename the MACRO to H and it works, but this is a bug in my
>> bonnet.
> 
> -- 
> gil
> 
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: CC compiler under CMS - LSEARCH option

2022-08-13 Thread Paul Gilmartin
On Sun, 14 Aug 2022 00:49:20 +0300, Binyamin Dissen wrote:

>I am trying to tell the C compiler to use MACRO file types for #include.
> 
Are you the author or are you working from FOSS or other distributed source?

If the latter, consider BFS.  Its directory structure may be more similar to 
what
exists in the real world.

on MVS-z/OS, I found it easier to build from HFS than struggle with Classic PDS.

One other thing I found invaluable was gmake's VPATH for building for disparate
targets (MVS, Solaris) from a single NFS source tree.


>The doc states:
> ==
> COMMANDS CC All Help Information
>LSEarch(opt)|NOLSEarch NOLSEARCH is the default. The LSEARCH option
>directs the preprocessor to
>look for the user include files in the specified libraries or MACLIBs,
>on the specified minidisks, or in the specified BFS directories. The
>format of the LSEARCH option is:LSEARCH (opt,opt,...)
>where:   opt may be one of the following:-  A CMS filemode
>-  A BFS path name-  (fname.suffix) = (subopt,subopt,...) where:
>- fname is the name of the include file or *   - suffix is the
>suffix of the include file or *   - subopt can be a filemode,
>LIB(maclib_name,maclib_name,...), or NOLIB.
> ==
>
>I have tried multiple versions of LSEARCH with no luck.
>
>cc **name** c * (lsearch(*.macro)
>WARNING CCN3261 Suboption *.macro is not valid for option LSEARCH.
>
>cc **name** c * (lsearch(*.*.*)
>WARNING CCN3261 Suboption *.*.* is not valid for option LSEARCH.
>
>I can simply rename the MACRO to H and it works, but this is a bug in my
>bonnet.

-- 
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: CC compiler under CMS - LSEARCH option

2022-08-13 Thread Joe Monk
you cant do it that way.

lsearch prepends to the include...

https://www.ibm.com/docs/en/zos/2.1.0?topic=options-lsearch-nolsearch

Joe

On Sat, Aug 13, 2022 at 4:49 PM Binyamin Dissen 
wrote:

> I am trying to tell the C compiler to use MACRO file types for #include.
>
> The doc states:
>
> ===
>  COMMANDS CC All Help Information
> LSEarch(opt)|NOLSEarch NOLSEARCH is the default. The LSEARCH option
> directs the preprocessor to
> look for the user include files in the specified libraries or
> MACLIBs,
> on the specified minidisks, or in the specified BFS directories. The
> format of the LSEARCH option is:LSEARCH (opt,opt,...)
> where:   opt may be one of the following:-  A CMS
> filemode
> -  A BFS path name-  (fname.suffix) = (subopt,subopt,...)
> where:
> - fname is the name of the include file or *   - suffix is the
> suffix of the include file or *   - subopt can be a filemode,
> LIB(maclib_name,maclib_name,...), or NOLIB.
>
> ===
>
> I have tried multiple versions of LSEARCH with no luck.
>
> cc **name** c * (lsearch(*.macro)
> WARNING CCN3261 Suboption *.macro is not valid for option LSEARCH.
>
> cc **name** c * (lsearch(*.*.*)
> WARNING CCN3261 Suboption *.*.* is not valid for option LSEARCH.
>
> I can simply rename the MACRO to H and it works, but this is a bug in my
> bonnet.
>
> --
> Binyamin Dissen 
> http://www.dissensoftware.com
>
> Director, Dissen Software, Bar & Grill - Israel
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN