• Vishap Oberon : Module search path

    From doug719125@gmail.com@21:1/5 to All on Mon Nov 27 19:34:01 2017
    Vishap Oberon will load the imported modules if they are in the same directory as the calling module.

    However, I would like to put some modules in a utility directory. How can I specify a module search path to include the utility directory?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to doug7...@gmail.com on Tue Nov 28 12:37:55 2017
    On Tuesday, 28 November 2017 03:34:01 UTC, doug7...@gmail.com wrote:
    Vishap Oberon will load the imported modules if they are in the same directory as the calling module.

    However, I would like to put some modules in a utility directory. How can I specify a module search path to include the utility directory?

    You should be able to provide a search path in environment variable OBERON.

    (Note that if you provide more than one path they must be semi-colon separated even on Linux, sorry about that.)

    The compiler should search this path before the current directory when looking for .sym files.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From doug719125@gmail.com@21:1/5 to doug7...@gmail.com on Tue Nov 28 14:01:19 2017
    On Monday, November 27, 2017 at 8:34:01 PM UTC-7, doug7...@gmail.com wrote:
    Vishap Oberon will load the imported modules if they are in the same directory as the calling module.

    However, I would like to put some modules in a utility directory. How can I specify a module search path to include the utility directory?

    Supplying the environment variable OBERON for a utility directory let VOC compile the main program (with IMPORT calls), but when gcc wants to link, it cannot find the imported modules .o .c and .h files, which are in the utility directory.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From doug719125@gmail.com@21:1/5 to doug7...@gmail.com on Tue Nov 28 13:57:07 2017
    On Monday, November 27, 2017 at 8:34:01 PM UTC-7, doug7...@gmail.com wrote:
    Vishap Oberon will load the imported modules if they are in the same directory as the calling module.

    However, I would like to put some modules in a utility directory. How can I specify a module search path to include the utility directory?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From doug719125@gmail.com@21:1/5 to doug7...@gmail.com on Tue Nov 28 15:19:31 2017
    On Monday, November 27, 2017 at 8:34:01 PM UTC-7, doug7...@gmail.com wrote:
    Vishap Oberon will load the imported modules if they are in the same directory as the calling module.

    However, I would like to put some modules in a utility directory. How can I specify a module search path to include the utility directory?

    A clarification of my last post:
    If I use the environment variable OBERON and try
    voc -OC -m test1.ob
    then voc does not complain about finding the utility modules in the utility directory.

    But when voc tries to compile test1.c into a .o file, it cannot find the .h files for the utility modules.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to All on Wed Nov 29 01:57:58 2017
    You can tell gcc where to look for headers with the (colon separated) C_INCLUDE_PATH environment variable.

    Finally you can tell voc to pass a (space separated) list of extra object files to link in the CFLAGS environment variable. This will need to specify each .o file (with path) in the other directory that you are linking to.

    Or you may find it more manageable to build a Makefile with the gcc compilation and linking done explicitly, rather than relying on the voc compiler to invoke them for you. Tell voc to stop before calling gcc with the '-S' flag. This is how the Vishap
    compiler and run time build works.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From doug719125@gmail.com@21:1/5 to doug7...@gmail.com on Wed Nov 29 05:46:03 2017
    On Monday, 27 November 2017 20:34:01 UTC-7, doug7...@gmail.com wrote:
    Vishap Oberon will load the imported modules if they are in the same directory as the calling module.

    However, I would like to put some modules in a utility directory. How can I specify a module search path to include the utility directory?

    Thanks for the reply. I don't believe I found the documentation of the environment variables in the vishap documentation (If I missed it, could you point it out for me).

    With your suggestions, I got things to work ok. For me the easiest way is to write a script to compile with voc the main module (using the environment variables) with -c and then use gcc to link main.0 and the utility library (which I built).

    Thanks for your help.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)