The R Project SVN R

Rev

Rev 11204 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11204 Rev 11515
Line 1... Line 1...
1
#!/bin/sh
1
#! /bin/sh
2
#
2
##
3
# ${R_HOME}/bin/LINK
3
## ${R_HOME}/bin/LINK
-
 
4
 
-
 
5
revision='$Revision: 1.5 $'
-
 
6
version=`set - ${revision}; echo ${2}`
-
 
7
version="R linker front end ${version}
-
 
8
 
-
 
9
Copyright (C) 2000 The R Core Development Team.
-
 
10
This is free software; see the GNU General Public Licence version 2
-
 
11
or later for copying conditions.  There is NO warranty."
-
 
12
 
-
 
13
usage="Usage: R CMD LINK [options] linkcmd
-
 
14
 
-
 
15
Perform the specified linkcmd by passing it through GNU libtool and
-
 
16
setting a few useful R-related options.  Use in particular when creating
-
 
17
executables linked against the R shared library, in which case linkcmd
-
 
18
must contain \`-lR' but need not specify its library path.
-
 
19
 
-
 
20
Options:
-
 
21
  -h, --help            print short help message and exit
-
 
22
  -v, --version         print version info and exit
-
 
23
 
-
 
24
Currently only is useful when creating executables, and only works if
-
 
25
the C compiler is used for linking.  If FORTRAN code is to be linked, it
-
 
26
needs to be manually ensured that the linker flags for the FORTRAN 77
-
 
27
intrinsic and run-time libraries are present.  C++ is not supported
-
 
28
(yet).
-
 
29
 
-
 
30
Report bugs to <r-bugs@r-project.org>."
-
 
31
 
-
 
32
args=
-
 
33
while test -n "${1}"; do
-
 
34
  case ${1} in
-
 
35
    -h|--help)
-
 
36
      echo "${usage}"; exit 0 ;;
-
 
37
    -v|--version)
-
 
38
      echo "${version}"; exit 0 ;;
-
 
39
    *)
-
 
40
      args="${args} ${1}" ;;
-
 
41
  esac
-
 
42
  shift
-
 
43
done
4
 
44
 
5
if test -z "${R_HOME}"; then
45
if test -z "${R_HOME}"; then
6
  echo "Fatal error: R_HOME was not set"
46
  echo "Fatal error: R_HOME was not set"
7
  exit 1
47
  exit 1
8
fi
48
fi
9
 
49
 
-
 
50
## FIXME: should be `lib' eventually
10
Rexeclibdir=${R_HOME}/bin
51
Rexeclibdir=${R_HOME}/bin
-
 
52
## </FIXME>
11
linkopts="-avoid-version -rpath ${Rexeclibdir}"
53
linkopts="-avoid-version -rpath ${Rexeclibdir}"
12
 
54
 
13
exec ${R_HOME}/bin/libtool --mode=link ${*} ${linkopts}
55
exec ${R_HOME}/bin/libtool --mode=link ${args} ${linkopts}
14
 
56
 
15
### Local Variables: ***
57
### Local Variables: ***
16
### mode: sh ***
58
### mode: sh ***
17
### sh-indentation: 2 ***
59
### sh-indentation: 2 ***
18
### End: ***
60
### End: ***