+2005-08-29 Gary V. Vaughan <gary@gnu.org>
+
+ Some macros had relied on accidentally correct ordering in order
+ for $MV to be defined before use. Factor out setting of some
+ common file commands and m4_require it before use:
+
+ * libltdl/m4/libtool.m4 (_LT_FILEUTILS_DEFAULTS): Allow user to
+ override some common file commands at configure time.
+ (_LT_SETUP, _LT_CONFIG, _LT_COMPILER_OPTION, _LT_LINKER_OPTION)
+ (_LT_COMPILER_C_O, _LT_COMPILER_FILE_LOCKS)
+ (_LT_SYS_DYNAMIC_LINKER, _LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG)
+ (_LT_SYS_HIDDEN_DEPLIBS): m4_require it to ensure the commands are
+ defined before they are called.
+
2005-08-28 Gary V. Vaughan <gary@gnu.org>
* libltdl/m4/libtool.m4, libltdl/m4/ltdl.m4: AU_DEFUN doesn't pass
])
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
# _LT_SETUP
# ---------
m4_defun([_LT_SETUP],
AC_REQUIRE([AC_EXEEXT])dnl
_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_CHECK_XSI_SHELL])dnl
m4_require([_LT_CMD_RELOAD])dnl
m4_require([_LT_CHECK_MAGIC_METHOD])dnl
# Sed substitution to avoid accidental globbing in evaled expressions
no_glob_subst='s/\*/\\\*/g'
-# Constants:
-RM="rm -f"
-
# Global variables:
ofile=libtool
can_build_shared=yes
])# _LT_PROG_LTMAIN
-
## ------------------------------------- ##
## Accumulate code for creating libtool. ##
## ------------------------------------- ##
# to config.status for appending the configuration named by TAG from the
# matching tagged config vars.
m4_defun([_LT_CONFIG],
-[_LT_CONFIG_SAVE_COMMANDS([
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
m4_if(_LT_TAG, [C], [
# See if we are running on zsh, and set the options which allow our
# Check whether the given compiler option works
AC_DEFUN([_LT_COMPILER_OPTION],
[AC_REQUIRE([AC_OBJEXT])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_SED])dnl
AC_CACHE_CHECK([$1], [$2],
[$2=no
# ----------------------------------------------------
# Check whether the given linker option works
AC_DEFUN([_LT_LINKER_OPTION],
-[AC_CACHE_CHECK([$1], [$2],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_CACHE_CHECK([$1], [$2],
[$2=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $3"
# This macro does not hard code the compiler like AC_PROG_CC_C_O.
m4_defun([_LT_COMPILER_C_O],
[AC_REQUIRE([AC_OBJEXT])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_TAG_COMPILER])dnl
AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
[_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
# Check to see if we can do hard links to lock some files if needed
m4_defun([_LT_COMPILER_FILE_LOCKS],
[m4_require([_LT_ENABLE_LOCK])dnl
-
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
_LT_COMPILER_C_O([$1])
hard_links="nottested"
# -----------------------------
# PORTME Fill in your ld.so characteristics
m4_defun([_LT_SYS_DYNAMIC_LINKER],
-[m4_require([_LT_DECL_EGREP])
+[m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
AC_MSG_CHECKING([dynamic linker characteristics])
m4_case([$1],
[C], [withGCC=$GCC],
m4_defun([_LT_LINKER_SHLIBS],
[AC_REQUIRE([LT_PATH_LD])dnl
AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_EGREP])dnl
m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
m4_defun([_LT_LANG_CXX_CONFIG],
[AC_REQUIRE([_LT_PROG_CXX])dnl
AC_REQUIRE([LT_SYS_DLOPEN_SELF])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_EGREP])dnl
AC_LANG_PUSH(C++)
# Parse the compiler output and extract the necessary
# objects, libraries and library flags.
m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
-[# Dependencies to place before and after the object being linked:
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+# Dependencies to place before and after the object being linked:
_LT_TAGVAR(predep_objects, $1)=
_LT_TAGVAR(postdep_objects, $1)=
_LT_TAGVAR(predeps, $1)=