Logtalk 2.24.0 files.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1282 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
140
Logtalk/scripts/NOTES
Normal file
140
Logtalk/scripts/NOTES
Normal file
@@ -0,0 +1,140 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.24.0
|
||||
|
||||
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
||||
|
||||
This directory contains several scripts used for Logtalk packaging,
|
||||
installation, and integration with Prolog compilers. Those with extension
|
||||
.sh are shell scripts for MacOS X, Linux, and similar systems. Those with
|
||||
extension .js are JScript command-line scripts for Windows; they require
|
||||
WSH 5.6 or later version to be installed and should be run using cscript.exe
|
||||
from a DOS shell command line.
|
||||
|
||||
|
||||
lgt_install.sh
|
||||
shell script for installing Logtalk in a system-wide location for Unix
|
||||
and Unix-like operating systems (must be run from this directory by a
|
||||
user with administration privileges); accepts as an optional argument
|
||||
a prefix for the installation directory, default is /usr/local)
|
||||
lgt_install.js
|
||||
Windows 2000/XP JScript script for completing the Logtalk installation by
|
||||
setting the LOGTALKHOME system environment variable and the LOGTALKUSER
|
||||
user environment variable (for the user performing the installation), by
|
||||
creating a new program group named "Logtalk" in the Windows Start Menu,
|
||||
and by adding the directories %LOGTALKHOME%\scripts and %LOGTALKHOME%\xml to
|
||||
the system path environment variable (must be run from this directory by
|
||||
a user with administration privileges after decompressing the Logtalk
|
||||
distribution into its final destination; you will need to restart your
|
||||
computer in order to use the items created in the "Logtalk" program group
|
||||
due to the definition of new system environment variables)
|
||||
|
||||
logtalk.spec
|
||||
specification file for building Linux RPMs
|
||||
(copy the Logtalk tarball to your RPM SOURCES directory and then
|
||||
run the command: rpmbuild -ba --target=noarch-*-linux logtalk.spec)
|
||||
|
||||
cplgtdirs.sh
|
||||
cplgtdirs.js
|
||||
end-user scripts for copying the Logtalk user-modifiable files and
|
||||
directories to the location pointed by the environment variable
|
||||
LOGTALKUSER (defaults to ~/logtalk on Unix-like operating-systems
|
||||
and to My Documents\logtalk on Windows when the variable is not
|
||||
defined); must be run by the end-user in order to ensure proper
|
||||
permissions on the copied files
|
||||
|
||||
cleandist.sh
|
||||
script for cleaning a Logtalk distribution in preparation for packaging
|
||||
|
||||
debian
|
||||
directory containing support files for building a Debian package
|
||||
(work in progress; not yet functional)
|
||||
|
||||
|
||||
The following scripts allow easy integration of Logtalk with selected Prolog
|
||||
compilers; they must be run by a user with administration privileges:
|
||||
|
||||
make_ciaolgt.sh
|
||||
makes a shell script named "ciaolgt" for running Logtalk with CIAO Prolog
|
||||
(the first run of the ciaolgt script must be made as root or using sudo)
|
||||
make_ciaolgt.js
|
||||
makes a Windows shortcut named "Logtalk - CIAO" for running Logtalk with
|
||||
CIAO 1.10 (the first call to the shortcut must be made by a user with
|
||||
administrative rights)
|
||||
|
||||
make_eclipselgt.sh
|
||||
makes a shell script named "eclipselgt" for running Logtalk with ECLiPSe
|
||||
make_eclipselgt.js
|
||||
makes a Windows shortcut named "Logtalk - ECLiPSe" for running Logtalk
|
||||
with ECLiPSe 5.8 (if you are using a different version, you must edit
|
||||
the reference to the registry key in the script; if you prefer to use
|
||||
TkEclipse, open the %LOGTALKHOME%\bin\logtalke_eclipse.pl file with it)
|
||||
|
||||
make_gplgt.sh
|
||||
makes a shell script named "gplgt" for running Logtalk with GNU Prolog (this
|
||||
script is adequate for development purposes but does not provide the best
|
||||
possible performance for running Logtalk with this Prolog compiler; for
|
||||
optimal performance, see the configs/NOTES file)
|
||||
make_gplgt.js
|
||||
makes a Windows shortcut named "Logtalk - GNU Prolog" for running Logtalk
|
||||
with GNU Prolog (this script is adequate for development purposes but does
|
||||
not provide the best possible performance for running Logtalk with this
|
||||
Prolog compiler; for optimal performance, see the configs/NOTES file)
|
||||
|
||||
make_plclgt.sh
|
||||
makes a shell script named "plclgt" for running Logtalk with K-Prolog
|
||||
make_plclgt.js
|
||||
makes a Windows shortcut named "Logtalk - K-Prolog" for running Logtalk
|
||||
with K-Prolog
|
||||
|
||||
make_qplgt.sh
|
||||
makes a shell script named "qplgt" for running Logtalk with Qu-Prolog
|
||||
(based on script code contributed by Peter Robinson)
|
||||
|
||||
make_sicstuslgt.sh
|
||||
makes a shell script named "sicstuslgt" for running Logtalk with SICStus
|
||||
Prolog
|
||||
make_sicstuslgt.js
|
||||
makes a Windows shortcut named "Logtalk - SICStus Prolog" for running
|
||||
Logtalk with SICStus Prolog 3.12 (if you are using a different version,
|
||||
you must edit the reference to the registry key in the script)
|
||||
|
||||
make_swilgt.sh
|
||||
makes a shell script named "swilgt" for running Logtalk with SWI-Prolog
|
||||
make_swilgt.js
|
||||
makes a Windows shortcut named "Logtalk - SWI-Prolog" for running Logtalk
|
||||
with SWI-Prolog
|
||||
|
||||
make_yaplgt.sh
|
||||
makes a shell script named "yaplgt" for running Logtalk with YAP
|
||||
make_yaplgt.js
|
||||
makes a Windows shortcut named "Logtalk - YAP" for running Logtalk with
|
||||
YAP (assumes that the Yap folder is installed in C:\Program Files; edit
|
||||
the path to the yap.exe executable in the script if necessary)
|
||||
|
||||
make_xsblgt.sh
|
||||
makes a shell script named "xsblgt" for running Logtalk with XSB (the
|
||||
first run of the xsblgt script must be made as root or using sudo; each
|
||||
user will need to rename the file configs/xsbXX.config to configs/xsb.P
|
||||
and make and edit a copy of the libpaths/libpaths.pl in order to replace
|
||||
all occurrences of the LOGTALKUSER environment variable with its value;
|
||||
the new file should also use the .P extension)
|
||||
|
||||
These scripts require the environment variable LOGTALKHOME (pointing to the
|
||||
Logtalk installation directory) to be defined. The *.sh shell scripts
|
||||
accept as an optional argument a prefix for the location of a link to the
|
||||
scripts (default is /usr/local, creating the links in /usr/local/bin). The
|
||||
*.js scripts add the created shortcuts to the "Logtalk" program group (which
|
||||
is accessed from the Windows Start Menu).
|
||||
|
||||
Please note that the environment variables LOGTALKHOME and LOGTALKUSER must
|
||||
be defined in order to run the *lgt scripts that are created by the shell
|
||||
scripts above or the Windows shortcuts (see the INSTALL file for details on
|
||||
setting the variables).
|
||||
|
||||
Note: when Logtalk is manually installed from sources, the shell scripts
|
||||
might not have the executable permission bit set. In that case it will
|
||||
be necessary to first run the command "chmod a+x *.sh" on the "scripts" and
|
||||
"xml" directories.
|
15
Logtalk/scripts/cleandist.sh
Executable file
15
Logtalk/scripts/cleandist.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
## =================================================================
|
||||
## Logtalk - Object oriented extension to Prolog
|
||||
## Release 2.24.0
|
||||
##
|
||||
## Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
## =================================================================
|
||||
|
||||
find . -name .svn -print0 | xargs -0 rm -rf
|
||||
find . -name CVS -print0 | xargs -0 rm -rf
|
||||
find . -name .cvsignore -print0 | xargs -0 rm -f
|
||||
find . -name '.#*' -print0 | xargs -0 rm -f
|
||||
find . -name .DS_Store -print0 | xargs -0 rm -f
|
||||
find . -name '.gdb*' -print0 | xargs -0 rm -f
|
3
Logtalk/scripts/cplgtdirs.bat
Normal file
3
Logtalk/scripts/cplgtdirs.bat
Normal file
@@ -0,0 +1,3 @@
|
||||
@ECHO off
|
||||
cscript "%LOGTALKHOME%\scripts\cplgtdirs.js"
|
||||
@ECHO on
|
90
Logtalk/scripts/cplgtdirs.js
Normal file
90
Logtalk/scripts/cplgtdirs.js
Normal file
@@ -0,0 +1,90 @@
|
||||
// =================================================================
|
||||
// Logtalk - Object oriented extension to Prolog
|
||||
// Release 2.24.0
|
||||
//
|
||||
// Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
// =================================================================
|
||||
|
||||
var WshShell = new ActiveXObject("WScript.Shell");
|
||||
|
||||
var WshSystemEnv = WshShell.Environment("SYSTEM");
|
||||
var WshUserEnv = WshShell.Environment("USER");
|
||||
var logtalk_home;
|
||||
var logtalk_user;
|
||||
|
||||
if (WshSystemEnv.Item("LOGTALKHOME"))
|
||||
logtalk_home = WshSystemEnv.Item("LOGTALKHOME");
|
||||
else if (WshUserEnv.Item("LOGTALKHOME"))
|
||||
logtalk_home = WshUserEnv.Item("LOGTALKHOME")
|
||||
else {
|
||||
WScript.Echo("Error! The environment variable LOGTALKHOME must be defined first!");
|
||||
usage_help();
|
||||
WScript.Quit(1);
|
||||
}
|
||||
|
||||
if (WScript.Arguments.Unnamed.Length > 0)
|
||||
usage_help();
|
||||
|
||||
if (WshUserEnv.Item("LOGTALKUSER"))
|
||||
logtalk_user = WshUserEnv.Item("LOGTALKUSER");
|
||||
else {
|
||||
logtalk_user = WshShell.SpecialFolders("MyDocuments") + "\\logtalk";
|
||||
WshUserEnv.Item("LOGTALKUSER") = WshShell.SpecialFolders("MyDocuments") + "\\logtalk";
|
||||
WScript.Echo("Defined user environment variable LOGTALKUSER.");
|
||||
WScript.Echo("");
|
||||
}
|
||||
|
||||
var fso = new ActiveXObject("Scripting.FileSystemObject");
|
||||
|
||||
if (fso.FolderExists(logtalk_user)) {
|
||||
WScript.Echo("Error! Logtalk directory already exists!");
|
||||
WScript.Echo("Please rename it and run this script again.");
|
||||
WScript.Echo("");
|
||||
usage_help();
|
||||
}
|
||||
|
||||
WScript.Echo("Creating LOGTALKUSER directory:");
|
||||
WScript.Echo("");
|
||||
WScript.Echo(" " + logtalk_user);
|
||||
WScript.Echo("");
|
||||
|
||||
fso.CreateFolder(logtalk_user);
|
||||
|
||||
WScript.Echo("Copying Logtalk files and directories...");
|
||||
fso.CopyFolder(logtalk_home + "\\configs", logtalk_user + "\\configs");
|
||||
fso.CopyFolder(logtalk_home + "\\contributions", logtalk_user + "\\contributions");
|
||||
fso.CopyFolder(logtalk_home + "\\examples", logtalk_user + "\\examples");
|
||||
fso.CopyFolder(logtalk_home + "\\libpaths", logtalk_user + "\\libpaths");
|
||||
fso.CopyFolder(logtalk_home + "\\library", logtalk_user + "\\library");
|
||||
fso.CopyFolder(logtalk_home + "\\xml", logtalk_user + "\\xml");
|
||||
|
||||
WScript.Echo("Finished copying Logtalk files directories.");
|
||||
WScript.Echo("");
|
||||
WScript.Echo("You may need to edit the contents of the file:");
|
||||
WScript.Echo("");
|
||||
WScript.Echo(" " + logtalk_user + "\\libpaths\\libpaths.pl");
|
||||
WScript.Echo("");
|
||||
WScript.Echo("to match your Prolog compiler and operating-system requirements or to");
|
||||
WScript.Echo("add your own library paths.");
|
||||
WScript.Echo("");
|
||||
WScript.Echo("You may want to customize the default Logtalk compiler flags by editing");
|
||||
WScript.Echo("the configuration file for your Prolog compiler found in the directory:");
|
||||
WScript.Echo("");
|
||||
WScript.Echo(" " + logtalk_user + "\\configs");
|
||||
WScript.Echo("");
|
||||
|
||||
WScript.Quit(0);
|
||||
|
||||
function usage_help() {
|
||||
WScript.Echo("");
|
||||
WScript.Echo("This script copies the Logtalk user-modifiable files and directories");
|
||||
WScript.Echo("to the user home directory. The location can be set by the environment");
|
||||
WScript.Echo("variable \%LOGTALKUSER\% (defaults to MyDocuments\\logtalk when the");
|
||||
WScript.Echo("variable is not defined)");
|
||||
WScript.Echo("");
|
||||
WScript.Echo("Usage:");
|
||||
WScript.Echo(" " + WScript.ScriptName + " help");
|
||||
WScript.Echo(" " + WScript.ScriptName);
|
||||
WScript.Echo("");
|
||||
WScript.Quit(1);
|
||||
}
|
70
Logtalk/scripts/cplgtdirs.sh
Executable file
70
Logtalk/scripts/cplgtdirs.sh
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/bin/sh
|
||||
|
||||
## =================================================================
|
||||
## Logtalk - Object oriented extension to Prolog
|
||||
## Release 2.24.0
|
||||
##
|
||||
## Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
## =================================================================
|
||||
|
||||
echo
|
||||
echo "This script copies the Logtalk user-modifiable files and directories"
|
||||
echo "to the user home directory. The location can be set by the environment"
|
||||
echo "variable \$LOGTALKUSER (defaults to ~/logtalk when the variable is not"
|
||||
echo "defined)"
|
||||
echo
|
||||
|
||||
if ! [ "$LOGTALKHOME" ]
|
||||
then
|
||||
echo "The environment variable LOGTALKHOME must be defined first!"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [ "$LOGTALKUSER" ]
|
||||
then
|
||||
LOGTALKUSER=$HOME/logtalk
|
||||
echo "After the script completion, you must set the environment variable"
|
||||
echo "LOGTALKUSER pointing to $LOGTALKUSER"
|
||||
echo
|
||||
fi
|
||||
|
||||
if [ -d "$LOGTALKUSER" ]
|
||||
then
|
||||
echo "Error! Logtalk directory already exists!"
|
||||
echo "Please rename it and run this script again."
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Copying Logtalk files and directories..."
|
||||
mkdir -p "$LOGTALKUSER"/configs
|
||||
mkdir -p "$LOGTALKUSER"/contributions
|
||||
mkdir -p "$LOGTALKUSER"/examples
|
||||
mkdir -p "$LOGTALKUSER"/libpaths
|
||||
mkdir -p "$LOGTALKUSER"/library
|
||||
mkdir -p "$LOGTALKUSER"/xml
|
||||
cp -RL "$LOGTALKHOME"/configs "$LOGTALKUSER"/
|
||||
cp -RL "$LOGTALKHOME"/contributions "$LOGTALKUSER"/
|
||||
cp -RL "$LOGTALKHOME"/examples "$LOGTALKUSER"/
|
||||
cp -RL "$LOGTALKHOME"/libpaths "$LOGTALKUSER"/
|
||||
cp -RL "$LOGTALKHOME"/library "$LOGTALKUSER"/
|
||||
cp -RL "$LOGTALKHOME"/xml "$LOGTALKUSER"/
|
||||
chmod -R u+w "$LOGTALKUSER"
|
||||
ln -sf "$LOGTALKHOME"/BIBLIOGRAPHY "$LOGTALKUSER"/BIBLIOGRAPHY
|
||||
ln -sf "$LOGTALKHOME"/LICENSE "$LOGTALKUSER"/LICENSE
|
||||
ln -sf "$LOGTALKHOME"/QUICK_START "$LOGTALKUSER"/QUICK_START
|
||||
ln -sf "$LOGTALKHOME"/README "$LOGTALKUSER"/README
|
||||
ln -sf "$LOGTALKHOME"/RELEASE_NOTES "$LOGTALKUSER"/RELEASE_NOTES
|
||||
ln -sf "$LOGTALKHOME"/UPGRADING "$LOGTALKUSER"/UPGRADING
|
||||
ln -sf "$LOGTALKHOME"/manuals "$LOGTALKUSER"/manuals
|
||||
echo "Finished copying Logtalk files directories."
|
||||
echo
|
||||
echo "You may need to edit the \$LOGTALKUSER/libpaths/libpaths.pl file to match"
|
||||
echo "your Prolog compiler and operating-system requirements or to add your own"
|
||||
echo "library paths."
|
||||
echo
|
||||
echo "You may want to customize the default Logtalk compiler flags by editing"
|
||||
echo "the configuration file for your Prolog compiler found in the directory"
|
||||
echo "\$LOGTALKUSER/configs."
|
||||
echo
|
133
Logtalk/scripts/lgt_install.js
Normal file
133
Logtalk/scripts/lgt_install.js
Normal file
@@ -0,0 +1,133 @@
|
||||
// =================================================================
|
||||
// Logtalk - Object oriented extension to Prolog
|
||||
// Release 2.24.0
|
||||
//
|
||||
// Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
// =================================================================
|
||||
|
||||
if (WScript.Arguments.Unnamed.Length > 0) {
|
||||
usage_help();
|
||||
WScript.Quit(0);
|
||||
}
|
||||
|
||||
WScript.Echo('');
|
||||
WScript.Echo('Completing Logtalk installation...');
|
||||
WScript.Echo('');
|
||||
|
||||
var WshShell = new ActiveXObject("WScript.Shell");
|
||||
var WshSystemEnv = WshShell.Environment("SYSTEM");
|
||||
var WshUserEnv = WshShell.Environment("USER");
|
||||
var FSObject = new ActiveXObject("Scripting.FileSystemObject");
|
||||
|
||||
WshShell.CurrentDirectory = "..";
|
||||
|
||||
WshSystemEnv.Item("LOGTALKHOME") = WshShell.CurrentDirectory;
|
||||
WScript.Echo("Defined system environment variable LOGTALKHOME pointing to:");
|
||||
WScript.Echo("");
|
||||
WScript.Echo(" " + WshShell.CurrentDirectory);
|
||||
WScript.Echo("");
|
||||
|
||||
if (WshUserEnv.Item("LOGTALKUSER")) {
|
||||
WScript.Echo("Reusing user environment variable LOGTALKUSER pointing to:");
|
||||
WScript.Echo("");
|
||||
WScript.Echo(" " + WshUserEnv.Item("LOGTALKUSER"));
|
||||
}
|
||||
else {
|
||||
WshUserEnv.Item("LOGTALKUSER") = WshShell.SpecialFolders("MyDocuments") + "\\logtalk";
|
||||
WScript.Echo("Defined user environment variable LOGTALKUSER pointing to:");
|
||||
WScript.Echo("");
|
||||
WScript.Echo(" " + WshShell.SpecialFolders("MyDocuments") + "\\logtalk");
|
||||
}
|
||||
WScript.Echo("");
|
||||
|
||||
WshSystemEnv.Item("PATH") = WshSystemEnv.Item("PATH") + ";%LOGTALKHOME%\\scripts;%LOGTALKHOME%\\xml";
|
||||
WScript.Echo("Added Logtalk scripts and xml directories to the system PATH environment");
|
||||
WScript.Echo("variable.");
|
||||
WScript.Echo("");
|
||||
|
||||
FSObject.CopyFile(WshShell.CurrentDirectory + "\\BIBLIOGRAPHY", WshShell.CurrentDirectory + "\\BIBLIOGRAPHY.txt");
|
||||
FSObject.CopyFile(WshShell.CurrentDirectory + "\\LICENSE", WshShell.CurrentDirectory + "\\LICENSE.txt");
|
||||
FSObject.CopyFile(WshShell.CurrentDirectory + "\\QUICK_START", WshShell.CurrentDirectory + "\\QUICK_START.txt");
|
||||
FSObject.CopyFile(WshShell.CurrentDirectory + "\\README", WshShell.CurrentDirectory + "\\README.txt");
|
||||
FSObject.CopyFile(WshShell.CurrentDirectory + "\\RELEASE_NOTES", WshShell.CurrentDirectory + "\\RELEASE_NOTES.txt");
|
||||
FSObject.CopyFile(WshShell.CurrentDirectory + "\\UPGRADING", WshShell.CurrentDirectory + "\\UPGRADING.txt");
|
||||
|
||||
var ProgramsPath = WshShell.SpecialFolders("AllUsersPrograms");
|
||||
|
||||
if (!FSObject.FolderExists(ProgramsPath + "\\Logtalk"))
|
||||
FSObject.CreateFolder(ProgramsPath + "\\Logtalk");
|
||||
|
||||
var link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk Web Site.url");
|
||||
|
||||
link.TargetPath = "http://www.logtalk.org/";
|
||||
link.Save();
|
||||
|
||||
link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk HTML Documentation.lnk");
|
||||
|
||||
link.Description = "Browse Logtalk Documentation";
|
||||
link.TargetPath = WshShell.CurrentDirectory + "\\manuals\\index.html";
|
||||
link.Save();
|
||||
|
||||
link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk ReadMe.lnk");
|
||||
|
||||
link.Description = "Open Logtalk ReadMe";
|
||||
link.TargetPath = WshShell.CurrentDirectory + "\\README.txt";
|
||||
link.Save();
|
||||
|
||||
link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk Quick Start.lnk");
|
||||
|
||||
link.Description = "Open Logtalk Quick Start";
|
||||
link.TargetPath = WshShell.CurrentDirectory + "\\QUICK_START.txt";
|
||||
link.Save();
|
||||
|
||||
link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk Bibliography.lnk");
|
||||
|
||||
link.Description = "Open Logtalk Bibliography";
|
||||
link.TargetPath = WshShell.CurrentDirectory + "\\BIBLIOGRAPHY.txt";
|
||||
link.Save();
|
||||
|
||||
link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk License.lnk");
|
||||
|
||||
link.Description = "Open Logtalk License";
|
||||
link.TargetPath = WshShell.CurrentDirectory + "\\LICENSE.txt";
|
||||
link.Save();
|
||||
|
||||
link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk Release Notes.lnk");
|
||||
|
||||
link.Description = "Open Logtalk Release Notes";
|
||||
link.TargetPath = WshShell.CurrentDirectory + "\\RELEASE_NOTES.txt";
|
||||
link.Save();
|
||||
|
||||
link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk Upgrading.lnk");
|
||||
|
||||
link.Description = "Open Logtalk Upgrading instructions";
|
||||
link.TargetPath = WshShell.CurrentDirectory + "\\UPGRADING.txt";
|
||||
link.Save();
|
||||
|
||||
WScript.Echo('Logtalk installation completed. You will need to restart in order');
|
||||
WScript.Echo('to activate the new system environment variables and use the items');
|
||||
WScript.Echo('in the new Logtalk program group.');
|
||||
WScript.Echo('');
|
||||
WScript.Echo('Users should run the batch script cplgtdirs in order to copy the');
|
||||
WScript.Echo('Logtalk user-modifiable files to their home directories. The path');
|
||||
WScript.Echo('to the cplgtdirs, lgt2pdf, lgt2html, and lgt2xml batch scripts has');
|
||||
WScript.Echo('been added to the system path environment variable.');
|
||||
WScript.Echo('');
|
||||
|
||||
WScript.Quit(0);
|
||||
|
||||
function usage_help() {
|
||||
WScript.Echo('');
|
||||
WScript.Echo('This script completes the installation of Logtalk by setting the LOGTALKHOME');
|
||||
WScript.Echo('and LOGTALKUSER system environment variables and by creating a new program');
|
||||
WScript.Echo('group named "Logtalk" in the Windows Start Menu.');
|
||||
WScript.Echo('');
|
||||
WScript.Echo('The script must be run from this directory, by a user with administration');
|
||||
WScript.Echo('privileges, after decompressing the Logtalk distribution into its final');
|
||||
WScript.Echo('destination.');
|
||||
WScript.Echo('');
|
||||
WScript.Echo('Usage:');
|
||||
WScript.Echo(' ' + WScript.ScriptName + ' help');
|
||||
WScript.Echo(' ' + WScript.ScriptName);
|
||||
WScript.Echo('');
|
||||
}
|
51
Logtalk/scripts/lgt_install.sh
Executable file
51
Logtalk/scripts/lgt_install.sh
Executable file
@@ -0,0 +1,51 @@
|
||||
#!/bin/sh
|
||||
|
||||
## =================================================================
|
||||
## Logtalk - Object oriented extension to Prolog
|
||||
## Release 2.24.0
|
||||
##
|
||||
## Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
## =================================================================
|
||||
|
||||
echo
|
||||
echo "Installing Logtalk..."
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
prefix=/usr/local
|
||||
else
|
||||
prefix="$1"
|
||||
fi
|
||||
|
||||
rm -rf $prefix/lgt2240
|
||||
rm -f $prefix/logtalk
|
||||
|
||||
mkdir $prefix/lgt2240
|
||||
|
||||
cd ..
|
||||
cp -R * $prefix/lgt2240
|
||||
|
||||
cd $prefix
|
||||
chmod -R go-w,a+r lgt2240
|
||||
chmod a+x lgt2240
|
||||
chmod a+x lgt2240/scripts/*.sh
|
||||
chmod a+x lgt2240/xml/*.sh
|
||||
ln -sf lgt2240 logtalk
|
||||
|
||||
mkdir -p bin
|
||||
cd bin
|
||||
ln -sf ../lgt2240/scripts/cplgtdirs.sh cplgtdirs
|
||||
ln -sf ../lgt2240/xml/lgt2pdf.sh lgt2pdf
|
||||
ln -sf ../lgt2240/xml/lgt2html.sh lgt2html
|
||||
ln -sf ../lgt2240/xml/lgt2xml.sh lgt2xml
|
||||
|
||||
echo "Logtalk installation completed."
|
||||
echo
|
||||
echo "Users should define the environment variable LOGTALKHOME pointing"
|
||||
echo "to $prefix/logtalk and then run the shell script cplgtdirs"
|
||||
echo "in order to copy the Logtalk user-modifiable files to their home"
|
||||
echo "directories."
|
||||
echo
|
||||
echo "Links to the cplgtdirs, lgt2pdf, lgt2html, and lgt2xml scripts have"
|
||||
echo "been created on $prefix/bin; you may need to add this directory to"
|
||||
echo "your execution path."
|
||||
echo
|
59
Logtalk/scripts/logtalk.spec
Normal file
59
Logtalk/scripts/logtalk.spec
Normal file
@@ -0,0 +1,59 @@
|
||||
Name: logtalk
|
||||
Summary: Logtalk - Open source object-oriented extension to Prolog
|
||||
Version: 2.24.0
|
||||
Release: 1
|
||||
License: Artistic License 2.0
|
||||
Group: Development/Languages
|
||||
Packager: Paulo Moura <pmoura@logtalk.org>
|
||||
Source: http://www.logtalk.org/files/lgt2240.tgz
|
||||
BuildArchitectures: noarch
|
||||
URL: http://www.logtalk.org/
|
||||
Prefix: /usr/local
|
||||
AutoReqProv: no
|
||||
%description
|
||||
Logtalk is an open source object-oriented extension to the Prolog programming language. Integrating logic programming with object-oriented and event-driven programming, it is compatible with most Prolog compilers. It supports both prototypes and classes. In addition, it supports component-based programming through category-based composition.
|
||||
%prep
|
||||
%setup -n lgt2240
|
||||
%build
|
||||
%install
|
||||
rm -rf /usr/local/lgt2240
|
||||
rm -f /usr/local/logtalk
|
||||
mkdir /usr/local/lgt2240
|
||||
cp -R * /usr/local/lgt2240
|
||||
cd /usr/local
|
||||
chmod -R go-w,a+r lgt2240
|
||||
chmod a+x lgt2240
|
||||
chmod a+x lgt2240/scripts/*.sh
|
||||
chmod a+x lgt2240/xml/*.sh
|
||||
ln -sf lgt2240 logtalk
|
||||
cd bin
|
||||
ln -sf ../lgt2240/scripts/cplgtdirs.sh cplgtdirs
|
||||
ln -sf ../lgt2240/xml/lgt2pdf.sh lgt2pdf
|
||||
ln -sf ../lgt2240/xml/lgt2html.sh lgt2html
|
||||
ln -sf ../lgt2240/xml/lgt2xml.sh lgt2xml
|
||||
%clean
|
||||
%files
|
||||
%defattr(-,root,users)
|
||||
%doc /usr/local/lgt2240/BIBLIOGRAPHY
|
||||
%doc /usr/local/lgt2240/INSTALL
|
||||
%doc /usr/local/lgt2240/LICENSE
|
||||
%doc /usr/local/lgt2240/QUICK_START
|
||||
%doc /usr/local/lgt2240/README
|
||||
%doc /usr/local/lgt2240/RELEASE_NOTES
|
||||
%doc /usr/local/lgt2240/UPGRADING
|
||||
/usr/local/lgt2240/compiler
|
||||
/usr/local/lgt2240/configs
|
||||
/usr/local/lgt2240/contributions
|
||||
/usr/local/lgt2240/examples
|
||||
/usr/local/lgt2240/libpaths
|
||||
/usr/local/lgt2240/library
|
||||
%docdir /usr/local/lgt2240/manuals
|
||||
/usr/local/lgt2240/manuals
|
||||
/usr/local/lgt2240/scripts
|
||||
/usr/local/lgt2240/wenv
|
||||
/usr/local/lgt2240/xml
|
||||
/usr/local/logtalk
|
||||
/usr/local/bin/cplgtdirs
|
||||
/usr/local/bin/lgt2pdf
|
||||
/usr/local/bin/lgt2html
|
||||
/usr/local/bin/lgt2xml
|
95
Logtalk/scripts/make_ciaolgt.js
Normal file
95
Logtalk/scripts/make_ciaolgt.js
Normal file
@@ -0,0 +1,95 @@
|
||||
// =================================================================
|
||||
// Logtalk - Object oriented extension to Prolog
|
||||
// Release 2.24.0
|
||||
//
|
||||
// Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
// =================================================================
|
||||
|
||||
if (WScript.Arguments.Unnamed.Length > 0) {
|
||||
usage_help();
|
||||
WScript.Quit(0);
|
||||
}
|
||||
|
||||
WScript.Echo('');
|
||||
WScript.Echo('Creating a shortcut named "Logtalk - CIAO" for running Logtalk');
|
||||
WScript.Echo('with CIAO...');
|
||||
WScript.Echo('');
|
||||
|
||||
var WshShell = new ActiveXObject("WScript.Shell");
|
||||
|
||||
var prolog_path = WshShell.RegRead("HKLM\\Software\\Ciao Prolog\\ciao_dir") + "\\shell\\ciaosh.cpx";
|
||||
|
||||
var FSObject = new ActiveXObject("Scripting.FileSystemObject");
|
||||
|
||||
if (!FSObject.FileExists(prolog_path)) {
|
||||
WScript.Echo("Error! Cannot find ciaosh.cpx at the expected place!");
|
||||
WScript.Quit(1);
|
||||
}
|
||||
|
||||
var WshSystemEnv = WshShell.Environment("SYSTEM");
|
||||
var WshUserEnv = WshShell.Environment("USER");
|
||||
var logtalk_home;
|
||||
|
||||
if (WshSystemEnv.Item("LOGTALKHOME"))
|
||||
logtalk_home = WshSystemEnv.Item("LOGTALKHOME");
|
||||
else if (WshUserEnv.Item("LOGTALKHOME"))
|
||||
logtalk_home = WshUserEnv.Item("LOGTALKHOME")
|
||||
else {
|
||||
WScript.Echo("Error! The system environment variable LOGTALKHOME must be defined first!");
|
||||
usage_help();
|
||||
WScript.Quit(1);
|
||||
}
|
||||
|
||||
logtalk_home = logtalk_home.replace(/\\/g, "\\\\");
|
||||
|
||||
if (!FSObject.FolderExists(logtalk_home + "\\bin"))
|
||||
FSObject.CreateFolder(logtalk_home + "\\bin");
|
||||
|
||||
var f = FSObject.CreateTextFile(logtalk_home + "\\bin\\logtalk_ciao.pl", true);
|
||||
|
||||
f.WriteLine(":- ensure_loaded('\$LOGTALKUSER/configs/ciao_aux.config').");
|
||||
f.WriteLine(":- ensure_loaded('\$LOGTALKHOME/compiler/logtalk.pl').");
|
||||
f.WriteLine(":- ensure_loaded('\$LOGTALKUSER/libpaths/libpaths.pl').");
|
||||
f.WriteLine(":- op(600, xfy, ::).");
|
||||
f.WriteLine(":- op(600, fy, ::).");
|
||||
f.WriteLine(":- op(600, fy, ^^).");
|
||||
f.WriteLine(":- op(200, fy, +).");
|
||||
f.WriteLine(":- op(200, fy, ?).");
|
||||
f.WriteLine(":- op(200, fy, @).");
|
||||
f.WriteLine(":- op(200, fy, -).");
|
||||
f.Close();
|
||||
|
||||
var ProgramsPath = WshShell.SpecialFolders("AllUsersPrograms");
|
||||
|
||||
if (!FSObject.FolderExists(ProgramsPath + "\\Logtalk"))
|
||||
FSObject.CreateFolder(ProgramsPath + "\\Logtalk");
|
||||
|
||||
var link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk - CIAO.lnk");
|
||||
link.Arguments = "-l %LOGTALKHOME%\\bin\\logtalk_ciao.pl";
|
||||
link.Description = "Runs Logtalk with CIAO";
|
||||
link.IconLocation = "app.exe,1";
|
||||
link.TargetPath = prolog_path;
|
||||
link.WindowStyle = 1;
|
||||
link.WorkingDirectory = logtalk_home;
|
||||
link.Save();
|
||||
|
||||
WScript.Echo('Done. The "Logtalk - CIAO" shortcut was been added to the');
|
||||
WScript.Echo('Start Menu Programs. Make sure that the environment variables');
|
||||
WScript.Echo('LOGTALKHOME and LOGTALKUSER are defined for all users wishing');
|
||||
WScript.Echo('to use the shortcut.');
|
||||
WScript.Echo('');
|
||||
|
||||
WScript.Quit(0);
|
||||
|
||||
function usage_help() {
|
||||
WScript.Echo('');
|
||||
WScript.Echo('This script creates a shortcut named "Logtalk - CIAO" for running Logtalk');
|
||||
WScript.Echo('with CIAO. The script must be run by a user with administrative rights.');
|
||||
WScript.Echo('The LOGTALKHOME environment variable must be defined before running this');
|
||||
WScript.Echo('script.');
|
||||
WScript.Echo('');
|
||||
WScript.Echo('Usage:');
|
||||
WScript.Echo(' ' + WScript.ScriptName + ' help');
|
||||
WScript.Echo(' ' + WScript.ScriptName);
|
||||
WScript.Echo('');
|
||||
}
|
44
Logtalk/scripts/make_ciaolgt.sh
Executable file
44
Logtalk/scripts/make_ciaolgt.sh
Executable file
@@ -0,0 +1,44 @@
|
||||
#! /bin/sh
|
||||
|
||||
## =================================================================
|
||||
## Logtalk - Object oriented extension to Prolog
|
||||
## Release 2.24.0
|
||||
##
|
||||
## Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
## =================================================================
|
||||
|
||||
echo
|
||||
echo "Creating a script named ciaolgt for running Logtalk with CIAO..."
|
||||
|
||||
if ! [ "$LOGTALKHOME" ]
|
||||
then
|
||||
echo "The environment variable LOGTALKHOME must be defined first!"
|
||||
else
|
||||
cd "$LOGTALKHOME"
|
||||
if [ -z "$1" ]; then
|
||||
prefix=/usr/local
|
||||
else
|
||||
prefix="$1"
|
||||
fi
|
||||
mkdir -p bin
|
||||
cd bin
|
||||
echo ":- ensure_loaded('\$LOGTALKUSER/configs/ciao_aux.config')." > logtalk_ciao.rc
|
||||
echo ":- ensure_loaded('\$LOGTALKHOME/compiler/logtalk.pl')." >> logtalk_ciao.rc
|
||||
echo ":- ensure_loaded('\$LOGTALKUSER/libpaths/libpaths.pl')." >> logtalk_ciao.rc
|
||||
echo ":- op(600, xfy, ::)." >> logtalk_ciao.rc
|
||||
echo ":- op(600, fy, ::)." >> logtalk_ciao.rc
|
||||
echo ":- op(600, fy, ^^)." >> logtalk_ciao.rc
|
||||
echo ":- op(200, fy, +)." >> logtalk_ciao.rc
|
||||
echo ":- op(200, fy, ?)." >> logtalk_ciao.rc
|
||||
echo ":- op(200, fy, @)." >> logtalk_ciao.rc
|
||||
echo ":- op(200, fy, -)." >> logtalk_ciao.rc
|
||||
|
||||
echo "#/bin/sh" > ciaolgt
|
||||
echo "ciaosh -l \$LOGTALKHOME/bin/logtalk_ciao.rc" >> ciaolgt
|
||||
chmod a+x ciaolgt
|
||||
ln -sf $LOGTALKHOME/bin/ciaolgt $prefix/bin/ciaolgt
|
||||
echo "Done. A link to the script was been created in $prefix/bin."
|
||||
echo "Users should define the environment variables LOGTALKHOME and"
|
||||
echo "LOGTALKUSER in order to use the script."
|
||||
echo
|
||||
fi
|
100
Logtalk/scripts/make_eclipselgt.js
Normal file
100
Logtalk/scripts/make_eclipselgt.js
Normal file
@@ -0,0 +1,100 @@
|
||||
// =================================================================
|
||||
// Logtalk - Object oriented extension to Prolog
|
||||
// Release 2.24.0
|
||||
//
|
||||
// Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
// =================================================================
|
||||
|
||||
if (WScript.Arguments.Unnamed.Length > 0) {
|
||||
usage_help();
|
||||
WScript.Quit(0);
|
||||
}
|
||||
|
||||
WScript.Echo('');
|
||||
WScript.Echo('Creating a shortcut named "Logtalk - ECLiPSe" for running Logtalk with');
|
||||
WScript.Echo('ECLiPSe 5.8 (edit the script if you are using other version)...');
|
||||
WScript.Echo('');
|
||||
|
||||
var WshShell = new ActiveXObject("WScript.Shell");
|
||||
|
||||
var prolog_path = WshShell.RegRead("HKLM\\Software\\IC-Parc\\Eclipse\\5.8\\ECLIPSEDIR") + "\\lib\\i386_nt\\eclipse.exe";
|
||||
|
||||
var FSObject = new ActiveXObject("Scripting.FileSystemObject");
|
||||
|
||||
if (!FSObject.FileExists(prolog_path)) {
|
||||
WScript.Echo("Error! Cannot find eclipse.exe at the expected place!");
|
||||
WScript.Quit(1);
|
||||
}
|
||||
|
||||
var WshSystemEnv = WshShell.Environment("SYSTEM");
|
||||
var WshUserEnv = WshShell.Environment("USER");
|
||||
var logtalk_home;
|
||||
|
||||
if (WshSystemEnv.Item("LOGTALKHOME"))
|
||||
logtalk_home = WshSystemEnv.Item("LOGTALKHOME");
|
||||
else if (WshUserEnv.Item("LOGTALKHOME"))
|
||||
logtalk_home = WshUserEnv.Item("LOGTALKHOME")
|
||||
else {
|
||||
WScript.Echo("Error! The system environment variable LOGTALKHOME must be defined first!");
|
||||
usage_help();
|
||||
WScript.Quit(1);
|
||||
}
|
||||
|
||||
logtalk_home = logtalk_home.replace(/\\/g, "\\\\");
|
||||
|
||||
if (!FSObject.FolderExists(logtalk_home + "\\bin"))
|
||||
FSObject.CreateFolder(logtalk_home + "\\bin");
|
||||
|
||||
var f = FSObject.CreateTextFile(logtalk_home + "\\bin\\lgtc_eclipse.pl", true);
|
||||
|
||||
f.WriteLine(":- pragma(system).");
|
||||
f.WriteLine(":- pragma(nodebug).");
|
||||
f.Close();
|
||||
|
||||
WshShell.Run("cmd /c type " + logtalk_home + "\\compiler\\logtalk.pl" + " >> " + logtalk_home + "\\bin\\lgtc_eclipse.pl", true);
|
||||
|
||||
f = FSObject.CreateTextFile(logtalk_home + "\\bin\\logtalk_eclipse.pl", true);
|
||||
|
||||
f.WriteLine(":- ensure_loaded(library(toplevel)).");
|
||||
f.WriteLine(":- cd('$LOGTALKUSER').");
|
||||
f.WriteLine(":- compile('configs/eclipseiso.config').");
|
||||
f.WriteLine(":- cd('$LOGTALKHOME').");
|
||||
f.WriteLine(":- compile('bin/lgtc_eclipse.pl').");
|
||||
f.WriteLine(":- cd('$LOGTALKUSER').");
|
||||
f.WriteLine(":- compile('libpaths/libpaths.pl').");
|
||||
f.Close();
|
||||
|
||||
var ProgramsPath = WshShell.SpecialFolders("AllUsersPrograms");
|
||||
|
||||
if (!FSObject.FolderExists(ProgramsPath + "\\Logtalk"))
|
||||
FSObject.CreateFolder(ProgramsPath + "\\Logtalk");
|
||||
|
||||
var link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk - ECLiPSe.lnk");
|
||||
link.Arguments = "-b %LOGTALKHOME%\\bin\\logtalk_eclipse.pl";
|
||||
link.Description = "Runs Logtalk with ECLiPSe";
|
||||
link.IconLocation = "app.exe,1";
|
||||
link.TargetPath = prolog_path;
|
||||
link.WindowStyle = 1;
|
||||
link.WorkingDirectory = logtalk_home;
|
||||
link.Save();
|
||||
|
||||
WScript.Echo('Done. The "Logtalk - ECLiPSe" shortcut was been added to the');
|
||||
WScript.Echo('Start Menu Programs. Make sure that the environment variables');
|
||||
WScript.Echo('LOGTALKHOME and LOGTALKUSER are defined for all users wishing');
|
||||
WScript.Echo('to use the shortcut.');
|
||||
WScript.Echo('');
|
||||
|
||||
WScript.Quit(0);
|
||||
|
||||
function usage_help() {
|
||||
WScript.Echo('');
|
||||
WScript.Echo('This script creates a shortcut named "Logtalk - ECLiPSe" for running Logtalk');
|
||||
WScript.Echo('with ECLiPSe. The script must be run by a user with administrative rights.');
|
||||
WScript.Echo('The LOGTALKHOME environment variable must be defined before running this');
|
||||
WScript.Echo('script.');
|
||||
WScript.Echo('');
|
||||
WScript.Echo('Usage:');
|
||||
WScript.Echo(' ' + WScript.ScriptName + ' help');
|
||||
WScript.Echo(' ' + WScript.ScriptName);
|
||||
WScript.Echo('');
|
||||
}
|
40
Logtalk/scripts/make_eclipselgt.sh
Executable file
40
Logtalk/scripts/make_eclipselgt.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#! /bin/sh
|
||||
|
||||
## =================================================================
|
||||
## Logtalk - Object oriented extension to Prolog
|
||||
## Release 2.24.0
|
||||
##
|
||||
## Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
## =================================================================
|
||||
|
||||
echo
|
||||
echo "Creating a script named eclipselgt for running Logtalk with ECLiPSe..."
|
||||
|
||||
if ! [ "$LOGTALKHOME" ]
|
||||
then
|
||||
echo "The environment variable LOGTALKHOME must be defined first!"
|
||||
else
|
||||
cd "$LOGTALKHOME"
|
||||
if [ -z "$1" ]; then
|
||||
prefix=/usr/local
|
||||
else
|
||||
prefix="$1"
|
||||
fi
|
||||
mkdir -p bin
|
||||
cd bin
|
||||
echo ":- pragma(system)." > logtalk_eclipse.pl
|
||||
echo ":- pragma(nodebug)." >> logtalk_eclipse.pl
|
||||
echo ":- ensure_loaded(library(toplevel))." >> logtalk_eclipse.pl
|
||||
echo ":- include('\$LOGTALKHOME/compiler/logtalk.pl')." >> logtalk_eclipse.pl
|
||||
echo ":- compile('\$LOGTALKUSER/configs/eclipseiso.config')." > logtalk_eclipse.rc
|
||||
echo ":- compile('\$LOGTALKHOME/bin/logtalk_eclipse.pl')." >> logtalk_eclipse.rc
|
||||
echo ":- compile('\$LOGTALKUSER/libpaths/libpaths.pl')." >> logtalk_eclipse.rc
|
||||
echo "#/bin/sh" > eclipselgt
|
||||
echo "eclipse -b \$LOGTALKHOME/bin/logtalk_eclipse.rc" >> eclipselgt
|
||||
chmod a+x eclipselgt
|
||||
ln -sf $LOGTALKHOME/bin/eclipselgt $prefix/bin/eclipselgt
|
||||
echo "Done. A link to the script was been created in $prefix/bin."
|
||||
echo "Users should define the environment variables LOGTALKHOME and"
|
||||
echo "LOGTALKUSER in order to use the script."
|
||||
echo
|
||||
fi
|
89
Logtalk/scripts/make_gplgt.js
Normal file
89
Logtalk/scripts/make_gplgt.js
Normal file
@@ -0,0 +1,89 @@
|
||||
// =================================================================
|
||||
// Logtalk - Object oriented extension to Prolog
|
||||
// Release 2.24.0
|
||||
//
|
||||
// Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
// =================================================================
|
||||
|
||||
if (WScript.Arguments.Unnamed.Length > 0) {
|
||||
usage_help();
|
||||
WScript.Quit(0);
|
||||
}
|
||||
|
||||
WScript.Echo('');
|
||||
WScript.Echo('Creating a shortcut named "Logtalk - GNU Prolog" for running Logtalk');
|
||||
WScript.Echo('with GNU Prolog...');
|
||||
WScript.Echo('');
|
||||
|
||||
var WshShell = new ActiveXObject("WScript.Shell");
|
||||
|
||||
var prolog_path = WshShell.RegRead("HKCU\\Software\\GnuProlog\\RootPath") + "\\bin\\gprolog.exe";
|
||||
|
||||
var FSObject = new ActiveXObject("Scripting.FileSystemObject");
|
||||
|
||||
if (!FSObject.FileExists(prolog_path)) {
|
||||
WScript.Echo("Error! Cannot find gprolog.exe at the expected place!");
|
||||
WScript.Quit(1);
|
||||
}
|
||||
|
||||
var WshSystemEnv = WshShell.Environment("SYSTEM");
|
||||
var WshUserEnv = WshShell.Environment("USER");
|
||||
var logtalk_home;
|
||||
|
||||
if (WshSystemEnv.Item("LOGTALKHOME"))
|
||||
logtalk_home = WshSystemEnv.Item("LOGTALKHOME");
|
||||
else if (WshUserEnv.Item("LOGTALKHOME"))
|
||||
logtalk_home = WshUserEnv.Item("LOGTALKHOME")
|
||||
else {
|
||||
WScript.Echo("Error! The system environment variable LOGTALKHOME must be defined first!");
|
||||
usage_help();
|
||||
WScript.Quit(1);
|
||||
}
|
||||
|
||||
logtalk_home = logtalk_home.replace(/\\/g, "\\\\");
|
||||
|
||||
if (!FSObject.FolderExists(logtalk_home + "\\bin"))
|
||||
FSObject.CreateFolder(logtalk_home + "\\bin");
|
||||
|
||||
FSObject.CopyFile(logtalk_home + "\\configs\\gnu.config", logtalk_home + "\\bin\\gnu.pl");
|
||||
|
||||
var f = FSObject.CreateTextFile(logtalk_home + "\\bin\\logtalk_gp.pl", true);
|
||||
f.WriteLine(":- built_in.");
|
||||
f.Close();
|
||||
|
||||
WshShell.Run("cmd /c type " + logtalk_home + "\\compiler\\logtalk.pl" + " >> " + logtalk_home + "\\bin\\logtalk_gp.pl", true);
|
||||
|
||||
var ProgramsPath = WshShell.SpecialFolders("AllUsersPrograms");
|
||||
|
||||
if (!FSObject.FolderExists(ProgramsPath + "\\Logtalk"))
|
||||
FSObject.CreateFolder(ProgramsPath + "\\Logtalk");
|
||||
|
||||
var link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk - GNU Prolog.lnk");
|
||||
link.Arguments = "--init-goal \"['$LOGTALKUSER/configs/gnu.config', '$LOGTALKHOME/bin/logtalk_gp.pl', '$LOGTALKUSER/libpaths/libpaths.pl']\"";
|
||||
link.Description = "Runs Logtalk with GNU Prolog";
|
||||
link.IconLocation = "app.exe,1";
|
||||
link.TargetPath = prolog_path;
|
||||
link.WindowStyle = 1;
|
||||
link.WorkingDirectory = logtalk_home;
|
||||
link.Save();
|
||||
|
||||
WScript.Echo('Done. The "Logtalk - GNU Prolog" shortcut was been added to the');
|
||||
WScript.Echo('Start Menu Programs. Make sure that the environment variables');
|
||||
WScript.Echo('LOGTALKHOME and LOGTALKUSER are defined for all users wishing');
|
||||
WScript.Echo('to use the shortcut.');
|
||||
WScript.Echo('');
|
||||
|
||||
WScript.Quit(0);
|
||||
|
||||
function usage_help() {
|
||||
WScript.Echo('');
|
||||
WScript.Echo('This script creates a shortcut named "Logtalk - GNU Prolog" for running Logtalk');
|
||||
WScript.Echo('with GNU Prolog. The script must be run by a user with administrative rights.');
|
||||
WScript.Echo('The LOGTALKHOME environment variable must be defined before running this');
|
||||
WScript.Echo('script.');
|
||||
WScript.Echo('');
|
||||
WScript.Echo('Usage:');
|
||||
WScript.Echo(' ' + WScript.ScriptName + ' help');
|
||||
WScript.Echo(' ' + WScript.ScriptName);
|
||||
WScript.Echo('');
|
||||
}
|
35
Logtalk/scripts/make_gplgt.sh
Executable file
35
Logtalk/scripts/make_gplgt.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#! /bin/sh
|
||||
|
||||
## =================================================================
|
||||
## Logtalk - Object oriented extension to Prolog
|
||||
## Release 2.24.0
|
||||
##
|
||||
## Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
## =================================================================
|
||||
|
||||
echo
|
||||
echo "Creating a script named gplgt for running Logtalk with GNU Prolog..."
|
||||
|
||||
if ! [ "$LOGTALKHOME" ]
|
||||
then
|
||||
echo "The environment variable LOGTALKHOME must be defined first!"
|
||||
else
|
||||
cd "$LOGTALKHOME"
|
||||
if [ -z "$1" ]; then
|
||||
prefix=/usr/local
|
||||
else
|
||||
prefix="$1"
|
||||
fi
|
||||
mkdir -p bin
|
||||
cd bin
|
||||
echo ":- built_in." > logtalk_gp.pl
|
||||
cat ../compiler/logtalk.pl >> logtalk_gp.pl
|
||||
echo "#/bin/sh" > gplgt
|
||||
echo "gprolog --init-goal \"['$LOGTALKUSER/configs/gnu.config', '$LOGTALKHOME/bin/logtalk_gp.pl', '$LOGTALKUSER/libpaths/libpaths.pl']\"" >> gplgt
|
||||
chmod a+x gplgt
|
||||
ln -sf $LOGTALKHOME/bin/gplgt $prefix/bin/gplgt
|
||||
echo "Done. A link to the script was been created in $prefix/bin."
|
||||
echo "Users should define the environment variables LOGTALKHOME and"
|
||||
echo "LOGTALKUSER in order to use the script."
|
||||
echo
|
||||
fi
|
98
Logtalk/scripts/make_plclgt.js
Normal file
98
Logtalk/scripts/make_plclgt.js
Normal file
@@ -0,0 +1,98 @@
|
||||
// =================================================================
|
||||
// Logtalk - Object oriented extension to Prolog
|
||||
// Release 2.24.0
|
||||
//
|
||||
// Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
// =================================================================
|
||||
|
||||
if (WScript.Arguments.Unnamed.Length > 0) {
|
||||
usage_help();
|
||||
WScript.Quit(0);
|
||||
}
|
||||
|
||||
WScript.Echo('');
|
||||
WScript.Echo('Creating a shortcut named "Logtalk - K-Prolog" for running Logtalk');
|
||||
WScript.Echo('with K-Prolog...');
|
||||
WScript.Echo('');
|
||||
|
||||
var WshShell = new ActiveXObject("WScript.Shell");
|
||||
var WshSystemEnv = WshShell.Environment("SYSTEM");
|
||||
var WshUserEnv = WshShell.Environment("USER");
|
||||
|
||||
var prolog_path;
|
||||
|
||||
if (WshSystemEnv.Item("PLC"))
|
||||
prolog_path = WshSystemEnv.Item("PLC") + "\\plc.exe";
|
||||
else if (WshUserEnv.Item("PLC"))
|
||||
prolog_path = WshUserEnv.Item("PLC") + "\\plc.exe"
|
||||
else {
|
||||
WScript.Echo("Error! The K-Prolog environment variable PLC must be defined first!");
|
||||
usage_help();
|
||||
WScript.Quit(1);
|
||||
}
|
||||
|
||||
var FSObject = new ActiveXObject("Scripting.FileSystemObject");
|
||||
|
||||
if (!FSObject.FileExists(prolog_path)) {
|
||||
WScript.Echo("Error! Cannot find plc.exe at the expected place!");
|
||||
WScript.Quit(1);
|
||||
}
|
||||
|
||||
var logtalk_home;
|
||||
|
||||
if (WshSystemEnv.Item("LOGTALKHOME"))
|
||||
logtalk_home = WshSystemEnv.Item("LOGTALKHOME");
|
||||
else if (WshUserEnv.Item("LOGTALKHOME"))
|
||||
logtalk_home = WshUserEnv.Item("LOGTALKHOME")
|
||||
else {
|
||||
WScript.Echo("Error! The environment variable LOGTALKHOME must be defined first!");
|
||||
usage_help();
|
||||
WScript.Quit(1);
|
||||
}
|
||||
|
||||
logtalk_home = logtalk_home.replace(/\\/g, "\\\\");
|
||||
|
||||
if (!FSObject.FolderExists(logtalk_home + "\\bin"))
|
||||
FSObject.CreateFolder(logtalk_home + "\\bin");
|
||||
|
||||
f = FSObject.CreateTextFile(logtalk_home + "\\bin\\logtalk_plc.rc", true);
|
||||
|
||||
f.WriteLine(":- consult('$LOGTALKUSER/configs/k.config').");
|
||||
f.WriteLine(":- consult('$LOGTALKHOME/compiler/logtalk.pl').");
|
||||
f.WriteLine(":- consult('$LOGTALKUSER/libpaths/libpaths.pl').");
|
||||
f.Close();
|
||||
|
||||
var ProgramsPath = WshShell.SpecialFolders("AllUsersPrograms");
|
||||
|
||||
if (!FSObject.FolderExists(ProgramsPath + "\\Logtalk"))
|
||||
FSObject.CreateFolder(ProgramsPath + "\\Logtalk");
|
||||
|
||||
var link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk - K-Prolog.lnk");
|
||||
link.Arguments = "-h 2048k -l 1024k -g 2048k -e \"(consult('$LOGTALKHOME/bin/logtalk_plc.rc'), '$root').\"";
|
||||
link.Description = "Runs Logtalk with K-Prolog";
|
||||
link.IconLocation = "app.exe,1";
|
||||
link.TargetPath = prolog_path;
|
||||
link.WindowStyle = 1;
|
||||
link.WorkingDirectory = logtalk_home;
|
||||
link.Save();
|
||||
|
||||
WScript.Echo('Done. The "Logtalk - K-Prolog" shortcut was been added to the');
|
||||
WScript.Echo('Start Menu Programs. Make sure that the environment variables');
|
||||
WScript.Echo('LOGTALKHOME and LOGTALKUSER are defined for all users wishing');
|
||||
WScript.Echo('to use the shortcut.');
|
||||
WScript.Echo('');
|
||||
|
||||
WScript.Quit(0);
|
||||
|
||||
function usage_help() {
|
||||
WScript.Echo('');
|
||||
WScript.Echo('This script creates a shortcut named "Logtalk - K-Prolog" for');
|
||||
WScript.Echo('running Logtalk with K-Prolog. The script must be run by a user');
|
||||
WScript.Echo('with administrative rights. The LOGTALKHOME environment variable');
|
||||
WScript.Echo('must be defined before running this script.');
|
||||
WScript.Echo('');
|
||||
WScript.Echo('Usage:');
|
||||
WScript.Echo(' ' + WScript.ScriptName + ' help');
|
||||
WScript.Echo(' ' + WScript.ScriptName);
|
||||
WScript.Echo('');
|
||||
}
|
36
Logtalk/scripts/make_plclgt.sh
Executable file
36
Logtalk/scripts/make_plclgt.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#! /bin/sh
|
||||
|
||||
## =================================================================
|
||||
## Logtalk - Object oriented extension to Prolog
|
||||
## Release 2.24.0
|
||||
##
|
||||
## Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
## =================================================================
|
||||
|
||||
echo
|
||||
echo "Creating a script named plclgt for running Logtalk with K-Prolog..."
|
||||
|
||||
if ! [ "$LOGTALKHOME" ]
|
||||
then
|
||||
echo "The environment variable LOGTALKHOME must be defined first!"
|
||||
else
|
||||
cd "$LOGTALKHOME"
|
||||
if [ -z "$1" ]; then
|
||||
prefix=/usr/local
|
||||
else
|
||||
prefix="$1"
|
||||
fi
|
||||
mkdir -p bin
|
||||
cd bin
|
||||
echo ":- ensure_loaded('\$LOGTALKUSER/configs/k.config')." > logtalk_plc.rc
|
||||
echo ":- ensure_loaded('\$LOGTALKHOME/compiler/logtalk.pl')." >> logtalk_plc.rc
|
||||
echo ":- ensure_loaded('\$LOGTALKUSER/libpaths/libpaths.pl')." >> logtalk_plc.rc
|
||||
echo "#/bin/sh" > plclgt
|
||||
echo "\$PLC/plc -h 2048k -l 1024k -g 2048k -e \"(consult('\\\$LOGTALKHOME/bin/logtalk_plc.rc'), '\\\$root').\"" >> plclgt
|
||||
chmod a+x plclgt
|
||||
ln -sf $LOGTALKHOME/bin/plclgt $prefix/bin/plclgt
|
||||
echo "Done. A link to the script was been created in $prefix/bin."
|
||||
echo "Users should define the environment variables LOGTALKHOME and"
|
||||
echo "LOGTALKUSER in order to use the script."
|
||||
echo
|
||||
fi
|
45
Logtalk/scripts/make_qplgt.sh
Executable file
45
Logtalk/scripts/make_qplgt.sh
Executable file
@@ -0,0 +1,45 @@
|
||||
#! /bin/sh
|
||||
|
||||
## =================================================================
|
||||
## Logtalk - Object oriented extension to Prolog
|
||||
## Release 2.24.0
|
||||
##
|
||||
## Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
## =================================================================
|
||||
|
||||
echo
|
||||
echo "Creating a script named qplgt for running Logtalk with Qu-Prolog..."
|
||||
|
||||
if ! [ "$LOGTALKHOME" ]
|
||||
then
|
||||
echo "The environment variable LOGTALKHOME must be defined first!"
|
||||
else
|
||||
cd "$LOGTALKHOME"
|
||||
if [ -z "$1" ]; then
|
||||
prefix=/usr/local
|
||||
else
|
||||
prefix="$1"
|
||||
fi
|
||||
mkdir -p bin
|
||||
find . -name "*.lgt" -exec perl -pi -e "s/version is (\d)\.(\d)/version is '\1\.\2'/" {} \;
|
||||
find . -name "*.mlgt" -exec perl -pi -e "s/version is (\d)\.(\d)/version is '\1\.\2'/" {} \;
|
||||
cd configs
|
||||
cp qu.config qu.ql
|
||||
echo "fcompile('qu.ql', [assemble_only(true)]), load(qu). \
|
||||
chdir('../compiler/'), fcompile('logtalk.pl', [assemble_only(true), string_table(256)]), load(logtalk). \
|
||||
chdir('../libpaths/'), fcompile('libpaths.pl', [assemble_only(true)]), load(libpaths)." | qp -s 2048 -d 1024 -h 2000
|
||||
qc -c qphook.ql
|
||||
cd ../bin
|
||||
qc -s 2048 -d 1024 -h 2000 -o qplgt ../configs/qphook.qo ../configs/qu.qo ../compiler/logtalk.qo ../libpaths/libpaths.qo
|
||||
chmod a+x qplgt
|
||||
ln -sf $LOGTALKHOME/bin/qplgt $prefix/bin/qplgt
|
||||
rm ../configs/qu.ql
|
||||
rm ../configs/qphook.qo
|
||||
rm ../configs/qu.qo
|
||||
rm ../compiler/logtalk.qo
|
||||
rm ../libpaths/libpaths.qo
|
||||
echo "Done. A link to the script was been created in $prefix/bin."
|
||||
echo "Users should define the environment variables LOGTALKHOME and"
|
||||
echo "LOGTALKUSER in order to use the script."
|
||||
echo
|
||||
fi
|
88
Logtalk/scripts/make_sicstuslgt.js
Normal file
88
Logtalk/scripts/make_sicstuslgt.js
Normal file
@@ -0,0 +1,88 @@
|
||||
// =================================================================
|
||||
// Logtalk - Object oriented extension to Prolog
|
||||
// Release 2.24.0
|
||||
//
|
||||
// Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
// =================================================================
|
||||
|
||||
if (WScript.Arguments.Unnamed.Length > 0) {
|
||||
usage_help();
|
||||
WScript.Quit(0);
|
||||
}
|
||||
|
||||
WScript.Echo('');
|
||||
WScript.Echo('Creating a shortcut named "Logtalk - SICStus Prolog" for running Logtalk with');
|
||||
WScript.Echo('SICStus Prolog 3.12 (edit the script if you are using other version)...');
|
||||
WScript.Echo('');
|
||||
|
||||
var WshShell = new ActiveXObject("WScript.Shell");
|
||||
|
||||
var prolog_path = WshShell.RegRead("HKLM\\Software\\SICS\\SICStus3.12_win32\\SP_PATH") + "\\bin\\spwin.exe";
|
||||
|
||||
var FSObject = new ActiveXObject("Scripting.FileSystemObject");
|
||||
|
||||
if (!FSObject.FileExists(prolog_path)) {
|
||||
WScript.Echo("Error! Cannot find spwin.exe at the expected place!");
|
||||
WScript.Quit(1);
|
||||
}
|
||||
|
||||
var WshSystemEnv = WshShell.Environment("SYSTEM");
|
||||
var WshUserEnv = WshShell.Environment("USER");
|
||||
var logtalk_home;
|
||||
|
||||
if (WshSystemEnv.Item("LOGTALKHOME"))
|
||||
logtalk_home = WshSystemEnv.Item("LOGTALKHOME");
|
||||
else if (WshUserEnv.Item("LOGTALKHOME"))
|
||||
logtalk_home = WshUserEnv.Item("LOGTALKHOME")
|
||||
else {
|
||||
WScript.Echo("Error! The environment variable LOGTALKHOME must be defined first!");
|
||||
usage_help();
|
||||
WScript.Quit(1);
|
||||
}
|
||||
|
||||
logtalk_home = logtalk_home.replace(/\\/g, "\\\\");
|
||||
|
||||
if (!FSObject.FolderExists(logtalk_home + "\\bin"))
|
||||
FSObject.CreateFolder(logtalk_home + "\\bin");
|
||||
|
||||
var f = FSObject.CreateTextFile(logtalk_home + "\\bin\\logtalk_sicstus.pl", true);
|
||||
|
||||
f.WriteLine(":- consult('$LOGTALKUSER/configs/sicstus.config').");
|
||||
f.WriteLine(":- consult('$LOGTALKHOME/compiler/logtalk.pl').");
|
||||
f.WriteLine(":- consult('$LOGTALKUSER/libpaths/libpaths.pl').");
|
||||
f.Close();
|
||||
|
||||
var ProgramsPath = WshShell.SpecialFolders("AllUsersPrograms");
|
||||
|
||||
if (!FSObject.FolderExists(ProgramsPath + "\\Logtalk"))
|
||||
FSObject.CreateFolder(ProgramsPath + "\\Logtalk");
|
||||
|
||||
var link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk - SICStus Prolog.lnk");
|
||||
link.Arguments = "-l %LOGTALKHOME%\\bin\\logtalk_sicstus.pl";
|
||||
link.Description = "Runs Logtalk with SICStus Prolog";
|
||||
link.IconLocation = "app.exe,1";
|
||||
link.TargetPath = prolog_path;
|
||||
link.WindowStyle = 1;
|
||||
link.WorkingDirectory = logtalk_home;
|
||||
link.Save();
|
||||
|
||||
WScript.Echo('Done. The "Logtalk - SICStus Prolog" shortcut was been added to');
|
||||
WScript.Echo('the Start Menu Programs. Make sure that the environment variables');
|
||||
WScript.Echo('LOGTALKHOME and LOGTALKUSER are defined for all users wishing');
|
||||
WScript.Echo('to use the shortcut.');
|
||||
WScript.Echo('');
|
||||
|
||||
WScript.Quit(0);
|
||||
|
||||
function usage_help() {
|
||||
WScript.Echo('');
|
||||
WScript.Echo('This script creates a shortcut named "Logtalk - SICStus Prolog" for');
|
||||
WScript.Echo('running Logtalk with SICStus Prolog. The script must be run by a user');
|
||||
WScript.Echo('with administrative rights. The LOGTALKHOME environment variable must');
|
||||
WScript.Echo('be defined before running this script.');
|
||||
WScript.Echo('');
|
||||
WScript.Echo('Usage:');
|
||||
WScript.Echo(' ' + WScript.ScriptName + ' help');
|
||||
WScript.Echo(' ' + WScript.ScriptName);
|
||||
WScript.Echo('');
|
||||
}
|
37
Logtalk/scripts/make_sicstuslgt.sh
Executable file
37
Logtalk/scripts/make_sicstuslgt.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#! /bin/sh
|
||||
|
||||
## =================================================================
|
||||
## Logtalk - Object oriented extension to Prolog
|
||||
## Release 2.24.0
|
||||
##
|
||||
## Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
## =================================================================
|
||||
|
||||
echo
|
||||
echo "Creating a script named sicstuslgt for running Logtalk with SICStus Prolog..."
|
||||
|
||||
if ! [ "$LOGTALKHOME" ]
|
||||
then
|
||||
echo "The environment variable LOGTALKHOME must be defined first!"
|
||||
else
|
||||
cd "$LOGTALKHOME"
|
||||
if [ -z "$1" ]; then
|
||||
prefix=/usr/local
|
||||
else
|
||||
prefix="$1"
|
||||
fi
|
||||
mkdir -p bin
|
||||
cd bin
|
||||
echo ":- compile('\$LOGTALKUSER/configs/sicstus.config')." > logtalk_sicstus.rc
|
||||
echo ":- compile('\$LOGTALKHOME/compiler/logtalk.pl')." >> logtalk_sicstus.rc
|
||||
echo ":- compile('\$LOGTALKUSER/libpaths/libpaths.pl')." >> logtalk_sicstus.rc
|
||||
|
||||
echo "#/bin/sh" > sicstuslgt
|
||||
echo "sicstus -l \$LOGTALKHOME/bin/logtalk_sicstus.rc" >> sicstuslgt
|
||||
chmod a+x sicstuslgt
|
||||
ln -sf $LOGTALKHOME/bin/sicstuslgt $prefix/bin/sicstuslgt
|
||||
echo "Done. A link to the script was been created in $prefix/bin."
|
||||
echo "Users should define the environment variables LOGTALKHOME and"
|
||||
echo "LOGTALKUSER in order to use the script."
|
||||
echo
|
||||
fi
|
95
Logtalk/scripts/make_swilgt.js
Normal file
95
Logtalk/scripts/make_swilgt.js
Normal file
@@ -0,0 +1,95 @@
|
||||
// =================================================================
|
||||
// Logtalk - Object oriented extension to Prolog
|
||||
// Release 2.24.0
|
||||
//
|
||||
// Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
// =================================================================
|
||||
|
||||
if (WScript.Arguments.Unnamed.Length > 0) {
|
||||
usage_help();
|
||||
WScript.Quit(0);
|
||||
}
|
||||
|
||||
WScript.Echo('');
|
||||
WScript.Echo('Creating a shortcut named "Logtalk - SWI-Prolog" for running Logtalk');
|
||||
WScript.Echo('with SWI-Prolog...');
|
||||
WScript.Echo('');
|
||||
|
||||
var WshShell = new ActiveXObject("WScript.Shell");
|
||||
|
||||
var prolog_path = WshShell.RegRead("HKLM\\Software\\SWI\\Prolog\\home") + "\\bin\\plwin.exe";
|
||||
|
||||
var FSObject = new ActiveXObject("Scripting.FileSystemObject");
|
||||
|
||||
if (!FSObject.FileExists(prolog_path)) {
|
||||
WScript.Echo("Error! Cannot find plwin.exe at the expected place!");
|
||||
WScript.Quit(1);
|
||||
}
|
||||
|
||||
var WshSystemEnv = WshShell.Environment("SYSTEM");
|
||||
var WshUserEnv = WshShell.Environment("USER");
|
||||
var logtalk_home;
|
||||
|
||||
if (WshSystemEnv.Item("LOGTALKHOME"))
|
||||
logtalk_home = WshSystemEnv.Item("LOGTALKHOME");
|
||||
else if (WshUserEnv.Item("LOGTALKHOME"))
|
||||
logtalk_home = WshUserEnv.Item("LOGTALKHOME")
|
||||
else {
|
||||
WScript.Echo("Error! The environment variable LOGTALKHOME must be defined first!");
|
||||
usage_help();
|
||||
WScript.Quit(1);
|
||||
}
|
||||
|
||||
logtalk_home = logtalk_home.replace(/\\/g, "\\\\");
|
||||
|
||||
if (!FSObject.FolderExists(logtalk_home + "\\bin"))
|
||||
FSObject.CreateFolder(logtalk_home + "\\bin");
|
||||
|
||||
var f = FSObject.CreateTextFile(logtalk_home + "\\bin\\logtalk_swi.pl", true);
|
||||
f.WriteLine(":- system_module.");
|
||||
f.Close();
|
||||
|
||||
WshShell.Run("cmd /c type " + logtalk_home + "\\compiler\\logtalk.pl" + " >> " + logtalk_home + "\\bin\\logtalk_swi.pl", true);
|
||||
|
||||
f = FSObject.CreateTextFile(logtalk_home + "\\bin\\logtalk_swi.rc", true);
|
||||
|
||||
f.WriteLine(":- consult('$LOGTALKUSER/configs/swihook.pl').");
|
||||
f.WriteLine(":- consult('$LOGTALKUSER/configs/swi.config').");
|
||||
f.WriteLine(":- consult('$LOGTALKHOME/bin/logtalk_swi.pl').");
|
||||
f.WriteLine(":- consult('$LOGTALKUSER/libpaths/libpaths.pl').");
|
||||
f.Close();
|
||||
|
||||
var ProgramsPath = WshShell.SpecialFolders("AllUsersPrograms");
|
||||
|
||||
if (!FSObject.FolderExists(ProgramsPath + "\\Logtalk"))
|
||||
FSObject.CreateFolder(ProgramsPath + "\\Logtalk");
|
||||
|
||||
var link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk - SWI-Prolog.lnk");
|
||||
link.Arguments = "-f %LOGTALKHOME%\\bin\\logtalk_swi.rc";
|
||||
link.Description = "Runs Logtalk with SWI-Prolog";
|
||||
link.IconLocation = "app.exe,1";
|
||||
link.TargetPath = prolog_path;
|
||||
link.WindowStyle = 1;
|
||||
link.WorkingDirectory = logtalk_home;
|
||||
link.Save();
|
||||
|
||||
WScript.Echo('Done. The "Logtalk - SWI-Prolog" shortcut was been added to the');
|
||||
WScript.Echo('Start Menu Programs. Make sure that the environment variables');
|
||||
WScript.Echo('LOGTALKHOME and LOGTALKUSER are defined for all users wishing');
|
||||
WScript.Echo('to use the shortcut.');
|
||||
WScript.Echo('');
|
||||
|
||||
WScript.Quit(0);
|
||||
|
||||
function usage_help() {
|
||||
WScript.Echo('');
|
||||
WScript.Echo('This script creates a shortcut named "Logtalk - SWI-Prolog" for');
|
||||
WScript.Echo('running Logtalk with SWI-Prolog. The script must be run by a user');
|
||||
WScript.Echo('with administrative rights. The LOGTALKHOME environment variable');
|
||||
WScript.Echo('must be defined before running this script.');
|
||||
WScript.Echo('');
|
||||
WScript.Echo('Usage:');
|
||||
WScript.Echo(' ' + WScript.ScriptName + ' help');
|
||||
WScript.Echo(' ' + WScript.ScriptName);
|
||||
WScript.Echo('');
|
||||
}
|
39
Logtalk/scripts/make_swilgt.sh
Executable file
39
Logtalk/scripts/make_swilgt.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#! /bin/sh
|
||||
|
||||
## =================================================================
|
||||
## Logtalk - Object oriented extension to Prolog
|
||||
## Release 2.24.0
|
||||
##
|
||||
## Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
## =================================================================
|
||||
|
||||
echo
|
||||
echo "Creating a script named swilgt for running Logtalk with SWI-Prolog..."
|
||||
|
||||
if ! [ "$LOGTALKHOME" ]
|
||||
then
|
||||
echo "The environment variable LOGTALKHOME must be defined first!"
|
||||
else
|
||||
cd "$LOGTALKHOME"
|
||||
if [ -z "$1" ]; then
|
||||
prefix=/usr/local
|
||||
else
|
||||
prefix="$1"
|
||||
fi
|
||||
mkdir -p bin
|
||||
cd bin
|
||||
echo ":- system_module." > logtalk_swi.pl
|
||||
cat ../compiler/logtalk.pl >> logtalk_swi.pl
|
||||
echo ":- consult('\$LOGTALKUSER/configs/swi.config')." > logtalk_swi.rc
|
||||
echo ":- consult('\$LOGTALKUSER/configs/swihook.pl')." >> logtalk_swi.rc
|
||||
echo ":- consult('\$LOGTALKHOME/bin/logtalk_swi.pl')." >> logtalk_swi.rc
|
||||
echo ":- consult('\$LOGTALKUSER/libpaths/libpaths.pl')." >> logtalk_swi.rc
|
||||
echo "#/bin/sh" > swilgt
|
||||
echo "swipl -f \$LOGTALKHOME/bin/logtalk_swi.rc" >> swilgt
|
||||
chmod a+x swilgt
|
||||
ln -sf $LOGTALKHOME/bin/swilgt $prefix/bin/swilgt
|
||||
echo "Done. A link to the script was been created in $prefix/bin."
|
||||
echo "Users should define the environment variables LOGTALKHOME and"
|
||||
echo "LOGTALKUSER in order to use the script."
|
||||
echo
|
||||
fi
|
47
Logtalk/scripts/make_xsblgt.sh
Executable file
47
Logtalk/scripts/make_xsblgt.sh
Executable file
@@ -0,0 +1,47 @@
|
||||
#! /bin/sh
|
||||
|
||||
## =================================================================
|
||||
## Logtalk - Object oriented extension to Prolog
|
||||
## Release 2.24.0
|
||||
##
|
||||
## Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
## =================================================================
|
||||
|
||||
echo
|
||||
echo "Creating a script named xsblgt for running Logtalk with XSB..."
|
||||
|
||||
if ! [ "$LOGTALKHOME" ]
|
||||
then
|
||||
echo "The environment variable LOGTALKHOME must be defined first!"
|
||||
else
|
||||
cd "$LOGTALKHOME"
|
||||
if [ -z "$1" ]; then
|
||||
prefix=/usr/local
|
||||
else
|
||||
prefix="$1"
|
||||
fi
|
||||
mkdir -p bin
|
||||
cd bin
|
||||
cp ../compiler/logtalk.pl logtalk.P
|
||||
sed 's/^..lgt_current_object_.[(]user.*[)]/:- assertz(&)/' logtalk.P > temp1
|
||||
sed 's/^..lgt_current_object_.[(]debugger.*[)]/:- assertz(&)/' temp1 > temp2
|
||||
sed 's/^..lgt_dbg_leashing_.[(].*[)]/:- assertz(&)/g' temp2 > logtalk.P
|
||||
rm temp1
|
||||
rm temp2
|
||||
echo ":- reconsult('$LOGTALKUSER/configs/xsb.P')." > logtalkxsb.P
|
||||
echo ":- reconsult('$LOGTALKHOME/bin/logtalk.P')." >> logtalkxsb.P
|
||||
echo ":- reconsult('$LOGTALKUSER/libpaths/libpaths.P')." >> logtalkxsb.P
|
||||
echo "#/bin/sh" > xsblgt
|
||||
echo "xsb -e \"reconsult('\$LOGTALKHOME/bin/logtalkxsb.P').\"" >> xsblgt
|
||||
chmod a+x xsblgt
|
||||
ln -sf $LOGTALKHOME/bin/xsblgt $prefix/bin/xsblgt
|
||||
echo "Done. A link to the script was been created in $prefix/bin."
|
||||
echo "Users should define the environment variables LOGTALKHOME and"
|
||||
echo "LOGTALKUSER in order to use the script."
|
||||
echo
|
||||
echo "Users must change the extension of files \$LOGTALKUSER/configs/xsb.config"
|
||||
echo "and \$LOGTALKUSER/libpaths/libpaths.pl to '.P' before using the xsblgt"
|
||||
echo "script. In addition, users must edit the libpaths.P file to replace all"
|
||||
echo "occurrences of the LOGTALKUSER environment variable by its value."
|
||||
echo
|
||||
fi
|
87
Logtalk/scripts/make_yaplgt.js
Normal file
87
Logtalk/scripts/make_yaplgt.js
Normal file
@@ -0,0 +1,87 @@
|
||||
// =================================================================
|
||||
// Logtalk - Object oriented extension to Prolog
|
||||
// Release 2.24.0
|
||||
//
|
||||
// Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
// =================================================================
|
||||
|
||||
var prolog_path = "C:\\Program Files\\Yap\\bin\\yap.exe";
|
||||
|
||||
if (WScript.Arguments.Unnamed.Length > 0) {
|
||||
usage_help();
|
||||
WScript.Quit(0);
|
||||
}
|
||||
|
||||
WScript.Echo('');
|
||||
WScript.Echo('Creating a shortcut named "Logtalk - YAP" for running Logtalk');
|
||||
WScript.Echo('with YAP...');
|
||||
WScript.Echo('');
|
||||
|
||||
var FSObject = new ActiveXObject("Scripting.FileSystemObject");
|
||||
|
||||
if (!FSObject.FileExists(prolog_path)) {
|
||||
WScript.Echo("Error! Cannot find yap.exe at the expected place!");
|
||||
WScript.Quit(1);
|
||||
}
|
||||
|
||||
var WshShell = new ActiveXObject("WScript.Shell");
|
||||
|
||||
var WshSystemEnv = WshShell.Environment("SYSTEM");
|
||||
var WshUserEnv = WshShell.Environment("USER");
|
||||
var logtalk_home;
|
||||
|
||||
if (WshSystemEnv.Item("LOGTALKHOME"))
|
||||
logtalk_home = WshSystemEnv.Item("LOGTALKHOME");
|
||||
else if (WshUserEnv.Item("LOGTALKHOME"))
|
||||
logtalk_home = WshUserEnv.Item("LOGTALKHOME")
|
||||
else {
|
||||
WScript.Echo("Error! The environment variable LOGTALKHOME must be defined first!");
|
||||
usage_help();
|
||||
WScript.Quit(1);
|
||||
}
|
||||
|
||||
logtalk_home = logtalk_home.replace(/\\/g, "\\\\");
|
||||
|
||||
if (!FSObject.FolderExists(logtalk_home + "\\bin"))
|
||||
FSObject.CreateFolder(logtalk_home + "\\bin");
|
||||
|
||||
var f = FSObject.CreateTextFile(logtalk_home + "\\bin\\logtalk_yap.pl", true);
|
||||
|
||||
f.WriteLine(":- reconsult('$LOGTALKUSER\\\\configs\\\\yap.config').");
|
||||
f.WriteLine(":- reconsult('$LOGTALKHOME\\\\compiler\\\\logtalk.pl').");
|
||||
f.WriteLine(":- reconsult('$LOGTALKUSER\\\\libpaths\\\\libpaths.pl').");
|
||||
f.Close();
|
||||
|
||||
var ProgramsPath = WshShell.SpecialFolders("AllUsersPrograms");
|
||||
|
||||
if (!FSObject.FolderExists(ProgramsPath + "\\Logtalk"))
|
||||
FSObject.CreateFolder(ProgramsPath + "\\Logtalk");
|
||||
|
||||
var link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk - YAP.lnk");
|
||||
link.Arguments = "-l %LOGTALKHOME%\\bin\\logtalk_yap.pl";
|
||||
link.Description = "Runs Logtalk with YAP";
|
||||
link.IconLocation = "app.exe,1";
|
||||
link.TargetPath = prolog_path;
|
||||
link.WindowStyle = 1;
|
||||
link.WorkingDirectory = logtalk_home;
|
||||
link.Save();
|
||||
|
||||
WScript.Echo('Done. The "Logtalk - YAP" shortcut was been added to the Start Menu');
|
||||
WScript.Echo('Programs. Make sure that the environment variables LOGTALKHOME and');
|
||||
WScript.Echo('LOGTALKUSER are defined for all users wishing to use the shortcut.');
|
||||
WScript.Echo('');
|
||||
|
||||
WScript.Quit(0);
|
||||
|
||||
function usage_help() {
|
||||
WScript.Echo('');
|
||||
WScript.Echo('This script creates a shortcut named "Logtalk - YAP" for running Logtalk');
|
||||
WScript.Echo('with YAP. The script must be run by a user with administrative rights.');
|
||||
WScript.Echo('The LOGTALKHOME environment variable must be defined before running this');
|
||||
WScript.Echo('script.');
|
||||
WScript.Echo('');
|
||||
WScript.Echo('Usage:');
|
||||
WScript.Echo(' ' + WScript.ScriptName + ' help');
|
||||
WScript.Echo(' ' + WScript.ScriptName);
|
||||
WScript.Echo('');
|
||||
}
|
37
Logtalk/scripts/make_yaplgt.sh
Executable file
37
Logtalk/scripts/make_yaplgt.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#! /bin/sh
|
||||
|
||||
## =================================================================
|
||||
## Logtalk - Object oriented extension to Prolog
|
||||
## Release 2.24.0
|
||||
##
|
||||
## Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
## =================================================================
|
||||
|
||||
echo
|
||||
echo "Creating a script named yaplgt for running Logtalk with YAP..."
|
||||
|
||||
if ! [ "$LOGTALKHOME" ]
|
||||
then
|
||||
echo "The environment variable LOGTALKHOME must be defined first!"
|
||||
else
|
||||
cd "$LOGTALKHOME"
|
||||
if [ -z "$1" ]; then
|
||||
prefix=/usr/local
|
||||
else
|
||||
prefix="$1"
|
||||
fi
|
||||
mkdir -p bin
|
||||
cd bin
|
||||
echo ":- reconsult('\$LOGTALKUSER/configs/yap.config')." > logtalk_yap.rc
|
||||
echo ":- reconsult('\$LOGTALKHOME/compiler/logtalk.pl')." >> logtalk_yap.rc
|
||||
echo ":- reconsult('\$LOGTALKUSER/libpaths/libpaths.pl')." >> logtalk_yap.rc
|
||||
|
||||
echo "#/bin/sh" > yaplgt
|
||||
echo "yap -l \$LOGTALKHOME/bin/logtalk_yap.rc" >> yaplgt
|
||||
chmod a+x yaplgt
|
||||
ln -sf $LOGTALKHOME/bin/yaplgt $prefix/bin/yaplgt
|
||||
echo "Done. A link to the script was been created in $prefix/bin."
|
||||
echo "Users should define the environment variables LOGTALKHOME and"
|
||||
echo "LOGTALKUSER in order to use the script."
|
||||
echo
|
||||
fi
|
Reference in New Issue
Block a user