root/trunk/integration/eclipselgt.sh

Revision 4581, 2.9 KB (checked in by pmoura, 2 weeks ago)

Added a "prolog" read-only compiler flag whose value is the name of the back-end Prolog compiler (an atom). This flag can be used for conditional compilation of Prolog specific code.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1#/bin/bash
2
3## ================================================================
4## Logtalk - Open source object-oriented logic programming language
5## Release 2.33.3
6##
7## Copyright (c) 1998-2008 Paulo Moura.        All Rights Reserved.
8## Logtalk is free software.  You can redistribute it and/or modify
9## it under the terms of the "Artistic License 2.0" as published by
10## The Perl Foundation. Consult the "LICENSE.txt" file for details.
11## ================================================================
12
13## As silly as it seems, there is no reliable solution to put the following
14## checks in their own file that would be source'd within each individual 
15## integration script!!!
16
17if ! [ "$LOGTALKHOME" ]; then
18    echo "The environment variable LOGTALKHOME should be defined first, pointing"
19    echo "to your Logtalk installation directory!"
20    echo "Trying the default locations for the Logtalk installation..."
21    if [ -d "/usr/local/share/logtalk" ]; then
22        LOGTALKHOME=/usr/local/share/logtalk
23        echo "... using Logtalk installation found at /usr/local/share/logtalk"
24    elif [ -d "/usr/share/logtalk" ]; then
25        LOGTALKHOME=/usr/share/logtalk
26        echo "... using Logtalk installation found at /usr/share/logtalk"
27    elif [ -d "/opt/local/share/logtalk" ]; then
28        LOGTALKHOME=/opt/local/share/logtalk
29        echo "... using Logtalk installation found at /opt/local/share/logtalk"
30    elif [ -d "/opt/share/logtalk" ]; then
31        LOGTALKHOME=/opt/share/logtalk
32        echo "... using Logtalk installation found at /opt/share/logtalk"
33    else
34        echo "... unable to locate Logtalk installation directory!"
35        echo
36        exit 1
37    fi
38    echo
39elif ! [ -d "$LOGTALKHOME" ]; then
40    echo "The environment variable LOGTALKHOME points to a non-existing directory!"
41    echo "Its current value is: $LOGTALKHOME"
42    echo "The variable must be set to your Logtalk installation directory!"
43    echo
44    exit 1
45fi
46export LOGTALKHOME
47
48if ! [ "$LOGTALKUSER" ]; then
49    echo "The environment variable LOGTALKUSER should be defined first, pointing"
50    echo "to your Logtalk user directory!"
51    echo "Trying the default location for the Logtalk user directory..."
52    echo
53    export LOGTALKUSER=$HOME/logtalk
54fi
55
56if [ -d "$LOGTALKUSER" ]; then
57    if ! [ -a "$LOGTALKUSER/VERSION.txt" ]; then
58        echo "Logtalk user directory at $LOGTALKUSER is outdated!"
59        echo "Creating an up-to-date Logtalk user directory..."
60        cplgtdirs
61    else
62        current=`cat $LOGTALKUSER/VERSION.txt | sed 's/\.//g'`
63        if [ $current -lt 2333 ]; then
64            echo "Logtalk user directory at $LOGTALKUSER is outdated!"
65            echo "Creating an up-to-date Logtalk user directory..."
66            cplgtdirs
67        fi
68    fi
69else
70    echo "Cannot find \$LOGTALKUSER directory! Creating a new Logtalk user directory"
71    echo "by running the \"cplgtdirs\" shell script:"
72    cplgtdirs
73fi
74echo
75
76if eclipse -e "get_flag(version, Version), write(Version), halt." 2>&1 | grep "5.10" 2>&1 >/dev/null; then
77    exec eclipse -b "$LOGTALKHOME/integration/logtalk_eclipse5.pl" "$@"
78else
79    exec eclipse -b "$LOGTALKHOME/integration/logtalk_eclipse6.pl" "$@"
80fi
Note: See TracBrowser for help on using the browser.