The R Project SVN R

Rev

Rev 58676 | Rev 63539 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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