diff options
Diffstat (limited to 'm4/slibtool.m4')
-rw-r--r-- | m4/slibtool.m4 | 77 |
1 files changed, 67 insertions, 10 deletions
diff --git a/m4/slibtool.m4 b/m4/slibtool.m4 index 29bfb8d..25c37a3 100644 --- a/m4/slibtool.m4 +++ b/m4/slibtool.m4 @@ -175,17 +175,47 @@ AC_BEFORE([$0],[SLIBTOOL_INIT]) # --------------------------------------------------------------------------- slibtool_set_flavor() { + if [[ -z "${SLIBTOOL:-}" ]]; then + SLIBTOOL="${LIBTOOL:-}" + fi + + _slibtool="${SLIBTOOL:-slibtool}" + + if [[ "${_slibtool%/*}" = "${_slibtool}" ]]; then + _slibtool_path= + else + _slibtool_path="${_slibtool%/*}/" + fi + + case "${_slibtool##*/}" in + 'rlibtool') + SLIBTOOL="${_slibtool_path}"'slibtool' + ;; + + 'rclibtool') + SLIBTOOL="${_slibtool_path}"'clibtool' + ;; + + 'rdlibtool') + SLIBTOOL="${_slibtool_path}"'dlibtool' + ;; + + 'rdclibtool') + SLIBTOOL="${_slibtool_path}"'dclibtool' + ;; + esac + case "_${slibtool_enable_shared}_${slibtool_enable_static}" in '_yes_yes') - SLIBTOOL='dlibtool' + SLIBTOOL="${SLIBTOOL:-slibtool}" ;; '_yes_no') - SLIBTOOL='dlibtool-shared' + SLIBTOOL="${SLIBTOOL:-slibtool}-shared" ;; '_no_yes') - SLIBTOOL='dlibtool-static' + SLIBTOOL="${SLIBTOOL:-slibtool}-static" ;; '_no_no') @@ -230,13 +260,6 @@ slibtool_set_flavor() enable_win32_dll=${slibtool_enable_win32_dll} enable_fast_install=${slibtool_enable_fast_install} pic_mode=${slibtool_pic_mode} - - # backward-compatible heuristics support - printf "%s\n%s=%s\n%s=%s\n" \ - '#!/dev/null' \ - 'build_libtool_libs' "${slibtool_enable_shared}" \ - 'build_old_libs' "${slibtool_enable_static}" \ - > libtool } ]) @@ -499,9 +522,11 @@ _SLIBTOOL_ARG_WITH([sysroot],[absolute path to the target's sysroot],[slibtool_s # -------------------- slibtool_set_flavor LIBTOOL='$(SLIBTOOL)' +SLIBTOOL="${SLIBTOOL} \$(SLIBTOOL_FLAGS)" AC_SUBST([LIBTOOL]) AC_SUBST([SLIBTOOL]) +AC_SUBST([SLIBTOOL_FLAGS]) AC_SUBST([SLIBTOOL_SYSROOT]) ]) @@ -534,6 +559,21 @@ AC_PROG_F77 ]) +# produce a backward compatible slibtool.cfg +AC_CONFIG_COMMANDS_PRE( + AC_CONFIG_FILES( + [slibtool.cfg:Makefile], + [rm -f slibtool.cfg || exit 2;] + [_slibtool="${SLIBTOOL:-slibtool}";] + [${_slibtool%% *} --mkvars=Makefile --config > slibtool.cfg])) + +# optionally create libtool as a symlink to slibtool.sh +AC_CONFIG_COMMANDS_PRE( + [if [[ -s slibtool.sh ]]; then + ln -f -s slibtool.sh libtool || exit 2 + fi]) + + # SLIBTOOL_PREREQ(_version_) # -------------------------- AC_DEFUN([SLIBTOOL_PREREQ],[ @@ -552,11 +592,21 @@ AC_PROG_MKDIR_P ]) +# SLIBTOOL_OUTPUT +# --------------- +AC_DEFUN([SLIBTOOL_OUTPUT],[ +_slibtool_cmd="${SLIBTOOL:-slibtool}" +_slibtool_cmd="${_slibtool_cmd%% *}" +_slibtool_aux_dir=$("${_slibtool_cmd}" -print-aux-dir) +cp -p "${_slibtool_aux_dir}/slibtool.sh" 'libtool' +]) + # drop-in replacement # ------------------- AC_DEFUN([LT_INIT], [SLIBTOOL_INIT($@)]) AC_DEFUN([LT_LANG], [SLIBTOOL_LANG($@)]) AC_DEFUN([LT_PREREQ], [SLIBTOOL_PREREQ($@)]) +AC_DEFUN([LT_OUTPUT], [SLIBTOOL_OUTPUT($@)]) AC_DEFUN([AC_PROG_LIBTOOL], [SLIBTOOL_INIT($@)]) AC_DEFUN([AM_PROG_LIBTOOL], [SLIBTOOL_INIT($@)]) @@ -594,3 +644,10 @@ AC_DEFUN([LT_LIB_DLLOAD], [SLIBTOOL_LFLAG_LTDL($@)]) AC_DEFUN([AC_LIBTOOL_DLOPEN],[]) AC_DEFUN([AC_LIBTOOL_WIN32_DLL],[]) AC_DEFUN([AC_DISABLE_FAST_INSTALL],[]) +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],[]) + +AC_DEFUN([LT_PATH_AR],[]) +AC_DEFUN([LT_PATH_AS],[]) +AC_DEFUN([LT_PATH_LD],[]) +AC_DEFUN([LT_PATH_NM],[]) +AC_DEFUN([LT_PATH_RANLIB],[]) |