File: swipl.sh.in

package info (click to toggle)
swi-prolog 6.6.6-1~bpo70+1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 82,312 kB
  • sloc: ansic: 322,250; perl: 245,822; sh: 6,651; java: 5,254; makefile: 4,423; cpp: 4,153; ruby: 1,594; yacc: 843; xml: 82; sed: 12; sql: 6
file content (45 lines) | stat: -rw-r--r-- 1,347 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh

# This script is used to start Prolog in the development environment
# when its shared libraries are not yet installed
#
# Typically, this must be done  using   LD_LIBRARY_PATH  on ELF systems.
# Unfortunately, we use rpath=<path> to find libswipl.so, which sets the
# ELF-symbol DT_RPATH, which overrules LD_LIBRARY_PATH.  What we want is
# DT_RUNPATH, which is behind LD_LIBRARY_PATH  in the search-order. This
# however cannot be set  directly  on   some  systems.  Therefore, where
# available, we use chrpath -c in the  Makefile to convert DT_RPATH into
# DT_RUNPATH. If this process fails,  you   may  have problems upgrading
# SWI-Prolog from source because the version-being-built uses the shared
# object from the installed version. If  the installed version is broken
# or incompatible, your build will  fail.   There  are  two ways around:
# install chrpath (if available) or remove   the installed system before
# rebuilding.

bdir=@abs_top_builddir@
lib=$bdir/../lib/@PLARCH@
libso=$lib/libswipl.@SO_EXT@
sep=":"

if [ "@WINEPATHEXE@" != ":" ]; then
  lib="$(@WINEPATHEXE@ -w $lib)"
  sep=";"
fi

if [ "x$@DLLIBVAR@" = "x" ]; then
  @DLLIBVAR@="$lib"
else
  @DLLIBVAR@="$lib$sep$@DLLIBVAR@"
fi

export @DLLIBVAR@

case "$1" in
  -C) cd "$2"
      shift
      shift
      ;;
   *) ;;
esac

$bdir/@PL@@EXEEXT@ "$@" || exit 1