mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
Update the auto* tools: autoconf 2.60, libtool 1.5.22, automake 1.9.6.
Update ltld.[ch] to version 1.5.22. Correct the notes about updating these tools (autoconf/README.TXT) Add configure options for getting the correct option for including a whole archive when linking. llvm-svn: 29529
This commit is contained in:
parent
ca845c5d7d
commit
982a99456c
@ -233,3 +233,10 @@ EXEEXT = @EXEEXT@
|
|||||||
|
|
||||||
# Things we just assume are "there"
|
# Things we just assume are "there"
|
||||||
ECHO := echo
|
ECHO := echo
|
||||||
|
|
||||||
|
# Get the options for causing archives to link all their content instead of
|
||||||
|
# just missing symbols, and the inverse of that. This is used for certain LLVM
|
||||||
|
# tools that permit loadable modules. It ensures that the LLVM symbols will be
|
||||||
|
# available to those loadable modules.
|
||||||
|
LINKALL := @LINKALL@
|
||||||
|
NOLINKALL := @NOLINKALL@
|
||||||
|
@ -7,14 +7,14 @@ outfile=configure
|
|||||||
configfile=configure.ac
|
configfile=configure.ac
|
||||||
test -d autoconf && test -f autoconf/$configfile && cd autoconf
|
test -d autoconf && test -f autoconf/$configfile && cd autoconf
|
||||||
test -f $configfile || die "Can't find 'autoconf' dir; please cd into it first"
|
test -f $configfile || die "Can't find 'autoconf' dir; please cd into it first"
|
||||||
autoconf --version | grep '2\.59' > /dev/null
|
autoconf --version | grep '2\.60' > /dev/null
|
||||||
test $? -eq 0 || die "Your autoconf was not detected as being 2.59"
|
test $? -eq 0 || die "Your autoconf was not detected as being 2.60"
|
||||||
aclocal --version | grep '^aclocal.*1\.9\.2' > /dev/null
|
aclocal --version | grep '^aclocal.*1\.9\.6' > /dev/null
|
||||||
test $? -eq 0 || die "Your aclocal was not detected as being 1.9.2"
|
test $? -eq 0 || die "Your aclocal was not detected as being 1.9.6"
|
||||||
autoheader --version | grep '^autoheader.*2\.59' > /dev/null
|
autoheader --version | grep '^autoheader.*2\.60' > /dev/null
|
||||||
test $? -eq 0 || die "Your autoheader was not detected as being 2.59"
|
test $? -eq 0 || die "Your autoheader was not detected as being 2.60"
|
||||||
libtool --version | grep '1\.5\.10' > /dev/null
|
libtool --version | grep '1\.5\.22' > /dev/null
|
||||||
test $? -eq 0 || die "Your libtool was not detected as being 1.5.10"
|
test $? -eq 0 || die "Your libtool was not detected as being 1.5.22"
|
||||||
echo ""
|
echo ""
|
||||||
echo "### NOTE: ############################################################"
|
echo "### NOTE: ############################################################"
|
||||||
echo "### If you get *any* warnings from autoconf below you MUST fix the"
|
echo "### If you get *any* warnings from autoconf below you MUST fix the"
|
||||||
@ -24,12 +24,12 @@ echo "### commit any configure script that was generated with warnings"
|
|||||||
echo "### present. You should get just three 'Regenerating..' lines."
|
echo "### present. You should get just three 'Regenerating..' lines."
|
||||||
echo "######################################################################"
|
echo "######################################################################"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Regenerating aclocal.m4 with aclocal 1.9.2"
|
echo "Regenerating aclocal.m4 with aclocal 1.9.6"
|
||||||
cwd=`pwd`
|
cwd=`pwd`
|
||||||
aclocal --force -I $cwd/m4 || die "aclocal failed"
|
aclocal --force -I $cwd/m4 || die "aclocal failed"
|
||||||
echo "Regenerating configure with autoconf 2.59"
|
echo "Regenerating configure with autoconf 2.60"
|
||||||
autoconf --force --warnings=all -o ../$outfile $configfile || die "autoconf failed"
|
autoconf --force --warnings=all -o ../$outfile $configfile || die "autoconf failed"
|
||||||
cd ..
|
cd ..
|
||||||
echo "Regenerating config.h.in with autoheader 2.59"
|
echo "Regenerating config.h.in with autoheader 2.60"
|
||||||
autoheader --warnings=all -I autoconf -I autoconf/m4 autoconf/$configfile || die "autoheader failed"
|
autoheader --warnings=all -I autoconf -I autoconf/m4 autoconf/$configfile || die "autoheader failed"
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -8,19 +8,28 @@ If you are in the mood to upgrade libtool, you must do the following:
|
|||||||
3. Copy <SRC>/ltdl.m4 to llvm/autoconf/m4
|
3. Copy <SRC>/ltdl.m4 to llvm/autoconf/m4
|
||||||
4. Copy <PFX>/share/aclocal/libtool.m4 to llvm/autoconf/m4/libtool.m4
|
4. Copy <PFX>/share/aclocal/libtool.m4 to llvm/autoconf/m4/libtool.m4
|
||||||
5. Copy <PFX>/share/libtool/ltmain.sh to llvm/autoconf/ltmain.sh
|
5. Copy <PFX>/share/libtool/ltmain.sh to llvm/autoconf/ltmain.sh
|
||||||
6. Run sed -e 's/output.exp/outputname.exp/g' on ltmain.sh
|
6. Copy <PFX>/share/libtool/libltdl/ltdl.c to llvm/lib/System
|
||||||
7. Copy <PFX>/share/libtool/libltdl/ltdl.c to llvm/lib/System
|
7. Copy <PFX>/share/libtool/libltdl/ltdl.h to llvm/lib/System
|
||||||
8. Copy <PFX>/share/libtool/libltdl/ltdl.h to llvm/lib/System
|
8. Edit the ltdl.h file to #include "llvm/Config/config.h" at the very top. You
|
||||||
9. Adjust the llvm/autoconf/m4/libtool.m4 file to ensure that the variable
|
might also need to resolve some compiler warnings (typically about
|
||||||
default_ofile is set to "mklib" instead of "libtool"
|
comparison of signed vs. unsigned values). But, you won't find out about
|
||||||
|
those until you build LLVM (step 13).
|
||||||
|
9. Edit the llvm/autoconf/m4/libtool.m4 file so that:
|
||||||
|
a) in AC_PROB_LIBTOOL macro, the value of LIBTOOL is set to
|
||||||
|
$(top_builddir)/mklib, not $(top_builddir)/libtool
|
||||||
|
b) in AC_LIBTOOL_SETUP macro, the variable default_ofile is set to
|
||||||
|
"mklib" instead of "libtool"
|
||||||
|
c) s/AC_ENABLE_SHARED_DEFAULT/enable_shared_default/g
|
||||||
|
d) s/AC_ENABLE_STATIC_DEFAULT/enable_static_default/g
|
||||||
|
e) s/AC_ENABLE_FAST_INSTALL_DEFAULT/enable_fast_install_default/g
|
||||||
10. Run "autoupdate libtool.m4 ltdl.m4" in the llvm/autoconf/m4 directory.
|
10. Run "autoupdate libtool.m4 ltdl.m4" in the llvm/autoconf/m4 directory.
|
||||||
This should correctly update the macro definitions in the libtool m4
|
This should correctly update the macro definitions in the libtool m4
|
||||||
files to match the version of autoconf that LLVM uses. This converts
|
files to match the version of autoconf that LLVM uses. This converts
|
||||||
AC_HELP_STRING to AS_HELP_STRING and AC_TRY_LINK to AC_LINK_IFELSE, amongst
|
AC_HELP_STRING to AS_HELP_STRING and AC_TRY_LINK to AC_LINK_IFELSE, amongst
|
||||||
other things. You may need to manually adjust the files.
|
other things. You may need to manually adjust the files.
|
||||||
11. Run AutoRegen.sh to get the new macros into configure script
|
11. Run AutoRegen.sh to get the new macros into configure script
|
||||||
12. If there are any warnings from configure, go to step 9.
|
12. If there are any warnings from AutoRegen.sh, go to step 9.
|
||||||
13. Rebuild LLVM, making sure it reconfigured
|
13. Rebuild LLVM, making sure it reconfigures
|
||||||
14. Test the JIT which uses libltdl
|
14. Test the JIT which uses libltdl
|
||||||
15. If it all works, only THEN commit the changes.
|
15. If it all works, only THEN commit the changes.
|
||||||
|
|
||||||
@ -36,5 +45,5 @@ If you are in the mood to upgrade autoconf, you should:
|
|||||||
5. Run autoupdate on all the m4 macros in llvm/autoconf/m4
|
5. Run autoupdate on all the m4 macros in llvm/autoconf/m4
|
||||||
6. Run autoupdate on llvm/autoconf/configure.ac
|
6. Run autoupdate on llvm/autoconf/configure.ac
|
||||||
7. Regenerate configure script with AutoRegen.sh
|
7. Regenerate configure script with AutoRegen.sh
|
||||||
8. If there are any warnings from autoconf, fix them and go to step 7.
|
8. If there are any warnings from AutoRegen.sh, fix them and go to step 7.
|
||||||
9. Test, test, test.
|
9. Test, test, test.
|
||||||
|
@ -102,39 +102,63 @@ AC_CACHE_CHECK([type of operating system we're going to host on],
|
|||||||
[llvm_cv_os_type],
|
[llvm_cv_os_type],
|
||||||
[case $host in
|
[case $host in
|
||||||
*-*-aix*)
|
*-*-aix*)
|
||||||
|
llvm_cv_link_all_option="-Wl,--whole-archive"
|
||||||
|
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
|
||||||
llvm_cv_os_type="AIX"
|
llvm_cv_os_type="AIX"
|
||||||
llvm_cv_platform_type="Unix" ;;
|
llvm_cv_platform_type="Unix" ;;
|
||||||
*-*-cygwin*)
|
*-*-cygwin*)
|
||||||
|
llvm_cv_link_all_option="-Wl,--whole-archive"
|
||||||
|
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
|
||||||
llvm_cv_os_type="Cygwin"
|
llvm_cv_os_type="Cygwin"
|
||||||
llvm_cv_platform_type="Unix" ;;
|
llvm_cv_platform_type="Unix" ;;
|
||||||
*-*-darwin*)
|
*-*-darwin*)
|
||||||
|
llvm_cv_link_all_option="-Wl,-all_load"
|
||||||
|
llvm_cv_link_all_option="-Wl,-noall_load"
|
||||||
llvm_cv_os_type="Darwin"
|
llvm_cv_os_type="Darwin"
|
||||||
llvm_cv_platform_type="Unix" ;;
|
llvm_cv_platform_type="Unix" ;;
|
||||||
*-*-freebsd*)
|
*-*-freebsd*)
|
||||||
|
llvm_cv_link_all_option="-Wl,--whole-archive"
|
||||||
|
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
|
||||||
llvm_cv_os_type="FreeBSD"
|
llvm_cv_os_type="FreeBSD"
|
||||||
llvm_cv_platform_type="Unix" ;;
|
llvm_cv_platform_type="Unix" ;;
|
||||||
*-*-openbsd*)
|
*-*-openbsd*)
|
||||||
|
llvm_cv_link_all_option="-Wl,--whole-archive"
|
||||||
|
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
|
||||||
llvm_cv_os_type="OpenBSD"
|
llvm_cv_os_type="OpenBSD"
|
||||||
llvm_cv_platform_type="Unix" ;;
|
llvm_cv_platform_type="Unix" ;;
|
||||||
*-*-hpux*)
|
*-*-hpux*)
|
||||||
|
llvm_cv_link_all_option="-Wl,--whole-archive"
|
||||||
|
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
|
||||||
llvm_cv_os_type="HP-UX"
|
llvm_cv_os_type="HP-UX"
|
||||||
llvm_cv_platform_type="Unix" ;;
|
llvm_cv_platform_type="Unix" ;;
|
||||||
*-*-interix*)
|
*-*-interix*)
|
||||||
|
llvm_cv_link_all_option="-Wl,--whole-archive"
|
||||||
|
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
|
||||||
llvm_cv_os_type="Interix"
|
llvm_cv_os_type="Interix"
|
||||||
llvm_cv_platform_type="Unix" ;;
|
llvm_cv_platform_type="Unix" ;;
|
||||||
*-*-linux*)
|
*-*-linux*)
|
||||||
|
llvm_cv_link_all_option="-Wl,--whole-archive"
|
||||||
|
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
|
||||||
llvm_cv_os_type="Linux"
|
llvm_cv_os_type="Linux"
|
||||||
llvm_cv_platform_type="Unix" ;;
|
llvm_cv_platform_type="Unix" ;;
|
||||||
*-*-solaris*)
|
*-*-solaris*)
|
||||||
|
llvm_cv_link_all_option="-Wl,-z,allextract"
|
||||||
|
llvm_cv_no_link_all_option="-Wl,-z,defaultextract"
|
||||||
llvm_cv_os_type="SunOS"
|
llvm_cv_os_type="SunOS"
|
||||||
llvm_cv_platform_type="Unix" ;;
|
llvm_cv_platform_type="Unix" ;;
|
||||||
*-*-win32*)
|
*-*-win32*)
|
||||||
|
llvm_cv_link_all_option="-Wl,--whole-archive"
|
||||||
|
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
|
||||||
llvm_cv_os_type="Win32"
|
llvm_cv_os_type="Win32"
|
||||||
llvm_cv_platform_type="Win32" ;;
|
llvm_cv_platform_type="Win32" ;;
|
||||||
*-*-mingw*)
|
*-*-mingw*)
|
||||||
|
llvm_cv_link_all_option="-Wl,--whole-archive"
|
||||||
|
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
|
||||||
llvm_cv_os_type="MingW"
|
llvm_cv_os_type="MingW"
|
||||||
llvm_cv_platform_type="Win32" ;;
|
llvm_cv_platform_type="Win32" ;;
|
||||||
*)
|
*)
|
||||||
|
llvm_cv_link_all_option=""
|
||||||
|
llvm_cv_no_link_all_option=""
|
||||||
llvm_cv_os_type="Unknown"
|
llvm_cv_os_type="Unknown"
|
||||||
llvm_cv_platform_type="Unknown" ;;
|
llvm_cv_platform_type="Unknown" ;;
|
||||||
esac])
|
esac])
|
||||||
@ -148,6 +172,10 @@ dnl Set the "OS" Makefile variable based on the platform type so the
|
|||||||
dnl makefile can configure itself to specific build hosts
|
dnl makefile can configure itself to specific build hosts
|
||||||
AC_SUBST(OS,$llvm_cv_os_type)
|
AC_SUBST(OS,$llvm_cv_os_type)
|
||||||
|
|
||||||
|
dnl Set the LINKALL and NOLINKALL Makefile variables based on the platform
|
||||||
|
AC_SUBST(LINKALL,$llvm_cv_link_all_option)
|
||||||
|
AC_SUBST(NOLINKALL,$llvm_cv_no_link_all_option)
|
||||||
|
|
||||||
dnl Set the "LLVM_ON_*" variables based on llvm_cvs_platform_type
|
dnl Set the "LLVM_ON_*" variables based on llvm_cvs_platform_type
|
||||||
dnl This is used by lib/System to determine the basic kind of implementation
|
dnl This is used by lib/System to determine the basic kind of implementation
|
||||||
dnl to use.
|
dnl to use.
|
||||||
|
1023
autoconf/ltmain.sh
1023
autoconf/ltmain.sh
File diff suppressed because it is too large
Load Diff
1354
autoconf/m4/libtool.m4
vendored
1354
autoconf/m4/libtool.m4
vendored
File diff suppressed because it is too large
Load Diff
@ -1,26 +1,11 @@
|
|||||||
## ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*-
|
## ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*-
|
||||||
## Copyright (C) 1999-2000 Free Software Foundation, Inc.
|
## Copyright (C) 1999-2000 Free Software Foundation, Inc.
|
||||||
##
|
##
|
||||||
## This program is free software; you can redistribute it and/or modify
|
## This file is free software; the Free Software Foundation gives
|
||||||
## it under the terms of the GNU General Public License as published by
|
## unlimited permission to copy and/or distribute it, with or without
|
||||||
## the Free Software Foundation; either version 2 of the License, or
|
## modifications, as long as this notice is preserved.
|
||||||
## (at your option) any later version.
|
|
||||||
##
|
|
||||||
## This program 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 this program; if not, write to the Free Software
|
|
||||||
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
##
|
|
||||||
## As a special exception to the GNU General Public License, if you
|
|
||||||
## distribute this file as part of a program that contains a
|
|
||||||
## configuration script generated by Autoconf, you may include it under
|
|
||||||
## the same distribution terms that you use for the rest of that program.
|
|
||||||
|
|
||||||
# serial 6 AC_LIB_LTDL
|
# serial 7 AC_LIB_LTDL
|
||||||
|
|
||||||
# AC_WITH_LTDL
|
# AC_WITH_LTDL
|
||||||
# ------------
|
# ------------
|
||||||
@ -57,7 +42,7 @@ fi
|
|||||||
if test "x$with_included_ltdl" = xno; then
|
if test "x$with_included_ltdl" = xno; then
|
||||||
# If the included ltdl is not to be used. then Use the
|
# If the included ltdl is not to be used. then Use the
|
||||||
# preinstalled libltdl we found.
|
# preinstalled libltdl we found.
|
||||||
AC_DEFINE([HAVE_LTDL], 1,
|
AC_DEFINE([HAVE_LTDL], [1],
|
||||||
[Define this if a modern libltdl is already installed])
|
[Define this if a modern libltdl is already installed])
|
||||||
LIBLTDL=-lltdl
|
LIBLTDL=-lltdl
|
||||||
fi
|
fi
|
||||||
@ -75,7 +60,7 @@ AC_CONFIG_SUBDIRS([libltdl])
|
|||||||
# Perform all the checks necessary for compilation of the ltdl objects
|
# Perform all the checks necessary for compilation of the ltdl objects
|
||||||
# -- including compiler checks and header checks.
|
# -- including compiler checks and header checks.
|
||||||
AC_DEFUN([AC_LIB_LTDL],
|
AC_DEFUN([AC_LIB_LTDL],
|
||||||
[AC_PREREQ(2.59)
|
[AC_PREREQ(2.60)
|
||||||
AC_REQUIRE([AC_PROG_CC])
|
AC_REQUIRE([AC_PROG_CC])
|
||||||
AC_REQUIRE([AC_C_CONST])
|
AC_REQUIRE([AC_C_CONST])
|
||||||
AC_REQUIRE([AC_HEADER_STDC])
|
AC_REQUIRE([AC_HEADER_STDC])
|
||||||
@ -110,11 +95,11 @@ AC_CHECK_FUNCS([closedir opendir readdir])
|
|||||||
# ----------------------
|
# ----------------------
|
||||||
AC_DEFUN([AC_LTDL_ENABLE_INSTALL],
|
AC_DEFUN([AC_LTDL_ENABLE_INSTALL],
|
||||||
[AC_ARG_ENABLE([ltdl-install],
|
[AC_ARG_ENABLE([ltdl-install],
|
||||||
[AS_HELP_STRING([--enable-ltdl-install], [install libltdl])])
|
[AS_HELP_STRING([--enable-ltdl-install],[install libltdl])])
|
||||||
|
|
||||||
AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
|
AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
|
||||||
AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)
|
AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)
|
||||||
])])# AC_LTDL_ENABLE_INSTALL
|
])# AC_LTDL_ENABLE_INSTALL
|
||||||
|
|
||||||
|
|
||||||
# AC_LTDL_SYS_DLOPEN_DEPLIBS
|
# AC_LTDL_SYS_DLOPEN_DEPLIBS
|
||||||
@ -141,7 +126,7 @@ AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
|
|||||||
# Assuming the user has installed a libdl from somewhere, this is true
|
# Assuming the user has installed a libdl from somewhere, this is true
|
||||||
# If you are looking for one http://www.opendarwin.org/projects/dlcompat
|
# If you are looking for one http://www.opendarwin.org/projects/dlcompat
|
||||||
libltdl_cv_sys_dlopen_deplibs=yes
|
libltdl_cv_sys_dlopen_deplibs=yes
|
||||||
;;
|
;;
|
||||||
gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
|
gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
|
||||||
# GNU and its variants, using gnu ld.so (Glibc)
|
# GNU and its variants, using gnu ld.so (Glibc)
|
||||||
libltdl_cv_sys_dlopen_deplibs=yes
|
libltdl_cv_sys_dlopen_deplibs=yes
|
||||||
@ -149,6 +134,9 @@ AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
|
|||||||
hpux10*|hpux11*)
|
hpux10*|hpux11*)
|
||||||
libltdl_cv_sys_dlopen_deplibs=yes
|
libltdl_cv_sys_dlopen_deplibs=yes
|
||||||
;;
|
;;
|
||||||
|
interix*)
|
||||||
|
libltdl_cv_sys_dlopen_deplibs=yes
|
||||||
|
;;
|
||||||
irix[[12345]]*|irix6.[[01]]*)
|
irix[[12345]]*|irix6.[[01]]*)
|
||||||
# Catch all versions of IRIX before 6.2, and indicate that we don't
|
# Catch all versions of IRIX before 6.2, and indicate that we don't
|
||||||
# know how it worked for any of those versions.
|
# know how it worked for any of those versions.
|
||||||
@ -190,6 +178,9 @@ AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
|
|||||||
solaris*)
|
solaris*)
|
||||||
libltdl_cv_sys_dlopen_deplibs=yes
|
libltdl_cv_sys_dlopen_deplibs=yes
|
||||||
;;
|
;;
|
||||||
|
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
|
||||||
|
libltdl_cv_sys_dlopen_deplibs=yes
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
])
|
])
|
||||||
if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then
|
if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then
|
||||||
@ -210,7 +201,7 @@ module=yes
|
|||||||
eval libltdl_cv_shlibext=$shrext_cmds
|
eval libltdl_cv_shlibext=$shrext_cmds
|
||||||
])
|
])
|
||||||
if test -n "$libltdl_cv_shlibext"; then
|
if test -n "$libltdl_cv_shlibext"; then
|
||||||
AC_DEFINE_UNQUOTED(LTDL_SHLIB_EXT, "$libltdl_cv_shlibext",
|
AC_DEFINE_UNQUOTED([LTDL_SHLIB_EXT], ["$libltdl_cv_shlibext"],
|
||||||
[Define to the extension used for shared libraries, say, ".so".])
|
[Define to the extension used for shared libraries, say, ".so".])
|
||||||
fi
|
fi
|
||||||
])# AC_LTDL_SHLIBEXT
|
])# AC_LTDL_SHLIBEXT
|
||||||
@ -223,7 +214,7 @@ AC_DEFUN([AC_LTDL_SHLIBPATH],
|
|||||||
AC_CACHE_CHECK([which variable specifies run-time library path],
|
AC_CACHE_CHECK([which variable specifies run-time library path],
|
||||||
[libltdl_cv_shlibpath_var], [libltdl_cv_shlibpath_var="$shlibpath_var"])
|
[libltdl_cv_shlibpath_var], [libltdl_cv_shlibpath_var="$shlibpath_var"])
|
||||||
if test -n "$libltdl_cv_shlibpath_var"; then
|
if test -n "$libltdl_cv_shlibpath_var"; then
|
||||||
AC_DEFINE_UNQUOTED(LTDL_SHLIBPATH_VAR, "$libltdl_cv_shlibpath_var",
|
AC_DEFINE_UNQUOTED([LTDL_SHLIBPATH_VAR], ["$libltdl_cv_shlibpath_var"],
|
||||||
[Define to the name of the environment variable that determines the dynamic library search path.])
|
[Define to the name of the environment variable that determines the dynamic library search path.])
|
||||||
fi
|
fi
|
||||||
])# AC_LTDL_SHLIBPATH
|
])# AC_LTDL_SHLIBPATH
|
||||||
@ -245,7 +236,7 @@ if test -n "$libltdl_cv_sys_search_path"; then
|
|||||||
sys_search_path="$sys_search_path$PATH_SEPARATOR$dir"
|
sys_search_path="$sys_search_path$PATH_SEPARATOR$dir"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
AC_DEFINE_UNQUOTED(LTDL_SYSSEARCHPATH, "$sys_search_path",
|
AC_DEFINE_UNQUOTED([LTDL_SYSSEARCHPATH], ["$sys_search_path"],
|
||||||
[Define to the system default library search path.])
|
[Define to the system default library search path.])
|
||||||
fi
|
fi
|
||||||
])# AC_LTDL_SYSSEARCHPATH
|
])# AC_LTDL_SYSSEARCHPATH
|
||||||
@ -271,7 +262,7 @@ AC_DEFUN([AC_LTDL_OBJDIR],
|
|||||||
rmdir .libs 2>/dev/null
|
rmdir .libs 2>/dev/null
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
AC_DEFINE_UNQUOTED(LTDL_OBJDIR, "$libltdl_cv_objdir/",
|
AC_DEFINE_UNQUOTED([LTDL_OBJDIR], ["$libltdl_cv_objdir/"],
|
||||||
[Define to the sub-directory in which libtool stores uninstalled libraries.])
|
[Define to the sub-directory in which libtool stores uninstalled libraries.])
|
||||||
])# AC_LTDL_OBJDIR
|
])# AC_LTDL_OBJDIR
|
||||||
|
|
||||||
@ -289,7 +280,7 @@ AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
|
|||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
if test x"$libltdl_cv_preloaded_symbols" = xyes; then
|
if test x"$libltdl_cv_preloaded_symbols" = xyes; then
|
||||||
AC_DEFINE(HAVE_PRELOADED_SYMBOLS, 1,
|
AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1],
|
||||||
[Define if libtool can extract symbol lists from object files.])
|
[Define if libtool can extract symbol lists from object files.])
|
||||||
fi
|
fi
|
||||||
])# AC_LTDL_DLPREOPEN
|
])# AC_LTDL_DLPREOPEN
|
||||||
@ -369,15 +360,15 @@ EOF
|
|||||||
if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
|
if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD()
|
echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD()
|
echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD()
|
echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
|
||||||
cat conftest.c >&AS_MESSAGE_LOG_FD()
|
cat conftest.c >&AS_MESSAGE_LOG_FD
|
||||||
fi
|
fi
|
||||||
rm -rf conftest*
|
rm -rf conftest*
|
||||||
])
|
])
|
||||||
@ -405,7 +396,7 @@ if test x"$ac_cv_sys_symbol_underscore" = xyes; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if test x"$libltdl_cv_need_uscore" = xyes; then
|
if test x"$libltdl_cv_need_uscore" = xyes; then
|
||||||
AC_DEFINE(NEED_USCORE, 1,
|
AC_DEFINE([NEED_USCORE], [1],
|
||||||
[Define if dlsym() requires a leading underscore in symbol names.])
|
[Define if dlsym() requires a leading underscore in symbol names.])
|
||||||
fi
|
fi
|
||||||
])# AC_LTDL_DLSYM_USCORE
|
])# AC_LTDL_DLSYM_USCORE
|
||||||
|
@ -508,7 +508,7 @@
|
|||||||
|
|
||||||
/* If using the C implementation of alloca, define if you know the
|
/* If using the C implementation of alloca, define if you know the
|
||||||
direction of stack growth for your system; otherwise it will be
|
direction of stack growth for your system; otherwise it will be
|
||||||
automatically deduced at run-time.
|
automatically deduced at runtime.
|
||||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||||
@ -539,5 +539,5 @@
|
|||||||
/* Define to `int' if <sys/types.h> does not define. */
|
/* Define to `int' if <sys/types.h> does not define. */
|
||||||
#undef pid_t
|
#undef pid_t
|
||||||
|
|
||||||
/* Define to `unsigned' if <sys/types.h> does not define. */
|
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||||
#undef size_t
|
#undef size_t
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* ltdl.c -- system independent dlopen wrapper
|
/* ltdl.c -- system independent dlopen wrapper
|
||||||
Copyright (C) 1998, 1999, 2000, 2004 Free Software Foundation, Inc.
|
Copyright (C) 1998, 1999, 2000, 2004, 2005 Free Software Foundation, Inc.
|
||||||
Originally by Thomas Tanner <tanner@ffii.org>
|
Originally by Thomas Tanner <tanner@ffii.org>
|
||||||
This file is part of GNU Libtool.
|
This file is part of GNU Libtool.
|
||||||
|
|
||||||
@ -20,17 +20,16 @@ Lesser General Public License for more details.
|
|||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
You should have received a copy of the GNU Lesser General Public
|
||||||
License along with this library; if not, write to the Free Software
|
License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
02111-1307 USA
|
02110-1301 USA
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "llvm/Config/config.h"
|
#include "llvm/Config/config.h"
|
||||||
/*
|
|
||||||
#if HAVE_CONFIG_H
|
#if HAVE_CONFIG_H
|
||||||
# include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
*/
|
|
||||||
|
|
||||||
#if HAVE_UNISTD_H
|
#if HAVE_UNISTD_H
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
@ -460,7 +459,9 @@ opendir (path)
|
|||||||
DIR *entry;
|
DIR *entry;
|
||||||
|
|
||||||
assert(path != (char *) NULL);
|
assert(path != (char *) NULL);
|
||||||
(void) strncpy(file_specification,path,LT_FILENAME_MAX-1);
|
/* allow space for: path + '\\' '\\' '*' '.' '*' + '\0' */
|
||||||
|
(void) strncpy (file_specification, path, LT_FILENAME_MAX-6);
|
||||||
|
file_specification[LT_FILENAME_MAX-6] = LT_EOS_CHAR;
|
||||||
(void) strcat(file_specification,"\\");
|
(void) strcat(file_specification,"\\");
|
||||||
entry = LT_DLMALLOC (DIR,sizeof(DIR));
|
entry = LT_DLMALLOC (DIR,sizeof(DIR));
|
||||||
if (entry != (DIR *) 0)
|
if (entry != (DIR *) 0)
|
||||||
@ -501,6 +502,7 @@ static struct dirent *readdir(entry)
|
|||||||
entry->firsttime = FALSE;
|
entry->firsttime = FALSE;
|
||||||
(void) strncpy(entry->file_info.d_name,entry->Win32FindData.cFileName,
|
(void) strncpy(entry->file_info.d_name,entry->Win32FindData.cFileName,
|
||||||
LT_FILENAME_MAX-1);
|
LT_FILENAME_MAX-1);
|
||||||
|
entry->file_info.d_name[LT_FILENAME_MAX - 1] = LT_EOS_CHAR;
|
||||||
entry->file_info.d_namlen = strlen(entry->file_info.d_name);
|
entry->file_info.d_namlen = strlen(entry->file_info.d_name);
|
||||||
return(&entry->file_info);
|
return(&entry->file_info);
|
||||||
}
|
}
|
||||||
@ -625,7 +627,7 @@ argz_create_sep (str, delim, pargz, pargz_len)
|
|||||||
assert (pargz);
|
assert (pargz);
|
||||||
assert (pargz_len);
|
assert (pargz_len);
|
||||||
|
|
||||||
/* Make a copy of STR, but replacing each occurence of
|
/* Make a copy of STR, but replacing each occurrence of
|
||||||
DELIM with '\0'. */
|
DELIM with '\0'. */
|
||||||
argz_len = 1+ LT_STRLEN (str);
|
argz_len = 1+ LT_STRLEN (str);
|
||||||
if (argz_len)
|
if (argz_len)
|
||||||
@ -1165,7 +1167,7 @@ static struct lt_user_dlloader sys_dl =
|
|||||||
|
|
||||||
/* --- SHL_LOAD() INTERFACE LOADER --- */
|
/* --- SHL_LOAD() INTERFACE LOADER --- */
|
||||||
|
|
||||||
#if HAVE_SHL_LOAD && !defined(__llvm__)
|
#if HAVE_SHL_LOAD
|
||||||
|
|
||||||
/* dynamic linking with shl_load (HP-UX) (comments from gmodule) */
|
/* dynamic linking with shl_load (HP-UX) (comments from gmodule) */
|
||||||
|
|
||||||
@ -1348,15 +1350,27 @@ sys_wll_open (loader_data, filename)
|
|||||||
if (!searchname)
|
if (!searchname)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#if __CYGWIN__
|
|
||||||
{
|
{
|
||||||
char wpath[MAX_PATH];
|
/* Silence dialog from LoadLibrary on some failures.
|
||||||
cygwin_conv_to_full_win32_path(searchname, wpath);
|
No way to get the error mode, but to set it,
|
||||||
module = LoadLibrary(wpath);
|
so set it twice to preserve any previous flags. */
|
||||||
}
|
UINT errormode = SetErrorMode(SEM_FAILCRITICALERRORS);
|
||||||
|
SetErrorMode(errormode | SEM_FAILCRITICALERRORS);
|
||||||
|
|
||||||
|
#if defined(__CYGWIN__)
|
||||||
|
{
|
||||||
|
char wpath[MAX_PATH];
|
||||||
|
cygwin_conv_to_full_win32_path (searchname, wpath);
|
||||||
|
module = LoadLibrary (wpath);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
module = LoadLibrary (searchname);
|
module = LoadLibrary (searchname);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Restore the error mode. */
|
||||||
|
SetErrorMode(errormode);
|
||||||
|
}
|
||||||
|
|
||||||
LT_DLFREE (searchname);
|
LT_DLFREE (searchname);
|
||||||
|
|
||||||
/* libltdl expects this function to fail if it is unable
|
/* libltdl expects this function to fail if it is unable
|
||||||
@ -2214,7 +2228,7 @@ lt_dlinit ()
|
|||||||
#if HAVE_LIBDL
|
#if HAVE_LIBDL
|
||||||
errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dl, "dlopen");
|
errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dl, "dlopen");
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_SHL_LOAD && !defined(__llvm__)
|
#if HAVE_SHL_LOAD
|
||||||
errors += lt_dlloader_add (lt_dlloader_next (0), &sys_shl, "dlopen");
|
errors += lt_dlloader_add (lt_dlloader_next (0), &sys_shl, "dlopen");
|
||||||
#endif
|
#endif
|
||||||
#ifdef __WINDOWS__
|
#ifdef __WINDOWS__
|
||||||
@ -2541,8 +2555,8 @@ find_module (handle, dir, libdir, dlname, old_name, installed)
|
|||||||
|
|
||||||
/* maybe it was moved to another directory */
|
/* maybe it was moved to another directory */
|
||||||
{
|
{
|
||||||
if (tryall_dlopen_module (handle,
|
if (dir && (tryall_dlopen_module (handle,
|
||||||
(const char *) 0, dir, dlname) == 0)
|
(const char *) 0, dir, dlname) == 0))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2869,12 +2883,6 @@ load_deplibs (handle, deplibs)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* restore the old search path */
|
|
||||||
LT_DLFREE (user_search_path);
|
|
||||||
user_search_path = save_search_path;
|
|
||||||
|
|
||||||
LT_DLMUTEX_UNLOCK ();
|
|
||||||
|
|
||||||
if (!depcount)
|
if (!depcount)
|
||||||
{
|
{
|
||||||
errors = 0;
|
errors = 0;
|
||||||
@ -2961,6 +2969,13 @@ load_deplibs (handle, deplibs)
|
|||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
LT_DLFREE (names);
|
LT_DLFREE (names);
|
||||||
|
/* restore the old search path */
|
||||||
|
if (user_search_path) {
|
||||||
|
LT_DLFREE (user_search_path);
|
||||||
|
user_search_path = save_search_path;
|
||||||
|
}
|
||||||
|
LT_DLMUTEX_UNLOCK ();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return errors;
|
return errors;
|
||||||
@ -3000,6 +3015,9 @@ trim (dest, str)
|
|||||||
|
|
||||||
LT_DLFREE (*dest);
|
LT_DLFREE (*dest);
|
||||||
|
|
||||||
|
if (!end)
|
||||||
|
return 1;
|
||||||
|
|
||||||
if (len > 3 && str[0] == '\'')
|
if (len > 3 && str[0] == '\'')
|
||||||
{
|
{
|
||||||
tmp = LT_EMALLOC (char, end - str);
|
tmp = LT_EMALLOC (char, end - str);
|
||||||
@ -3104,7 +3122,7 @@ try_dlopen (phandle, filename)
|
|||||||
++base_name;
|
++base_name;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
LT_DLMEM_REASSIGN (base_name, canonical);
|
base_name = canonical;
|
||||||
|
|
||||||
assert (base_name && *base_name);
|
assert (base_name && *base_name);
|
||||||
|
|
||||||
@ -3537,7 +3555,14 @@ lt_argz_insert (pargz, pargz_len, before, entry)
|
|||||||
{
|
{
|
||||||
error_t error;
|
error_t error;
|
||||||
|
|
||||||
if ((error = argz_insert (pargz, pargz_len, before, entry)))
|
/* Prior to Sep 8, 2005, newlib had a bug where argz_insert(pargz,
|
||||||
|
pargz_len, NULL, entry) failed with EINVAL. */
|
||||||
|
if (before)
|
||||||
|
error = argz_insert (pargz, pargz_len, before, entry);
|
||||||
|
else
|
||||||
|
error = argz_append (pargz, pargz_len, entry, 1 + LT_STRLEN (entry));
|
||||||
|
|
||||||
|
if (error)
|
||||||
{
|
{
|
||||||
switch (error)
|
switch (error)
|
||||||
{
|
{
|
||||||
@ -3989,7 +4014,7 @@ lt_dlpath_insertdir (ppath, before, dir)
|
|||||||
if (before)
|
if (before)
|
||||||
{
|
{
|
||||||
assert (*ppath <= before);
|
assert (*ppath <= before);
|
||||||
assert (before - *ppath <= (int)strlen (*ppath));
|
assert ((size_t)(before - *ppath) <= strlen (*ppath));
|
||||||
|
|
||||||
before = before - *ppath + argz;
|
before = before - *ppath + argz;
|
||||||
}
|
}
|
||||||
|
@ -20,32 +20,32 @@ Lesser General Public License for more details.
|
|||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
You should have received a copy of the GNU Lesser General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
02111-1307 USA
|
02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Only include this header file once. */
|
/* Only include this header file once. */
|
||||||
#ifndef LTDL_H
|
#ifndef LTDL_H
|
||||||
#define LTDL_H 1
|
#define LTDL_H 1
|
||||||
|
|
||||||
#include <sys/types.h> /* for size_t declaration */
|
#include <sys/types.h> /* for size_t declaration */
|
||||||
|
|
||||||
|
|
||||||
/* --- MACROS FOR PORTABILITY --- */
|
/* --- MACROS FOR PORTABILITY --- */
|
||||||
|
|
||||||
|
|
||||||
/* Saves on those hard to debug '\0' typos.... */
|
/* Saves on those hard to debug '\0' typos.... */
|
||||||
#define LT_EOS_CHAR '\0'
|
#define LT_EOS_CHAR '\0'
|
||||||
|
|
||||||
/* LTDL_BEGIN_C_DECLS should be used at the beginning of your declarations,
|
/* LTDL_BEGIN_C_DECLS should be used at the beginning of your declarations,
|
||||||
so that C++ compilers don't mangle their names. Use LTDL_END_C_DECLS at
|
so that C++ compilers don't mangle their names. Use LTDL_END_C_DECLS at
|
||||||
the end of C declarations. */
|
the end of C declarations. */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
# define LT_BEGIN_C_DECLS extern "C" {
|
# define LT_BEGIN_C_DECLS extern "C" {
|
||||||
# define LT_END_C_DECLS }
|
# define LT_END_C_DECLS }
|
||||||
#else
|
#else
|
||||||
# define LT_BEGIN_C_DECLS /* empty */
|
# define LT_BEGIN_C_DECLS /* empty */
|
||||||
# define LT_END_C_DECLS /* empty */
|
# define LT_END_C_DECLS /* empty */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LT_BEGIN_C_DECLS
|
LT_BEGIN_C_DECLS
|
||||||
@ -55,11 +55,11 @@ LT_BEGIN_C_DECLS
|
|||||||
that don't understand ANSI C prototypes still work, and ANSI C
|
that don't understand ANSI C prototypes still work, and ANSI C
|
||||||
compilers can issue warnings about type mismatches. */
|
compilers can issue warnings about type mismatches. */
|
||||||
#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus)
|
#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus)
|
||||||
# define LT_PARAMS(protos) protos
|
# define LT_PARAMS(protos) protos
|
||||||
# define lt_ptr void*
|
# define lt_ptr void*
|
||||||
#else
|
#else
|
||||||
# define LT_PARAMS(protos) ()
|
# define LT_PARAMS(protos) ()
|
||||||
# define lt_ptr char*
|
# define lt_ptr char*
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* LT_STMT_START/END are used to create macros which expand to a
|
/* LT_STMT_START/END are used to create macros which expand to a
|
||||||
@ -80,13 +80,13 @@ LT_BEGIN_C_DECLS
|
|||||||
/* LT_CONC creates a new concatenated symbol for the compiler
|
/* LT_CONC creates a new concatenated symbol for the compiler
|
||||||
in a portable way. */
|
in a portable way. */
|
||||||
#if defined(__STDC__) || defined(__cplusplus) || defined(_MSC_VER)
|
#if defined(__STDC__) || defined(__cplusplus) || defined(_MSC_VER)
|
||||||
# define LT_CONC(s,t) s##t
|
# define LT_CONC(s,t) s##t
|
||||||
#else
|
#else
|
||||||
# define LT_CONC(s,t) s/**/t
|
# define LT_CONC(s,t) s/**/t
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* LT_STRLEN can be used safely on NULL pointers. */
|
/* LT_STRLEN can be used safely on NULL pointers. */
|
||||||
#define LT_STRLEN(s) (((s) && (s)[0]) ? strlen (s) : 0)
|
#define LT_STRLEN(s) (((s) && (s)[0]) ? strlen (s) : 0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -116,27 +116,27 @@ LT_BEGIN_C_DECLS
|
|||||||
# ifndef __CYGWIN__
|
# ifndef __CYGWIN__
|
||||||
/* LT_DIRSEP_CHAR is accepted *in addition* to '/' as a directory
|
/* LT_DIRSEP_CHAR is accepted *in addition* to '/' as a directory
|
||||||
separator when it is set. */
|
separator when it is set. */
|
||||||
# define LT_DIRSEP_CHAR '\\'
|
# define LT_DIRSEP_CHAR '\\'
|
||||||
# define LT_PATHSEP_CHAR ';'
|
# define LT_PATHSEP_CHAR ';'
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifndef LT_PATHSEP_CHAR
|
#ifndef LT_PATHSEP_CHAR
|
||||||
# define LT_PATHSEP_CHAR ':'
|
# define LT_PATHSEP_CHAR ':'
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* DLL building support on win32 hosts; mostly to workaround their
|
/* DLL building support on win32 hosts; mostly to workaround their
|
||||||
ridiculous implementation of data symbol exporting. */
|
ridiculous implementation of data symbol exporting. */
|
||||||
#ifndef LT_SCOPE
|
#ifndef LT_SCOPE
|
||||||
# ifdef __WINDOWS__
|
# ifdef __WINDOWS__
|
||||||
# ifdef DLL_EXPORT /* defined by libtool (if required) */
|
# ifdef DLL_EXPORT /* defined by libtool (if required) */
|
||||||
# define LT_SCOPE __declspec(dllexport)
|
# define LT_SCOPE __declspec(dllexport)
|
||||||
# endif
|
# endif
|
||||||
# ifdef LIBLTDL_DLL_IMPORT /* define if linking with this dll */
|
# ifdef LIBLTDL_DLL_IMPORT /* define if linking with this dll */
|
||||||
# define LT_SCOPE extern __declspec(dllimport)
|
# define LT_SCOPE extern __declspec(dllimport)
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
# ifndef LT_SCOPE /* static linking or !__WINDOWS__ */
|
# ifndef LT_SCOPE /* static linking or !__WINDOWS__ */
|
||||||
# define LT_SCOPE extern
|
# define LT_SCOPE extern
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -150,34 +150,34 @@ LT_BEGIN_C_DECLS
|
|||||||
/* --- DYNAMIC MODULE LOADING API --- */
|
/* --- DYNAMIC MODULE LOADING API --- */
|
||||||
|
|
||||||
|
|
||||||
typedef struct lt_dlhandle_struct *lt_dlhandle; /* A loaded module. */
|
typedef struct lt_dlhandle_struct *lt_dlhandle; /* A loaded module. */
|
||||||
|
|
||||||
/* Initialisation and finalisation functions for libltdl. */
|
/* Initialisation and finalisation functions for libltdl. */
|
||||||
LT_SCOPE int lt_dlinit LT_PARAMS((void));
|
LT_SCOPE int lt_dlinit LT_PARAMS((void));
|
||||||
LT_SCOPE int lt_dlexit LT_PARAMS((void));
|
LT_SCOPE int lt_dlexit LT_PARAMS((void));
|
||||||
|
|
||||||
/* Module search path manipulation. */
|
/* Module search path manipulation. */
|
||||||
LT_SCOPE int lt_dladdsearchdir LT_PARAMS((const char *search_dir));
|
LT_SCOPE int lt_dladdsearchdir LT_PARAMS((const char *search_dir));
|
||||||
LT_SCOPE int lt_dlinsertsearchdir LT_PARAMS((const char *before,
|
LT_SCOPE int lt_dlinsertsearchdir LT_PARAMS((const char *before,
|
||||||
const char *search_dir));
|
const char *search_dir));
|
||||||
LT_SCOPE int lt_dlsetsearchpath LT_PARAMS((const char *search_path));
|
LT_SCOPE int lt_dlsetsearchpath LT_PARAMS((const char *search_path));
|
||||||
LT_SCOPE const char *lt_dlgetsearchpath LT_PARAMS((void));
|
LT_SCOPE const char *lt_dlgetsearchpath LT_PARAMS((void));
|
||||||
LT_SCOPE int lt_dlforeachfile LT_PARAMS((
|
LT_SCOPE int lt_dlforeachfile LT_PARAMS((
|
||||||
const char *search_path,
|
const char *search_path,
|
||||||
int (*func) (const char *filename, lt_ptr data),
|
int (*func) (const char *filename, lt_ptr data),
|
||||||
lt_ptr data));
|
lt_ptr data));
|
||||||
|
|
||||||
/* Portable libltdl versions of the system dlopen() API. */
|
/* Portable libltdl versions of the system dlopen() API. */
|
||||||
LT_SCOPE lt_dlhandle lt_dlopen LT_PARAMS((const char *filename));
|
LT_SCOPE lt_dlhandle lt_dlopen LT_PARAMS((const char *filename));
|
||||||
LT_SCOPE lt_dlhandle lt_dlopenext LT_PARAMS((const char *filename));
|
LT_SCOPE lt_dlhandle lt_dlopenext LT_PARAMS((const char *filename));
|
||||||
LT_SCOPE lt_ptr lt_dlsym LT_PARAMS((lt_dlhandle handle,
|
LT_SCOPE lt_ptr lt_dlsym LT_PARAMS((lt_dlhandle handle,
|
||||||
const char *name));
|
const char *name));
|
||||||
LT_SCOPE const char *lt_dlerror LT_PARAMS((void));
|
LT_SCOPE const char *lt_dlerror LT_PARAMS((void));
|
||||||
LT_SCOPE int lt_dlclose LT_PARAMS((lt_dlhandle handle));
|
LT_SCOPE int lt_dlclose LT_PARAMS((lt_dlhandle handle));
|
||||||
|
|
||||||
/* Module residency management. */
|
/* Module residency management. */
|
||||||
LT_SCOPE int lt_dlmakeresident LT_PARAMS((lt_dlhandle handle));
|
LT_SCOPE int lt_dlmakeresident LT_PARAMS((lt_dlhandle handle));
|
||||||
LT_SCOPE int lt_dlisresident LT_PARAMS((lt_dlhandle handle));
|
LT_SCOPE int lt_dlisresident LT_PARAMS((lt_dlhandle handle));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -185,15 +185,15 @@ LT_SCOPE int lt_dlisresident LT_PARAMS((lt_dlhandle handle));
|
|||||||
/* --- MUTEX LOCKING --- */
|
/* --- MUTEX LOCKING --- */
|
||||||
|
|
||||||
|
|
||||||
typedef void lt_dlmutex_lock LT_PARAMS((void));
|
typedef void lt_dlmutex_lock LT_PARAMS((void));
|
||||||
typedef void lt_dlmutex_unlock LT_PARAMS((void));
|
typedef void lt_dlmutex_unlock LT_PARAMS((void));
|
||||||
typedef void lt_dlmutex_seterror LT_PARAMS((const char *errmsg));
|
typedef void lt_dlmutex_seterror LT_PARAMS((const char *errmsg));
|
||||||
typedef const char *lt_dlmutex_geterror LT_PARAMS((void));
|
typedef const char *lt_dlmutex_geterror LT_PARAMS((void));
|
||||||
|
|
||||||
LT_SCOPE int lt_dlmutex_register LT_PARAMS((lt_dlmutex_lock *lock,
|
LT_SCOPE int lt_dlmutex_register LT_PARAMS((lt_dlmutex_lock *lock,
|
||||||
lt_dlmutex_unlock *unlock,
|
lt_dlmutex_unlock *unlock,
|
||||||
lt_dlmutex_seterror *seterror,
|
lt_dlmutex_seterror *seterror,
|
||||||
lt_dlmutex_geterror *geterror));
|
lt_dlmutex_geterror *geterror));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -206,9 +206,9 @@ LT_SCOPE int lt_dlmutex_register LT_PARAMS((lt_dlmutex_lock *lock
|
|||||||
libltdl relies on a featureful realloc, but if you are sure yours
|
libltdl relies on a featureful realloc, but if you are sure yours
|
||||||
has the right semantics then you can assign it directly. Generally,
|
has the right semantics then you can assign it directly. Generally,
|
||||||
it is safe to assign just a malloc() and a free() function. */
|
it is safe to assign just a malloc() and a free() function. */
|
||||||
LT_SCOPE lt_ptr (*lt_dlmalloc) LT_PARAMS((size_t size));
|
LT_SCOPE lt_ptr (*lt_dlmalloc) LT_PARAMS((size_t size));
|
||||||
LT_SCOPE lt_ptr (*lt_dlrealloc) LT_PARAMS((lt_ptr ptr, size_t size));
|
LT_SCOPE lt_ptr (*lt_dlrealloc) LT_PARAMS((lt_ptr ptr, size_t size));
|
||||||
LT_SCOPE void (*lt_dlfree) LT_PARAMS((lt_ptr ptr));
|
LT_SCOPE void (*lt_dlfree) LT_PARAMS((lt_ptr ptr));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -223,14 +223,14 @@ typedef struct {
|
|||||||
lt_ptr address;
|
lt_ptr address;
|
||||||
} lt_dlsymlist;
|
} lt_dlsymlist;
|
||||||
|
|
||||||
LT_SCOPE int lt_dlpreload LT_PARAMS((const lt_dlsymlist *preloaded));
|
LT_SCOPE int lt_dlpreload LT_PARAMS((const lt_dlsymlist *preloaded));
|
||||||
LT_SCOPE int lt_dlpreload_default
|
LT_SCOPE int lt_dlpreload_default
|
||||||
LT_PARAMS((const lt_dlsymlist *preloaded));
|
LT_PARAMS((const lt_dlsymlist *preloaded));
|
||||||
|
|
||||||
#define LTDL_SET_PRELOADED_SYMBOLS() LT_STMT_START{ \
|
#define LTDL_SET_PRELOADED_SYMBOLS() LT_STMT_START{ \
|
||||||
extern const lt_dlsymlist lt_preloaded_symbols[]; \
|
extern const lt_dlsymlist lt_preloaded_symbols[]; \
|
||||||
lt_dlpreload_default(lt_preloaded_symbols); \
|
lt_dlpreload_default(lt_preloaded_symbols); \
|
||||||
}LT_STMT_END
|
}LT_STMT_END
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -239,67 +239,67 @@ LT_SCOPE int lt_dlpreload_default
|
|||||||
|
|
||||||
|
|
||||||
/* Read only information pertaining to a loaded module. */
|
/* Read only information pertaining to a loaded module. */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *filename; /* file name */
|
char *filename; /* file name */
|
||||||
char *name; /* module name */
|
char *name; /* module name */
|
||||||
int ref_count; /* number of times lt_dlopened minus
|
int ref_count; /* number of times lt_dlopened minus
|
||||||
number of times lt_dlclosed. */
|
number of times lt_dlclosed. */
|
||||||
} lt_dlinfo;
|
} lt_dlinfo;
|
||||||
|
|
||||||
LT_SCOPE const lt_dlinfo *lt_dlgetinfo LT_PARAMS((lt_dlhandle handle));
|
LT_SCOPE const lt_dlinfo *lt_dlgetinfo LT_PARAMS((lt_dlhandle handle));
|
||||||
LT_SCOPE lt_dlhandle lt_dlhandle_next LT_PARAMS((lt_dlhandle place));
|
LT_SCOPE lt_dlhandle lt_dlhandle_next LT_PARAMS((lt_dlhandle place));
|
||||||
LT_SCOPE int lt_dlforeach LT_PARAMS((
|
LT_SCOPE int lt_dlforeach LT_PARAMS((
|
||||||
int (*func) (lt_dlhandle handle, lt_ptr data),
|
int (*func) (lt_dlhandle handle, lt_ptr data),
|
||||||
lt_ptr data));
|
lt_ptr data));
|
||||||
|
|
||||||
/* Associating user data with loaded modules. */
|
/* Associating user data with loaded modules. */
|
||||||
typedef unsigned lt_dlcaller_id;
|
typedef unsigned lt_dlcaller_id;
|
||||||
|
|
||||||
LT_SCOPE lt_dlcaller_id lt_dlcaller_register LT_PARAMS((void));
|
LT_SCOPE lt_dlcaller_id lt_dlcaller_register LT_PARAMS((void));
|
||||||
LT_SCOPE lt_ptr lt_dlcaller_set_data LT_PARAMS((lt_dlcaller_id key,
|
LT_SCOPE lt_ptr lt_dlcaller_set_data LT_PARAMS((lt_dlcaller_id key,
|
||||||
lt_dlhandle handle,
|
lt_dlhandle handle,
|
||||||
lt_ptr data));
|
lt_ptr data));
|
||||||
LT_SCOPE lt_ptr lt_dlcaller_get_data LT_PARAMS((lt_dlcaller_id key,
|
LT_SCOPE lt_ptr lt_dlcaller_get_data LT_PARAMS((lt_dlcaller_id key,
|
||||||
lt_dlhandle handle));
|
lt_dlhandle handle));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* --- USER MODULE LOADER API --- */
|
/* --- USER MODULE LOADER API --- */
|
||||||
|
|
||||||
|
|
||||||
typedef struct lt_dlloader lt_dlloader;
|
typedef struct lt_dlloader lt_dlloader;
|
||||||
typedef lt_ptr lt_user_data;
|
typedef lt_ptr lt_user_data;
|
||||||
typedef lt_ptr lt_module;
|
typedef lt_ptr lt_module;
|
||||||
|
|
||||||
/* Function pointer types for creating user defined module loaders. */
|
/* Function pointer types for creating user defined module loaders. */
|
||||||
typedef lt_module lt_module_open LT_PARAMS((lt_user_data loader_data,
|
typedef lt_module lt_module_open LT_PARAMS((lt_user_data loader_data,
|
||||||
const char *filename));
|
const char *filename));
|
||||||
typedef int lt_module_close LT_PARAMS((lt_user_data loader_data,
|
typedef int lt_module_close LT_PARAMS((lt_user_data loader_data,
|
||||||
lt_module handle));
|
lt_module handle));
|
||||||
typedef lt_ptr lt_find_sym LT_PARAMS((lt_user_data loader_data,
|
typedef lt_ptr lt_find_sym LT_PARAMS((lt_user_data loader_data,
|
||||||
lt_module handle,
|
lt_module handle,
|
||||||
const char *symbol));
|
const char *symbol));
|
||||||
typedef int lt_dlloader_exit LT_PARAMS((lt_user_data loader_data));
|
typedef int lt_dlloader_exit LT_PARAMS((lt_user_data loader_data));
|
||||||
|
|
||||||
struct lt_user_dlloader {
|
struct lt_user_dlloader {
|
||||||
const char *sym_prefix;
|
const char *sym_prefix;
|
||||||
lt_module_open *module_open;
|
lt_module_open *module_open;
|
||||||
lt_module_close *module_close;
|
lt_module_close *module_close;
|
||||||
lt_find_sym *find_sym;
|
lt_find_sym *find_sym;
|
||||||
lt_dlloader_exit *dlloader_exit;
|
lt_dlloader_exit *dlloader_exit;
|
||||||
lt_user_data dlloader_data;
|
lt_user_data dlloader_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
LT_SCOPE lt_dlloader *lt_dlloader_next LT_PARAMS((lt_dlloader *place));
|
LT_SCOPE lt_dlloader *lt_dlloader_next LT_PARAMS((lt_dlloader *place));
|
||||||
LT_SCOPE lt_dlloader *lt_dlloader_find LT_PARAMS((
|
LT_SCOPE lt_dlloader *lt_dlloader_find LT_PARAMS((
|
||||||
const char *loader_name));
|
const char *loader_name));
|
||||||
LT_SCOPE const char *lt_dlloader_name LT_PARAMS((lt_dlloader *place));
|
LT_SCOPE const char *lt_dlloader_name LT_PARAMS((lt_dlloader *place));
|
||||||
LT_SCOPE lt_user_data *lt_dlloader_data LT_PARAMS((lt_dlloader *place));
|
LT_SCOPE lt_user_data *lt_dlloader_data LT_PARAMS((lt_dlloader *place));
|
||||||
LT_SCOPE int lt_dlloader_add LT_PARAMS((lt_dlloader *place,
|
LT_SCOPE int lt_dlloader_add LT_PARAMS((lt_dlloader *place,
|
||||||
const struct lt_user_dlloader *dlloader,
|
const struct lt_user_dlloader *dlloader,
|
||||||
const char *loader_name));
|
const char *loader_name));
|
||||||
LT_SCOPE int lt_dlloader_remove LT_PARAMS((
|
LT_SCOPE int lt_dlloader_remove LT_PARAMS((
|
||||||
const char *loader_name));
|
const char *loader_name));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -310,39 +310,39 @@ LT_SCOPE int lt_dlloader_remove LT_PARAMS((
|
|||||||
this way allows us to expand the macro in different contexts with
|
this way allows us to expand the macro in different contexts with
|
||||||
confidence that the enumeration of symbolic names will map correctly
|
confidence that the enumeration of symbolic names will map correctly
|
||||||
onto the table of error strings. */
|
onto the table of error strings. */
|
||||||
#define lt_dlerror_table \
|
#define lt_dlerror_table \
|
||||||
LT_ERROR(UNKNOWN, "unknown error") \
|
LT_ERROR(UNKNOWN, "unknown error") \
|
||||||
LT_ERROR(DLOPEN_NOT_SUPPORTED, "dlopen support not available") \
|
LT_ERROR(DLOPEN_NOT_SUPPORTED, "dlopen support not available") \
|
||||||
LT_ERROR(INVALID_LOADER, "invalid loader") \
|
LT_ERROR(INVALID_LOADER, "invalid loader") \
|
||||||
LT_ERROR(INIT_LOADER, "loader initialization failed") \
|
LT_ERROR(INIT_LOADER, "loader initialization failed") \
|
||||||
LT_ERROR(REMOVE_LOADER, "loader removal failed") \
|
LT_ERROR(REMOVE_LOADER, "loader removal failed") \
|
||||||
LT_ERROR(FILE_NOT_FOUND, "file not found") \
|
LT_ERROR(FILE_NOT_FOUND, "file not found") \
|
||||||
LT_ERROR(DEPLIB_NOT_FOUND, "dependency library not found") \
|
LT_ERROR(DEPLIB_NOT_FOUND, "dependency library not found") \
|
||||||
LT_ERROR(NO_SYMBOLS, "no symbols defined") \
|
LT_ERROR(NO_SYMBOLS, "no symbols defined") \
|
||||||
LT_ERROR(CANNOT_OPEN, "can't open the module") \
|
LT_ERROR(CANNOT_OPEN, "can't open the module") \
|
||||||
LT_ERROR(CANNOT_CLOSE, "can't close the module") \
|
LT_ERROR(CANNOT_CLOSE, "can't close the module") \
|
||||||
LT_ERROR(SYMBOL_NOT_FOUND, "symbol not found") \
|
LT_ERROR(SYMBOL_NOT_FOUND, "symbol not found") \
|
||||||
LT_ERROR(NO_MEMORY, "not enough memory") \
|
LT_ERROR(NO_MEMORY, "not enough memory") \
|
||||||
LT_ERROR(INVALID_HANDLE, "invalid module handle") \
|
LT_ERROR(INVALID_HANDLE, "invalid module handle") \
|
||||||
LT_ERROR(BUFFER_OVERFLOW, "internal buffer overflow") \
|
LT_ERROR(BUFFER_OVERFLOW, "internal buffer overflow") \
|
||||||
LT_ERROR(INVALID_ERRORCODE, "invalid errorcode") \
|
LT_ERROR(INVALID_ERRORCODE, "invalid errorcode") \
|
||||||
LT_ERROR(SHUTDOWN, "library already shutdown") \
|
LT_ERROR(SHUTDOWN, "library already shutdown") \
|
||||||
LT_ERROR(CLOSE_RESIDENT_MODULE, "can't close resident module") \
|
LT_ERROR(CLOSE_RESIDENT_MODULE, "can't close resident module") \
|
||||||
LT_ERROR(INVALID_MUTEX_ARGS, "invalid mutex handler registration") \
|
LT_ERROR(INVALID_MUTEX_ARGS, "invalid mutex handler registration") \
|
||||||
LT_ERROR(INVALID_POSITION, "invalid search path insert position")
|
LT_ERROR(INVALID_POSITION, "invalid search path insert position")
|
||||||
|
|
||||||
/* Enumerate the symbolic error names. */
|
/* Enumerate the symbolic error names. */
|
||||||
enum {
|
enum {
|
||||||
#define LT_ERROR(name, diagnostic) LT_CONC(LT_ERROR_, name),
|
#define LT_ERROR(name, diagnostic) LT_CONC(LT_ERROR_, name),
|
||||||
lt_dlerror_table
|
lt_dlerror_table
|
||||||
#undef LT_ERROR
|
#undef LT_ERROR
|
||||||
|
|
||||||
LT_ERROR_MAX
|
LT_ERROR_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
/* These functions are only useful from inside custom module loaders. */
|
/* These functions are only useful from inside custom module loaders. */
|
||||||
LT_SCOPE int lt_dladderror LT_PARAMS((const char *diagnostic));
|
LT_SCOPE int lt_dladderror LT_PARAMS((const char *diagnostic));
|
||||||
LT_SCOPE int lt_dlseterror LT_PARAMS((int errorcode));
|
LT_SCOPE int lt_dlseterror LT_PARAMS((int errorcode));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -351,14 +351,14 @@ LT_SCOPE int lt_dlseterror LT_PARAMS((int errorcode));
|
|||||||
|
|
||||||
|
|
||||||
#ifdef LT_NON_POSIX_NAMESPACE
|
#ifdef LT_NON_POSIX_NAMESPACE
|
||||||
# define lt_ptr_t lt_ptr
|
# define lt_ptr_t lt_ptr
|
||||||
# define lt_module_t lt_module
|
# define lt_module_t lt_module
|
||||||
# define lt_module_open_t lt_module_open
|
# define lt_module_open_t lt_module_open
|
||||||
# define lt_module_close_t lt_module_close
|
# define lt_module_close_t lt_module_close
|
||||||
# define lt_find_sym_t lt_find_sym
|
# define lt_find_sym_t lt_find_sym
|
||||||
# define lt_dlloader_exit_t lt_dlloader_exit
|
# define lt_dlloader_exit_t lt_dlloader_exit
|
||||||
# define lt_dlloader_t lt_dlloader
|
# define lt_dlloader_t lt_dlloader
|
||||||
# define lt_dlloader_data_t lt_user_data
|
# define lt_dlloader_data_t lt_user_data
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LT_END_C_DECLS
|
LT_END_C_DECLS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user