Browse files

more cleaning up of FLIBS

git-svn-id: https://svn.r-project.org/R/trunk@31975 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information...
1 parent 060c6fe commit d7c77fdccd29446d183410041badafeb65b0fe82 ripley committed Nov 19, 2004
Showing with 571 additions and 5 deletions.
  1. +1 −0 Makefile.in
  2. +4 −1 NEWS
  3. +335 −1 configure
  4. +1 −0 m4/Makefile.in
  5. +11 −3 m4/R.m4
  6. +219 −0 m4/clibs.m4
View
1 Makefile.in
@@ -31,6 +31,7 @@ Makeconf: $(srcdir)/Makeconf.in $(top_builddir)/config.status
ACLOCAL_M4 = aclocal.m4
ACINCLUDE_DEPENDENCIES = \
m4/R.m4 \
+ m4/clibs.m4 \
m4/codeset.m4 \
m4/libtool.m4
CONFIGURE_DEPENDENCIES = $(srcdir)/VERSION
View
5 NEWS
@@ -141,7 +141,10 @@ INSTALLATION CHANGES
o Configuring without having the recommended packages is now an
error unless --with-recommended-packages=no is used.
- o Configure tries harder to find a minimal set of FLIBS.
+ o Configure tries harder to find a minimal set of FLIBS. Under
+ some circumstances this may remove from R_LD_LIBRARY_PATH
+ path elements that ought to have specified in LDFLAGS (but
+ were not).
BUG FIXES
View
336 configure
@@ -25738,6 +25738,337 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -z "${MAIN_LD}" ; then
+ LIBS=
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to get verbose linking output from ${CC}" >&5
+echo $ECHO_N "checking how to get verbose linking output from ${CC}... $ECHO_C" >&6
+if test "${r_cv_prog_c_v+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ r_cv_prog_c_v=
+# Try some options frequently used verbose output
+for r_verb in -v -verbose --verbose -V -\#\#\#; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+
+# Compile and link our simple test program by passing a flag (argument
+# 1 to this macro) to the Fortran compiler in order to get
+# "verbose" output that we can then parse for the Fortran linker
+# flags.
+r_save_CFLAGS=$CFLAGS
+CFLAGS="$CFLAGS $r_verb"
+(eval echo $as_me:25815: \"$ac_link\") >&5
+r_c_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
+echo "$r_c_v_output" >&5
+CFLAGS=$r_save_CFLAGS
+
+rm -f conftest*
+
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
+r_c_v_output="`echo $r_c_v_output |
+ grep 'LPATH is:' |
+ sed 's,.*LPATH is\(: *[^ ]*\).*,\1,;s,: */, -L/,g'` $r_c_v_output"
+
+case $r_c_v_output in
+ # If we are using xlc then replace all the commas with spaces.
+ *xlcentry*)
+ r_c_v_output=`echo $r_c_v_output | sed 's/,/ /g'` ;;
+
+ # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
+ # $LIBS confuse us, and the libraries appear later in the output anyway).
+ *mGLOB_options_string*)
+ r_c_v_output=`echo $r_c_v_output | sed 's/\"-mGLOB[^\"]*\"/ /g'` ;;
+esac
+
+
+ # look for -l* and *.a constructs in the output
+ for r_arg in $r_c_v_output; do
+ case $r_arg in
+ [\\/]*.a | ?:[\\/]*.a | -[lLRu]*)
+ r_cv_prog_c_v=$r_verb
+ break 2 ;;
+ esac
+ done
+done
+if test -z "$r_cv_prog_c_v"; then
+ { echo "$as_me:$LINENO: WARNING: cannot determine how to obtain linking information from ${CC}" >&5
+echo "$as_me: WARNING: cannot determine how to obtain linking information from ${CC}" >&2;}
+fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ echo "$as_me:$LINENO: WARNING: compilation failed" >&5
+echo "$as_me: WARNING: compilation failed" >&2;}
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $r_cv_prog_c_v" >&5
+echo "${ECHO_T}$r_cv_prog_c_v" >&6
+echo "$as_me:$LINENO: checking for C libraries of ${CC}" >&5
+echo $ECHO_N "checking for C libraries of ${CC}... $ECHO_C" >&6
+if test "${r_cv_c_libs+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "x$CLIBS" != "x"; then
+ r_cv_c_libs="$CLIBS" # Let the user override the test.
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+
+# Compile and link our simple test program by passing a flag (argument
+# 1 to this macro) to the Fortran compiler in order to get
+# "verbose" output that we can then parse for the Fortran linker
+# flags.
+r_save_CFLAGS=$CFLAGS
+CFLAGS="$CFLAGS $r_cv_prog_c_v"
+(eval echo $as_me:25897: \"$ac_link\") >&5
+r_c_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
+echo "$r_c_v_output" >&5
+CFLAGS=$r_save_CFLAGS
+
+rm -f conftest*
+
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
+r_c_v_output="`echo $r_c_v_output |
+ grep 'LPATH is:' |
+ sed 's,.*LPATH is\(: *[^ ]*\).*,\1,;s,: */, -L/,g'` $r_c_v_output"
+
+case $r_c_v_output in
+ # If we are using xlc then replace all the commas with spaces.
+ *xlcentry*)
+ r_c_v_output=`echo $r_c_v_output | sed 's/,/ /g'` ;;
+
+ # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
+ # $LIBS confuse us, and the libraries appear later in the output anyway).
+ *mGLOB_options_string*)
+ r_c_v_output=`echo $r_c_v_output | sed 's/\"-mGLOB[^\"]*\"/ /g'` ;;
+esac
+
+
+
+r_cv_c_libs=
+
+# Save positional arguments (if any)
+r_save_positional="$@"
+
+set X $r_c_v_output
+while test $# != 1; do
+ shift
+ r_arg=$1
+ case $r_arg in
+ [\\/]*.a | ?:[\\/]*.a)
+ ac_exists=false
+ for ac_i in $r_cv_c_libs; do
+ if test x"$r_arg" = x"$ac_i"; then
+ ac_exists=true
+ break
+ fi
+ done
+
+ if test x"$ac_exists" = xtrue; then
+ :
+else
+ r_cv_c_libs="$r_cv_c_libs $r_arg"
+fi
+
+ ;;
+ -bI:*)
+ ac_exists=false
+ for ac_i in $r_cv_c_libs; do
+ if test x"$r_arg" = x"$ac_i"; then
+ ac_exists=true
+ break
+ fi
+ done
+
+ if test x"$ac_exists" = xtrue; then
+ :
+else
+ if test "$ac_compiler_gnu" = yes; then
+ for ac_link_opt in $r_arg; do
+ r_cv_c_libs="$r_cv_c_libs -Xlinker $ac_link_opt"
+ done
+else
+ r_cv_c_libs="$r_cv_c_libs $r_arg"
+fi
+fi
+
+ ;;
+ # Ignore these flags.
+ -lang* | -lcrt[01].o | -lcrtbegin.o | -lc | -lgcc | -libmil | -LANG:=*)
+ ;;
+ -lkernel32)
+ test x"$CYGWIN" != xyes && r_cv_c_libs="$r_cv_c_libs $r_arg"
+ ;;
+ -[LRuY])
+ # These flags, when seen by themselves, take an argument.
+ # We remove the space between option and argument and re-iterate
+ # unless we find an empty arg or a new option (starting with -)
+ case $2 in
+ "" | -*);;
+ *)
+ r_arg="$r_arg$2"
+ shift; shift
+ set X $r_arg "$@"
+ ;;
+ esac
+ ;;
+ -YP,*)
+ for r_j in `echo $r_arg | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do
+ ac_exists=false
+ for ac_i in $r_cv_c_libs; do
+ if test x"$r_j" = x"$ac_i"; then
+ ac_exists=true
+ break
+ fi
+ done
+
+ if test x"$ac_exists" = xtrue; then
+ :
+else
+ r_arg="$r_arg $r_j"
+ r_cv_c_libs="$r_cv_c_libs $r_j"
+fi
+
+ done
+ ;;
+ -[lLR]*)
+ ac_exists=false
+ for ac_i in $r_cv_c_libs; do
+ if test x"$r_arg" = x"$ac_i"; then
+ ac_exists=true
+ break
+ fi
+ done
+
+ if test x"$ac_exists" = xtrue; then
+ :
+else
+ r_cv_c_libs="$r_cv_c_libs $r_arg"
+fi
+
+ ;;
+ # Ignore everything else.
+ esac
+done
+# restore positional arguments
+set X $r_save_positional; shift
+
+# We only consider "LD_RUN_PATH" on Solaris systems. If this is seen,
+# then we insist that the "run path" must be an absolute path (i.e. it
+# must begin with a "/").
+case `(uname -sr) 2>/dev/null` in
+ "SunOS 5"*)
+ r_ld_run_path=`echo $r_c_v_output |
+ sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'`
+ test "x$r_ld_run_path" != x &&
+ if test "$ac_compiler_gnu" = yes; then
+ for ac_link_opt in $r_ld_run_path; do
+ r_cv_c_libs="$r_cv_c_libs -Xlinker $ac_link_opt"
+ done
+else
+ r_cv_c_libs="$r_cv_c_libs $r_ld_run_path"
+fi
+ ;;
+esac
+fi # test "x$CLIBS" = "x"
+
+fi
+echo "$as_me:$LINENO: result: $r_cv_c_libs" >&5
+echo "${ECHO_T}$r_cv_c_libs" >&6
+CLIBS=
+for arg in $r_cv_c_libs; do
+ case "${arg}" in
+ -L*)
+ CLIBS="${CLIBS} $arg"
+ ;;
+ esac
+done
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+else
+ CLIBS=
+fi
LIBS="${r_save_LIBS}"
case "${host_os}" in
linux*)
@@ -25751,10 +26082,13 @@ case "${host_os}" in
;;
esac
r_extra_libs=
-for arg in ${LDFLAGS}; do
+for arg in ${LDFLAGS} ${CLIBS}; do
case "${arg}" in
-L*)
lib=`echo ${arg} | sed "s/^-L//"`
+ test -d "${lib}" || continue
+ ## Canonicalize (/usr/lib/gcc-lib/i686-linux/3.4.3/../../..).
+ lib=`cd "${lib}" && ${GETWD}`
r_extra_libs="${r_extra_libs} $lib"
;;
esac
View
1 m4/Makefile.in
@@ -13,6 +13,7 @@ include $(top_builddir)/Makeconf
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
DISTFILES = Makefile.in README \
R.m4 \
+ clibs.m4 \
codeset.m4 \
libtool.m4
View
14 m4/R.m4
@@ -728,6 +728,12 @@ AC_DEFUN([R_PROG_F77_FLIBS],
r_save_LIBS="${LIBS}"
LIBS=
AC_F77_LIBRARY_LDFLAGS
+if test -z "${MAIN_LD}" ; then
+ LIBS=
+ R_C_LIBRARY_LDFLAGS
+else
+ CLIBS=
+fi
LIBS="${r_save_LIBS}"
## Currently g77 on Darwin links against '-lcrt1.o' (and for GCC 3.1 or
## better also against '-lcrtbegin.o'), which (unlike '-lcrt0.o') are
@@ -761,8 +767,7 @@ LIBS="${r_save_LIBS}"
## 2) g77 also tends to duplicate paths via ../../.., so we canonicalize
## paths and remove duplicates.
## 3) We do not need -L/lib etc, nor those in LDFLAGS
-## 4) We only need a path like /usr/lib/gcc-lib/i686-linux/3.4.3 if it contains
-## libg2c.a, libgfortranpreview ... but cover that later.
+## 4) We exclude path with CC will include when linking.
##
## First try to fathom out what -Lfoo commands are unnecessary.
case "${host_os}" in
@@ -777,10 +782,13 @@ case "${host_os}" in
;;
esac
r_extra_libs=
-for arg in ${LDFLAGS}; do
+for arg in ${LDFLAGS} ${CLIBS}; do
case "${arg}" in
-L*)
lib=`echo ${arg} | sed "s/^-L//"`
+ test -d "${lib}" || continue
+ ## Canonicalize (/usr/lib/gcc-lib/i686-linux/3.4.3/../../..).
+ lib=`cd "${lib}" && ${GETWD}`
r_extra_libs="${r_extra_libs} $lib"
;;
esac
View
219 m4/clibs.m4
@@ -0,0 +1,219 @@
+### clibs.m4 -- extra macros for configuring R -*- Autoconf -*-
+###
+### Copyright (C) 2004 R Core Team
+###
+### This file is part of R.
+###
+### R is free software; you can redistribute it and/or modify it under
+### the terms of the GNU General Public License as published by the Free
+### Software Foundation; either version 2 of the License, or (at your
+### option) any later version.
+###
+### R is distributed in the hope that it will be useful, but WITHOUT ANY
+### WARRANTY; without even the implied warranty of MERCHANTABILITY or
+### FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+### License for more details.
+###
+### You should have received a copy of the GNU General Public License
+### along with R; if not, you can obtain it via the World Wide Web at
+### `http://www.gnu.org/copyleft/gpl.html', or by writing to the Free
+### Software Foundation, 59 Temple Place -- Suite 330, Boston, MA
+### 02111-3307, USA.
+
+## modified version of AC_F77_LIBRARY_LDFLAGS for C libraries
+
+
+# _R_PROG_C_V_OUTPUT([FLAG = $r_cv_prog_c_v])
+# -------------------------------------------------
+# Link a trivial Fortran program, compiling with a verbose output FLAG
+# (whose default value, $r_cv_prog_c_v, is computed by
+# _R_PROG_C_V), and return the output in $r_c_v_output. This
+# output is processed in the way expected by _AC_FC_LIBRARY_LDFLAGS,
+# so that any link flags that are echoed by the compiler appear as
+# space-separated items.
+AC_DEFUN([_R_PROG_C_V_OUTPUT],
+[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+
+# Compile and link our simple test program by passing a flag (argument
+# 1 to this macro) to the Fortran compiler in order to get
+# "verbose" output that we can then parse for the Fortran linker
+# flags.
+r_save_CFLAGS=$CFLAGS
+CFLAGS="$CFLAGS m4_default([$1], [$r_cv_prog_c_v])"
+(eval echo $as_me:__oline__: \"$ac_link\") >&AS_MESSAGE_LOG_FD
+r_c_v_output=`eval $ac_link AS_MESSAGE_LOG_FD>&1 2>&1 | grep -v 'Driving:'`
+echo "$r_c_v_output" >&AS_MESSAGE_LOG_FD
+CFLAGS=$r_save_CFLAGS
+
+rm -f conftest*
+
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
+r_c_v_output="`echo $r_c_v_output |
+ grep 'LPATH is:' |
+ sed 's,.*LPATH is\(: *[[^ ]]*\).*,\1,;s,: */, -L/,g'` $r_c_v_output"
+
+case $r_c_v_output in
+ # If we are using xlc then replace all the commas with spaces.
+ *xlcentry*)
+ r_c_v_output=`echo $r_c_v_output | sed 's/,/ /g'` ;;
+
+ # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
+ # $LIBS confuse us, and the libraries appear later in the output anyway).
+ *mGLOB_options_string*)
+ r_c_v_output=`echo $r_c_v_output | sed 's/\"-mGLOB[[^\"]]*\"/ /g'` ;;
+esac
+
+])# _R_PROG_C_V_OUTPUT
+
+
+# _R_PROG_C_V
+# --------------
+#
+# Determine the flag that causes the Fortran compiler to print
+# information of library and object files (normally -v)
+# Needed for _AC_FC_LIBRARY_FLAGS
+# Some compilers don't accept -v (Lahey: -verbose, xlf: -V, Fujitsu: -###)
+AC_DEFUN([_R_PROG_C_V],
+[AC_CACHE_CHECK([how to get verbose linking output from ${CC}],
+ [r_cv_prog_c_v],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+[r_cv_prog_c_v=
+# Try some options frequently used verbose output
+for r_verb in -v -verbose --verbose -V -\#\#\#; do
+ _R_PROG_C_V_OUTPUT($r_verb)
+ # look for -l* and *.a constructs in the output
+ for r_arg in $r_c_v_output; do
+ case $r_arg in
+ [[\\/]]*.a | ?:[[\\/]]*.a | -[[lLRu]]*)
+ r_cv_prog_c_v=$r_verb
+ break 2 ;;
+ esac
+ done
+done
+if test -z "$r_cv_prog_c_v"; then
+ AC_MSG_WARN([cannot determine how to obtain linking information from ${CC}])
+fi],
+ [AC_MSG_WARN([compilation failed])])
+])])# _R_PROG_C_V
+
+
+# _R_C_LIBRARY_LDFLAGS
+# ----------------------
+#
+# Determine the linker flags (e.g. "-L" and "-l") for the C
+# intrinsic and run-time libraries that are required to successfully
+# link a C program or shared library. The output variable
+# CLIBS is set to these flags.
+#
+# This macro is intended to be used in those situations when it is
+# necessary to mix, e.g. C++ and Fortran, source code into a single
+# program or shared library.
+#
+# For example, if object files from a C++ and Fortran compiler must
+# be linked together, then the C++ compiler/linker must be used for
+# linking (since special C++-ish things need to happen at link time
+# like calling global constructors, instantiating templates, enabling
+# exception support, etc.).
+#
+# This macro was packaged in its current form by Matthew D. Langston.
+# However, nearly all of this macro came from the "OCTAVE_FLIBS" macro
+# in "octave-2.0.13/aclocal.m4", and full credit should go to John
+# W. Eaton for writing this extremely useful macro. Thank you John.
+AC_DEFUN([_R_C_LIBRARY_LDFLAGS],
+[_R_PROG_C_V
+AC_CACHE_CHECK([for C libraries of ${CC}], r_cv_c_libs,
+[if test "x$CLIBS" != "x"; then
+ r_cv_c_libs="$CLIBS" # Let the user override the test.
+else
+
+_R_PROG_C_V_OUTPUT
+
+r_cv_c_libs=
+
+# Save positional arguments (if any)
+r_save_positional="$[@]"
+
+set X $r_c_v_output
+while test $[@%:@] != 1; do
+ shift
+ r_arg=$[1]
+ case $r_arg in
+ [[\\/]]*.a | ?:[[\\/]]*.a)
+ _AC_LIST_MEMBER_IF($r_arg, $r_cv_c_libs, ,
+ r_cv_c_libs="$r_cv_c_libs $r_arg")
+ ;;
+ -bI:*)
+ _AC_LIST_MEMBER_IF($r_arg, $r_cv_c_libs, ,
+ [_AC_LINKER_OPTION([$r_arg], r_cv_c_libs)])
+ ;;
+ # Ignore these flags.
+ -lang* | -lcrt[[01]].o | -lcrtbegin.o | -lc | -lgcc | -libmil | -LANG:=*)
+ ;;
+ -lkernel32)
+ test x"$CYGWIN" != xyes && r_cv_c_libs="$r_cv_c_libs $r_arg"
+ ;;
+ -[[LRuY]])
+ # These flags, when seen by themselves, take an argument.
+ # We remove the space between option and argument and re-iterate
+ # unless we find an empty arg or a new option (starting with -)
+ case $[2] in
+ "" | -*);;
+ *)
+ r_arg="$r_arg$[2]"
+ shift; shift
+ set X $r_arg "$[@]"
+ ;;
+ esac
+ ;;
+ -YP,*)
+ for r_j in `echo $r_arg | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do
+ _AC_LIST_MEMBER_IF($r_j, $r_cv_c_libs, ,
+ [r_arg="$r_arg $r_j"
+ r_cv_c_libs="$r_cv_c_libs $r_j"])
+ done
+ ;;
+ -[[lLR]]*)
+ _AC_LIST_MEMBER_IF($r_arg, $r_cv_c_libs, ,
+ r_cv_c_libs="$r_cv_c_libs $r_arg")
+ ;;
+ # Ignore everything else.
+ esac
+done
+# restore positional arguments
+set X $r_save_positional; shift
+
+# We only consider "LD_RUN_PATH" on Solaris systems. If this is seen,
+# then we insist that the "run path" must be an absolute path (i.e. it
+# must begin with a "/").
+case `(uname -sr) 2>/dev/null` in
+ "SunOS 5"*)
+ r_ld_run_path=`echo $r_c_v_output |
+ sed -n 's,^.*LD_RUN_PATH *= *\(/[[^ ]]*\).*$,-R\1,p'`
+ test "x$r_ld_run_path" != x &&
+ _AC_LINKER_OPTION([$r_ld_run_path], r_cv_c_libs)
+ ;;
+esac
+fi # test "x$CLIBS" = "x"
+])
+CLIBS=
+for arg in $r_cv_c_libs; do
+ case "${arg}" in
+ -L*)
+ CLIBS="${CLIBS} $arg"
+ ;;
+ esac
+done
+])# _R_C_LIBRARY_LDFLAGS
+
+
+# R_C_LIBRARY_LDFLAGS
+# -------------------
+AC_DEFUN([R_C_LIBRARY_LDFLAGS],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_LANG_PUSH(C)dnl
+_R_C_LIBRARY_LDFLAGS
+AC_LANG_POP(C)dnl
+])# R_C_LIBRARY_LDFLAGS
+

0 comments on commit d7c77fd

Please sign in to comment.