Re: [Seed7-users] Library search path
Interpreter and compiler for the Seed7 programming language.
Brought to you by:
thomas_mertes
From: Thomas M. <tho...@gm...> - 2011-03-20 10:03:17
|
At Sat, 19 Mar 2011 15:52:01 +0000 "Milo Mirate" <mm...@ym...> wrote: > This sounds great. I needed those details because I would like to make an > Arch Linux User Repository (http://aur.archlinux.org) package of Seed7 and > I needed to know where to put the library files. Now that I know how to > specify where the interpreter should look for the standard library, I can > start making the package. Thank you again for your help. Great, a package for Seed7. Thanks in advance. Considering this case I try give you more precise information. There are two things to consider: Seed7 include files (they use the extension .s7i and are sometimes called libraries in the Seed7 documentation) and Seed7 runtime libraries (static *.a libraries of the operating system). I suggest using different directories for *.s7i and *.a files. The position of all this files is determined in the makefile (and must be considered in a package). To determine the position of the *.a runtime libraries (seed7_05.a, s7_data.a and s7_comp.a) the preprocessor macros SEED7_LIB, COMP_DATA_LIB and COMPILER_LIB are written to the file "version.h". The commands in the makefile to do this are: cd ../bin; echo "#define SEED7_LIB \"`pwd`/$(SEED7_LIB)\"" >> ../src/version.h; cd ../src cd ../bin; echo "#define COMP_DATA_LIB \"`pwd`/$(COMP_DATA_LIB)\"" >> ../src/version.h; cd ../src cd ../bin; echo "#define COMPILER_LIB \"`pwd`/$(COMPILER_LIB)\"" >> ../src/version.h; cd ../src The position of the Seed7 *.s7i include files is determinated with the preprocessor macro SEED7_LIBRARY (also written to "version.h"). The command to write SEED7_LIBRARY in the makefile is: cd ../lib; echo "#define SEED7_LIBRARY \"`pwd`\"" >> ../src/version.h; cd ../src The file "version.h" is created with the 'make depend' command. My "version.h" file contains the following lines (regarding library and include files): #define SEED7_LIB "/home/tm/seed7_5/bin/seed7_05.a" #define COMP_DATA_LIB "/home/tm/seed7_5/bin/s7_data.a" #define COMPILER_LIB "/home/tm/seed7_5/bin/s7_comp.a" #define SEED7_LIBRARY "/home/tm/seed7_5/lib" The mechanism to carry this and other information to the Seed7 compiler (comp.s7i) is as follows. The function cmdConfigValue() (see: "cmd_rtl.c") allows access to several values from the "version.h" file. BTW: The contents of the file "version.h" are described in "seed7/src/read_me.txt". Please do NOT change "version.h" manually. It contains many things that are determined automatically by the make process. If you want to change preprocessor macros in "version.h" you should definitely change the makefile. The Seed7 compiler needs detailed information about the C compiler and its runtime library. This information is created with 'make depend' and written to "version.h". When the Seed7 compiler runs this information is obtained via cmdConfigValue(). There are two C compilers and runtime libraries to consider: 1. The one which compiles the Seed7 interpreter and the Seed7 libraries (C compiler and runtime used to crate the package). 2. The one which is used by the Seed7 compiler (C compiler and runtime installed at a users computer). As long as essentially the same C compiler and runtime library is used for both cases no unpleasant surprise will happen. For its own libraries Seed7 uses static (*.a) libraries. I did not try to uses dynamic (*.so) libraries for them. So I cannot tell if it would work for dynamic libraries. If you need more help or want some upstream changes, please tell me. Greetings Thomas Mertes -- Seed7 Homepage: http://seed7.sourceforge.net Seed7 - The extensible programming language: User defined statements and operators, abstract data types, templates without special syntax, OO with interfaces and multiple dispatch, statically typed, interpreted or compiled, portable, runs under linux/unix/windows. -- GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit gratis Handy-Flat! http://portal.gmx.net/de/go/dsl |