| CConfig Library |
signature C_CONFIG =
sig
val verbose : bool -> unit
val message : bool -> unit
val logging : bool -> unit
val config
: string -> {set : string option -> unit, get : unit -> string option}
val expand : string -> string
val haveLibrary : string * string * string list -> bool
val findLibrary : string * string * string list -> string option
val haveConstInt : string * string list -> int option
val haveConstLong : string * string list -> LargeInt.int option
val haveConstUInt : string * string list -> word option
val haveConstULong : string * string list -> LargeWord.word option
val haveConstFloat : string * string list -> real option
val haveConstDouble : string * string list -> real option
val haveConstString : string * string list -> string option
val checkSizeOf : string * string list -> int
val checkStructMember : string * string * string list -> (int * int) option
val checkIsBigEndian : unit -> bool
val accessor
: int * int ->
{
set : Word8Array.array * word -> unit,
get : Word8Array.array -> word
}
end
| Value detail |
|---|
val verbose : bool -> unit
val message : bool -> unit
val logging : bool -> unit
fun config name
: string -> {set : string option -> unit, get : unit -> string option}
name
fun expand string : string -> string
$ followed by one name of
variable optionally surrounded by parentheses or braces.
$$ is replaced with $.
The content of variable VAR is
#set config to VAR,#set config,"+$BAR+" and the content of BAR
is "BAZ", this function replaces "$FOO"
with "+BAZ+".
Note that this function never stop if there is a looped reference.
string
fun haveLibrary (libraryName, functionName, headerFiles)
: string * string * string list -> bool
This function inspects whether the library is already installed on the current system like GNU Autoconf. This function generates minimal C source code and try to compile and link it by C compiler.
The command line to compile a C source file is given by TRY_COMPILE variable, and one to link is given by TRY_LINK variable. Default content of TRY_COMPILE is the following:
$(CC) -c $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(ccopt) $(src)
And default content of TRY_LINK is:
$(CC) $(OUTFLAG)$(out) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(ccopt) $(src) $(LIBPATH) $(LDFLAGS) $(ldopt) $(LOCAL_LIBS) $(LIBS)
libraryName
functionName
headerFiles
fun findLibrary (libraryName, functionName, headerFiles)
: string * string * string list -> string option
This function inspects whether the library exists in the same way
as haveLibrary function.
If found, this function analyzes the resulting C object file by
using ldd command, and extracts a list of library
filenames which are linked dynamically from the object code,
and then chooses appropriciate one from the list.
The command line to invoke ldd command is given by
TRY_LDD variable. Default content of TRY_LDD is
the following:
$(LDD) $(out)
libraryName
functionName
headerFiles
NONE if the library is not found.
SOME filename if found, where
filename is an absolute path to the library file.
fun haveConstInt (constantName, headerFiles)
: string * string list -> int option
This function inspects whether the contant (C constant or macro constant) is defined like GNU Autoconf. This function generates minimal C program to print the constant, and try to compile and link by C compiler and execute the resulting executable file to get the output of the program.
constantName
headerFiles
NONE if the const is not found.
SOME value if found, where
value is the value of the constant.
val haveConstLong : string * string list -> LargeInt.int option
val haveConstUInt : string * string list -> word option
val haveConstULong : string * string list -> LargeWord.word option
val haveConstFloat : string * string list -> real option
val haveConstDouble : string * string list -> real option
val haveConstString : string * string list -> string option
fun checkSizeOf (typeName, headerFiles) : string * string list -> int
typeName
headerFiles
sizeof(typeName).
fun checkStructMember (structName, memberName, headerFiles)
: string * string * string list -> (int * int) option
structName
memberName
headerFiles
val checkIsBigEndian : unit -> bool
fun accessor (size, offset)
: int * int ->
{set : Word8Array.array * word -> unit, get : Word8Array.array -> word}
size
offset
| CConfig Library |