On 12/19/18 10:08 AM, Georgios Petasis wrote:
Dear Massimo,
I have committed an update to CMakeLists.txt (master branch), which:
1) After libs have been installed, writes a file
"regenerate_pkgIndex.tcl", inside the installation directory.
2) Puts in the file:
"puts \"Regenerating pkgIndex.tcl in [pwd]:\"
file delete {*}[glob [file join packages * pkgIndex.tcl]] pkgIndex.tcl
pkg_mkIndex -verbose [pwd] init.tcl \\
{*}[glob [file join packages * *.tcl] \\
[file join ${RIVET_LIBS_ARCH} *[info sharedlibextension]]]"
librivetparser and librivetlib are created with the .so suffix on
Windows too so this code would fail to put these libraries in pkgIndex
(see my notes below anyway). We must keep the module named as
mod_rivet.so because Apache itself expects this suffix but we can adopt
the OS native suffix for any other binary library.
I guess this requires a similar procedure for the library suffix
determination. I tried something like
execute_process(COMMAND ${shell_command}
ERROR_VARIABLE EXEC_ERROR_VAR
OUTPUT_VARIABLE LIB_SUFFIX
OUTPUT_STRIP_TRAILING_WHITESPACE)
where shell_command to is
${TCL_TCLSH} inlinetcl.tcl puts [info sharedlibextension]
where inline.tcl simply is
eval $argv
it works from the command line, but execute_process returns empty output
variables
3) Executes the file with tclsh (it will break if tclsh is not found
during configuration)
4) Deletes the file.
I have replaced "eval" with "{*}". Eval will break if paths contain
spaces (very common in Windows). "{*}" will break in old tcl versions (I
do not remember when it was introduced).
*I do not know what it should be put in RIVET_LIBS_ARCH*.
The way you defined RIVET_LIB_ARCH it points to the directory that keeps
only the MPM bridges modules that must not go to pkgIndex as they are of
no general usefulness. Their named is determined by this macro
#define RIVET_MPM_BRIDGE_COMPOSE(bridge)
RIVET_DIR,"/mpm/rivet_",bridge,"_mpm.so"
in RIVET_LIB_ARCH just remove the final 'mpm' and put the right suffix
in the code fragment.
I'm in favor to adopt the native suffix for external libraries too, as
libraries such as librivet are of generic purpose and they can be used
from the shell
-- Massimo
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org
For additional commands, e-mail: rivet-dev-h...@tcl.apache.org