The R Project SVN R

Rev

Rev 46881 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 46881 Rev 46994
Line 20... Line 20...
20
## General Public License for more details.
20
## General Public License for more details.
21
##
21
##
22
## A copy of the GNU General Public License is available at
22
## A copy of the GNU General Public License is available at
23
## http://www.r-project.org/Licenses/
23
## http://www.r-project.org/Licenses/
24
 
24
 
25
revision='$Revision: 46881 $'
25
revision='$Revision: 46994 $'
26
version=`set - ${revision}; echo ${2}`
26
version=`set - ${revision}; echo ${2}`
27
version="R configuration information retrieval script ${version}
27
version="R configuration information retrieval script ${version}
28
 
28
 
29
Copyright (C) 2002-6 The R Core Development Team.
29
Copyright (C) 2002-6 The R Core Development Team.
30
This is free software; see the GNU General Public License version 2
30
This is free software; see the GNU General Public License version 2
Line 38... Line 38...
38
 
38
 
39
Options:
39
Options:
40
  -h, --help            print short help message and exit
40
  -h, --help            print short help message and exit
41
  -v, --version         print 'config' version info and exit
41
  -v, --version         print 'config' version info and exit
42
      --cppflags        print pre-processor flags required to compile
42
      --cppflags        print pre-processor flags required to compile
43
                        a program using R as a library
43
			a program using R as a library
44
      --ldflags         print linker flags needed for linking against
44
      --ldflags         print linker flags needed for linking against
45
                        the R library
45
			the R library
46
 
46
 
47
Variables:
47
Variables:
48
  BLAS_LIBS     flags needed for linking against external BLAS libraries 
48
  BLAS_LIBS     flags needed for linking against external BLAS libraries
49
  CC            C compiler command
49
  CC            C compiler command
50
  CFLAGS        C compiler flags
50
  CFLAGS        C compiler flags
51
  CPICFLAGS     special flags for compiling C code to be turned into a
51
  CPICFLAGS     special flags for compiling C code to be turned into a
52
                shared library 
52
		shared library
53
  CPP           C preprocessor
53
  CPP           C preprocessor
54
  CPPFLAGS      C/C++ preprocessor flags, e.g. -I<dir> if you have
54
  CPPFLAGS      C/C++ preprocessor flags, e.g. -I<dir> if you have
55
                headers in a nonstandard directory <dir> 
55
		headers in a nonstandard directory <dir>
56
  CXX           C++ compiler command
56
  CXX           C++ compiler command
57
  CXXCPP        C++ preprocessor
57
  CXXCPP        C++ preprocessor
58
  CXXFLAGS      C++ compiler flags
58
  CXXFLAGS      C++ compiler flags
59
  CXXPICFLAGS   special flags for compiling C++ code to be turned into a
59
  CXXPICFLAGS   special flags for compiling C++ code to be turned into a
60
                shared library
60
		shared library
61
  DYLIB_LD      command for linking dynamic libraries which contain
61
  DYLIB_LD      command for linking dynamic libraries which contain
62
                object files from a C or Fortran compiler only
62
		object files from a C or Fortran compiler only
63
  DYLIB_LDFLAGS
63
  DYLIB_LDFLAGS
64
                special flags used by DYLIB_LD
64
		special flags used by DYLIB_LD
65
  F77           Fortran 77 compiler command
65
  F77           Fortran 77 compiler command
66
  FFLAGS        Fortran 77 compiler flags
66
  FFLAGS        Fortran 77 compiler flags
67
  FLIBS         linker flags needed to link Fortran code
67
  FLIBS         linker flags needed to link Fortran code
68
  FPICFLAGS     special flags for compiling Fortran code to be turned
68
  FPICFLAGS     special flags for compiling Fortran code to be turned
69
                into a shared library 
69
		into a shared library
70
  FC            Fortran 9x compiler command
70
  FC            Fortran 9x compiler command
71
  FCFLAGS       Fortran 9x compiler flags
71
  FCFLAGS       Fortran 9x compiler flags
72
  FCPICFLAGS    special flags for compiling Fortran 9x code to be turned
72
  FCPICFLAGS    special flags for compiling Fortran 9x code to be turned
73
                into a shared library 
73
		into a shared library
74
  JAR           Java archive tool command
74
  JAR           Java archive tool command
75
  JAVA          Java interpreter command
75
  JAVA          Java interpreter command
76
  JAVAC         Java compiler command
76
  JAVAC         Java compiler command
77
  JAVAH         Java header and stub generator command
77
  JAVAH         Java header and stub generator command
78
  JAVA_HOME     path to the home of Java distribution
78
  JAVA_HOME     path to the home of Java distribution
79
  JAVA_LIBS     flags needed for linking against Java libraries
79
  JAVA_LIBS     flags needed for linking against Java libraries
80
  JAVA_CPPFLAGS C preprocessor flags needed for compiling JNI programs
80
  JAVA_CPPFLAGS C preprocessor flags needed for compiling JNI programs
81
  LAPACK_LIBS   flags needed for linking against external LAPACK libraries
81
  LAPACK_LIBS   flags needed for linking against external LAPACK libraries
82
  LIBnn         location for libraries, e.g. 'lib' or 'lib64' on this platform
82
  LIBnn         location for libraries, e.g. 'lib' or 'lib64' on this platform
83
  LDFLAGS       linker flags, e.g. -L<dir> if you have libraries in a
83
  LDFLAGS       linker flags, e.g. -L<dir> if you have libraries in a
84
                nonstandard directory <dir> 
84
		nonstandard directory <dir>
85
  OBJC          Objective C compiler command
85
  OBJC          Objective C compiler command
86
  OBJCFLAGS     Objective C compiler flags
86
  OBJCFLAGS     Objective C compiler flags
87
  MAKE          Make command
87
  MAKE          Make command
88
  SAFE_FFLAGS   Safe (as conformant as possible) Fortran 77 compiler flags
88
  SAFE_FFLAGS   Safe (as conformant as possible) Fortran 77 compiler flags
89
  SHLIB_CFLAGS  additional CFLAGS used when building shared libraries
89
  SHLIB_CFLAGS  additional CFLAGS used when building shared libraries
90
  SHLIB_CXXLD   command for linking shared libraries which contain
90
  SHLIB_CXXLD   command for linking shared libraries which contain
91
                object files from a C++ compiler 
91
		object files from a C++ compiler
92
  SHLIB_CXXLDFLAGS
92
  SHLIB_CXXLDFLAGS
93
                special flags used by SHLIB_CXXLD
93
		special flags used by SHLIB_CXXLD
94
  SHLIB_FFLAGS  additional FFLAGS used when building shared libraries 
94
  SHLIB_FFLAGS  additional FFLAGS used when building shared libraries
95
  SHLIB_LD      command for linking shared libraries which contain
95
  SHLIB_LD      command for linking shared libraries which contain
96
                object files from a C or Fortran compiler only 
96
		object files from a C or Fortran compiler only
97
  SHLIB_LDFLAGS
97
  SHLIB_LDFLAGS
98
                special flags used by SHLIB_LD
98
		special flags used by SHLIB_LD
99
  SHLIB_FCLD, SHLIB_FCLDFLAGS
99
  SHLIB_FCLD, SHLIB_FCLDFLAGS
100
                ditto when using Fortran 9x
100
		ditto when using Fortran 9x
101
  TCLTK_CPPFLAGS
101
  TCLTK_CPPFLAGS
102
                flags needed for finding the tcl.h and tk.h headers
102
		flags needed for finding the tcl.h and tk.h headers
103
  TCLTK_LIBS    flags needed for linking against the Tcl and Tk libraries
103
  TCLTK_LIBS    flags needed for linking against the Tcl and Tk libraries
104
 
104
 
105
Report bugs to <r-bugs@r-project.org>."
105
Report bugs to <r-bugs@r-project.org>."
106
 
106
 
107
## <NOTE>
107
## <NOTE>
Line 155... Line 155...
155
      echo "${usage}"; exit 0 ;;
155
      echo "${usage}"; exit 0 ;;
156
    -v|--version)
156
    -v|--version)
157
      echo "${version}"; exit 0 ;;
157
      echo "${version}"; exit 0 ;;
158
    --cppflags)
158
    --cppflags)
159
      if test -z "${LIBR}"; then
159
      if test -z "${LIBR}"; then
160
        if test -z "${STATIC_LIBR}"; then
160
	if test -z "${STATIC_LIBR}"; then
161
          echo "R was not built as a library" >&2
161
	  echo "R was not built as a library" >&2
162
	else
162
	else
163
          echo "${includes}"
163
	  echo "${includes}"
164
        fi
164
	fi
165
      else
165
      else
166
        echo "${includes}"
166
	echo "${includes}"
167
      fi
167
      fi
168
      exit 0
168
      exit 0
169
      ;;
169
      ;;
170
    --ldflags)
170
    --ldflags)
171
      if test -z "${LIBR}"; then
171
      if test -z "${LIBR}"; then
172
        if test -z "${STATIC_LIBR}"; then
172
	if test -z "${STATIC_LIBR}"; then
173
          echo "R was not built as a library" >&2
173
	  echo "R was not built as a library" >&2
174
	else
174
	else
175
          echo "${STATIC_LIBR}"
175
	  echo "${STATIC_LIBR}"
176
        fi
176
	fi
177
      else
177
      else
178
        echo "${LIBR}"
178
	echo "${LIBR}"
179
      fi
179
      fi
180
      exit 0
180
      exit 0
181
      ;;
181
      ;;
182
    *)
182
    *)
183
      if test -z "${var}"; then
183
      if test -z "${var}"; then
184
        var="${1}"
184
	var="${1}"
185
      else
185
      else
186
        echo "ERROR: cannot query more than one variable" >&2
186
	echo "ERROR: cannot query more than one variable" >&2
187
        exit 1
187
	exit 1
188
      fi
188
      fi
189
      ;;
189
      ;;
190
  esac
190
  esac
191
  shift
191
  shift
192
done
192
done
Line 204... Line 204...
204
 
204
 
205
## Can we do this elegantly using case?
205
## Can we do this elegantly using case?
206
 
206
 
207
var_ok=no
207
var_ok=no
208
for v in ${ok_c_vars} ${ok_cxx_vars} ${ok_dylib_vars} ${ok_f77_vars} \
208
for v in ${ok_c_vars} ${ok_cxx_vars} ${ok_dylib_vars} ${ok_f77_vars} \
209
         ${ok_objc_vars} ${ok_java_vars} \
209
	 ${ok_objc_vars} ${ok_java_vars} \
210
         ${ok_ld_vars} ${ok_shlib_vars} ${ok_tcltk_vars} \
210
	 ${ok_ld_vars} ${ok_shlib_vars} ${ok_tcltk_vars} \
211
	 ${ok_other_vars}; do
211
	 ${ok_other_vars}; do
212
  if test "${var}" = "${v}"; then
212
  if test "${var}" = "${v}"; then
213
    var_ok=yes
213
    var_ok=yes
214
    break
214
    break
215
  fi
215
  fi