Sun Mar 11 10:37:32 2018 UTC ()
merge libpciaccess 0.14.


(mrg)
diff -r1.5 -r1.6 xsrc/external/mit/libpciaccess/dist/m4/libtool.m4
diff -r1.16 -r1.17 xsrc/external/mit/libpciaccess/dist/src/netbsd_pci.c

cvs diff -r1.5 -r1.6 xsrc/external/mit/libpciaccess/dist/m4/libtool.m4 (switch to unified diff)

--- xsrc/external/mit/libpciaccess/dist/m4/libtool.m4 2017/08/29 05:52:34 1.5
+++ xsrc/external/mit/libpciaccess/dist/m4/libtool.m4 2018/03/11 10:37:32 1.6
@@ -1871,2007 +1871,2010 @@ else @@ -1871,2007 +1871,2010 @@ else
1871# endif 1871# endif
1872#endif 1872#endif
1873 1873
1874/* When -fvisibility=hidden is used, assume the code has been annotated 1874/* When -fvisibility=hidden is used, assume the code has been annotated
1875 correspondingly for the symbols needed. */ 1875 correspondingly for the symbols needed. */
1876#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) 1876#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1877int fnord () __attribute__((visibility("default"))); 1877int fnord () __attribute__((visibility("default")));
1878#endif 1878#endif
1879 1879
1880int fnord () { return 42; } 1880int fnord () { return 42; }
1881int main () 1881int main ()
1882{ 1882{
1883 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); 1883 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1884 int status = $lt_dlunknown; 1884 int status = $lt_dlunknown;
1885 1885
1886 if (self) 1886 if (self)
1887 { 1887 {
1888 if (dlsym (self,"fnord")) status = $lt_dlno_uscore; 1888 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
1889 else 1889 else
1890 { 1890 {
1891 if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; 1891 if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1892 else puts (dlerror ()); 1892 else puts (dlerror ());
1893 } 1893 }
1894 /* dlclose (self); */ 1894 /* dlclose (self); */
1895 } 1895 }
1896 else 1896 else
1897 puts (dlerror ()); 1897 puts (dlerror ());
1898 1898
1899 return status; 1899 return status;
1900}] 1900}]
1901_LT_EOF 1901_LT_EOF
1902 if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then 1902 if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
1903 (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null 1903 (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1904 lt_status=$? 1904 lt_status=$?
1905 case x$lt_status in 1905 case x$lt_status in
1906 x$lt_dlno_uscore) $1 ;; 1906 x$lt_dlno_uscore) $1 ;;
1907 x$lt_dlneed_uscore) $2 ;; 1907 x$lt_dlneed_uscore) $2 ;;
1908 x$lt_dlunknown|x*) $3 ;; 1908 x$lt_dlunknown|x*) $3 ;;
1909 esac 1909 esac
1910 else : 1910 else :
1911 # compilation failed 1911 # compilation failed
1912 $3 1912 $3
1913 fi 1913 fi
1914fi 1914fi
1915rm -fr conftest* 1915rm -fr conftest*
1916])# _LT_TRY_DLOPEN_SELF 1916])# _LT_TRY_DLOPEN_SELF
1917 1917
1918 1918
1919# LT_SYS_DLOPEN_SELF 1919# LT_SYS_DLOPEN_SELF
1920# ------------------ 1920# ------------------
1921AC_DEFUN([LT_SYS_DLOPEN_SELF], 1921AC_DEFUN([LT_SYS_DLOPEN_SELF],
1922[m4_require([_LT_HEADER_DLFCN])dnl 1922[m4_require([_LT_HEADER_DLFCN])dnl
1923if test yes != "$enable_dlopen"; then 1923if test yes != "$enable_dlopen"; then
1924 enable_dlopen=unknown 1924 enable_dlopen=unknown
1925 enable_dlopen_self=unknown 1925 enable_dlopen_self=unknown
1926 enable_dlopen_self_static=unknown 1926 enable_dlopen_self_static=unknown
1927else 1927else
1928 lt_cv_dlopen=no 1928 lt_cv_dlopen=no
1929 lt_cv_dlopen_libs= 1929 lt_cv_dlopen_libs=
1930 1930
1931 case $host_os in 1931 case $host_os in
1932 beos*) 1932 beos*)
1933 lt_cv_dlopen=load_add_on 1933 lt_cv_dlopen=load_add_on
1934 lt_cv_dlopen_libs= 1934 lt_cv_dlopen_libs=
1935 lt_cv_dlopen_self=yes 1935 lt_cv_dlopen_self=yes
1936 ;; 1936 ;;
1937 1937
1938 mingw* | pw32* | cegcc*) 1938 mingw* | pw32* | cegcc*)
1939 lt_cv_dlopen=LoadLibrary 1939 lt_cv_dlopen=LoadLibrary
1940 lt_cv_dlopen_libs= 1940 lt_cv_dlopen_libs=
1941 ;; 1941 ;;
1942 1942
1943 cygwin*) 1943 cygwin*)
1944 lt_cv_dlopen=dlopen 1944 lt_cv_dlopen=dlopen
1945 lt_cv_dlopen_libs= 1945 lt_cv_dlopen_libs=
1946 ;; 1946 ;;
1947 1947
1948 darwin*) 1948 darwin*)
1949 # if libdl is installed we need to link against it 1949 # if libdl is installed we need to link against it
1950 AC_CHECK_LIB([dl], [dlopen], 1950 AC_CHECK_LIB([dl], [dlopen],
1951 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ 1951 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
1952 lt_cv_dlopen=dyld 1952 lt_cv_dlopen=dyld
1953 lt_cv_dlopen_libs= 1953 lt_cv_dlopen_libs=
1954 lt_cv_dlopen_self=yes 1954 lt_cv_dlopen_self=yes
1955 ]) 1955 ])
1956 ;; 1956 ;;
1957 1957
1958 tpf*) 1958 tpf*)
1959 # Don't try to run any link tests for TPF. We know it's impossible 1959 # Don't try to run any link tests for TPF. We know it's impossible
1960 # because TPF is a cross-compiler, and we know how we open DSOs. 1960 # because TPF is a cross-compiler, and we know how we open DSOs.
1961 lt_cv_dlopen=dlopen 1961 lt_cv_dlopen=dlopen
1962 lt_cv_dlopen_libs= 1962 lt_cv_dlopen_libs=
1963 lt_cv_dlopen_self=no 1963 lt_cv_dlopen_self=no
1964 ;; 1964 ;;
1965 1965
1966 *) 1966 *)
1967 AC_CHECK_FUNC([shl_load], 1967 AC_CHECK_FUNC([shl_load],
1968 [lt_cv_dlopen=shl_load], 1968 [lt_cv_dlopen=shl_load],
1969 [AC_CHECK_LIB([dld], [shl_load], 1969 [AC_CHECK_LIB([dld], [shl_load],
1970 [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], 1970 [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
1971 [AC_CHECK_FUNC([dlopen], 1971 [AC_CHECK_FUNC([dlopen],
1972 [lt_cv_dlopen=dlopen], 1972 [lt_cv_dlopen=dlopen],
1973 [AC_CHECK_LIB([dl], [dlopen], 1973 [AC_CHECK_LIB([dl], [dlopen],
1974 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], 1974 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
1975 [AC_CHECK_LIB([svld], [dlopen], 1975 [AC_CHECK_LIB([svld], [dlopen],
1976 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], 1976 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
1977 [AC_CHECK_LIB([dld], [dld_link], 1977 [AC_CHECK_LIB([dld], [dld_link],
1978 [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) 1978 [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
1979 ]) 1979 ])
1980 ]) 1980 ])
1981 ]) 1981 ])
1982 ]) 1982 ])
1983 ]) 1983 ])
1984 ;; 1984 ;;
1985 esac 1985 esac
1986 1986
1987 if test no = "$lt_cv_dlopen"; then 1987 if test no = "$lt_cv_dlopen"; then
1988 enable_dlopen=no 1988 enable_dlopen=no
1989 else 1989 else
1990 enable_dlopen=yes 1990 enable_dlopen=yes
1991 fi 1991 fi
1992 1992
1993 case $lt_cv_dlopen in 1993 case $lt_cv_dlopen in
1994 dlopen) 1994 dlopen)
1995 save_CPPFLAGS=$CPPFLAGS 1995 save_CPPFLAGS=$CPPFLAGS
1996 test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" 1996 test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1997 1997
1998 save_LDFLAGS=$LDFLAGS 1998 save_LDFLAGS=$LDFLAGS
1999 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" 1999 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2000 2000
2001 save_LIBS=$LIBS 2001 save_LIBS=$LIBS
2002 LIBS="$lt_cv_dlopen_libs $LIBS" 2002 LIBS="$lt_cv_dlopen_libs $LIBS"
2003 2003
2004 AC_CACHE_CHECK([whether a program can dlopen itself], 2004 AC_CACHE_CHECK([whether a program can dlopen itself],
2005 lt_cv_dlopen_self, [dnl 2005 lt_cv_dlopen_self, [dnl
2006 _LT_TRY_DLOPEN_SELF( 2006 _LT_TRY_DLOPEN_SELF(
2007 lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, 2007 lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2008 lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) 2008 lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2009 ]) 2009 ])
2010 2010
2011 if test yes = "$lt_cv_dlopen_self"; then 2011 if test yes = "$lt_cv_dlopen_self"; then
2012 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" 2012 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
2013 AC_CACHE_CHECK([whether a statically linked program can dlopen itself], 2013 AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2014 lt_cv_dlopen_self_static, [dnl 2014 lt_cv_dlopen_self_static, [dnl
2015 _LT_TRY_DLOPEN_SELF( 2015 _LT_TRY_DLOPEN_SELF(
2016 lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, 2016 lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2017 lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) 2017 lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
2018 ]) 2018 ])
2019 fi 2019 fi
2020 2020
2021 CPPFLAGS=$save_CPPFLAGS 2021 CPPFLAGS=$save_CPPFLAGS
2022 LDFLAGS=$save_LDFLAGS 2022 LDFLAGS=$save_LDFLAGS
2023 LIBS=$save_LIBS 2023 LIBS=$save_LIBS
2024 ;; 2024 ;;
2025 esac 2025 esac
2026 2026
2027 case $lt_cv_dlopen_self in 2027 case $lt_cv_dlopen_self in
2028 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; 2028 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2029 *) enable_dlopen_self=unknown ;; 2029 *) enable_dlopen_self=unknown ;;
2030 esac 2030 esac
2031 2031
2032 case $lt_cv_dlopen_self_static in 2032 case $lt_cv_dlopen_self_static in
2033 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; 2033 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2034 *) enable_dlopen_self_static=unknown ;; 2034 *) enable_dlopen_self_static=unknown ;;
2035 esac 2035 esac
2036fi 2036fi
2037_LT_DECL([dlopen_support], [enable_dlopen], [0], 2037_LT_DECL([dlopen_support], [enable_dlopen], [0],
2038 [Whether dlopen is supported]) 2038 [Whether dlopen is supported])
2039_LT_DECL([dlopen_self], [enable_dlopen_self], [0], 2039_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
2040 [Whether dlopen of programs is supported]) 2040 [Whether dlopen of programs is supported])
2041_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], 2041_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
2042 [Whether dlopen of statically linked programs is supported]) 2042 [Whether dlopen of statically linked programs is supported])
2043])# LT_SYS_DLOPEN_SELF 2043])# LT_SYS_DLOPEN_SELF
2044 2044
2045# Old name: 2045# Old name:
2046AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) 2046AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
2047dnl aclocal-1.4 backwards compatibility: 2047dnl aclocal-1.4 backwards compatibility:
2048dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) 2048dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2049 2049
2050 2050
2051# _LT_COMPILER_C_O([TAGNAME]) 2051# _LT_COMPILER_C_O([TAGNAME])
2052# --------------------------- 2052# ---------------------------
2053# Check to see if options -c and -o are simultaneously supported by compiler. 2053# Check to see if options -c and -o are simultaneously supported by compiler.
2054# This macro does not hard code the compiler like AC_PROG_CC_C_O. 2054# This macro does not hard code the compiler like AC_PROG_CC_C_O.
2055m4_defun([_LT_COMPILER_C_O], 2055m4_defun([_LT_COMPILER_C_O],
2056[m4_require([_LT_DECL_SED])dnl 2056[m4_require([_LT_DECL_SED])dnl
2057m4_require([_LT_FILEUTILS_DEFAULTS])dnl 2057m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2058m4_require([_LT_TAG_COMPILER])dnl 2058m4_require([_LT_TAG_COMPILER])dnl
2059AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], 2059AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
2060 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], 2060 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
2061 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no 2061 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
2062 $RM -r conftest 2>/dev/null 2062 $RM -r conftest 2>/dev/null
2063 mkdir conftest 2063 mkdir conftest
2064 cd conftest 2064 cd conftest
2065 mkdir out 2065 mkdir out
2066 echo "$lt_simple_compile_test_code" > conftest.$ac_ext 2066 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2067 2067
2068 lt_compiler_flag="-o out/conftest2.$ac_objext" 2068 lt_compiler_flag="-o out/conftest2.$ac_objext"
2069 # Insert the option either (1) after the last *FLAGS variable, or 2069 # Insert the option either (1) after the last *FLAGS variable, or
2070 # (2) before a word containing "conftest.", or (3) at the end. 2070 # (2) before a word containing "conftest.", or (3) at the end.
2071 # Note that $ac_compile itself does not contain backslashes and begins 2071 # Note that $ac_compile itself does not contain backslashes and begins
2072 # with a dollar sign (not a hyphen), so the echo should work correctly. 2072 # with a dollar sign (not a hyphen), so the echo should work correctly.
2073 lt_compile=`echo "$ac_compile" | $SED \ 2073 lt_compile=`echo "$ac_compile" | $SED \
2074 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ 2074 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2075 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ 2075 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2076 -e 's:$: $lt_compiler_flag:'` 2076 -e 's:$: $lt_compiler_flag:'`
2077 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) 2077 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2078 (eval "$lt_compile" 2>out/conftest.err) 2078 (eval "$lt_compile" 2>out/conftest.err)
2079 ac_status=$? 2079 ac_status=$?
2080 cat out/conftest.err >&AS_MESSAGE_LOG_FD 2080 cat out/conftest.err >&AS_MESSAGE_LOG_FD
2081 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 2081 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2082 if (exit $ac_status) && test -s out/conftest2.$ac_objext 2082 if (exit $ac_status) && test -s out/conftest2.$ac_objext
2083 then 2083 then
2084 # The compiler can only warn and ignore the option if not recognized 2084 # The compiler can only warn and ignore the option if not recognized
2085 # So say no if there are warnings 2085 # So say no if there are warnings
2086 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp 2086 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
2087 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 2087 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2088 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then 2088 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2089 _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes 2089 _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2090 fi 2090 fi
2091 fi 2091 fi
2092 chmod u+w . 2>&AS_MESSAGE_LOG_FD 2092 chmod u+w . 2>&AS_MESSAGE_LOG_FD
2093 $RM conftest* 2093 $RM conftest*
2094 # SGI C++ compiler will create directory out/ii_files/ for 2094 # SGI C++ compiler will create directory out/ii_files/ for
2095 # template instantiation 2095 # template instantiation
2096 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files 2096 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
2097 $RM out/* && rmdir out 2097 $RM out/* && rmdir out
2098 cd .. 2098 cd ..
2099 $RM -r conftest 2099 $RM -r conftest
2100 $RM conftest* 2100 $RM conftest*
2101]) 2101])
2102_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], 2102_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
2103 [Does compiler simultaneously support -c and -o options?]) 2103 [Does compiler simultaneously support -c and -o options?])
2104])# _LT_COMPILER_C_O 2104])# _LT_COMPILER_C_O
2105 2105
2106 2106
2107# _LT_COMPILER_FILE_LOCKS([TAGNAME]) 2107# _LT_COMPILER_FILE_LOCKS([TAGNAME])
2108# ---------------------------------- 2108# ----------------------------------
2109# Check to see if we can do hard links to lock some files if needed 2109# Check to see if we can do hard links to lock some files if needed
2110m4_defun([_LT_COMPILER_FILE_LOCKS], 2110m4_defun([_LT_COMPILER_FILE_LOCKS],
2111[m4_require([_LT_ENABLE_LOCK])dnl 2111[m4_require([_LT_ENABLE_LOCK])dnl
2112m4_require([_LT_FILEUTILS_DEFAULTS])dnl 2112m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2113_LT_COMPILER_C_O([$1]) 2113_LT_COMPILER_C_O([$1])
2114 2114
2115hard_links=nottested 2115hard_links=nottested
2116if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then 2116if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
2117 # do not overwrite the value of need_locks provided by the user 2117 # do not overwrite the value of need_locks provided by the user
2118 AC_MSG_CHECKING([if we can lock with hard links]) 2118 AC_MSG_CHECKING([if we can lock with hard links])
2119 hard_links=yes 2119 hard_links=yes
2120 $RM conftest* 2120 $RM conftest*
2121 ln conftest.a conftest.b 2>/dev/null && hard_links=no 2121 ln conftest.a conftest.b 2>/dev/null && hard_links=no
2122 touch conftest.a 2122 touch conftest.a
2123 ln conftest.a conftest.b 2>&5 || hard_links=no 2123 ln conftest.a conftest.b 2>&5 || hard_links=no
2124 ln conftest.a conftest.b 2>/dev/null && hard_links=no 2124 ln conftest.a conftest.b 2>/dev/null && hard_links=no
2125 AC_MSG_RESULT([$hard_links]) 2125 AC_MSG_RESULT([$hard_links])
2126 if test no = "$hard_links"; then 2126 if test no = "$hard_links"; then
2127 AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) 2127 AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
2128 need_locks=warn 2128 need_locks=warn
2129 fi 2129 fi
2130else 2130else
2131 need_locks=no 2131 need_locks=no
2132fi 2132fi
2133_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) 2133_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2134])# _LT_COMPILER_FILE_LOCKS 2134])# _LT_COMPILER_FILE_LOCKS
2135 2135
2136 2136
2137# _LT_CHECK_OBJDIR 2137# _LT_CHECK_OBJDIR
2138# ---------------- 2138# ----------------
2139m4_defun([_LT_CHECK_OBJDIR], 2139m4_defun([_LT_CHECK_OBJDIR],
2140[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], 2140[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2141[rm -f .libs 2>/dev/null 2141[rm -f .libs 2>/dev/null
2142mkdir .libs 2>/dev/null 2142mkdir .libs 2>/dev/null
2143if test -d .libs; then 2143if test -d .libs; then
2144 lt_cv_objdir=.libs 2144 lt_cv_objdir=.libs
2145else 2145else
2146 # MS-DOS does not allow filenames that begin with a dot. 2146 # MS-DOS does not allow filenames that begin with a dot.
2147 lt_cv_objdir=_libs 2147 lt_cv_objdir=_libs
2148fi 2148fi
2149rmdir .libs 2>/dev/null]) 2149rmdir .libs 2>/dev/null])
2150objdir=$lt_cv_objdir 2150objdir=$lt_cv_objdir
2151_LT_DECL([], [objdir], [0], 2151_LT_DECL([], [objdir], [0],
2152 [The name of the directory that contains temporary libtool files])dnl 2152 [The name of the directory that contains temporary libtool files])dnl
2153m4_pattern_allow([LT_OBJDIR])dnl 2153m4_pattern_allow([LT_OBJDIR])dnl
2154AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", 2154AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
2155 [Define to the sub-directory where libtool stores uninstalled libraries.]) 2155 [Define to the sub-directory where libtool stores uninstalled libraries.])
2156])# _LT_CHECK_OBJDIR 2156])# _LT_CHECK_OBJDIR
2157 2157
2158 2158
2159# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) 2159# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2160# -------------------------------------- 2160# --------------------------------------
2161# Check hardcoding attributes. 2161# Check hardcoding attributes.
2162m4_defun([_LT_LINKER_HARDCODE_LIBPATH], 2162m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
2163[AC_MSG_CHECKING([how to hardcode library paths into programs]) 2163[AC_MSG_CHECKING([how to hardcode library paths into programs])
2164_LT_TAGVAR(hardcode_action, $1)= 2164_LT_TAGVAR(hardcode_action, $1)=
2165if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || 2165if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2166 test -n "$_LT_TAGVAR(runpath_var, $1)" || 2166 test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2167 test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then 2167 test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
2168 2168
2169 # We can hardcode non-existent directories. 2169 # We can hardcode non-existent directories.
2170 if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && 2170 if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
2171 # If the only mechanism to avoid hardcoding is shlibpath_var, we 2171 # If the only mechanism to avoid hardcoding is shlibpath_var, we
2172 # have to relink, otherwise we might link with an installed library 2172 # have to relink, otherwise we might link with an installed library
2173 # when we should be linking with a yet-to-be-installed one 2173 # when we should be linking with a yet-to-be-installed one
2174 ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && 2174 ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
2175 test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then 2175 test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
2176 # Linking always hardcodes the temporary library directory. 2176 # Linking always hardcodes the temporary library directory.
2177 _LT_TAGVAR(hardcode_action, $1)=relink 2177 _LT_TAGVAR(hardcode_action, $1)=relink
2178 else 2178 else
2179 # We can link without hardcoding, and we can hardcode nonexisting dirs. 2179 # We can link without hardcoding, and we can hardcode nonexisting dirs.
2180 _LT_TAGVAR(hardcode_action, $1)=immediate 2180 _LT_TAGVAR(hardcode_action, $1)=immediate
2181 fi 2181 fi
2182else 2182else
2183 # We cannot hardcode anything, or else we can only hardcode existing 2183 # We cannot hardcode anything, or else we can only hardcode existing
2184 # directories. 2184 # directories.
2185 _LT_TAGVAR(hardcode_action, $1)=unsupported 2185 _LT_TAGVAR(hardcode_action, $1)=unsupported
2186fi 2186fi
2187AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) 2187AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2188 2188
2189if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || 2189if test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
2190 test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then 2190 test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
2191 # Fast installation is not supported 2191 # Fast installation is not supported
2192 enable_fast_install=no 2192 enable_fast_install=no
2193elif test yes = "$shlibpath_overrides_runpath" || 2193elif test yes = "$shlibpath_overrides_runpath" ||
2194 test no = "$enable_shared"; then 2194 test no = "$enable_shared"; then
2195 # Fast installation is not necessary 2195 # Fast installation is not necessary
2196 enable_fast_install=needless 2196 enable_fast_install=needless
2197fi 2197fi
2198_LT_TAGDECL([], [hardcode_action], [0], 2198_LT_TAGDECL([], [hardcode_action], [0],
2199 [How to hardcode a shared library path into an executable]) 2199 [How to hardcode a shared library path into an executable])
2200])# _LT_LINKER_HARDCODE_LIBPATH 2200])# _LT_LINKER_HARDCODE_LIBPATH
2201 2201
2202 2202
2203# _LT_CMD_STRIPLIB 2203# _LT_CMD_STRIPLIB
2204# ---------------- 2204# ----------------
2205m4_defun([_LT_CMD_STRIPLIB], 2205m4_defun([_LT_CMD_STRIPLIB],
2206[m4_require([_LT_DECL_EGREP]) 2206[m4_require([_LT_DECL_EGREP])
2207striplib= 2207striplib=
2208old_striplib= 2208old_striplib=
2209AC_MSG_CHECKING([whether stripping libraries is possible]) 2209AC_MSG_CHECKING([whether stripping libraries is possible])
2210if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then 2210if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2211 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" 2211 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2212 test -z "$striplib" && striplib="$STRIP --strip-unneeded" 2212 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2213 AC_MSG_RESULT([yes]) 2213 AC_MSG_RESULT([yes])
2214else 2214else
2215# FIXME - insert some real tests, host_os isn't really good enough 2215# FIXME - insert some real tests, host_os isn't really good enough
2216 case $host_os in 2216 case $host_os in
2217 darwin*) 2217 darwin*)
2218 if test -n "$STRIP"; then 2218 if test -n "$STRIP"; then
2219 striplib="$STRIP -x" 2219 striplib="$STRIP -x"
2220 old_striplib="$STRIP -S" 2220 old_striplib="$STRIP -S"
2221 AC_MSG_RESULT([yes]) 2221 AC_MSG_RESULT([yes])
2222 else 2222 else
2223 AC_MSG_RESULT([no]) 2223 AC_MSG_RESULT([no])
2224 fi 2224 fi
2225 ;; 2225 ;;
2226 *) 2226 *)
2227 AC_MSG_RESULT([no]) 2227 AC_MSG_RESULT([no])
2228 ;; 2228 ;;
2229 esac 2229 esac
2230fi 2230fi
2231_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) 2231_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2232_LT_DECL([], [striplib], [1]) 2232_LT_DECL([], [striplib], [1])
2233])# _LT_CMD_STRIPLIB 2233])# _LT_CMD_STRIPLIB
2234 2234
2235 2235
2236# _LT_PREPARE_MUNGE_PATH_LIST 2236# _LT_PREPARE_MUNGE_PATH_LIST
2237# --------------------------- 2237# ---------------------------
2238# Make sure func_munge_path_list() is defined correctly. 2238# Make sure func_munge_path_list() is defined correctly.
2239m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], 2239m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
2240[[# func_munge_path_list VARIABLE PATH 2240[[# func_munge_path_list VARIABLE PATH
2241# ----------------------------------- 2241# -----------------------------------
2242# VARIABLE is name of variable containing _space_ separated list of 2242# VARIABLE is name of variable containing _space_ separated list of
2243# directories to be munged by the contents of PATH, which is string 2243# directories to be munged by the contents of PATH, which is string
2244# having a format: 2244# having a format:
2245# "DIR[:DIR]:" 2245# "DIR[:DIR]:"
2246# string "DIR[ DIR]" will be prepended to VARIABLE 2246# string "DIR[ DIR]" will be prepended to VARIABLE
2247# ":DIR[:DIR]" 2247# ":DIR[:DIR]"
2248# string "DIR[ DIR]" will be appended to VARIABLE 2248# string "DIR[ DIR]" will be appended to VARIABLE
2249# "DIRP[:DIRP]::[DIRA:]DIRA" 2249# "DIRP[:DIRP]::[DIRA:]DIRA"
2250# string "DIRP[ DIRP]" will be prepended to VARIABLE and string 2250# string "DIRP[ DIRP]" will be prepended to VARIABLE and string
2251# "DIRA[ DIRA]" will be appended to VARIABLE 2251# "DIRA[ DIRA]" will be appended to VARIABLE
2252# "DIR[:DIR]" 2252# "DIR[:DIR]"
2253# VARIABLE will be replaced by "DIR[ DIR]" 2253# VARIABLE will be replaced by "DIR[ DIR]"
2254func_munge_path_list () 2254func_munge_path_list ()
2255{ 2255{
2256 case x@S|@2 in 2256 case x@S|@2 in
2257 x) 2257 x)
2258 ;; 2258 ;;
2259 *:) 2259 *:)
2260 eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" 2260 eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
2261 ;; 2261 ;;
2262 x:*) 2262 x:*)
2263 eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" 2263 eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
2264 ;; 2264 ;;
2265 *::*) 2265 *::*)
2266 eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" 2266 eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
2267 eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" 2267 eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
2268 ;; 2268 ;;
2269 *) 2269 *)
2270 eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" 2270 eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
2271 ;; 2271 ;;
2272 esac 2272 esac
2273} 2273}
2274]])# _LT_PREPARE_PATH_LIST 2274]])# _LT_PREPARE_PATH_LIST
2275 2275
2276 2276
2277# _LT_SYS_DYNAMIC_LINKER([TAG]) 2277# _LT_SYS_DYNAMIC_LINKER([TAG])
2278# ----------------------------- 2278# -----------------------------
2279# PORTME Fill in your ld.so characteristics 2279# PORTME Fill in your ld.so characteristics
2280m4_defun([_LT_SYS_DYNAMIC_LINKER], 2280m4_defun([_LT_SYS_DYNAMIC_LINKER],
2281[AC_REQUIRE([AC_CANONICAL_HOST])dnl 2281[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2282m4_require([_LT_DECL_EGREP])dnl 2282m4_require([_LT_DECL_EGREP])dnl
2283m4_require([_LT_FILEUTILS_DEFAULTS])dnl 2283m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2284m4_require([_LT_DECL_OBJDUMP])dnl 2284m4_require([_LT_DECL_OBJDUMP])dnl
2285m4_require([_LT_DECL_SED])dnl 2285m4_require([_LT_DECL_SED])dnl
2286m4_require([_LT_CHECK_SHELL_FEATURES])dnl 2286m4_require([_LT_CHECK_SHELL_FEATURES])dnl
2287m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl 2287m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
2288AC_MSG_CHECKING([dynamic linker characteristics]) 2288AC_MSG_CHECKING([dynamic linker characteristics])
2289m4_if([$1], 2289m4_if([$1],
2290 [], [ 2290 [], [
2291if test yes = "$GCC"; then 2291if test yes = "$GCC"; then
2292 case $host_os in 2292 case $host_os in
2293 darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; 2293 darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
2294 *) lt_awk_arg='/^libraries:/' ;; 2294 *) lt_awk_arg='/^libraries:/' ;;
2295 esac 2295 esac
2296 case $host_os in 2296 case $host_os in
2297 mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; 2297 mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
2298 *) lt_sed_strip_eq='s|=/|/|g' ;; 2298 *) lt_sed_strip_eq='s|=/|/|g' ;;
2299 esac 2299 esac
2300 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` 2300 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
2301 case $lt_search_path_spec in 2301 case $lt_search_path_spec in
2302 *\;*) 2302 *\;*)
2303 # if the path contains ";" then we assume it to be the separator 2303 # if the path contains ";" then we assume it to be the separator
2304 # otherwise default to the standard path separator (i.e. ":") - it is 2304 # otherwise default to the standard path separator (i.e. ":") - it is
2305 # assumed that no part of a normal pathname contains ";" but that should 2305 # assumed that no part of a normal pathname contains ";" but that should
2306 # okay in the real world where ";" in dirpaths is itself problematic. 2306 # okay in the real world where ";" in dirpaths is itself problematic.
2307 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` 2307 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
2308 ;; 2308 ;;
2309 *) 2309 *)
2310 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` 2310 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
2311 ;; 2311 ;;
2312 esac 2312 esac
2313 # Ok, now we have the path, separated by spaces, we can step through it 2313 # Ok, now we have the path, separated by spaces, we can step through it
2314 # and add multilib dir if necessary... 2314 # and add multilib dir if necessary...
2315 lt_tmp_lt_search_path_spec= 2315 lt_tmp_lt_search_path_spec=
2316 lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` 2316 lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2317 # ...but if some path component already ends with the multilib dir we assume 2317 # ...but if some path component already ends with the multilib dir we assume
2318 # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). 2318 # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
2319 case "$lt_multi_os_dir; $lt_search_path_spec " in 2319 case "$lt_multi_os_dir; $lt_search_path_spec " in
2320 "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) 2320 "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
2321 lt_multi_os_dir= 2321 lt_multi_os_dir=
2322 ;; 2322 ;;
2323 esac 2323 esac
2324 for lt_sys_path in $lt_search_path_spec; do 2324 for lt_sys_path in $lt_search_path_spec; do
2325 if test -d "$lt_sys_path$lt_multi_os_dir"; then 2325 if test -d "$lt_sys_path$lt_multi_os_dir"; then
2326 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" 2326 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
2327 elif test -n "$lt_multi_os_dir"; then 2327 elif test -n "$lt_multi_os_dir"; then
2328 test -d "$lt_sys_path" && \ 2328 test -d "$lt_sys_path" && \
2329 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" 2329 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2330 fi 2330 fi
2331 done 2331 done
2332 lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' 2332 lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2333BEGIN {RS = " "; FS = "/|\n";} { 2333BEGIN {RS = " "; FS = "/|\n";} {
2334 lt_foo = ""; 2334 lt_foo = "";
2335 lt_count = 0; 2335 lt_count = 0;
2336 for (lt_i = NF; lt_i > 0; lt_i--) { 2336 for (lt_i = NF; lt_i > 0; lt_i--) {
2337 if ($lt_i != "" && $lt_i != ".") { 2337 if ($lt_i != "" && $lt_i != ".") {
2338 if ($lt_i == "..") { 2338 if ($lt_i == "..") {
2339 lt_count++; 2339 lt_count++;
2340 } else { 2340 } else {
2341 if (lt_count == 0) { 2341 if (lt_count == 0) {
2342 lt_foo = "/" $lt_i lt_foo; 2342 lt_foo = "/" $lt_i lt_foo;
2343 } else { 2343 } else {
2344 lt_count--; 2344 lt_count--;
2345 } 2345 }
2346 } 2346 }
2347 } 2347 }
2348 } 2348 }
2349 if (lt_foo != "") { lt_freq[[lt_foo]]++; } 2349 if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2350 if (lt_freq[[lt_foo]] == 1) { print lt_foo; } 2350 if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2351}'` 2351}'`
2352 # AWK program above erroneously prepends '/' to C:/dos/paths 2352 # AWK program above erroneously prepends '/' to C:/dos/paths
2353 # for these hosts. 2353 # for these hosts.
2354 case $host_os in 2354 case $host_os in
2355 mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ 2355 mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2356 $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; 2356 $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
2357 esac 2357 esac
2358 sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` 2358 sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
2359else 2359else
2360 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" 2360 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2361fi]) 2361fi])
2362library_names_spec= 2362library_names_spec=
2363libname_spec='lib$name' 2363libname_spec='lib$name'
2364soname_spec= 2364soname_spec=
2365shrext_cmds=.so 2365shrext_cmds=.so
2366postinstall_cmds= 2366postinstall_cmds=
2367postuninstall_cmds= 2367postuninstall_cmds=
2368finish_cmds= 2368finish_cmds=
2369finish_eval= 2369finish_eval=
2370shlibpath_var= 2370shlibpath_var=
2371shlibpath_overrides_runpath=unknown 2371shlibpath_overrides_runpath=unknown
2372version_type=none 2372version_type=none
2373dynamic_linker="$host_os ld.so" 2373dynamic_linker="$host_os ld.so"
2374sys_lib_dlsearch_path_spec="/lib /usr/lib" 2374sys_lib_dlsearch_path_spec="/lib /usr/lib"
2375need_lib_prefix=unknown 2375need_lib_prefix=unknown
2376hardcode_into_libs=no 2376hardcode_into_libs=no
2377 2377
2378# when you set need_version to no, make sure it does not cause -set_version 2378# when you set need_version to no, make sure it does not cause -set_version
2379# flags to be left without arguments 2379# flags to be left without arguments
2380need_version=unknown 2380need_version=unknown
2381 2381
2382AC_ARG_VAR([LT_SYS_LIBRARY_PATH], 2382AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
2383[User-defined run-time library search path.]) 2383[User-defined run-time library search path.])
2384 2384
2385case $host_os in 2385case $host_os in
2386aix3*) 2386aix3*)
2387 version_type=linux # correct to gnu/linux during the next big refactor 2387 version_type=linux # correct to gnu/linux during the next big refactor
2388 library_names_spec='$libname$release$shared_ext$versuffix $libname.a' 2388 library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
2389 shlibpath_var=LIBPATH 2389 shlibpath_var=LIBPATH
2390 2390
2391 # AIX 3 has no versioning support, so we append a major version to the name. 2391 # AIX 3 has no versioning support, so we append a major version to the name.
2392 soname_spec='$libname$release$shared_ext$major' 2392 soname_spec='$libname$release$shared_ext$major'
2393 ;; 2393 ;;
2394 2394
2395aix[[4-9]]*) 2395aix[[4-9]]*)
2396 version_type=linux # correct to gnu/linux during the next big refactor 2396 version_type=linux # correct to gnu/linux during the next big refactor
2397 need_lib_prefix=no 2397 need_lib_prefix=no
2398 need_version=no 2398 need_version=no
2399 hardcode_into_libs=yes 2399 hardcode_into_libs=yes
2400 if test ia64 = "$host_cpu"; then 2400 if test ia64 = "$host_cpu"; then
2401 # AIX 5 supports IA64 2401 # AIX 5 supports IA64
2402 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' 2402 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
2403 shlibpath_var=LD_LIBRARY_PATH 2403 shlibpath_var=LD_LIBRARY_PATH
2404 else 2404 else
2405 # With GCC up to 2.95.x, collect2 would create an import file 2405 # With GCC up to 2.95.x, collect2 would create an import file
2406 # for dependence libraries. The import file would start with 2406 # for dependence libraries. The import file would start with
2407 # the line '#! .'. This would cause the generated library to 2407 # the line '#! .'. This would cause the generated library to
2408 # depend on '.', always an invalid library. This was fixed in 2408 # depend on '.', always an invalid library. This was fixed in
2409 # development snapshots of GCC prior to 3.0. 2409 # development snapshots of GCC prior to 3.0.
2410 case $host_os in 2410 case $host_os in
2411 aix4 | aix4.[[01]] | aix4.[[01]].*) 2411 aix4 | aix4.[[01]] | aix4.[[01]].*)
2412 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' 2412 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2413 echo ' yes ' 2413 echo ' yes '
2414 echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then 2414 echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
2415 : 2415 :
2416 else 2416 else
2417 can_build_shared=no 2417 can_build_shared=no
2418 fi 2418 fi
2419 ;; 2419 ;;
2420 esac 2420 esac
2421 # Using Import Files as archive members, it is possible to support 2421 # Using Import Files as archive members, it is possible to support
2422 # filename-based versioning of shared library archives on AIX. While 2422 # filename-based versioning of shared library archives on AIX. While
2423 # this would work for both with and without runtime linking, it will 2423 # this would work for both with and without runtime linking, it will
2424 # prevent static linking of such archives. So we do filename-based 2424 # prevent static linking of such archives. So we do filename-based
2425 # shared library versioning with .so extension only, which is used 2425 # shared library versioning with .so extension only, which is used
2426 # when both runtime linking and shared linking is enabled. 2426 # when both runtime linking and shared linking is enabled.
2427 # Unfortunately, runtime linking may impact performance, so we do 2427 # Unfortunately, runtime linking may impact performance, so we do
2428 # not want this to be the default eventually. Also, we use the 2428 # not want this to be the default eventually. Also, we use the
2429 # versioned .so libs for executables only if there is the -brtl 2429 # versioned .so libs for executables only if there is the -brtl
2430 # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. 2430 # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
2431 # To allow for filename-based versioning support, we need to create 2431 # To allow for filename-based versioning support, we need to create
2432 # libNAME.so.V as an archive file, containing: 2432 # libNAME.so.V as an archive file, containing:
2433 # *) an Import File, referring to the versioned filename of the 2433 # *) an Import File, referring to the versioned filename of the
2434 # archive as well as the shared archive member, telling the 2434 # archive as well as the shared archive member, telling the
2435 # bitwidth (32 or 64) of that shared object, and providing the 2435 # bitwidth (32 or 64) of that shared object, and providing the
2436 # list of exported symbols of that shared object, eventually 2436 # list of exported symbols of that shared object, eventually
2437 # decorated with the 'weak' keyword 2437 # decorated with the 'weak' keyword
2438 # *) the shared object with the F_LOADONLY flag set, to really avoid 2438 # *) the shared object with the F_LOADONLY flag set, to really avoid
2439 # it being seen by the linker. 2439 # it being seen by the linker.
2440 # At run time we better use the real file rather than another symlink, 2440 # At run time we better use the real file rather than another symlink,
2441 # but for link time we create the symlink libNAME.so -> libNAME.so.V 2441 # but for link time we create the symlink libNAME.so -> libNAME.so.V
2442 2442
2443 case $with_aix_soname,$aix_use_runtimelinking in 2443 case $with_aix_soname,$aix_use_runtimelinking in
2444 # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct 2444 # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
2445 # soname into executable. Probably we can add versioning support to 2445 # soname into executable. Probably we can add versioning support to
2446 # collect2, so additional links can be useful in future. 2446 # collect2, so additional links can be useful in future.
2447 aix,yes) # traditional libtool 2447 aix,yes) # traditional libtool
2448 dynamic_linker='AIX unversionable lib.so' 2448 dynamic_linker='AIX unversionable lib.so'
2449 # If using run time linking (on AIX 4.2 or later) use lib<name>.so 2449 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2450 # instead of lib<name>.a to let people know that these are not 2450 # instead of lib<name>.a to let people know that these are not
2451 # typical AIX shared libraries. 2451 # typical AIX shared libraries.
2452 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' 2452 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2453 ;; 2453 ;;
2454 aix,no) # traditional AIX only 2454 aix,no) # traditional AIX only
2455 dynamic_linker='AIX lib.a[(]lib.so.V[)]' 2455 dynamic_linker='AIX lib.a[(]lib.so.V[)]'
2456 # We preserve .a as extension for shared libraries through AIX4.2 2456 # We preserve .a as extension for shared libraries through AIX4.2
2457 # and later when we are not doing run time linking. 2457 # and later when we are not doing run time linking.
2458 library_names_spec='$libname$release.a $libname.a' 2458 library_names_spec='$libname$release.a $libname.a'
2459 soname_spec='$libname$release$shared_ext$major' 2459 soname_spec='$libname$release$shared_ext$major'
2460 ;; 2460 ;;
2461 svr4,*) # full svr4 only 2461 svr4,*) # full svr4 only
2462 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" 2462 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
2463 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' 2463 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2464 # We do not specify a path in Import Files, so LIBPATH fires. 2464 # We do not specify a path in Import Files, so LIBPATH fires.
2465 shlibpath_overrides_runpath=yes 2465 shlibpath_overrides_runpath=yes
2466 ;; 2466 ;;
2467 *,yes) # both, prefer svr4 2467 *,yes) # both, prefer svr4
2468 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" 2468 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
2469 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' 2469 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2470 # unpreferred sharedlib libNAME.a needs extra handling 2470 # unpreferred sharedlib libNAME.a needs extra handling
2471 postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' 2471 postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
2472 postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' 2472 postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
2473 # We do not specify a path in Import Files, so LIBPATH fires. 2473 # We do not specify a path in Import Files, so LIBPATH fires.
2474 shlibpath_overrides_runpath=yes 2474 shlibpath_overrides_runpath=yes
2475 ;; 2475 ;;
2476 *,no) # both, prefer aix 2476 *,no) # both, prefer aix
2477 dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" 2477 dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
2478 library_names_spec='$libname$release.a $libname.a' 2478 library_names_spec='$libname$release.a $libname.a'
2479 soname_spec='$libname$release$shared_ext$major' 2479 soname_spec='$libname$release$shared_ext$major'
2480 # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling 2480 # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
2481 postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' 2481 postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
2482 postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' 2482 postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
2483 ;; 2483 ;;
2484 esac 2484 esac
2485 shlibpath_var=LIBPATH 2485 shlibpath_var=LIBPATH
2486 fi 2486 fi
2487 ;; 2487 ;;
2488 2488
2489amigaos*) 2489amigaos*)
2490 case $host_cpu in 2490 case $host_cpu in
2491 powerpc) 2491 powerpc)
2492 # Since July 2007 AmigaOS4 officially supports .so libraries. 2492 # Since July 2007 AmigaOS4 officially supports .so libraries.
2493 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. 2493 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2494 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' 2494 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2495 ;; 2495 ;;
2496 m68k) 2496 m68k)
2497 library_names_spec='$libname.ixlibrary $libname.a' 2497 library_names_spec='$libname.ixlibrary $libname.a'
2498 # Create ${libname}_ixlibrary.a entries in /sys/libs. 2498 # Create ${libname}_ixlibrary.a entries in /sys/libs.
2499 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' 2499 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
2500 ;; 2500 ;;
2501 esac 2501 esac
2502 ;; 2502 ;;
2503 2503
2504beos*) 2504beos*)
2505 library_names_spec='$libname$shared_ext' 2505 library_names_spec='$libname$shared_ext'
2506 dynamic_linker="$host_os ld.so" 2506 dynamic_linker="$host_os ld.so"
2507 shlibpath_var=LIBRARY_PATH 2507 shlibpath_var=LIBRARY_PATH
2508 ;; 2508 ;;
2509 2509
2510bsdi[[45]]*) 2510bsdi[[45]]*)
2511 version_type=linux # correct to gnu/linux during the next big refactor 2511 version_type=linux # correct to gnu/linux during the next big refactor
2512 need_version=no 2512 need_version=no
2513 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' 2513 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2514 soname_spec='$libname$release$shared_ext$major' 2514 soname_spec='$libname$release$shared_ext$major'
2515 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' 2515 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2516 shlibpath_var=LD_LIBRARY_PATH 2516 shlibpath_var=LD_LIBRARY_PATH
2517 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" 2517 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2518 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" 2518 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2519 # the default ld.so.conf also contains /usr/contrib/lib and 2519 # the default ld.so.conf also contains /usr/contrib/lib and
2520 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow 2520 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2521 # libtool to hard-code these into programs 2521 # libtool to hard-code these into programs
2522 ;; 2522 ;;
2523 2523
2524cygwin* | mingw* | pw32* | cegcc*) 2524cygwin* | mingw* | pw32* | cegcc*)
2525 version_type=windows 2525 version_type=windows
2526 shrext_cmds=.dll 2526 shrext_cmds=.dll
2527 need_version=no 2527 need_version=no
2528 need_lib_prefix=no 2528 need_lib_prefix=no
2529 2529
2530 case $GCC,$cc_basename in 2530 case $GCC,$cc_basename in
2531 yes,*) 2531 yes,*)
2532 # gcc 2532 # gcc
2533 library_names_spec='$libname.dll.a' 2533 library_names_spec='$libname.dll.a'
2534 # DLL is installed to $(libdir)/../bin by postinstall_cmds 2534 # DLL is installed to $(libdir)/../bin by postinstall_cmds
2535 postinstall_cmds='base_file=`basename \$file`~ 2535 postinstall_cmds='base_file=`basename \$file`~
2536 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ 2536 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2537 dldir=$destdir/`dirname \$dlpath`~ 2537 dldir=$destdir/`dirname \$dlpath`~
2538 test -d \$dldir || mkdir -p \$dldir~ 2538 test -d \$dldir || mkdir -p \$dldir~
2539 $install_prog $dir/$dlname \$dldir/$dlname~ 2539 $install_prog $dir/$dlname \$dldir/$dlname~
2540 chmod a+x \$dldir/$dlname~ 2540 chmod a+x \$dldir/$dlname~
2541 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then 2541 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2542 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; 2542 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2543 fi' 2543 fi'
2544 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ 2544 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2545 dlpath=$dir/\$dldll~ 2545 dlpath=$dir/\$dldll~
2546 $RM \$dlpath' 2546 $RM \$dlpath'
2547 shlibpath_overrides_runpath=yes 2547 shlibpath_overrides_runpath=yes
2548 2548
2549 case $host_os in 2549 case $host_os in
2550 cygwin*) 2550 cygwin*)
2551 # Cygwin DLLs use 'cyg' prefix rather than 'lib' 2551 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2552 soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' 2552 soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2553m4_if([$1], [],[ 2553m4_if([$1], [],[
2554 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) 2554 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2555 ;; 2555 ;;
2556 mingw* | cegcc*) 2556 mingw* | cegcc*)
2557 # MinGW DLLs use traditional 'lib' prefix 2557 # MinGW DLLs use traditional 'lib' prefix
2558 soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' 2558 soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2559 ;; 2559 ;;
2560 pw32*) 2560 pw32*)
2561 # pw32 DLLs use 'pw' prefix rather than 'lib' 2561 # pw32 DLLs use 'pw' prefix rather than 'lib'
2562 library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' 2562 library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2563 ;; 2563 ;;
2564 esac 2564 esac
2565 dynamic_linker='Win32 ld.exe' 2565 dynamic_linker='Win32 ld.exe'
2566 ;; 2566 ;;
2567 2567
2568 *,cl*) 2568 *,cl*)
2569 # Native MSVC 2569 # Native MSVC
2570 libname_spec='$name' 2570 libname_spec='$name'
2571 soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' 2571 soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2572 library_names_spec='$libname.dll.lib' 2572 library_names_spec='$libname.dll.lib'
2573 2573
2574 case $build_os in 2574 case $build_os in
2575 mingw*) 2575 mingw*)
2576 sys_lib_search_path_spec= 2576 sys_lib_search_path_spec=
2577 lt_save_ifs=$IFS 2577 lt_save_ifs=$IFS
2578 IFS=';' 2578 IFS=';'
2579 for lt_path in $LIB 2579 for lt_path in $LIB
2580 do 2580 do
2581 IFS=$lt_save_ifs 2581 IFS=$lt_save_ifs
2582 # Let DOS variable expansion print the short 8.3 style file name. 2582 # Let DOS variable expansion print the short 8.3 style file name.
2583 lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` 2583 lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2584 sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" 2584 sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2585 done 2585 done
2586 IFS=$lt_save_ifs 2586 IFS=$lt_save_ifs
2587 # Convert to MSYS style. 2587 # Convert to MSYS style.
2588 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` 2588 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2589 ;; 2589 ;;
2590 cygwin*) 2590 cygwin*)
2591 # Convert to unix form, then to dos form, then back to unix form 2591 # Convert to unix form, then to dos form, then back to unix form
2592 # but this time dos style (no spaces!) so that the unix form looks 2592 # but this time dos style (no spaces!) so that the unix form looks
2593 # like /cygdrive/c/PROGRA~1:/cygdr... 2593 # like /cygdrive/c/PROGRA~1:/cygdr...
2594 sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` 2594 sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2595 sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` 2595 sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2596 sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` 2596 sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2597 ;; 2597 ;;
2598 *) 2598 *)
2599 sys_lib_search_path_spec=$LIB 2599 sys_lib_search_path_spec=$LIB
2600 if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then 2600 if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2601 # It is most probably a Windows format PATH. 2601 # It is most probably a Windows format PATH.
2602 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` 2602 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2603 else 2603 else
2604 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` 2604 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2605 fi 2605 fi
2606 # FIXME: find the short name or the path components, as spaces are 2606 # FIXME: find the short name or the path components, as spaces are
2607 # common. (e.g. "Program Files" -> "PROGRA~1") 2607 # common. (e.g. "Program Files" -> "PROGRA~1")
2608 ;; 2608 ;;
2609 esac 2609 esac
2610 2610
2611 # DLL is installed to $(libdir)/../bin by postinstall_cmds 2611 # DLL is installed to $(libdir)/../bin by postinstall_cmds
2612 postinstall_cmds='base_file=`basename \$file`~ 2612 postinstall_cmds='base_file=`basename \$file`~
2613 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ 2613 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2614 dldir=$destdir/`dirname \$dlpath`~ 2614 dldir=$destdir/`dirname \$dlpath`~
2615 test -d \$dldir || mkdir -p \$dldir~ 2615 test -d \$dldir || mkdir -p \$dldir~
2616 $install_prog $dir/$dlname \$dldir/$dlname' 2616 $install_prog $dir/$dlname \$dldir/$dlname'
2617 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ 2617 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2618 dlpath=$dir/\$dldll~ 2618 dlpath=$dir/\$dldll~
2619 $RM \$dlpath' 2619 $RM \$dlpath'
2620 shlibpath_overrides_runpath=yes 2620 shlibpath_overrides_runpath=yes
2621 dynamic_linker='Win32 link.exe' 2621 dynamic_linker='Win32 link.exe'
2622 ;; 2622 ;;
2623 2623
2624 *) 2624 *)
2625 # Assume MSVC wrapper 2625 # Assume MSVC wrapper
2626 library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' 2626 library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
2627 dynamic_linker='Win32 ld.exe' 2627 dynamic_linker='Win32 ld.exe'
2628 ;; 2628 ;;
2629 esac 2629 esac
2630 # FIXME: first we should search . and the directory the executable is in 2630 # FIXME: first we should search . and the directory the executable is in
2631 shlibpath_var=PATH 2631 shlibpath_var=PATH
2632 ;; 2632 ;;
2633 2633
2634darwin* | rhapsody*) 2634darwin* | rhapsody*)
2635 dynamic_linker="$host_os dyld" 2635 dynamic_linker="$host_os dyld"
2636 version_type=darwin 2636 version_type=darwin
2637 need_lib_prefix=no 2637 need_lib_prefix=no
2638 need_version=no 2638 need_version=no
2639 library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' 2639 library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
2640 soname_spec='$libname$release$major$shared_ext' 2640 soname_spec='$libname$release$major$shared_ext'
2641 shlibpath_overrides_runpath=yes 2641 shlibpath_overrides_runpath=yes
2642 shlibpath_var=DYLD_LIBRARY_PATH 2642 shlibpath_var=DYLD_LIBRARY_PATH
2643 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' 2643 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2644m4_if([$1], [],[ 2644m4_if([$1], [],[
2645 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) 2645 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2646 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' 2646 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2647 ;; 2647 ;;
2648 2648
2649dgux*) 2649dgux*)
2650 version_type=linux # correct to gnu/linux during the next big refactor 2650 version_type=linux # correct to gnu/linux during the next big refactor
2651 need_lib_prefix=no 2651 need_lib_prefix=no
2652 need_version=no 2652 need_version=no
2653 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' 2653 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2654 soname_spec='$libname$release$shared_ext$major' 2654 soname_spec='$libname$release$shared_ext$major'
2655 shlibpath_var=LD_LIBRARY_PATH 2655 shlibpath_var=LD_LIBRARY_PATH
2656 ;; 2656 ;;
2657 2657
2658freebsd* | dragonfly*) 2658freebsd* | dragonfly*)
2659 # DragonFly does not have aout. When/if they implement a new 2659 # DragonFly does not have aout. When/if they implement a new
2660 # versioning mechanism, adjust this. 2660 # versioning mechanism, adjust this.
2661 if test -x /usr/bin/objformat; then 2661 if test -x /usr/bin/objformat; then
2662 objformat=`/usr/bin/objformat` 2662 objformat=`/usr/bin/objformat`
2663 else 2663 else
2664 case $host_os in 2664 case $host_os in
2665 freebsd[[23]].*) objformat=aout ;; 2665 freebsd[[23]].*) objformat=aout ;;
2666 *) objformat=elf ;; 2666 *) objformat=elf ;;
2667 esac 2667 esac
2668 fi 2668 fi
2669 version_type=freebsd-$objformat 2669 version_type=freebsd-$objformat
2670 case $version_type in 2670 case $version_type in
2671 freebsd-elf*) 2671 freebsd-elf*)
2672 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' 2672 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2673 soname_spec='$libname$release$shared_ext$major' 2673 soname_spec='$libname$release$shared_ext$major'
2674 need_version=no 2674 need_version=no
2675 need_lib_prefix=no 2675 need_lib_prefix=no
2676 ;; 2676 ;;
2677 freebsd-*) 2677 freebsd-*)
2678 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' 2678 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2679 need_version=yes 2679 need_version=yes
2680 ;; 2680 ;;
2681 esac 2681 esac
2682 shlibpath_var=LD_LIBRARY_PATH 2682 shlibpath_var=LD_LIBRARY_PATH
2683 case $host_os in 2683 case $host_os in
2684 freebsd2.*) 2684 freebsd2.*)
2685 shlibpath_overrides_runpath=yes 2685 shlibpath_overrides_runpath=yes
2686 ;; 2686 ;;
2687 freebsd3.[[01]]* | freebsdelf3.[[01]]*) 2687 freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2688 shlibpath_overrides_runpath=yes 2688 shlibpath_overrides_runpath=yes
2689 hardcode_into_libs=yes 2689 hardcode_into_libs=yes
2690 ;; 2690 ;;
2691 freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ 2691 freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2692 freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) 2692 freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2693 shlibpath_overrides_runpath=no 2693 shlibpath_overrides_runpath=no
2694 hardcode_into_libs=yes 2694 hardcode_into_libs=yes
2695 ;; 2695 ;;
2696 *) # from 4.6 on, and DragonFly 2696 *) # from 4.6 on, and DragonFly
2697 shlibpath_overrides_runpath=yes 2697 shlibpath_overrides_runpath=yes
2698 hardcode_into_libs=yes 2698 hardcode_into_libs=yes
2699 ;; 2699 ;;
2700 esac 2700 esac
2701 ;; 2701 ;;
2702 2702
2703haiku*) 2703haiku*)
2704 version_type=linux # correct to gnu/linux during the next big refactor 2704 version_type=linux # correct to gnu/linux during the next big refactor
2705 need_lib_prefix=no 2705 need_lib_prefix=no
2706 need_version=no 2706 need_version=no
2707 dynamic_linker="$host_os runtime_loader" 2707 dynamic_linker="$host_os runtime_loader"
2708 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' 2708 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2709 soname_spec='$libname$release$shared_ext$major' 2709 soname_spec='$libname$release$shared_ext$major'
2710 shlibpath_var=LIBRARY_PATH 2710 shlibpath_var=LIBRARY_PATH
2711 shlibpath_overrides_runpath=no 2711 shlibpath_overrides_runpath=no
2712 sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' 2712 sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
2713 hardcode_into_libs=yes 2713 hardcode_into_libs=yes
2714 ;; 2714 ;;
2715 2715
2716hpux9* | hpux10* | hpux11*) 2716hpux9* | hpux10* | hpux11*)
2717 # Give a soname corresponding to the major version so that dld.sl refuses to 2717 # Give a soname corresponding to the major version so that dld.sl refuses to
2718 # link against other versions. 2718 # link against other versions.
2719 version_type=sunos 2719 version_type=sunos
2720 need_lib_prefix=no 2720 need_lib_prefix=no
2721 need_version=no 2721 need_version=no
2722 case $host_cpu in 2722 case $host_cpu in
2723 ia64*) 2723 ia64*)
2724 shrext_cmds='.so' 2724 shrext_cmds='.so'
2725 hardcode_into_libs=yes 2725 hardcode_into_libs=yes
2726 dynamic_linker="$host_os dld.so" 2726 dynamic_linker="$host_os dld.so"
2727 shlibpath_var=LD_LIBRARY_PATH 2727 shlibpath_var=LD_LIBRARY_PATH
2728 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. 2728 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2729 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' 2729 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2730 soname_spec='$libname$release$shared_ext$major' 2730 soname_spec='$libname$release$shared_ext$major'
2731 if test 32 = "$HPUX_IA64_MODE"; then 2731 if test 32 = "$HPUX_IA64_MODE"; then
2732 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" 2732 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2733 sys_lib_dlsearch_path_spec=/usr/lib/hpux32 2733 sys_lib_dlsearch_path_spec=/usr/lib/hpux32
2734 else 2734 else
2735 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" 2735 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2736 sys_lib_dlsearch_path_spec=/usr/lib/hpux64 2736 sys_lib_dlsearch_path_spec=/usr/lib/hpux64
2737 fi 2737 fi
2738 ;; 2738 ;;
2739 hppa*64*) 2739 hppa*64*)
2740 shrext_cmds='.sl' 2740 shrext_cmds='.sl'
2741 hardcode_into_libs=yes 2741 hardcode_into_libs=yes
2742 dynamic_linker="$host_os dld.sl" 2742 dynamic_linker="$host_os dld.sl"
2743 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH 2743 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2744 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. 2744 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2745 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' 2745 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2746 soname_spec='$libname$release$shared_ext$major' 2746 soname_spec='$libname$release$shared_ext$major'
2747 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" 2747 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2748 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 2748 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2749 ;; 2749 ;;
2750 *) 2750 *)
2751 shrext_cmds='.sl' 2751 shrext_cmds='.sl'
2752 dynamic_linker="$host_os dld.sl" 2752 dynamic_linker="$host_os dld.sl"
2753 shlibpath_var=SHLIB_PATH 2753 shlibpath_var=SHLIB_PATH
2754 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH 2754 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2755 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' 2755 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2756 soname_spec='$libname$release$shared_ext$major' 2756 soname_spec='$libname$release$shared_ext$major'
2757 ;; 2757 ;;
2758 esac 2758 esac
2759 # HP-UX runs *really* slowly unless shared libraries are mode 555, ... 2759 # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
2760 postinstall_cmds='chmod 555 $lib' 2760 postinstall_cmds='chmod 555 $lib'
2761 # or fails outright, so override atomically: 2761 # or fails outright, so override atomically:
2762 install_override_mode=555 2762 install_override_mode=555
2763 ;; 2763 ;;
2764 2764
2765interix[[3-9]]*) 2765interix[[3-9]]*)
2766 version_type=linux # correct to gnu/linux during the next big refactor 2766 version_type=linux # correct to gnu/linux during the next big refactor
2767 need_lib_prefix=no 2767 need_lib_prefix=no
2768 need_version=no 2768 need_version=no
2769 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' 2769 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2770 soname_spec='$libname$release$shared_ext$major' 2770 soname_spec='$libname$release$shared_ext$major'
2771 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' 2771 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2772 shlibpath_var=LD_LIBRARY_PATH 2772 shlibpath_var=LD_LIBRARY_PATH
2773 shlibpath_overrides_runpath=no 2773 shlibpath_overrides_runpath=no
2774 hardcode_into_libs=yes 2774 hardcode_into_libs=yes
2775 ;; 2775 ;;
2776 2776
2777irix5* | irix6* | nonstopux*) 2777irix5* | irix6* | nonstopux*)
2778 case $host_os in 2778 case $host_os in
2779 nonstopux*) version_type=nonstopux ;; 2779 nonstopux*) version_type=nonstopux ;;
2780 *) 2780 *)
2781 if test yes = "$lt_cv_prog_gnu_ld"; then 2781 if test yes = "$lt_cv_prog_gnu_ld"; then
2782 version_type=linux # correct to gnu/linux during the next big refactor 2782 version_type=linux # correct to gnu/linux during the next big refactor
2783 else 2783 else
2784 version_type=irix 2784 version_type=irix
2785 fi ;; 2785 fi ;;
2786 esac 2786 esac
2787 need_lib_prefix=no 2787 need_lib_prefix=no
2788 need_version=no 2788 need_version=no
2789 soname_spec='$libname$release$shared_ext$major' 2789 soname_spec='$libname$release$shared_ext$major'
2790 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' 2790 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
2791 case $host_os in 2791 case $host_os in
2792 irix5* | nonstopux*) 2792 irix5* | nonstopux*)
2793 libsuff= shlibsuff= 2793 libsuff= shlibsuff=
2794 ;; 2794 ;;
2795 *) 2795 *)
2796 case $LD in # libtool.m4 will add one of these switches to LD 2796 case $LD in # libtool.m4 will add one of these switches to LD
2797 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") 2797 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2798 libsuff= shlibsuff= libmagic=32-bit;; 2798 libsuff= shlibsuff= libmagic=32-bit;;
2799 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") 2799 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2800 libsuff=32 shlibsuff=N32 libmagic=N32;; 2800 libsuff=32 shlibsuff=N32 libmagic=N32;;
2801 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") 2801 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2802 libsuff=64 shlibsuff=64 libmagic=64-bit;; 2802 libsuff=64 shlibsuff=64 libmagic=64-bit;;
2803 *) libsuff= shlibsuff= libmagic=never-match;; 2803 *) libsuff= shlibsuff= libmagic=never-match;;
2804 esac 2804 esac
2805 ;; 2805 ;;
2806 esac 2806 esac
2807 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH 2807 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2808 shlibpath_overrides_runpath=no 2808 shlibpath_overrides_runpath=no
2809 sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" 2809 sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
2810 sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" 2810 sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
2811 hardcode_into_libs=yes 2811 hardcode_into_libs=yes
2812 ;; 2812 ;;
2813 2813
2814# No shared lib support for Linux oldld, aout, or coff. 2814# No shared lib support for Linux oldld, aout, or coff.
2815linux*oldld* | linux*aout* | linux*coff*) 2815linux*oldld* | linux*aout* | linux*coff*)
2816 dynamic_linker=no 2816 dynamic_linker=no
2817 ;; 2817 ;;
2818 2818
2819linux*android*) 2819linux*android*)
2820 version_type=none # Android doesn't support versioned libraries. 2820 version_type=none # Android doesn't support versioned libraries.
2821 need_lib_prefix=no 2821 need_lib_prefix=no
2822 need_version=no 2822 need_version=no
2823 library_names_spec='$libname$release$shared_ext' 2823 library_names_spec='$libname$release$shared_ext'
2824 soname_spec='$libname$release$shared_ext' 2824 soname_spec='$libname$release$shared_ext'
2825 finish_cmds= 2825 finish_cmds=
2826 shlibpath_var=LD_LIBRARY_PATH 2826 shlibpath_var=LD_LIBRARY_PATH
2827 shlibpath_overrides_runpath=yes 2827 shlibpath_overrides_runpath=yes
2828 2828
2829 # This implies no fast_install, which is unacceptable. 2829 # This implies no fast_install, which is unacceptable.
2830 # Some rework will be needed to allow for fast_install 2830 # Some rework will be needed to allow for fast_install
2831 # before this can be enabled. 2831 # before this can be enabled.
2832 hardcode_into_libs=yes 2832 hardcode_into_libs=yes
2833 2833
2834 dynamic_linker='Android linker' 2834 dynamic_linker='Android linker'
2835 # Don't embed -rpath directories since the linker doesn't support them. 2835 # Don't embed -rpath directories since the linker doesn't support them.
2836 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' 2836 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
2837 ;; 2837 ;;
2838 2838
2839# This must be glibc/ELF. 2839# This must be glibc/ELF.
2840linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) 2840linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
2841 version_type=linux # correct to gnu/linux during the next big refactor 2841 version_type=linux # correct to gnu/linux during the next big refactor
2842 need_lib_prefix=no 2842 need_lib_prefix=no
2843 need_version=no 2843 need_version=no
2844 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' 2844 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2845 soname_spec='$libname$release$shared_ext$major' 2845 soname_spec='$libname$release$shared_ext$major'
2846 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' 2846 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2847 shlibpath_var=LD_LIBRARY_PATH 2847 shlibpath_var=LD_LIBRARY_PATH
2848 shlibpath_overrides_runpath=no 2848 shlibpath_overrides_runpath=no
2849 2849
2850 # Some binutils ld are patched to set DT_RUNPATH 2850 # Some binutils ld are patched to set DT_RUNPATH
2851 AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], 2851 AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
2852 [lt_cv_shlibpath_overrides_runpath=no 2852 [lt_cv_shlibpath_overrides_runpath=no
2853 save_LDFLAGS=$LDFLAGS 2853 save_LDFLAGS=$LDFLAGS
2854 save_libdir=$libdir 2854 save_libdir=$libdir
2855 eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ 2855 eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2856 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" 2856 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2857 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], 2857 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2858 [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], 2858 [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2859 [lt_cv_shlibpath_overrides_runpath=yes])]) 2859 [lt_cv_shlibpath_overrides_runpath=yes])])
2860 LDFLAGS=$save_LDFLAGS 2860 LDFLAGS=$save_LDFLAGS
2861 libdir=$save_libdir 2861 libdir=$save_libdir
2862 ]) 2862 ])
2863 shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath 2863 shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2864 2864
2865 # This implies no fast_install, which is unacceptable. 2865 # This implies no fast_install, which is unacceptable.
2866 # Some rework will be needed to allow for fast_install 2866 # Some rework will be needed to allow for fast_install
2867 # before this can be enabled. 2867 # before this can be enabled.
2868 hardcode_into_libs=yes 2868 hardcode_into_libs=yes
2869 2869
 2870 # Add ABI-specific directories to the system library path.
 2871 sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
 2872
2870 # Ideally, we could use ldconfig to report *all* directores which are 2873 # Ideally, we could use ldconfig to report *all* directores which are
2871 # searched for libraries, however this is still not possible. Aside from not 2874 # searched for libraries, however this is still not possible. Aside from not
2872 # being certain /sbin/ldconfig is available, command 2875 # being certain /sbin/ldconfig is available, command
2873 # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, 2876 # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
2874 # even though it is searched at run-time. Try to do the best guess by 2877 # even though it is searched at run-time. Try to do the best guess by
2875 # appending ld.so.conf contents (and includes) to the search path. 2878 # appending ld.so.conf contents (and includes) to the search path.
2876 if test -f /etc/ld.so.conf; then 2879 if test -f /etc/ld.so.conf; then
2877 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` 2880 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
2878 sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" 2881 sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
2879 fi 2882 fi
2880 2883
2881 # We used to test for /lib/ld.so.1 and disable shared libraries on 2884 # We used to test for /lib/ld.so.1 and disable shared libraries on
2882 # powerpc, because MkLinux only supported shared libraries with the 2885 # powerpc, because MkLinux only supported shared libraries with the
2883 # GNU dynamic linker. Since this was broken with cross compilers, 2886 # GNU dynamic linker. Since this was broken with cross compilers,
2884 # most powerpc-linux boxes support dynamic linking these days and 2887 # most powerpc-linux boxes support dynamic linking these days and
2885 # people can always --disable-shared, the test was removed, and we 2888 # people can always --disable-shared, the test was removed, and we
2886 # assume the GNU/Linux dynamic linker is in use. 2889 # assume the GNU/Linux dynamic linker is in use.
2887 dynamic_linker='GNU/Linux ld.so' 2890 dynamic_linker='GNU/Linux ld.so'
2888 ;; 2891 ;;
2889 2892
2890netbsd*) 2893netbsd*)
2891 version_type=sunos 2894 version_type=sunos
2892 need_lib_prefix=no 2895 need_lib_prefix=no
2893 need_version=no 2896 need_version=no
2894 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then 2897 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2895 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' 2898 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2896 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' 2899 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2897 dynamic_linker='NetBSD (a.out) ld.so' 2900 dynamic_linker='NetBSD (a.out) ld.so'
2898 else 2901 else
2899 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' 2902 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2900 soname_spec='$libname$release$shared_ext$major' 2903 soname_spec='$libname$release$shared_ext$major'
2901 dynamic_linker='NetBSD ld.elf_so' 2904 dynamic_linker='NetBSD ld.elf_so'
2902 fi 2905 fi
2903 shlibpath_var=LD_LIBRARY_PATH 2906 shlibpath_var=LD_LIBRARY_PATH
2904 shlibpath_overrides_runpath=yes 2907 shlibpath_overrides_runpath=yes
2905 hardcode_into_libs=yes 2908 hardcode_into_libs=yes
2906 ;; 2909 ;;
2907 2910
2908newsos6) 2911newsos6)
2909 version_type=linux # correct to gnu/linux during the next big refactor 2912 version_type=linux # correct to gnu/linux during the next big refactor
2910 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' 2913 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2911 shlibpath_var=LD_LIBRARY_PATH 2914 shlibpath_var=LD_LIBRARY_PATH
2912 shlibpath_overrides_runpath=yes 2915 shlibpath_overrides_runpath=yes
2913 ;; 2916 ;;
2914 2917
2915*nto* | *qnx*) 2918*nto* | *qnx*)
2916 version_type=qnx 2919 version_type=qnx
2917 need_lib_prefix=no 2920 need_lib_prefix=no
2918 need_version=no 2921 need_version=no
2919 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' 2922 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2920 soname_spec='$libname$release$shared_ext$major' 2923 soname_spec='$libname$release$shared_ext$major'
2921 shlibpath_var=LD_LIBRARY_PATH 2924 shlibpath_var=LD_LIBRARY_PATH
2922 shlibpath_overrides_runpath=no 2925 shlibpath_overrides_runpath=no
2923 hardcode_into_libs=yes 2926 hardcode_into_libs=yes
2924 dynamic_linker='ldqnx.so' 2927 dynamic_linker='ldqnx.so'
2925 ;; 2928 ;;
2926 2929
2927openbsd* | bitrig*) 2930openbsd* | bitrig*)
2928 version_type=sunos 2931 version_type=sunos
2929 sys_lib_dlsearch_path_spec=/usr/lib 2932 sys_lib_dlsearch_path_spec=/usr/lib
2930 need_lib_prefix=no 2933 need_lib_prefix=no
2931 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then 2934 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
2932 need_version=no 2935 need_version=no
2933 else 2936 else
2934 need_version=yes 2937 need_version=yes
2935 fi 2938 fi
2936 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' 2939 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2937 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' 2940 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2938 shlibpath_var=LD_LIBRARY_PATH 2941 shlibpath_var=LD_LIBRARY_PATH
2939 shlibpath_overrides_runpath=yes 2942 shlibpath_overrides_runpath=yes
2940 ;; 2943 ;;
2941 2944
2942os2*) 2945os2*)
2943 libname_spec='$name' 2946 libname_spec='$name'
2944 version_type=windows 2947 version_type=windows
2945 shrext_cmds=.dll 2948 shrext_cmds=.dll
2946 need_version=no 2949 need_version=no
2947 need_lib_prefix=no 2950 need_lib_prefix=no
2948 # OS/2 can only load a DLL with a base name of 8 characters or less. 2951 # OS/2 can only load a DLL with a base name of 8 characters or less.
2949 soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; 2952 soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
2950 v=$($ECHO $release$versuffix | tr -d .-); 2953 v=$($ECHO $release$versuffix | tr -d .-);
2951 n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); 2954 n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
2952 $ECHO $n$v`$shared_ext' 2955 $ECHO $n$v`$shared_ext'
2953 library_names_spec='${libname}_dll.$libext' 2956 library_names_spec='${libname}_dll.$libext'
2954 dynamic_linker='OS/2 ld.exe' 2957 dynamic_linker='OS/2 ld.exe'
2955 shlibpath_var=BEGINLIBPATH 2958 shlibpath_var=BEGINLIBPATH
2956 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" 2959 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2957 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 2960 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2958 postinstall_cmds='base_file=`basename \$file`~ 2961 postinstall_cmds='base_file=`basename \$file`~
2959 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ 2962 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
2960 dldir=$destdir/`dirname \$dlpath`~ 2963 dldir=$destdir/`dirname \$dlpath`~
2961 test -d \$dldir || mkdir -p \$dldir~ 2964 test -d \$dldir || mkdir -p \$dldir~
2962 $install_prog $dir/$dlname \$dldir/$dlname~ 2965 $install_prog $dir/$dlname \$dldir/$dlname~
2963 chmod a+x \$dldir/$dlname~ 2966 chmod a+x \$dldir/$dlname~
2964 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then 2967 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2965 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; 2968 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2966 fi' 2969 fi'
2967 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ 2970 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
2968 dlpath=$dir/\$dldll~ 2971 dlpath=$dir/\$dldll~
2969 $RM \$dlpath' 2972 $RM \$dlpath'
2970 ;; 2973 ;;
2971 2974
2972osf3* | osf4* | osf5*) 2975osf3* | osf4* | osf5*)
2973 version_type=osf 2976 version_type=osf
2974 need_lib_prefix=no 2977 need_lib_prefix=no
2975 need_version=no 2978 need_version=no
2976 soname_spec='$libname$release$shared_ext$major' 2979 soname_spec='$libname$release$shared_ext$major'
2977 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' 2980 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2978 shlibpath_var=LD_LIBRARY_PATH 2981 shlibpath_var=LD_LIBRARY_PATH
2979 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" 2982 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2980 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 2983 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2981 ;; 2984 ;;
2982 2985
2983rdos*) 2986rdos*)
2984 dynamic_linker=no 2987 dynamic_linker=no
2985 ;; 2988 ;;
2986 2989
2987solaris*) 2990solaris*)
2988 version_type=linux # correct to gnu/linux during the next big refactor 2991 version_type=linux # correct to gnu/linux during the next big refactor
2989 need_lib_prefix=no 2992 need_lib_prefix=no
2990 need_version=no 2993 need_version=no
2991 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' 2994 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2992 soname_spec='$libname$release$shared_ext$major' 2995 soname_spec='$libname$release$shared_ext$major'
2993 shlibpath_var=LD_LIBRARY_PATH 2996 shlibpath_var=LD_LIBRARY_PATH
2994 shlibpath_overrides_runpath=yes 2997 shlibpath_overrides_runpath=yes
2995 hardcode_into_libs=yes 2998 hardcode_into_libs=yes
2996 # ldd complains unless libraries are executable 2999 # ldd complains unless libraries are executable
2997 postinstall_cmds='chmod +x $lib' 3000 postinstall_cmds='chmod +x $lib'
2998 ;; 3001 ;;
2999 3002
3000sunos4*) 3003sunos4*)
3001 version_type=sunos 3004 version_type=sunos
3002 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' 3005 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
3003 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' 3006 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3004 shlibpath_var=LD_LIBRARY_PATH 3007 shlibpath_var=LD_LIBRARY_PATH
3005 shlibpath_overrides_runpath=yes 3008 shlibpath_overrides_runpath=yes
3006 if test yes = "$with_gnu_ld"; then 3009 if test yes = "$with_gnu_ld"; then
3007 need_lib_prefix=no 3010 need_lib_prefix=no
3008 fi 3011 fi
3009 need_version=yes 3012 need_version=yes
3010 ;; 3013 ;;
3011 3014
3012sysv4 | sysv4.3*) 3015sysv4 | sysv4.3*)
3013 version_type=linux # correct to gnu/linux during the next big refactor 3016 version_type=linux # correct to gnu/linux during the next big refactor
3014 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' 3017 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3015 soname_spec='$libname$release$shared_ext$major' 3018 soname_spec='$libname$release$shared_ext$major'
3016 shlibpath_var=LD_LIBRARY_PATH 3019 shlibpath_var=LD_LIBRARY_PATH
3017 case $host_vendor in 3020 case $host_vendor in
3018 sni) 3021 sni)
3019 shlibpath_overrides_runpath=no 3022 shlibpath_overrides_runpath=no
3020 need_lib_prefix=no 3023 need_lib_prefix=no
3021 runpath_var=LD_RUN_PATH 3024 runpath_var=LD_RUN_PATH
3022 ;; 3025 ;;
3023 siemens) 3026 siemens)
3024 need_lib_prefix=no 3027 need_lib_prefix=no
3025 ;; 3028 ;;
3026 motorola) 3029 motorola)
3027 need_lib_prefix=no 3030 need_lib_prefix=no
3028 need_version=no 3031 need_version=no
3029 shlibpath_overrides_runpath=no 3032 shlibpath_overrides_runpath=no
3030 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' 3033 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3031 ;; 3034 ;;
3032 esac 3035 esac
3033 ;; 3036 ;;
3034 3037
3035sysv4*MP*) 3038sysv4*MP*)
3036 if test -d /usr/nec; then 3039 if test -d /usr/nec; then
3037 version_type=linux # correct to gnu/linux during the next big refactor 3040 version_type=linux # correct to gnu/linux during the next big refactor
3038 library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' 3041 library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
3039 soname_spec='$libname$shared_ext.$major' 3042 soname_spec='$libname$shared_ext.$major'
3040 shlibpath_var=LD_LIBRARY_PATH 3043 shlibpath_var=LD_LIBRARY_PATH
3041 fi 3044 fi
3042 ;; 3045 ;;
3043 3046
3044sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) 3047sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3045 version_type=sco 3048 version_type=sco
3046 need_lib_prefix=no 3049 need_lib_prefix=no
3047 need_version=no 3050 need_version=no
3048 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' 3051 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
3049 soname_spec='$libname$release$shared_ext$major' 3052 soname_spec='$libname$release$shared_ext$major'
3050 shlibpath_var=LD_LIBRARY_PATH 3053 shlibpath_var=LD_LIBRARY_PATH
3051 shlibpath_overrides_runpath=yes 3054 shlibpath_overrides_runpath=yes
3052 hardcode_into_libs=yes 3055 hardcode_into_libs=yes
3053 if test yes = "$with_gnu_ld"; then 3056 if test yes = "$with_gnu_ld"; then
3054 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' 3057 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3055 else 3058 else
3056 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' 3059 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3057 case $host_os in 3060 case $host_os in
3058 sco3.2v5*) 3061 sco3.2v5*)
3059 sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" 3062 sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3060 ;; 3063 ;;
3061 esac 3064 esac
3062 fi 3065 fi
3063 sys_lib_dlsearch_path_spec='/usr/lib' 3066 sys_lib_dlsearch_path_spec='/usr/lib'
3064 ;; 3067 ;;
3065 3068
3066tpf*) 3069tpf*)
3067 # TPF is a cross-target only. Preferred cross-host = GNU/Linux. 3070 # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
3068 version_type=linux # correct to gnu/linux during the next big refactor 3071 version_type=linux # correct to gnu/linux during the next big refactor
3069 need_lib_prefix=no 3072 need_lib_prefix=no
3070 need_version=no 3073 need_version=no
3071 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' 3074 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3072 shlibpath_var=LD_LIBRARY_PATH 3075 shlibpath_var=LD_LIBRARY_PATH
3073 shlibpath_overrides_runpath=no 3076 shlibpath_overrides_runpath=no
3074 hardcode_into_libs=yes 3077 hardcode_into_libs=yes
3075 ;; 3078 ;;
3076 3079
3077uts4*) 3080uts4*)
3078 version_type=linux # correct to gnu/linux during the next big refactor 3081 version_type=linux # correct to gnu/linux during the next big refactor
3079 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' 3082 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3080 soname_spec='$libname$release$shared_ext$major' 3083 soname_spec='$libname$release$shared_ext$major'
3081 shlibpath_var=LD_LIBRARY_PATH 3084 shlibpath_var=LD_LIBRARY_PATH
3082 ;; 3085 ;;
3083 3086
3084*) 3087*)
3085 dynamic_linker=no 3088 dynamic_linker=no
3086 ;; 3089 ;;
3087esac 3090esac
3088AC_MSG_RESULT([$dynamic_linker]) 3091AC_MSG_RESULT([$dynamic_linker])
3089test no = "$dynamic_linker" && can_build_shared=no 3092test no = "$dynamic_linker" && can_build_shared=no
3090 3093
3091variables_saved_for_relink="PATH $shlibpath_var $runpath_var" 3094variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3092if test yes = "$GCC"; then 3095if test yes = "$GCC"; then
3093 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" 3096 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3094fi 3097fi
3095 3098
3096if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then 3099if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
3097 sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec 3100 sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
3098fi 3101fi
3099 3102
3100if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then 3103if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
3101 sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec 3104 sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
3102fi 3105fi
3103 3106
3104# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... 3107# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
3105configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec 3108configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
3106 3109
3107# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code 3110# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
3108func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" 3111func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
3109 3112
3110# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool 3113# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
3111configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH 3114configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
3112 3115
3113_LT_DECL([], [variables_saved_for_relink], [1], 3116_LT_DECL([], [variables_saved_for_relink], [1],
3114 [Variables whose values should be saved in libtool wrapper scripts and 3117 [Variables whose values should be saved in libtool wrapper scripts and
3115 restored at link time]) 3118 restored at link time])
3116_LT_DECL([], [need_lib_prefix], [0], 3119_LT_DECL([], [need_lib_prefix], [0],
3117 [Do we need the "lib" prefix for modules?]) 3120 [Do we need the "lib" prefix for modules?])
3118_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) 3121_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3119_LT_DECL([], [version_type], [0], [Library versioning type]) 3122_LT_DECL([], [version_type], [0], [Library versioning type])
3120_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) 3123_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
3121_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) 3124_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3122_LT_DECL([], [shlibpath_overrides_runpath], [0], 3125_LT_DECL([], [shlibpath_overrides_runpath], [0],
3123 [Is shlibpath searched before the hard-coded library search path?]) 3126 [Is shlibpath searched before the hard-coded library search path?])
3124_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) 3127_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3125_LT_DECL([], [library_names_spec], [1], 3128_LT_DECL([], [library_names_spec], [1],
3126 [[List of archive names. First name is the real one, the rest are links. 3129 [[List of archive names. First name is the real one, the rest are links.
3127 The last name is the one that the linker finds with -lNAME]]) 3130 The last name is the one that the linker finds with -lNAME]])
3128_LT_DECL([], [soname_spec], [1], 3131_LT_DECL([], [soname_spec], [1],
3129 [[The coded name of the library, if different from the real name]]) 3132 [[The coded name of the library, if different from the real name]])
3130_LT_DECL([], [install_override_mode], [1], 3133_LT_DECL([], [install_override_mode], [1],
3131 [Permission mode override for installation of shared libraries]) 3134 [Permission mode override for installation of shared libraries])
3132_LT_DECL([], [postinstall_cmds], [2], 3135_LT_DECL([], [postinstall_cmds], [2],
3133 [Command to use after installation of a shared archive]) 3136 [Command to use after installation of a shared archive])
3134_LT_DECL([], [postuninstall_cmds], [2], 3137_LT_DECL([], [postuninstall_cmds], [2],
3135 [Command to use after uninstallation of a shared archive]) 3138 [Command to use after uninstallation of a shared archive])
3136_LT_DECL([], [finish_cmds], [2], 3139_LT_DECL([], [finish_cmds], [2],
3137 [Commands used to finish a libtool library installation in a directory]) 3140 [Commands used to finish a libtool library installation in a directory])
3138_LT_DECL([], [finish_eval], [1], 3141_LT_DECL([], [finish_eval], [1],
3139 [[As "finish_cmds", except a single script fragment to be evaled but 3142 [[As "finish_cmds", except a single script fragment to be evaled but
3140 not shown]]) 3143 not shown]])
3141_LT_DECL([], [hardcode_into_libs], [0], 3144_LT_DECL([], [hardcode_into_libs], [0],
3142 [Whether we should hardcode library paths into libraries]) 3145 [Whether we should hardcode library paths into libraries])
3143_LT_DECL([], [sys_lib_search_path_spec], [2], 3146_LT_DECL([], [sys_lib_search_path_spec], [2],
3144 [Compile-time system search path for libraries]) 3147 [Compile-time system search path for libraries])
3145_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], 3148_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
3146 [Detected run-time system search path for libraries]) 3149 [Detected run-time system search path for libraries])
3147_LT_DECL([], [configure_time_lt_sys_library_path], [2], 3150_LT_DECL([], [configure_time_lt_sys_library_path], [2],
3148 [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) 3151 [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
3149])# _LT_SYS_DYNAMIC_LINKER 3152])# _LT_SYS_DYNAMIC_LINKER
3150 3153
3151 3154
3152# _LT_PATH_TOOL_PREFIX(TOOL) 3155# _LT_PATH_TOOL_PREFIX(TOOL)
3153# -------------------------- 3156# --------------------------
3154# find a file program that can recognize shared library 3157# find a file program that can recognize shared library
3155AC_DEFUN([_LT_PATH_TOOL_PREFIX], 3158AC_DEFUN([_LT_PATH_TOOL_PREFIX],
3156[m4_require([_LT_DECL_EGREP])dnl 3159[m4_require([_LT_DECL_EGREP])dnl
3157AC_MSG_CHECKING([for $1]) 3160AC_MSG_CHECKING([for $1])
3158AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, 3161AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3159[case $MAGIC_CMD in 3162[case $MAGIC_CMD in
3160[[\\/*] | ?:[\\/]*]) 3163[[\\/*] | ?:[\\/]*])
3161 lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. 3164 lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
3162 ;; 3165 ;;
3163*) 3166*)
3164 lt_save_MAGIC_CMD=$MAGIC_CMD 3167 lt_save_MAGIC_CMD=$MAGIC_CMD
3165 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR 3168 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3166dnl $ac_dummy forces splitting on constant user-supplied paths. 3169dnl $ac_dummy forces splitting on constant user-supplied paths.
3167dnl POSIX.2 word splitting is done only on the output of word expansions, 3170dnl POSIX.2 word splitting is done only on the output of word expansions,
3168dnl not every word. This closes a longstanding sh security hole. 3171dnl not every word. This closes a longstanding sh security hole.
3169 ac_dummy="m4_if([$2], , $PATH, [$2])" 3172 ac_dummy="m4_if([$2], , $PATH, [$2])"
3170 for ac_dir in $ac_dummy; do 3173 for ac_dir in $ac_dummy; do
3171 IFS=$lt_save_ifs 3174 IFS=$lt_save_ifs
3172 test -z "$ac_dir" && ac_dir=. 3175 test -z "$ac_dir" && ac_dir=.
3173 if test -f "$ac_dir/$1"; then 3176 if test -f "$ac_dir/$1"; then
3174 lt_cv_path_MAGIC_CMD=$ac_dir/"$1" 3177 lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
3175 if test -n "$file_magic_test_file"; then 3178 if test -n "$file_magic_test_file"; then
3176 case $deplibs_check_method in 3179 case $deplibs_check_method in
3177 "file_magic "*) 3180 "file_magic "*)
3178 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` 3181 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3179 MAGIC_CMD=$lt_cv_path_MAGIC_CMD 3182 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
3180 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | 3183 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3181 $EGREP "$file_magic_regex" > /dev/null; then 3184 $EGREP "$file_magic_regex" > /dev/null; then
3182 : 3185 :
3183 else 3186 else
3184 cat <<_LT_EOF 1>&2 3187 cat <<_LT_EOF 1>&2
3185 3188
3186*** Warning: the command libtool uses to detect shared libraries, 3189*** Warning: the command libtool uses to detect shared libraries,
3187*** $file_magic_cmd, produces output that libtool cannot recognize. 3190*** $file_magic_cmd, produces output that libtool cannot recognize.
3188*** The result is that libtool may fail to recognize shared libraries 3191*** The result is that libtool may fail to recognize shared libraries
3189*** as such. This will affect the creation of libtool libraries that 3192*** as such. This will affect the creation of libtool libraries that
3190*** depend on shared libraries, but programs linked with such libtool 3193*** depend on shared libraries, but programs linked with such libtool
3191*** libraries will work regardless of this problem. Nevertheless, you 3194*** libraries will work regardless of this problem. Nevertheless, you
3192*** may want to report the problem to your system manager and/or to 3195*** may want to report the problem to your system manager and/or to
3193*** bug-libtool@gnu.org 3196*** bug-libtool@gnu.org
3194 3197
3195_LT_EOF 3198_LT_EOF
3196 fi ;; 3199 fi ;;
3197 esac 3200 esac
3198 fi 3201 fi
3199 break 3202 break
3200 fi 3203 fi
3201 done 3204 done
3202 IFS=$lt_save_ifs 3205 IFS=$lt_save_ifs
3203 MAGIC_CMD=$lt_save_MAGIC_CMD 3206 MAGIC_CMD=$lt_save_MAGIC_CMD
3204 ;; 3207 ;;
3205esac]) 3208esac])
3206MAGIC_CMD=$lt_cv_path_MAGIC_CMD 3209MAGIC_CMD=$lt_cv_path_MAGIC_CMD
3207if test -n "$MAGIC_CMD"; then 3210if test -n "$MAGIC_CMD"; then
3208 AC_MSG_RESULT($MAGIC_CMD) 3211 AC_MSG_RESULT($MAGIC_CMD)
3209else 3212else
3210 AC_MSG_RESULT(no) 3213 AC_MSG_RESULT(no)
3211fi 3214fi
3212_LT_DECL([], [MAGIC_CMD], [0], 3215_LT_DECL([], [MAGIC_CMD], [0],
3213 [Used to examine libraries when file_magic_cmd begins with "file"])dnl 3216 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3214])# _LT_PATH_TOOL_PREFIX 3217])# _LT_PATH_TOOL_PREFIX
3215 3218
3216# Old name: 3219# Old name:
3217AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) 3220AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3218dnl aclocal-1.4 backwards compatibility: 3221dnl aclocal-1.4 backwards compatibility:
3219dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) 3222dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3220 3223
3221 3224
3222# _LT_PATH_MAGIC 3225# _LT_PATH_MAGIC
3223# -------------- 3226# --------------
3224# find a file program that can recognize a shared library 3227# find a file program that can recognize a shared library
3225m4_defun([_LT_PATH_MAGIC], 3228m4_defun([_LT_PATH_MAGIC],
3226[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) 3229[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3227if test -z "$lt_cv_path_MAGIC_CMD"; then 3230if test -z "$lt_cv_path_MAGIC_CMD"; then
3228 if test -n "$ac_tool_prefix"; then 3231 if test -n "$ac_tool_prefix"; then
3229 _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) 3232 _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3230 else 3233 else
3231 MAGIC_CMD=: 3234 MAGIC_CMD=:
3232 fi 3235 fi
3233fi 3236fi
3234])# _LT_PATH_MAGIC 3237])# _LT_PATH_MAGIC
3235 3238
3236 3239
3237# LT_PATH_LD 3240# LT_PATH_LD
3238# ---------- 3241# ----------
3239# find the pathname to the GNU or non-GNU linker 3242# find the pathname to the GNU or non-GNU linker
3240AC_DEFUN([LT_PATH_LD], 3243AC_DEFUN([LT_PATH_LD],
3241[AC_REQUIRE([AC_PROG_CC])dnl 3244[AC_REQUIRE([AC_PROG_CC])dnl
3242AC_REQUIRE([AC_CANONICAL_HOST])dnl 3245AC_REQUIRE([AC_CANONICAL_HOST])dnl
3243AC_REQUIRE([AC_CANONICAL_BUILD])dnl 3246AC_REQUIRE([AC_CANONICAL_BUILD])dnl
3244m4_require([_LT_DECL_SED])dnl 3247m4_require([_LT_DECL_SED])dnl
3245m4_require([_LT_DECL_EGREP])dnl 3248m4_require([_LT_DECL_EGREP])dnl
3246m4_require([_LT_PROG_ECHO_BACKSLASH])dnl 3249m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3247 3250
3248AC_ARG_WITH([gnu-ld], 3251AC_ARG_WITH([gnu-ld],
3249 [AS_HELP_STRING([--with-gnu-ld], 3252 [AS_HELP_STRING([--with-gnu-ld],
3250 [assume the C compiler uses GNU ld @<:@default=no@:>@])], 3253 [assume the C compiler uses GNU ld @<:@default=no@:>@])],
3251 [test no = "$withval" || with_gnu_ld=yes], 3254 [test no = "$withval" || with_gnu_ld=yes],
3252 [with_gnu_ld=no])dnl 3255 [with_gnu_ld=no])dnl
3253 3256
3254ac_prog=ld 3257ac_prog=ld
3255if test yes = "$GCC"; then 3258if test yes = "$GCC"; then
3256 # Check if gcc -print-prog-name=ld gives a path. 3259 # Check if gcc -print-prog-name=ld gives a path.
3257 AC_MSG_CHECKING([for ld used by $CC]) 3260 AC_MSG_CHECKING([for ld used by $CC])
3258 case $host in 3261 case $host in
3259 *-*-mingw*) 3262 *-*-mingw*)
3260 # gcc leaves a trailing carriage return, which upsets mingw 3263 # gcc leaves a trailing carriage return, which upsets mingw
3261 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; 3264 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3262 *) 3265 *)
3263 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; 3266 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3264 esac 3267 esac
3265 case $ac_prog in 3268 case $ac_prog in
3266 # Accept absolute paths. 3269 # Accept absolute paths.
3267 [[\\/]]* | ?:[[\\/]]*) 3270 [[\\/]]* | ?:[[\\/]]*)
3268 re_direlt='/[[^/]][[^/]]*/\.\./' 3271 re_direlt='/[[^/]][[^/]]*/\.\./'
3269 # Canonicalize the pathname of ld 3272 # Canonicalize the pathname of ld
3270 ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` 3273 ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3271 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do 3274 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3272 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` 3275 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3273 done 3276 done
3274 test -z "$LD" && LD=$ac_prog 3277 test -z "$LD" && LD=$ac_prog
3275 ;; 3278 ;;
3276 "") 3279 "")
3277 # If it fails, then pretend we aren't using GCC. 3280 # If it fails, then pretend we aren't using GCC.
3278 ac_prog=ld 3281 ac_prog=ld
3279 ;; 3282 ;;
3280 *) 3283 *)
3281 # If it is relative, then search for the first ld in PATH. 3284 # If it is relative, then search for the first ld in PATH.
3282 with_gnu_ld=unknown 3285 with_gnu_ld=unknown
3283 ;; 3286 ;;
3284 esac 3287 esac
3285elif test yes = "$with_gnu_ld"; then 3288elif test yes = "$with_gnu_ld"; then
3286 AC_MSG_CHECKING([for GNU ld]) 3289 AC_MSG_CHECKING([for GNU ld])
3287else 3290else
3288 AC_MSG_CHECKING([for non-GNU ld]) 3291 AC_MSG_CHECKING([for non-GNU ld])
3289fi 3292fi
3290AC_CACHE_VAL(lt_cv_path_LD, 3293AC_CACHE_VAL(lt_cv_path_LD,
3291[if test -z "$LD"; then 3294[if test -z "$LD"; then
3292 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR 3295 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3293 for ac_dir in $PATH; do 3296 for ac_dir in $PATH; do
3294 IFS=$lt_save_ifs 3297 IFS=$lt_save_ifs
3295 test -z "$ac_dir" && ac_dir=. 3298 test -z "$ac_dir" && ac_dir=.
3296 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then 3299 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3297 lt_cv_path_LD=$ac_dir/$ac_prog 3300 lt_cv_path_LD=$ac_dir/$ac_prog
3298 # Check to see if the program is GNU ld. I'd rather use --version, 3301 # Check to see if the program is GNU ld. I'd rather use --version,
3299 # but apparently some variants of GNU ld only accept -v. 3302 # but apparently some variants of GNU ld only accept -v.
3300 # Break only if it was the GNU/non-GNU ld that we prefer. 3303 # Break only if it was the GNU/non-GNU ld that we prefer.
3301 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in 3304 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3302 *GNU* | *'with BFD'*) 3305 *GNU* | *'with BFD'*)
3303 test no != "$with_gnu_ld" && break 3306 test no != "$with_gnu_ld" && break
3304 ;; 3307 ;;
3305 *) 3308 *)
3306 test yes != "$with_gnu_ld" && break 3309 test yes != "$with_gnu_ld" && break
3307 ;; 3310 ;;
3308 esac 3311 esac
3309 fi 3312 fi
3310 done 3313 done
3311 IFS=$lt_save_ifs 3314 IFS=$lt_save_ifs
3312else 3315else
3313 lt_cv_path_LD=$LD # Let the user override the test with a path. 3316 lt_cv_path_LD=$LD # Let the user override the test with a path.
3314fi]) 3317fi])
3315LD=$lt_cv_path_LD 3318LD=$lt_cv_path_LD
3316if test -n "$LD"; then 3319if test -n "$LD"; then
3317 AC_MSG_RESULT($LD) 3320 AC_MSG_RESULT($LD)
3318else 3321else
3319 AC_MSG_RESULT(no) 3322 AC_MSG_RESULT(no)
3320fi 3323fi
3321test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) 3324test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3322_LT_PATH_LD_GNU 3325_LT_PATH_LD_GNU
3323AC_SUBST([LD]) 3326AC_SUBST([LD])
3324 3327
3325_LT_TAGDECL([], [LD], [1], [The linker used to build libraries]) 3328_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3326])# LT_PATH_LD 3329])# LT_PATH_LD
3327 3330
3328# Old names: 3331# Old names:
3329AU_ALIAS([AM_PROG_LD], [LT_PATH_LD]) 3332AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3330AU_ALIAS([AC_PROG_LD], [LT_PATH_LD]) 3333AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3331dnl aclocal-1.4 backwards compatibility: 3334dnl aclocal-1.4 backwards compatibility:
3332dnl AC_DEFUN([AM_PROG_LD], []) 3335dnl AC_DEFUN([AM_PROG_LD], [])
3333dnl AC_DEFUN([AC_PROG_LD], []) 3336dnl AC_DEFUN([AC_PROG_LD], [])
3334 3337
3335 3338
3336# _LT_PATH_LD_GNU 3339# _LT_PATH_LD_GNU
3337#- -------------- 3340#- --------------
3338m4_defun([_LT_PATH_LD_GNU], 3341m4_defun([_LT_PATH_LD_GNU],
3339[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, 3342[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3340[# I'd rather use --version here, but apparently some GNU lds only accept -v. 3343[# I'd rather use --version here, but apparently some GNU lds only accept -v.
3341case `$LD -v 2>&1 </dev/null` in 3344case `$LD -v 2>&1 </dev/null` in
3342*GNU* | *'with BFD'*) 3345*GNU* | *'with BFD'*)
3343 lt_cv_prog_gnu_ld=yes 3346 lt_cv_prog_gnu_ld=yes
3344 ;; 3347 ;;
3345*) 3348*)
3346 lt_cv_prog_gnu_ld=no 3349 lt_cv_prog_gnu_ld=no
3347 ;; 3350 ;;
3348esac]) 3351esac])
3349with_gnu_ld=$lt_cv_prog_gnu_ld 3352with_gnu_ld=$lt_cv_prog_gnu_ld
3350])# _LT_PATH_LD_GNU 3353])# _LT_PATH_LD_GNU
3351 3354
3352 3355
3353# _LT_CMD_RELOAD 3356# _LT_CMD_RELOAD
3354# -------------- 3357# --------------
3355# find reload flag for linker 3358# find reload flag for linker
3356# -- PORTME Some linkers may need a different reload flag. 3359# -- PORTME Some linkers may need a different reload flag.
3357m4_defun([_LT_CMD_RELOAD], 3360m4_defun([_LT_CMD_RELOAD],
3358[AC_CACHE_CHECK([for $LD option to reload object files], 3361[AC_CACHE_CHECK([for $LD option to reload object files],
3359 lt_cv_ld_reload_flag, 3362 lt_cv_ld_reload_flag,
3360 [lt_cv_ld_reload_flag='-r']) 3363 [lt_cv_ld_reload_flag='-r'])
3361reload_flag=$lt_cv_ld_reload_flag 3364reload_flag=$lt_cv_ld_reload_flag
3362case $reload_flag in 3365case $reload_flag in
3363"" | " "*) ;; 3366"" | " "*) ;;
3364*) reload_flag=" $reload_flag" ;; 3367*) reload_flag=" $reload_flag" ;;
3365esac 3368esac
3366reload_cmds='$LD$reload_flag -o $output$reload_objs' 3369reload_cmds='$LD$reload_flag -o $output$reload_objs'
3367case $host_os in 3370case $host_os in
3368 cygwin* | mingw* | pw32* | cegcc*) 3371 cygwin* | mingw* | pw32* | cegcc*)
3369 if test yes != "$GCC"; then 3372 if test yes != "$GCC"; then
3370 reload_cmds=false 3373 reload_cmds=false
3371 fi 3374 fi
3372 ;; 3375 ;;
3373 darwin*) 3376 darwin*)
3374 if test yes = "$GCC"; then 3377 if test yes = "$GCC"; then
3375 reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' 3378 reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
3376 else 3379 else
3377 reload_cmds='$LD$reload_flag -o $output$reload_objs' 3380 reload_cmds='$LD$reload_flag -o $output$reload_objs'
3378 fi 3381 fi
3379 ;; 3382 ;;
3380esac 3383esac
3381_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl 3384_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
3382_LT_TAGDECL([], [reload_cmds], [2])dnl 3385_LT_TAGDECL([], [reload_cmds], [2])dnl
3383])# _LT_CMD_RELOAD 3386])# _LT_CMD_RELOAD
3384 3387
3385 3388
3386# _LT_PATH_DD 3389# _LT_PATH_DD
3387# ----------- 3390# -----------
3388# find a working dd 3391# find a working dd
3389m4_defun([_LT_PATH_DD], 3392m4_defun([_LT_PATH_DD],
3390[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD], 3393[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
3391[printf 0123456789abcdef0123456789abcdef >conftest.i 3394[printf 0123456789abcdef0123456789abcdef >conftest.i
3392cat conftest.i conftest.i >conftest2.i 3395cat conftest.i conftest.i >conftest2.i
3393: ${lt_DD:=$DD} 3396: ${lt_DD:=$DD}
3394AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], 3397AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
3395[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then 3398[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3396 cmp -s conftest.i conftest.out \ 3399 cmp -s conftest.i conftest.out \
3397 && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: 3400 && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
3398fi]) 3401fi])
3399rm -f conftest.i conftest2.i conftest.out]) 3402rm -f conftest.i conftest2.i conftest.out])
3400])# _LT_PATH_DD 3403])# _LT_PATH_DD
3401 3404
3402 3405
3403# _LT_CMD_TRUNCATE 3406# _LT_CMD_TRUNCATE
3404# ---------------- 3407# ----------------
3405# find command to truncate a binary pipe 3408# find command to truncate a binary pipe
3406m4_defun([_LT_CMD_TRUNCATE], 3409m4_defun([_LT_CMD_TRUNCATE],
3407[m4_require([_LT_PATH_DD]) 3410[m4_require([_LT_PATH_DD])
3408AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], 3411AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
3409[printf 0123456789abcdef0123456789abcdef >conftest.i 3412[printf 0123456789abcdef0123456789abcdef >conftest.i
3410cat conftest.i conftest.i >conftest2.i 3413cat conftest.i conftest.i >conftest2.i
3411lt_cv_truncate_bin= 3414lt_cv_truncate_bin=
3412if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then 3415if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3413 cmp -s conftest.i conftest.out \ 3416 cmp -s conftest.i conftest.out \
3414 && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" 3417 && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
3415fi 3418fi
3416rm -f conftest.i conftest2.i conftest.out 3419rm -f conftest.i conftest2.i conftest.out
3417test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) 3420test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
3418_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], 3421_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
3419 [Command to truncate a binary pipe]) 3422 [Command to truncate a binary pipe])
3420])# _LT_CMD_TRUNCATE 3423])# _LT_CMD_TRUNCATE
3421 3424
3422 3425
3423# _LT_CHECK_MAGIC_METHOD 3426# _LT_CHECK_MAGIC_METHOD
3424# ---------------------- 3427# ----------------------
3425# how to check for library dependencies 3428# how to check for library dependencies
3426# -- PORTME fill in with the dynamic library characteristics 3429# -- PORTME fill in with the dynamic library characteristics
3427m4_defun([_LT_CHECK_MAGIC_METHOD], 3430m4_defun([_LT_CHECK_MAGIC_METHOD],
3428[m4_require([_LT_DECL_EGREP]) 3431[m4_require([_LT_DECL_EGREP])
3429m4_require([_LT_DECL_OBJDUMP]) 3432m4_require([_LT_DECL_OBJDUMP])
3430AC_CACHE_CHECK([how to recognize dependent libraries], 3433AC_CACHE_CHECK([how to recognize dependent libraries],
3431lt_cv_deplibs_check_method, 3434lt_cv_deplibs_check_method,
3432[lt_cv_file_magic_cmd='$MAGIC_CMD' 3435[lt_cv_file_magic_cmd='$MAGIC_CMD'
3433lt_cv_file_magic_test_file= 3436lt_cv_file_magic_test_file=
3434lt_cv_deplibs_check_method='unknown' 3437lt_cv_deplibs_check_method='unknown'
3435# Need to set the preceding variable on all platforms that support 3438# Need to set the preceding variable on all platforms that support
3436# interlibrary dependencies. 3439# interlibrary dependencies.
3437# 'none' -- dependencies not supported. 3440# 'none' -- dependencies not supported.
3438# 'unknown' -- same as none, but documents that we really don't know. 3441# 'unknown' -- same as none, but documents that we really don't know.
3439# 'pass_all' -- all dependencies passed with no checks. 3442# 'pass_all' -- all dependencies passed with no checks.
3440# 'test_compile' -- check by making test program. 3443# 'test_compile' -- check by making test program.
3441# 'file_magic [[regex]]' -- check by looking for files in library path 3444# 'file_magic [[regex]]' -- check by looking for files in library path
3442# that responds to the $file_magic_cmd with a given extended regex. 3445# that responds to the $file_magic_cmd with a given extended regex.
3443# If you have 'file' or equivalent on your system and you're not sure 3446# If you have 'file' or equivalent on your system and you're not sure
3444# whether 'pass_all' will *always* work, you probably want this one. 3447# whether 'pass_all' will *always* work, you probably want this one.
3445 3448
3446case $host_os in 3449case $host_os in
3447aix[[4-9]]*) 3450aix[[4-9]]*)
3448 lt_cv_deplibs_check_method=pass_all 3451 lt_cv_deplibs_check_method=pass_all
3449 ;; 3452 ;;
3450 3453
3451beos*) 3454beos*)
3452 lt_cv_deplibs_check_method=pass_all 3455 lt_cv_deplibs_check_method=pass_all
3453 ;; 3456 ;;
3454 3457
3455bsdi[[45]]*) 3458bsdi[[45]]*)
3456 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' 3459 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3457 lt_cv_file_magic_cmd='/usr/bin/file -L' 3460 lt_cv_file_magic_cmd='/usr/bin/file -L'
3458 lt_cv_file_magic_test_file=/shlib/libc.so 3461 lt_cv_file_magic_test_file=/shlib/libc.so
3459 ;; 3462 ;;
3460 3463
3461cygwin*) 3464cygwin*)
3462 # func_win32_libid is a shell function defined in ltmain.sh 3465 # func_win32_libid is a shell function defined in ltmain.sh
3463 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' 3466 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3464 lt_cv_file_magic_cmd='func_win32_libid' 3467 lt_cv_file_magic_cmd='func_win32_libid'
3465 ;; 3468 ;;
3466 3469
3467mingw* | pw32*) 3470mingw* | pw32*)
3468 # Base MSYS/MinGW do not provide the 'file' command needed by 3471 # Base MSYS/MinGW do not provide the 'file' command needed by
3469 # func_win32_libid shell function, so use a weaker test based on 'objdump', 3472 # func_win32_libid shell function, so use a weaker test based on 'objdump',
3470 # unless we find 'file', for example because we are cross-compiling. 3473 # unless we find 'file', for example because we are cross-compiling.
3471 if ( file / ) >/dev/null 2>&1; then 3474 if ( file / ) >/dev/null 2>&1; then
3472 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' 3475 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3473 lt_cv_file_magic_cmd='func_win32_libid' 3476 lt_cv_file_magic_cmd='func_win32_libid'
3474 else 3477 else
3475 # Keep this pattern in sync with the one in func_win32_libid. 3478 # Keep this pattern in sync with the one in func_win32_libid.
3476 lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' 3479 lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
3477 lt_cv_file_magic_cmd='$OBJDUMP -f' 3480 lt_cv_file_magic_cmd='$OBJDUMP -f'
3478 fi 3481 fi
3479 ;; 3482 ;;
3480 3483
3481cegcc*) 3484cegcc*)
3482 # use the weaker test based on 'objdump'. See mingw*. 3485 # use the weaker test based on 'objdump'. See mingw*.
3483 lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' 3486 lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3484 lt_cv_file_magic_cmd='$OBJDUMP -f' 3487 lt_cv_file_magic_cmd='$OBJDUMP -f'
3485 ;; 3488 ;;
3486 3489
3487darwin* | rhapsody*) 3490darwin* | rhapsody*)
3488 lt_cv_deplibs_check_method=pass_all 3491 lt_cv_deplibs_check_method=pass_all
3489 ;; 3492 ;;
3490 3493
3491freebsd* | dragonfly*) 3494freebsd* | dragonfly*)
3492 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then 3495 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3493 case $host_cpu in 3496 case $host_cpu in
3494 i*86 ) 3497 i*86 )
3495 # Not sure whether the presence of OpenBSD here was a mistake. 3498 # Not sure whether the presence of OpenBSD here was a mistake.
3496 # Let's accept both of them until this is cleared up. 3499 # Let's accept both of them until this is cleared up.
3497 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' 3500 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3498 lt_cv_file_magic_cmd=/usr/bin/file 3501 lt_cv_file_magic_cmd=/usr/bin/file
3499 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` 3502 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3500 ;; 3503 ;;
3501 esac 3504 esac
3502 else 3505 else
3503 lt_cv_deplibs_check_method=pass_all 3506 lt_cv_deplibs_check_method=pass_all
3504 fi 3507 fi
3505 ;; 3508 ;;
3506 3509
3507haiku*) 3510haiku*)
3508 lt_cv_deplibs_check_method=pass_all 3511 lt_cv_deplibs_check_method=pass_all
3509 ;; 3512 ;;
3510 3513
3511hpux10.20* | hpux11*) 3514hpux10.20* | hpux11*)
3512 lt_cv_file_magic_cmd=/usr/bin/file 3515 lt_cv_file_magic_cmd=/usr/bin/file
3513 case $host_cpu in 3516 case $host_cpu in
3514 ia64*) 3517 ia64*)
3515 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' 3518 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3516 lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so 3519 lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3517 ;; 3520 ;;
3518 hppa*64*) 3521 hppa*64*)
3519 [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] 3522 [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
3520 lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl 3523 lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3521 ;; 3524 ;;
3522 *) 3525 *)
3523 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' 3526 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3524 lt_cv_file_magic_test_file=/usr/lib/libc.sl 3527 lt_cv_file_magic_test_file=/usr/lib/libc.sl
3525 ;; 3528 ;;
3526 esac 3529 esac
3527 ;; 3530 ;;
3528 3531
3529interix[[3-9]]*) 3532interix[[3-9]]*)
3530 # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here 3533 # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3531 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' 3534 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3532 ;; 3535 ;;
3533 3536
3534irix5* | irix6* | nonstopux*) 3537irix5* | irix6* | nonstopux*)
3535 case $LD in 3538 case $LD in
3536 *-32|*"-32 ") libmagic=32-bit;; 3539 *-32|*"-32 ") libmagic=32-bit;;
3537 *-n32|*"-n32 ") libmagic=N32;; 3540 *-n32|*"-n32 ") libmagic=N32;;
3538 *-64|*"-64 ") libmagic=64-bit;; 3541 *-64|*"-64 ") libmagic=64-bit;;
3539 *) libmagic=never-match;; 3542 *) libmagic=never-match;;
3540 esac 3543 esac
3541 lt_cv_deplibs_check_method=pass_all 3544 lt_cv_deplibs_check_method=pass_all
3542 ;; 3545 ;;
3543 3546
3544# This must be glibc/ELF. 3547# This must be glibc/ELF.
3545linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) 3548linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
3546 lt_cv_deplibs_check_method=pass_all 3549 lt_cv_deplibs_check_method=pass_all
3547 ;; 3550 ;;
3548 3551
3549netbsd*) 3552netbsd*)
3550 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then 3553 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3551 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' 3554 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3552 else 3555 else
3553 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' 3556 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3554 fi 3557 fi
3555 ;; 3558 ;;
3556 3559
3557newos6*) 3560newos6*)
3558 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' 3561 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3559 lt_cv_file_magic_cmd=/usr/bin/file 3562 lt_cv_file_magic_cmd=/usr/bin/file
3560 lt_cv_file_magic_test_file=/usr/lib/libnls.so 3563 lt_cv_file_magic_test_file=/usr/lib/libnls.so
3561 ;; 3564 ;;
3562 3565
3563*nto* | *qnx*) 3566*nto* | *qnx*)
3564 lt_cv_deplibs_check_method=pass_all 3567 lt_cv_deplibs_check_method=pass_all
3565 ;; 3568 ;;
3566 3569
3567openbsd* | bitrig*) 3570openbsd* | bitrig*)
3568 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then 3571 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
3569 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' 3572 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3570 else 3573 else
3571 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' 3574 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3572 fi 3575 fi
3573 ;; 3576 ;;
3574 3577
3575osf3* | osf4* | osf5*) 3578osf3* | osf4* | osf5*)
3576 lt_cv_deplibs_check_method=pass_all 3579 lt_cv_deplibs_check_method=pass_all
3577 ;; 3580 ;;
3578 3581
3579rdos*) 3582rdos*)
3580 lt_cv_deplibs_check_method=pass_all 3583 lt_cv_deplibs_check_method=pass_all
3581 ;; 3584 ;;
3582 3585
3583solaris*) 3586solaris*)
3584 lt_cv_deplibs_check_method=pass_all 3587 lt_cv_deplibs_check_method=pass_all
3585 ;; 3588 ;;
3586 3589
3587sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) 3590sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3588 lt_cv_deplibs_check_method=pass_all 3591 lt_cv_deplibs_check_method=pass_all
3589 ;; 3592 ;;
3590 3593
3591sysv4 | sysv4.3*) 3594sysv4 | sysv4.3*)
3592 case $host_vendor in 3595 case $host_vendor in
3593 motorola) 3596 motorola)
3594 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' 3597 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
3595 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` 3598 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3596 ;; 3599 ;;
3597 ncr) 3600 ncr)
3598 lt_cv_deplibs_check_method=pass_all 3601 lt_cv_deplibs_check_method=pass_all
3599 ;; 3602 ;;
3600 sequent) 3603 sequent)
3601 lt_cv_file_magic_cmd='/bin/file' 3604 lt_cv_file_magic_cmd='/bin/file'
3602 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' 3605 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3603 ;; 3606 ;;
3604 sni) 3607 sni)
3605 lt_cv_file_magic_cmd='/bin/file' 3608 lt_cv_file_magic_cmd='/bin/file'
3606 lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" 3609 lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3607 lt_cv_file_magic_test_file=/lib/libc.so 3610 lt_cv_file_magic_test_file=/lib/libc.so
3608 ;; 3611 ;;
3609 siemens) 3612 siemens)
3610 lt_cv_deplibs_check_method=pass_all 3613 lt_cv_deplibs_check_method=pass_all
3611 ;; 3614 ;;
3612 pc) 3615 pc)
3613 lt_cv_deplibs_check_method=pass_all 3616 lt_cv_deplibs_check_method=pass_all
3614 ;; 3617 ;;
3615 esac 3618 esac
3616 ;; 3619 ;;
3617 3620
3618tpf*) 3621tpf*)
3619 lt_cv_deplibs_check_method=pass_all 3622 lt_cv_deplibs_check_method=pass_all
3620 ;; 3623 ;;
3621os2*) 3624os2*)
3622 lt_cv_deplibs_check_method=pass_all 3625 lt_cv_deplibs_check_method=pass_all
3623 ;; 3626 ;;
3624esac 3627esac
3625]) 3628])
3626 3629
3627file_magic_glob= 3630file_magic_glob=
3628want_nocaseglob=no 3631want_nocaseglob=no
3629if test "$build" = "$host"; then 3632if test "$build" = "$host"; then
3630 case $host_os in 3633 case $host_os in
3631 mingw* | pw32*) 3634 mingw* | pw32*)
3632 if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then 3635 if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3633 want_nocaseglob=yes 3636 want_nocaseglob=yes
3634 else 3637 else
3635 file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` 3638 file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
3636 fi 3639 fi
3637 ;; 3640 ;;
3638 esac 3641 esac
3639fi 3642fi
3640 3643
3641file_magic_cmd=$lt_cv_file_magic_cmd 3644file_magic_cmd=$lt_cv_file_magic_cmd
3642deplibs_check_method=$lt_cv_deplibs_check_method 3645deplibs_check_method=$lt_cv_deplibs_check_method
3643test -z "$deplibs_check_method" && deplibs_check_method=unknown 3646test -z "$deplibs_check_method" && deplibs_check_method=unknown
3644 3647
3645_LT_DECL([], [deplibs_check_method], [1], 3648_LT_DECL([], [deplibs_check_method], [1],
3646 [Method to check whether dependent libraries are shared objects]) 3649 [Method to check whether dependent libraries are shared objects])
3647_LT_DECL([], [file_magic_cmd], [1], 3650_LT_DECL([], [file_magic_cmd], [1],
3648 [Command to use when deplibs_check_method = "file_magic"]) 3651 [Command to use when deplibs_check_method = "file_magic"])
3649_LT_DECL([], [file_magic_glob], [1], 3652_LT_DECL([], [file_magic_glob], [1],
3650 [How to find potential files when deplibs_check_method = "file_magic"]) 3653 [How to find potential files when deplibs_check_method = "file_magic"])
3651_LT_DECL([], [want_nocaseglob], [1], 3654_LT_DECL([], [want_nocaseglob], [1],
3652 [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) 3655 [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3653])# _LT_CHECK_MAGIC_METHOD 3656])# _LT_CHECK_MAGIC_METHOD
3654 3657
3655 3658
3656# LT_PATH_NM 3659# LT_PATH_NM
3657# ---------- 3660# ----------
3658# find the pathname to a BSD- or MS-compatible name lister 3661# find the pathname to a BSD- or MS-compatible name lister
3659AC_DEFUN([LT_PATH_NM], 3662AC_DEFUN([LT_PATH_NM],
3660[AC_REQUIRE([AC_PROG_CC])dnl 3663[AC_REQUIRE([AC_PROG_CC])dnl
3661AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, 3664AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3662[if test -n "$NM"; then 3665[if test -n "$NM"; then
3663 # Let the user override the test. 3666 # Let the user override the test.
3664 lt_cv_path_NM=$NM 3667 lt_cv_path_NM=$NM
3665else 3668else
3666 lt_nm_to_check=${ac_tool_prefix}nm 3669 lt_nm_to_check=${ac_tool_prefix}nm
3667 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then 3670 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3668 lt_nm_to_check="$lt_nm_to_check nm" 3671 lt_nm_to_check="$lt_nm_to_check nm"
3669 fi 3672 fi
3670 for lt_tmp_nm in $lt_nm_to_check; do 3673 for lt_tmp_nm in $lt_nm_to_check; do
3671 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR 3674 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3672 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do 3675 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3673 IFS=$lt_save_ifs 3676 IFS=$lt_save_ifs
3674 test -z "$ac_dir" && ac_dir=. 3677 test -z "$ac_dir" && ac_dir=.
3675 tmp_nm=$ac_dir/$lt_tmp_nm 3678 tmp_nm=$ac_dir/$lt_tmp_nm
3676 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then 3679 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
3677 # Check to see if the nm accepts a BSD-compat flag. 3680 # Check to see if the nm accepts a BSD-compat flag.
3678 # Adding the 'sed 1q' prevents false positives on HP-UX, which says: 3681 # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
3679 # nm: unknown option "B" ignored 3682 # nm: unknown option "B" ignored
3680 # Tru64's nm complains that /dev/null is an invalid object file 3683 # Tru64's nm complains that /dev/null is an invalid object file
3681 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty 3684 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
3682 case $build_os in 3685 case $build_os in
3683 mingw*) lt_bad_file=conftest.nm/nofile ;; 3686 mingw*) lt_bad_file=conftest.nm/nofile ;;
3684 *) lt_bad_file=/dev/null ;; 3687 *) lt_bad_file=/dev/null ;;
3685 esac 3688 esac
3686 case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in 3689 case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
3687 *$lt_bad_file* | *'Invalid file or object type'*) 3690 *$lt_bad_file* | *'Invalid file or object type'*)
3688 lt_cv_path_NM="$tmp_nm -B" 3691 lt_cv_path_NM="$tmp_nm -B"
3689 break 2 3692 break 2
3690 ;; 3693 ;;
3691 *) 3694 *)
3692 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in 3695 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3693 */dev/null*) 3696 */dev/null*)
3694 lt_cv_path_NM="$tmp_nm -p" 3697 lt_cv_path_NM="$tmp_nm -p"
3695 break 2 3698 break 2
3696 ;; 3699 ;;
3697 *) 3700 *)
3698 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but 3701 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3699 continue # so that we can try to find one that supports BSD flags 3702 continue # so that we can try to find one that supports BSD flags
3700 ;; 3703 ;;
3701 esac 3704 esac
3702 ;; 3705 ;;
3703 esac 3706 esac
3704 fi 3707 fi
3705 done 3708 done
3706 IFS=$lt_save_ifs 3709 IFS=$lt_save_ifs
3707 done 3710 done
3708 : ${lt_cv_path_NM=no} 3711 : ${lt_cv_path_NM=no}
3709fi]) 3712fi])
3710if test no != "$lt_cv_path_NM"; then 3713if test no != "$lt_cv_path_NM"; then
3711 NM=$lt_cv_path_NM 3714 NM=$lt_cv_path_NM
3712else 3715else
3713 # Didn't find any BSD compatible name lister, look for dumpbin. 3716 # Didn't find any BSD compatible name lister, look for dumpbin.
3714 if test -n "$DUMPBIN"; then : 3717 if test -n "$DUMPBIN"; then :
3715 # Let the user override the test. 3718 # Let the user override the test.
3716 else 3719 else
3717 AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) 3720 AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3718 case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in 3721 case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
3719 *COFF*) 3722 *COFF*)
3720 DUMPBIN="$DUMPBIN -symbols -headers" 3723 DUMPBIN="$DUMPBIN -symbols -headers"
3721 ;; 3724 ;;
3722 *) 3725 *)
3723 DUMPBIN=: 3726 DUMPBIN=:
3724 ;; 3727 ;;
3725 esac 3728 esac
3726 fi 3729 fi
3727 AC_SUBST([DUMPBIN]) 3730 AC_SUBST([DUMPBIN])
3728 if test : != "$DUMPBIN"; then 3731 if test : != "$DUMPBIN"; then
3729 NM=$DUMPBIN 3732 NM=$DUMPBIN
3730 fi 3733 fi
3731fi 3734fi
3732test -z "$NM" && NM=nm 3735test -z "$NM" && NM=nm
3733AC_SUBST([NM]) 3736AC_SUBST([NM])
3734_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl 3737_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3735 3738
3736AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], 3739AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3737 [lt_cv_nm_interface="BSD nm" 3740 [lt_cv_nm_interface="BSD nm"
3738 echo "int some_variable = 0;" > conftest.$ac_ext 3741 echo "int some_variable = 0;" > conftest.$ac_ext
3739 (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) 3742 (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3740 (eval "$ac_compile" 2>conftest.err) 3743 (eval "$ac_compile" 2>conftest.err)
3741 cat conftest.err >&AS_MESSAGE_LOG_FD 3744 cat conftest.err >&AS_MESSAGE_LOG_FD
3742 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) 3745 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3743 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) 3746 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3744 cat conftest.err >&AS_MESSAGE_LOG_FD 3747 cat conftest.err >&AS_MESSAGE_LOG_FD
3745 (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) 3748 (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3746 cat conftest.out >&AS_MESSAGE_LOG_FD 3749 cat conftest.out >&AS_MESSAGE_LOG_FD
3747 if $GREP 'External.*some_variable' conftest.out > /dev/null; then 3750 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3748 lt_cv_nm_interface="MS dumpbin" 3751 lt_cv_nm_interface="MS dumpbin"
3749 fi 3752 fi
3750 rm -f conftest*]) 3753 rm -f conftest*])
3751])# LT_PATH_NM 3754])# LT_PATH_NM
3752 3755
3753# Old names: 3756# Old names:
3754AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) 3757AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3755AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) 3758AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3756dnl aclocal-1.4 backwards compatibility: 3759dnl aclocal-1.4 backwards compatibility:
3757dnl AC_DEFUN([AM_PROG_NM], []) 3760dnl AC_DEFUN([AM_PROG_NM], [])
3758dnl AC_DEFUN([AC_PROG_NM], []) 3761dnl AC_DEFUN([AC_PROG_NM], [])
3759 3762
3760# _LT_CHECK_SHAREDLIB_FROM_LINKLIB 3763# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3761# -------------------------------- 3764# --------------------------------
3762# how to determine the name of the shared library 3765# how to determine the name of the shared library
3763# associated with a specific link library. 3766# associated with a specific link library.
3764# -- PORTME fill in with the dynamic library characteristics 3767# -- PORTME fill in with the dynamic library characteristics
3765m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], 3768m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3766[m4_require([_LT_DECL_EGREP]) 3769[m4_require([_LT_DECL_EGREP])
3767m4_require([_LT_DECL_OBJDUMP]) 3770m4_require([_LT_DECL_OBJDUMP])
3768m4_require([_LT_DECL_DLLTOOL]) 3771m4_require([_LT_DECL_DLLTOOL])
3769AC_CACHE_CHECK([how to associate runtime and link libraries], 3772AC_CACHE_CHECK([how to associate runtime and link libraries],
3770lt_cv_sharedlib_from_linklib_cmd, 3773lt_cv_sharedlib_from_linklib_cmd,
3771[lt_cv_sharedlib_from_linklib_cmd='unknown' 3774[lt_cv_sharedlib_from_linklib_cmd='unknown'
3772 3775
3773case $host_os in 3776case $host_os in
3774cygwin* | mingw* | pw32* | cegcc*) 3777cygwin* | mingw* | pw32* | cegcc*)
3775 # two different shell functions defined in ltmain.sh; 3778 # two different shell functions defined in ltmain.sh;
3776 # decide which one to use based on capabilities of $DLLTOOL 3779 # decide which one to use based on capabilities of $DLLTOOL
3777 case `$DLLTOOL --help 2>&1` in 3780 case `$DLLTOOL --help 2>&1` in
3778 *--identify-strict*) 3781 *--identify-strict*)
3779 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib 3782 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
3780 ;; 3783 ;;
3781 *) 3784 *)
3782 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback 3785 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
3783 ;; 3786 ;;
3784 esac 3787 esac
3785 ;; 3788 ;;
3786*) 3789*)
3787 # fallback: assume linklib IS sharedlib 3790 # fallback: assume linklib IS sharedlib
3788 lt_cv_sharedlib_from_linklib_cmd=$ECHO 3791 lt_cv_sharedlib_from_linklib_cmd=$ECHO
3789 ;; 3792 ;;
3790esac 3793esac
3791]) 3794])
3792sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd 3795sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3793test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO 3796test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3794 3797
3795_LT_DECL([], [sharedlib_from_linklib_cmd], [1], 3798_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3796 [Command to associate shared and link libraries]) 3799 [Command to associate shared and link libraries])
3797])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB 3800])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3798 3801
3799 3802
3800# _LT_PATH_MANIFEST_TOOL 3803# _LT_PATH_MANIFEST_TOOL
3801# ---------------------- 3804# ----------------------
3802# locate the manifest tool 3805# locate the manifest tool
3803m4_defun([_LT_PATH_MANIFEST_TOOL], 3806m4_defun([_LT_PATH_MANIFEST_TOOL],
3804[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) 3807[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3805test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt 3808test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3806AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], 3809AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
3807 [lt_cv_path_mainfest_tool=no 3810 [lt_cv_path_mainfest_tool=no
3808 echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD 3811 echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3809 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out 3812 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3810 cat conftest.err >&AS_MESSAGE_LOG_FD 3813 cat conftest.err >&AS_MESSAGE_LOG_FD
3811 if $GREP 'Manifest Tool' conftest.out > /dev/null; then 3814 if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3812 lt_cv_path_mainfest_tool=yes 3815 lt_cv_path_mainfest_tool=yes
3813 fi 3816 fi
3814 rm -f conftest*]) 3817 rm -f conftest*])
3815if test yes != "$lt_cv_path_mainfest_tool"; then 3818if test yes != "$lt_cv_path_mainfest_tool"; then
3816 MANIFEST_TOOL=: 3819 MANIFEST_TOOL=:
3817fi 3820fi
3818_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl 3821_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3819])# _LT_PATH_MANIFEST_TOOL 3822])# _LT_PATH_MANIFEST_TOOL
3820 3823
3821 3824
3822# _LT_DLL_DEF_P([FILE]) 3825# _LT_DLL_DEF_P([FILE])
3823# --------------------- 3826# ---------------------
3824# True iff FILE is a Windows DLL '.def' file. 3827# True iff FILE is a Windows DLL '.def' file.
3825# Keep in sync with func_dll_def_p in the libtool script 3828# Keep in sync with func_dll_def_p in the libtool script
3826AC_DEFUN([_LT_DLL_DEF_P], 3829AC_DEFUN([_LT_DLL_DEF_P],
3827[dnl 3830[dnl
3828 test DEF = "`$SED -n dnl 3831 test DEF = "`$SED -n dnl
3829 -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace 3832 -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace
3830 -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments 3833 -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments
3831 -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl 3834 -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl
3832 -e q dnl Only consider the first "real" line 3835 -e q dnl Only consider the first "real" line
3833 $1`" dnl 3836 $1`" dnl
3834])# _LT_DLL_DEF_P 3837])# _LT_DLL_DEF_P
3835 3838
3836 3839
3837# LT_LIB_M 3840# LT_LIB_M
3838# -------- 3841# --------
3839# check for math library 3842# check for math library
3840AC_DEFUN([LT_LIB_M], 3843AC_DEFUN([LT_LIB_M],
3841[AC_REQUIRE([AC_CANONICAL_HOST])dnl 3844[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3842LIBM= 3845LIBM=
3843case $host in 3846case $host in
3844*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) 3847*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
3845 # These system don't have libm, or don't need it 3848 # These system don't have libm, or don't need it
3846 ;; 3849 ;;
3847*-ncr-sysv4.3*) 3850*-ncr-sysv4.3*)
3848 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) 3851 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
3849 AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") 3852 AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3850 ;; 3853 ;;
3851*) 3854*)
3852 AC_CHECK_LIB(m, cos, LIBM=-lm) 3855 AC_CHECK_LIB(m, cos, LIBM=-lm)
3853 ;; 3856 ;;
3854esac 3857esac
3855AC_SUBST([LIBM]) 3858AC_SUBST([LIBM])
3856])# LT_LIB_M 3859])# LT_LIB_M
3857 3860
3858# Old name: 3861# Old name:
3859AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) 3862AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3860dnl aclocal-1.4 backwards compatibility: 3863dnl aclocal-1.4 backwards compatibility:
3861dnl AC_DEFUN([AC_CHECK_LIBM], []) 3864dnl AC_DEFUN([AC_CHECK_LIBM], [])
3862 3865
3863 3866
3864# _LT_COMPILER_NO_RTTI([TAGNAME]) 3867# _LT_COMPILER_NO_RTTI([TAGNAME])
3865# ------------------------------- 3868# -------------------------------
3866m4_defun([_LT_COMPILER_NO_RTTI], 3869m4_defun([_LT_COMPILER_NO_RTTI],
3867[m4_require([_LT_TAG_COMPILER])dnl 3870[m4_require([_LT_TAG_COMPILER])dnl
3868 3871
3869_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= 3872_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3870 3873
3871if test yes = "$GCC"; then 3874if test yes = "$GCC"; then
3872 case $cc_basename in 3875 case $cc_basename in
3873 nvcc*) 3876 nvcc*)
3874 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; 3877 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
3875 *) 3878 *)
3876 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; 3879 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
3877 esac 3880 esac

cvs diff -r1.16 -r1.17 xsrc/external/mit/libpciaccess/dist/src/netbsd_pci.c (switch to unified diff)

--- xsrc/external/mit/libpciaccess/dist/src/netbsd_pci.c 2016/09/24 23:14:21 1.16
+++ xsrc/external/mit/libpciaccess/dist/src/netbsd_pci.c 2018/03/11 10:37:32 1.17
@@ -1,1004 +1,1008 @@ @@ -1,1004 +1,1008 @@
1/* 1/*
2 * Copyright (c) 2008 Juan Romero Pardines 2 * Copyright (c) 2008 Juan Romero Pardines
3 * Copyright (c) 2008 Mark Kettenis 3 * Copyright (c) 2008 Mark Kettenis
4 * Copyright (c) 2009 Michael Lorenz 4 * Copyright (c) 2009 Michael Lorenz
5 * 5 *
6 * Permission to use, copy, modify, and distribute this software for any 6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above 7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies. 8 * copyright notice and this permission notice appear in all copies.
9 * 9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */ 17 */
18 18
19#ifdef HAVE_CONFIG_H 19#ifdef HAVE_CONFIG_H
20#include "config.h" 20#include "config.h"
21#endif 21#endif
22 22
23#include <sys/param.h> 23#include <sys/param.h>
24#include <sys/ioctl.h> 24#include <sys/ioctl.h>
25#include <sys/mman.h> 25#include <sys/mman.h>
26#include <sys/types.h> 26#include <sys/types.h>
27 27
28#ifdef HAVE_MTRR 28#ifdef HAVE_MTRR
29#include <machine/sysarch.h> 29#include <machine/sysarch.h>
30#include <machine/mtrr.h> 30#include <machine/mtrr.h>
31#ifdef _X86_SYSARCH_L 31#ifdef _X86_SYSARCH_L
32/* NetBSD 5.x and newer */ 32/* NetBSD 5.x and newer */
33#define netbsd_set_mtrr(mr, num) _X86_SYSARCH_L(set_mtrr)(mr, num) 33#define netbsd_set_mtrr(mr, num) _X86_SYSARCH_L(set_mtrr)(mr, num)
34#else 34#else
35/* NetBSD 4.x and older */ 35/* NetBSD 4.x and older */
36#ifdef __i386__ 36#ifdef __i386__
37#define netbsd_set_mtrr(mr, num) i386_set_mtrr((mr), (num)) 37#define netbsd_set_mtrr(mr, num) i386_set_mtrr((mr), (num))
38#endif 38#endif
39#ifdef __amd64__ 39#ifdef __amd64__
40#define netbsd_set_mtrr(mr, num) x86_64_set_mtrr((mr), (num)) 40#define netbsd_set_mtrr(mr, num) x86_64_set_mtrr((mr), (num))
41#endif 41#endif
42#endif 42#endif
43#endif 43#endif
44 44
45#include <dev/pci/pcidevs.h> 45#include <dev/pci/pcidevs.h>
46#include <dev/pci/pciio.h> 46#include <dev/pci/pciio.h>
47#include <dev/pci/pcireg.h> 47#include <dev/pci/pcireg.h>
48 48
49#include <errno.h> 49#include <errno.h>
50#include <fcntl.h> 50#include <fcntl.h>
51#include <stdio.h> 51#include <stdio.h>
52#include <stdlib.h> 52#include <stdlib.h>
53#include <string.h> 53#include <string.h>
54#include <unistd.h> 54#include <unistd.h>
55 55
56 56
57#include <pci.h> 57#include <pci.h>
58#include <dev/wscons/wsconsio.h> 58#include <dev/wscons/wsconsio.h>
59 59
60#include "pciaccess.h" 60#include "pciaccess.h"
61#include "pciaccess_private.h" 61#include "pciaccess_private.h"
62 62
63typedef struct _pcibus { 63typedef struct _pcibus {
64 int fd; /* /dev/pci* */ 64 int fd; /* /dev/pci* */
65 int num; /* bus number */ 65 int num; /* bus number */
66 int maxdevs; /* maximum number of devices */ 66 int maxdevs; /* maximum number of devices */
67} PciBus; 67} PciBus;
68 68
69static PciBus buses[32]; /* indexed by pci_device.domain */ 69static PciBus buses[32]; /* indexed by pci_device.domain */
70static int nbuses = 0; /* number of buses found */ 70static int nbuses = 0; /* number of buses found */
71 71
72/* 72/*
73 * NetBSD's userland has a /dev/pci* entry for each bus but userland has no way 73 * NetBSD's userland has a /dev/pci* entry for each bus but userland has no way
74 * to tell if a bus is a subordinate of another one or if it's on a different 74 * to tell if a bus is a subordinate of another one or if it's on a different
75 * host bridge. On some architectures ( macppc for example ) all root buses have 75 * host bridge. On some architectures ( macppc for example ) all root buses have
76 * bus number 0 but on sparc64 for example the two roots in an Ultra60 have 76 * bus number 0 but on sparc64 for example the two roots in an Ultra60 have
77 * different bus numbers - one is 0 and the other 128. 77 * different bus numbers - one is 0 and the other 128.
78 * With each /dev/pci* we can map everything on the same root and we can also 78 * With each /dev/pci* we can map everything on the same root and we can also
79 * see all devices on the same root, trying to do that causes problems though: 79 * see all devices on the same root, trying to do that causes problems though:
80 * - since we can't tell which /dev/pci* is a subordinate we would find some 80 * - since we can't tell which /dev/pci* is a subordinate we would find some
81 * devices more than once 81 * devices more than once
82 * - we would have to guess subordinate bus numbers which is a waste of time 82 * - we would have to guess subordinate bus numbers which is a waste of time
83 * since we can ask each /dev/pci* for its bus number so we can scan only the 83 * since we can ask each /dev/pci* for its bus number so we can scan only the
84 * buses we know exist, not all 256 which may exist in each domain. 84 * buses we know exist, not all 256 which may exist in each domain.
85 * - some bus_space_mmap() methods may limit mappings to address ranges which 85 * - some bus_space_mmap() methods may limit mappings to address ranges which
86 * belong to known devices on that bus only. 86 * belong to known devices on that bus only.
87 * Each host bridge may or may not have its own IO range, to avoid guesswork 87 * Each host bridge may or may not have its own IO range, to avoid guesswork
88 * here each /dev/pci* will let userland map its appropriate IO range at 88 * here each /dev/pci* will let userland map its appropriate IO range at
89 * PCI_MAGIC_IO_RANGE if defined in <machine/param.h> 89 * PCI_MAGIC_IO_RANGE if defined in <machine/param.h>
90 * With all this we should be able to use any PCI graphics device on any PCI 90 * With all this we should be able to use any PCI graphics device on any PCI
91 * bus on any architecture as long as Xorg has a driver, without allowing 91 * bus on any architecture as long as Xorg has a driver, without allowing
92 * arbitrary mappings via /dev/mem and without userland having to know or care 92 * arbitrary mappings via /dev/mem and without userland having to know or care
93 * about translating bus addresses to physical addresses or the other way 93 * about translating bus addresses to physical addresses or the other way
94 * around. 94 * around.
95 */ 95 */
96 96
97static int 97static int
98pci_read(int domain, int bus, int dev, int func, uint32_t reg, uint32_t *val) 98pci_read(int domain, int bus, int dev, int func, uint32_t reg, uint32_t *val)
99{ 99{
100 uint32_t rval; 100 uint32_t rval;
101 101
102 if ((domain < 0) || (domain > nbuses)) 102 if ((domain < 0) || (domain > nbuses))
103 return -1; 103 return -1;
104 104
105 if (pcibus_conf_read(buses[domain].fd, (unsigned int)bus, 105 if (pcibus_conf_read(buses[domain].fd, (unsigned int)bus,
106 (unsigned int)dev, (unsigned int)func, reg, &rval) == -1) 106 (unsigned int)dev, (unsigned int)func, reg, &rval) == -1)
107 return (-1); 107 return (-1);
108 108
109 *val = rval; 109 *val = rval;
110 110
111 return 0; 111 return 0;
112} 112}
113 113
114static int 114static int
115pci_write(int domain, int bus, int dev, int func, uint32_t reg, uint32_t val) 115pci_write(int domain, int bus, int dev, int func, uint32_t reg, uint32_t val)
116{ 116{
117 117
118 if ((domain < 0) || (domain > nbuses)) 118 if ((domain < 0) || (domain > nbuses))
119 return -1; 119 return -1;
120 120
121 return pcibus_conf_write(buses[domain].fd, (unsigned int)bus, 121 return pcibus_conf_write(buses[domain].fd, (unsigned int)bus,
122 (unsigned int)dev, (unsigned int)func, reg, val); 122 (unsigned int)dev, (unsigned int)func, reg, val);
123} 123}
124 124
125static int 125static int
126pci_nfuncs(int domain, int bus, int dev) 126pci_nfuncs(int domain, int bus, int dev)
127{ 127{
128 uint32_t hdr; 128 uint32_t hdr;
129 129
130 if ((domain < 0) || (domain > nbuses)) 130 if ((domain < 0) || (domain > nbuses))
131 return -1; 131 return -1;
132 132
133 if (pci_read(domain, bus, dev, 0, PCI_BHLC_REG, &hdr) != 0) 133 if (pci_read(domain, bus, dev, 0, PCI_BHLC_REG, &hdr) != 0)
134 return -1; 134 return -1;
135 135
136 return (PCI_HDRTYPE_MULTIFN(hdr) ? 8 : 1); 136 return (PCI_HDRTYPE_MULTIFN(hdr) ? 8 : 1);
137} 137}
138 138
139/*ARGSUSED*/ 139/*ARGSUSED*/
140static int 140static int
141pci_device_netbsd_map_range(struct pci_device *dev, 141pci_device_netbsd_map_range(struct pci_device *dev,
142 struct pci_device_mapping *map) 142 struct pci_device_mapping *map)
143{ 143{
144#ifdef HAVE_MTRR 144#ifdef HAVE_MTRR
145 struct mtrr m; 145 struct mtrr m;
146 int n = 1; 146 int n = 1;
147#endif 147#endif
148 int prot, ret = 0; 148 int prot, ret = 0;
149 149
150 prot = PROT_READ; 150 prot = PROT_READ;
151 151
152 if (map->flags & PCI_DEV_MAP_FLAG_WRITABLE) 152 if (map->flags & PCI_DEV_MAP_FLAG_WRITABLE)
153 prot |= PROT_WRITE; 153 prot |= PROT_WRITE;
154 map->memory = mmap(NULL, (size_t)map->size, prot, MAP_SHARED, 154 map->memory = mmap(NULL, (size_t)map->size, prot, MAP_SHARED,
155 buses[dev->domain].fd, (off_t)map->base); 155 buses[dev->domain].fd, (off_t)map->base);
156 if (map->memory == MAP_FAILED) 156 if (map->memory == MAP_FAILED)
157 return errno; 157 return errno;
158 158
159#ifdef HAVE_MTRR 159#ifdef HAVE_MTRR
160 memset(&m, 0, sizeof(m)); 160 memset(&m, 0, sizeof(m));
161 161
162 /* No need to set an MTRR if it's the default mode. */ 162 /* No need to set an MTRR if it's the default mode. */
163 if ((map->flags & PCI_DEV_MAP_FLAG_CACHABLE) || 163 if ((map->flags & PCI_DEV_MAP_FLAG_CACHABLE) ||
164 (map->flags & PCI_DEV_MAP_FLAG_WRITE_COMBINE)) { 164 (map->flags & PCI_DEV_MAP_FLAG_WRITE_COMBINE)) {
165 m.base = map->base; 165 m.base = map->base;
166 m.flags = MTRR_VALID | MTRR_PRIVATE; 166 m.flags = MTRR_VALID | MTRR_PRIVATE;
167 m.len = map->size; 167 m.len = map->size;
168 m.owner = getpid(); 168 m.owner = getpid();
169 if (map->flags & PCI_DEV_MAP_FLAG_CACHABLE) 169 if (map->flags & PCI_DEV_MAP_FLAG_CACHABLE)
170 m.type = MTRR_TYPE_WB; 170 m.type = MTRR_TYPE_WB;
171 if (map->flags & PCI_DEV_MAP_FLAG_WRITE_COMBINE) 171 if (map->flags & PCI_DEV_MAP_FLAG_WRITE_COMBINE)
172 m.type = MTRR_TYPE_WC; 172 m.type = MTRR_TYPE_WC;
173 173
174 if ((netbsd_set_mtrr(&m, &n)) == -1) { 174 if ((netbsd_set_mtrr(&m, &n)) == -1) {
175 fprintf(stderr, "mtrr set failed: %s\n", 175 fprintf(stderr, "mtrr set failed: %s\n",
176 strerror(errno)); 176 strerror(errno));
177 } 177 }
178 } 178 }
179#endif 179#endif
180 180
181 return ret; 181 return ret;
182} 182}
183 183
184static int 184static int
185pci_device_netbsd_unmap_range(struct pci_device *dev, 185pci_device_netbsd_unmap_range(struct pci_device *dev,
186 struct pci_device_mapping *map) 186 struct pci_device_mapping *map)
187{ 187{
188#ifdef HAVE_MTRR 188#ifdef HAVE_MTRR
189 struct mtrr m; 189 struct mtrr m;
190 int n = 1; 190 int n = 1;
191 191
192 memset(&m, 0, sizeof(m)); 192 memset(&m, 0, sizeof(m));
193 193
194 if ((map->flags & PCI_DEV_MAP_FLAG_CACHABLE) || 194 if ((map->flags & PCI_DEV_MAP_FLAG_CACHABLE) ||
195 (map->flags & PCI_DEV_MAP_FLAG_WRITE_COMBINE)) { 195 (map->flags & PCI_DEV_MAP_FLAG_WRITE_COMBINE)) {
196 m.base = map->base; 196 m.base = map->base;
197 m.flags = 0; 197 m.flags = 0;
198 m.len = map->size; 198 m.len = map->size;
199 m.type = MTRR_TYPE_UC; 199 m.type = MTRR_TYPE_UC;
200 (void)netbsd_set_mtrr(&m, &n); 200 (void)netbsd_set_mtrr(&m, &n);
201 } 201 }
202#endif 202#endif
203 203
204 return pci_device_generic_unmap_range(dev, map); 204 return pci_device_generic_unmap_range(dev, map);
205} 205}
206 206
207static int 207static int
208pci_device_netbsd_read(struct pci_device *dev, void *data, 208pci_device_netbsd_read(struct pci_device *dev, void *data,
209 pciaddr_t offset, pciaddr_t size, pciaddr_t *bytes_read) 209 pciaddr_t offset, pciaddr_t size, pciaddr_t *bytes_read)
210{ 210{
211 u_int reg, rval; 211 u_int reg, rval;
212 212
213 *bytes_read = 0; 213 *bytes_read = 0;
214 while (size > 0) { 214 while (size > 0) {
215 size_t toread = MIN(size, 4 - (offset & 0x3)); 215 size_t toread = MIN(size, 4 - (offset & 0x3));
216 216
217 reg = (u_int)(offset & ~0x3); 217 reg = (u_int)(offset & ~0x3);
218 218
219 if ((pcibus_conf_read(buses[dev->domain].fd, 219 if ((pcibus_conf_read(buses[dev->domain].fd,
220 (unsigned int)dev->bus, (unsigned int)dev->dev, 220 (unsigned int)dev->bus, (unsigned int)dev->dev,
221 (unsigned int)dev->func, reg, &rval)) == -1) 221 (unsigned int)dev->func, reg, &rval)) == -1)
222 return errno; 222 return errno;
223 223
224 rval = htole32(rval); 224 rval = htole32(rval);
225 rval >>= ((offset & 0x3) * 8); 225 rval >>= ((offset & 0x3) * 8);
226 226
227 memcpy(data, &rval, toread); 227 memcpy(data, &rval, toread);
228 228
229 offset += toread; 229 offset += toread;
230 data = (char *)data + toread; 230 data = (char *)data + toread;
231 size -= toread; 231 size -= toread;
232 *bytes_read += toread; 232 *bytes_read += toread;
233 } 233 }
234 234
235 return 0; 235 return 0;
236} 236}
237 237
238static int 238static int
239pci_device_netbsd_write(struct pci_device *dev, const void *data, 239pci_device_netbsd_write(struct pci_device *dev, const void *data,
240 pciaddr_t offset, pciaddr_t size, pciaddr_t *bytes_written) 240 pciaddr_t offset, pciaddr_t size, pciaddr_t *bytes_written)
241{ 241{
242 u_int reg, val; 242 u_int reg, val;
243 243
244 if ((offset % 4) != 0 || (size % 4) != 0) 244 if ((offset % 4) != 0 || (size % 4) != 0)
245 return EINVAL; 245 return EINVAL;
246 246
247 *bytes_written = 0; 247 *bytes_written = 0;
248 while (size > 0) { 248 while (size > 0) {
249 reg = (u_int)offset; 249 reg = (u_int)offset;
250 memcpy(&val, data, 4); 250 memcpy(&val, data, 4);
251 251
252 if ((pcibus_conf_write(buses[dev->domain].fd, 252 if ((pcibus_conf_write(buses[dev->domain].fd,
253 (unsigned int)dev->bus, (unsigned int)dev->dev, 253 (unsigned int)dev->bus, (unsigned int)dev->dev,
254 (unsigned int)dev->func, reg, val)) == -1) 254 (unsigned int)dev->func, reg, val)) == -1)
255 return errno; 255 return errno;
256 256
257 offset += 4; 257 offset += 4;
258 data = (const char *)data + 4; 258 data = (const char *)data + 4;
259 size -= 4; 259 size -= 4;
260 *bytes_written += 4; 260 *bytes_written += 4;
261 } 261 }
262 262
263 return 0; 263 return 0;
264} 264}
265 265
266#if defined(WSDISPLAYIO_GET_BUSID) 266#if defined(WSDISPLAYIO_GET_BUSID)
267static int 267static int
268pci_device_netbsd_boot_vga(struct pci_device *dev) 268pci_device_netbsd_boot_vga(struct pci_device *dev)
269{ 269{
270 int ret; 270 int ret;
271 struct wsdisplayio_bus_id busid; 271 struct wsdisplayio_bus_id busid;
272 int fd; 272 int fd;
273 273
274 fd = open("/dev/ttyE0", O_RDONLY); 274 fd = open("/dev/ttyE0", O_RDONLY);
275 if (fd == -1) { 275 if (fd == -1) {
276 fprintf(stderr, "failed to open /dev/ttyE0: %s\n", 276 fprintf(stderr, "failed to open /dev/ttyE0: %s\n",
277 strerror(errno)); 277 strerror(errno));
278 return 0; 278 return 0;
279 } 279 }
280 280
281 ret = ioctl(fd, WSDISPLAYIO_GET_BUSID, &busid); 281 ret = ioctl(fd, WSDISPLAYIO_GET_BUSID, &busid);
282 close(fd); 282 close(fd);
283 if (ret == -1) { 283 if (ret == -1) {
284 fprintf(stderr, "ioctl WSDISPLAYIO_GET_BUSID failed: %s\n", 284 fprintf(stderr, "ioctl WSDISPLAYIO_GET_BUSID failed: %s\n",
285 strerror(errno)); 285 strerror(errno));
286 return 0; 286 return 0;
287 } 287 }
288 288
289 if (busid.bus_type != WSDISPLAYIO_BUS_PCI) 289 if (busid.bus_type != WSDISPLAYIO_BUS_PCI)
290 return 0; 290 return 0;
291 291
292 if (busid.ubus.pci.domain != dev->domain) 292 if (busid.ubus.pci.domain != dev->domain)
293 return 0; 293 return 0;
294 if (busid.ubus.pci.bus != dev->bus) 294 if (busid.ubus.pci.bus != dev->bus)
295 return 0; 295 return 0;
296 if (busid.ubus.pci.device != dev->dev) 296 if (busid.ubus.pci.device != dev->dev)
297 return 0; 297 return 0;
298 if (busid.ubus.pci.function != dev->func) 298 if (busid.ubus.pci.function != dev->func)
299 return 0; 299 return 0;
300 300
301 return 1; 301 return 1;
302} 302}
303#endif 303#endif
304 304
305static void 305static void
306pci_system_netbsd_destroy(void) 306pci_system_netbsd_destroy(void)
307{ 307{
308 int i; 308 int i;
309 309
310 for (i = 0; i < nbuses; i++) { 310 for (i = 0; i < nbuses; i++) {
311 close(buses[i].fd); 311 close(buses[i].fd);
312 } 312 }
313 free(pci_sys); 313 free(pci_sys);
314 pci_sys = NULL; 314 pci_sys = NULL;
315} 315}
316 316
317static int 317static int
318pci_device_netbsd_probe(struct pci_device *device) 318pci_device_netbsd_probe(struct pci_device *device)
319{ 319{
320 struct pci_device_private *priv = 320 struct pci_device_private *priv =
321 (struct pci_device_private *)(void *)device; 321 (struct pci_device_private *)(void *)device;
322 struct pci_mem_region *region; 322 struct pci_mem_region *region;
323 uint64_t reg64, size64; 323 uint64_t reg64, size64;
324 uint32_t bar, reg, size; 324 uint32_t bar, reg, size;
325 int bus, dev, func, err, domain; 325 int bus, dev, func, err, domain;
326 326
327 domain = device->domain; 327 domain = device->domain;
328 bus = device->bus; 328 bus = device->bus;
329 dev = device->dev; 329 dev = device->dev;
330 func = device->func; 330 func = device->func;
331 331
332 /* Enable the device if necessary */ 332 /* Enable the device if necessary */
333 err = pci_read(domain, bus, dev, func, PCI_COMMAND_STATUS_REG, &reg); 333 err = pci_read(domain, bus, dev, func, PCI_COMMAND_STATUS_REG, &reg);
334 if (err) 334 if (err)
335 return err; 335 return err;
336 if ((reg & (PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE | PCI_COMMAND_MASTER_ENABLE)) != 336 if ((reg & (PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE | PCI_COMMAND_MASTER_ENABLE)) !=
337 (PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE | PCI_COMMAND_MASTER_ENABLE)) { 337 (PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE | PCI_COMMAND_MASTER_ENABLE)) {
338 reg |= PCI_COMMAND_IO_ENABLE | 338 reg |= PCI_COMMAND_IO_ENABLE |
339 PCI_COMMAND_MEM_ENABLE | 339 PCI_COMMAND_MEM_ENABLE |
340 PCI_COMMAND_MASTER_ENABLE; 340 PCI_COMMAND_MASTER_ENABLE;
341 err = pci_write(domain, bus, dev, func, PCI_COMMAND_STATUS_REG, 341 err = pci_write(domain, bus, dev, func, PCI_COMMAND_STATUS_REG,
342 reg); 342 reg);
343 if (err) 343 if (err)
344 return err; 344 return err;
345 } 345 }
346 346
347 err = pci_read(domain, bus, dev, func, PCI_BHLC_REG, &reg); 347 err = pci_read(domain, bus, dev, func, PCI_BHLC_REG, &reg);
348 if (err) 348 if (err)
349 return err; 349 return err;
350 350
351 priv->header_type = PCI_HDRTYPE_TYPE(reg); 351 priv->header_type = PCI_HDRTYPE_TYPE(reg);
352 if (priv->header_type != 0) 352 if (priv->header_type != 0)
353 return 0; 353 return 0;
354 354
355 region = device->regions; 355 region = device->regions;
356 for (bar = PCI_MAPREG_START; bar < PCI_MAPREG_END; 356 for (bar = PCI_MAPREG_START; bar < PCI_MAPREG_END;
357 bar += sizeof(uint32_t), region++) { 357 bar += sizeof(uint32_t), region++) {
358 err = pci_read(domain, bus, dev, func, bar, &reg); 358 err = pci_read(domain, bus, dev, func, bar, &reg);
359 if (err) 359 if (err)
360 return err; 360 return err;
361 361
362 /* Probe the size of the region. */ 362 /* Probe the size of the region. */
363 err = pci_write(domain, bus, dev, func, bar, (unsigned int)~0); 363 err = pci_write(domain, bus, dev, func, bar, (unsigned int)~0);
364 if (err) 364 if (err)
365 return err; 365 return err;
366 pci_read(domain, bus, dev, func, bar, &size); 366 pci_read(domain, bus, dev, func, bar, &size);
367 pci_write(domain, bus, dev, func, bar, reg); 367 pci_write(domain, bus, dev, func, bar, reg);
368 368
369 if (PCI_MAPREG_TYPE(reg) == PCI_MAPREG_TYPE_IO) { 369 if (PCI_MAPREG_TYPE(reg) == PCI_MAPREG_TYPE_IO) {
370 region->is_IO = 1; 370 region->is_IO = 1;
371 region->base_addr = PCI_MAPREG_IO_ADDR(reg); 371 region->base_addr = PCI_MAPREG_IO_ADDR(reg);
372 region->size = PCI_MAPREG_IO_SIZE(size); 372 region->size = PCI_MAPREG_IO_SIZE(size);
373 } else { 373 } else {
374 if (PCI_MAPREG_MEM_PREFETCHABLE(reg)) 374 if (PCI_MAPREG_MEM_PREFETCHABLE(reg))
375 region->is_prefetchable = 1; 375 region->is_prefetchable = 1;
376 switch(PCI_MAPREG_MEM_TYPE(reg)) { 376 switch(PCI_MAPREG_MEM_TYPE(reg)) {
377 case PCI_MAPREG_MEM_TYPE_32BIT: 377 case PCI_MAPREG_MEM_TYPE_32BIT:
378 case PCI_MAPREG_MEM_TYPE_32BIT_1M: 378 case PCI_MAPREG_MEM_TYPE_32BIT_1M:
379 region->base_addr = PCI_MAPREG_MEM_ADDR(reg); 379 region->base_addr = PCI_MAPREG_MEM_ADDR(reg);
380 region->size = PCI_MAPREG_MEM_SIZE(size); 380 region->size = PCI_MAPREG_MEM_SIZE(size);
381 break; 381 break;
382 case PCI_MAPREG_MEM_TYPE_64BIT: 382 case PCI_MAPREG_MEM_TYPE_64BIT:
383 region->is_64 = 1; 383 region->is_64 = 1;
384 384
385 reg64 = reg; 385 reg64 = reg;
386 size64 = size; 386 size64 = size;
387 387
388 bar += sizeof(uint32_t); 388 bar += sizeof(uint32_t);
389 389
390 err = pci_read(domain, bus, dev, func, bar, &reg); 390 err = pci_read(domain, bus, dev, func, bar, &reg);
391 if (err) 391 if (err)
392 return err; 392 return err;
393 reg64 |= (uint64_t)reg << 32; 393 reg64 |= (uint64_t)reg << 32;
394 394
395 err = pci_write(domain, bus, dev, func, bar, 395 err = pci_write(domain, bus, dev, func, bar,
396 (unsigned int)~0); 396 (unsigned int)~0);
397 if (err) 397 if (err)
398 return err; 398 return err;
399 pci_read(domain, bus, dev, func, bar, &size); 399 pci_read(domain, bus, dev, func, bar, &size);
400 pci_write(domain, bus, dev, func, bar, 400 pci_write(domain, bus, dev, func, bar,
401 (unsigned int)(reg64 >> 32)); 401 (unsigned int)(reg64 >> 32));
402 size64 |= (uint64_t)size << 32; 402 size64 |= (uint64_t)size << 32;
403 403
404 region->base_addr = 404 region->base_addr =
405 (unsigned long)PCI_MAPREG_MEM64_ADDR(reg64); 405 (unsigned long)PCI_MAPREG_MEM64_ADDR(reg64);
406 region->size = 406 region->size =
407 (unsigned long)PCI_MAPREG_MEM64_SIZE(size64); 407 (unsigned long)PCI_MAPREG_MEM64_SIZE(size64);
408 region++; 408 region++;
409 break; 409 break;
410 } 410 }
411 } 411 }
412 } 412 }
413 413
414 /* Probe expansion ROM if present */ 414 /* Probe expansion ROM if present */
415 err = pci_read(domain, bus, dev, func, PCI_MAPREG_ROM, &reg); 415 err = pci_read(domain, bus, dev, func, PCI_MAPREG_ROM, &reg);
416 if (err) 416 if (err)
417 return err; 417 return err;
418 if (reg != 0) { 418 if (reg != 0) {
419 err = pci_write(domain, bus, dev, func, PCI_MAPREG_ROM, 419 err = pci_write(domain, bus, dev, func, PCI_MAPREG_ROM,
420 (uint32_t)(~PCI_MAPREG_ROM_ENABLE)); 420 (uint32_t)(~PCI_MAPREG_ROM_ENABLE));
421 if (err) 421 if (err)
422 return err; 422 return err;
423 pci_read(domain, bus, dev, func, PCI_MAPREG_ROM, &size); 423 pci_read(domain, bus, dev, func, PCI_MAPREG_ROM, &size);
424 pci_write(domain, bus, dev, func, PCI_MAPREG_ROM, reg); 424 pci_write(domain, bus, dev, func, PCI_MAPREG_ROM, reg);
425 if ((reg & PCI_MAPREG_MEM_ADDR_MASK) != 0) { 425 if ((reg & PCI_MAPREG_MEM_ADDR_MASK) != 0) {
426 priv->rom_base = reg & PCI_MAPREG_MEM_ADDR_MASK; 426 priv->rom_base = reg & PCI_MAPREG_MEM_ADDR_MASK;
427 device->rom_size = -(size & PCI_MAPREG_MEM_ADDR_MASK); 427 device->rom_size = -(size & PCI_MAPREG_MEM_ADDR_MASK);
428 } 428 }
429 } 429 }
430 430
431 return 0; 431 return 0;
432} 432}
433 433
434/** 434/**
435 * Read a VGA rom using the 0xc0000 mapping. 435 * Read a VGA rom using the 0xc0000 mapping.
436 * 436 *
437 * This function should be extended to handle access through PCI resources, 437 * This function should be extended to handle access through PCI resources,
438 * which should be more reliable when available. 438 * which should be more reliable when available.
439 */ 439 */
440static int 440static int
441pci_device_netbsd_read_rom(struct pci_device *dev, void *buffer) 441pci_device_netbsd_read_rom(struct pci_device *dev, void *buffer)
442{ 442{
443 struct pci_device_private *priv = (struct pci_device_private *)(void *)dev; 443 struct pci_device_private *priv = (struct pci_device_private *)(void *)dev;
444 void *bios; 444 void *bios;
445 pciaddr_t rom_base; 445 pciaddr_t rom_base;
446 size_t rom_size; 446 size_t rom_size;
447 uint32_t bios_val, command_val; 447 uint32_t bios_val, command_val;
448 int pci_rom; 448 int pci_rom;
449 449
450 if (((priv->base.device_class >> 16) & 0xff) != PCI_CLASS_DISPLAY || 450 if (((priv->base.device_class >> 16) & 0xff) != PCI_CLASS_DISPLAY ||
451 ((priv->base.device_class >> 8) & 0xff) != PCI_SUBCLASS_DISPLAY_VGA) 451 ((priv->base.device_class >> 8) & 0xff) != PCI_SUBCLASS_DISPLAY_VGA)
452 return ENOSYS; 452 return ENOSYS;
453 453
454 if (priv->rom_base == 0) { 454 if (priv->rom_base == 0) {
455#if defined(__amd64__) || defined(__i386__) 455#if defined(__amd64__) || defined(__i386__)
456 /* 456 /*
457 * We need a way to detect when this isn't the console and reject 457 * We need a way to detect when this isn't the console and reject
458 * this request outright. 458 * this request outright.
459 */ 459 */
460 rom_base = 0xc0000; 460 rom_base = 0xc0000;
461 rom_size = 0x10000; 461 rom_size = 0x10000;
462 pci_rom = 0; 462 pci_rom = 0;
463#else 463#else
464 return ENOSYS; 464 return ENOSYS;
465#endif 465#endif
466 } else { 466 } else {
467 rom_base = priv->rom_base; 467 rom_base = priv->rom_base;
468 rom_size = dev->rom_size; 468 rom_size = dev->rom_size;
469 pci_rom = 1; 469 pci_rom = 1;
470 if ((pcibus_conf_read(buses[dev->domain].fd, (unsigned int)dev->bus, 470 if ((pcibus_conf_read(buses[dev->domain].fd, (unsigned int)dev->bus,
471 (unsigned int)dev->dev, (unsigned int)dev->func, 471 (unsigned int)dev->dev, (unsigned int)dev->func,
472 PCI_COMMAND_STATUS_REG, &command_val)) == -1) 472 PCI_COMMAND_STATUS_REG, &command_val)) == -1)
473 return errno; 473 return errno;
474 if ((command_val & PCI_COMMAND_MEM_ENABLE) == 0) { 474 if ((command_val & PCI_COMMAND_MEM_ENABLE) == 0) {
475 if ((pcibus_conf_write(buses[dev->domain].fd, 475 if ((pcibus_conf_write(buses[dev->domain].fd,
476 (unsigned int)dev->bus, (unsigned int)dev->dev, 476 (unsigned int)dev->bus, (unsigned int)dev->dev,
477 (unsigned int)dev->func, PCI_COMMAND_STATUS_REG, 477 (unsigned int)dev->func, PCI_COMMAND_STATUS_REG,
478 command_val | PCI_COMMAND_MEM_ENABLE)) == -1) 478 command_val | PCI_COMMAND_MEM_ENABLE)) == -1)
479 return errno; 479 return errno;
480 } 480 }
481 if ((pcibus_conf_read(buses[dev->domain].fd, (unsigned int)dev->bus, 481 if ((pcibus_conf_read(buses[dev->domain].fd, (unsigned int)dev->bus,
482 (unsigned int)dev->dev, (unsigned int)dev->func, 482 (unsigned int)dev->dev, (unsigned int)dev->func,
483 PCI_MAPREG_ROM, &bios_val)) == -1) 483 PCI_MAPREG_ROM, &bios_val)) == -1)
484 return errno; 484 return errno;
485 if ((bios_val & PCI_MAPREG_ROM_ENABLE) == 0) { 485 if ((bios_val & PCI_MAPREG_ROM_ENABLE) == 0) {
486 if ((pcibus_conf_write(buses[dev->domain].fd, 486 if ((pcibus_conf_write(buses[dev->domain].fd,
487 (unsigned int)dev->bus, 487 (unsigned int)dev->bus,
488 (unsigned int)dev->dev, (unsigned int)dev->func, 488 (unsigned int)dev->dev, (unsigned int)dev->func,
489 PCI_MAPREG_ROM, bios_val | PCI_MAPREG_ROM_ENABLE)) == -1) 489 PCI_MAPREG_ROM, bios_val | PCI_MAPREG_ROM_ENABLE)) == -1)
490 return errno; 490 return errno;
491 } 491 }
492 } 492 }
493 493
494 fprintf(stderr, "Using rom_base = 0x%lx 0x%lx (pci_rom=%d)\n", 494 fprintf(stderr, "Using rom_base = 0x%lx 0x%lx (pci_rom=%d)\n",
495 (long)rom_base, (long)rom_size, pci_rom); 495 (long)rom_base, (long)rom_size, pci_rom);
496 496
497 bios = mmap(NULL, rom_size, PROT_READ, MAP_SHARED, buses[dev->domain].fd, 497 bios = mmap(NULL, rom_size, PROT_READ, MAP_SHARED, buses[dev->domain].fd,
498 (off_t)rom_base); 498 (off_t)rom_base);
499 if (bios == MAP_FAILED) { 499 if (bios == MAP_FAILED) {
500 int serrno = errno; 500 int serrno = errno;
501 return serrno; 501 return serrno;
502 } 502 }
503 503
504 memcpy(buffer, bios, rom_size); 504 memcpy(buffer, bios, rom_size);
505 505
506 munmap(bios, rom_size); 506 munmap(bios, rom_size);
507 507
508 if (pci_rom) { 508 if (pci_rom) {
509 if ((command_val & PCI_COMMAND_MEM_ENABLE) == 0) { 509 if ((command_val & PCI_COMMAND_MEM_ENABLE) == 0) {
510 if ((pcibus_conf_write(buses[dev->domain].fd, 510 if ((pcibus_conf_write(buses[dev->domain].fd,
511 (unsigned int)dev->bus, 511 (unsigned int)dev->bus,
512 (unsigned int)dev->dev, (unsigned int)dev->func, 512 (unsigned int)dev->dev, (unsigned int)dev->func,
513 PCI_COMMAND_STATUS_REG, command_val)) == -1) 513 PCI_COMMAND_STATUS_REG, command_val)) == -1)
514 return errno; 514 return errno;
515 } 515 }
516 if ((bios_val & PCI_MAPREG_ROM_ENABLE) == 0) { 516 if ((bios_val & PCI_MAPREG_ROM_ENABLE) == 0) {
517 if ((pcibus_conf_write(buses[dev->domain].fd, 517 if ((pcibus_conf_write(buses[dev->domain].fd,
518 (unsigned int)dev->bus, 518 (unsigned int)dev->bus,
519 (unsigned int)dev->dev, (unsigned int)dev->func, 519 (unsigned int)dev->dev, (unsigned int)dev->func,
520 PCI_MAPREG_ROM, bios_val)) == -1) 520 PCI_MAPREG_ROM, bios_val)) == -1)
521 return errno; 521 return errno;
522 } 522 }
523 } 523 }
524 524
525 return 0; 525 return 0;
526} 526}
527 527
528#if defined(__i386__) || defined(__amd64__) 528#if defined(__i386__) || defined(__amd64__)
529#include <machine/sysarch.h> 529#include <machine/sysarch.h>
530 530
531/* 531/*
532 * Functions to provide access to x86 programmed I/O instructions. 532 * Functions to provide access to x86 programmed I/O instructions.
533 * 533 *
534 * The in[bwl]() and out[bwl]() functions are split into two varieties: one to 534 * The in[bwl]() and out[bwl]() functions are split into two varieties: one to
535 * use a small, constant, 8-bit port number, and another to use a large or 535 * use a small, constant, 8-bit port number, and another to use a large or
536 * variable port number. The former can be compiled as a smaller instruction. 536 * variable port number. The former can be compiled as a smaller instruction.
537 */ 537 */
538 538
539 539
540#ifdef __OPTIMIZE__ 540#ifdef __OPTIMIZE__
541 541
542#define __use_immediate_port(port) \ 542#define __use_immediate_port(port) \
543 (__builtin_constant_p((port)) && (port) < 0x100) 543 (__builtin_constant_p((port)) && (port) < 0x100)
544 544
545#else 545#else
546 546
547#define __use_immediate_port(port) 0 547#define __use_immediate_port(port) 0
548 548
549#endif 549#endif
550 550
551 551
552#define inb(port) \ 552#define inb(port) \
553 (/* CONSTCOND */ __use_immediate_port(port) ? __inbc(port) : __inb(port)) 553 (/* CONSTCOND */ __use_immediate_port(port) ? __inbc(port) : __inb(port))
554 554
555static __inline u_int8_t 555static __inline u_int8_t
556__inbc(unsigned port) 556__inbc(unsigned port)
557{ 557{
558 u_int8_t data; 558 u_int8_t data;
559 __asm __volatile("inb %w1,%0" : "=a" (data) : "id" (port)); 559 __asm __volatile("inb %w1,%0" : "=a" (data) : "id" (port));
560 return data; 560 return data;
561} 561}
562 562
563static __inline u_int8_t 563static __inline u_int8_t
564__inb(unsigned port) 564__inb(unsigned port)
565{ 565{
566 u_int8_t data; 566 u_int8_t data;
567 __asm __volatile("inb %w1,%0" : "=a" (data) : "d" (port)); 567 __asm __volatile("inb %w1,%0" : "=a" (data) : "d" (port));
568 return data; 568 return data;
569} 569}
570 570
571static __inline void 571static __inline void
572insb(unsigned port, void *addr, int cnt) 572insb(unsigned port, void *addr, int cnt)
573{ 573{
574 void *dummy1; 574 void *dummy1;
575 int dummy2; 575 int dummy2;
576 __asm __volatile("cld\n\trepne\n\tinsb" : 576 __asm __volatile("cld\n\trepne\n\tinsb" :
577 "=D" (dummy1), "=c" (dummy2) : 577 "=D" (dummy1), "=c" (dummy2) :
578 "d" (port), "0" (addr), "1" (cnt) : 578 "d" (port), "0" (addr), "1" (cnt) :
579 "memory"); 579 "memory");
580} 580}
581 581
582#define inw(port) \ 582#define inw(port) \
583 (/* CONSTCOND */ __use_immediate_port(port) ? __inwc(port) : __inw(port)) 583 (/* CONSTCOND */ __use_immediate_port(port) ? __inwc(port) : __inw(port))
584 584
585static __inline u_int16_t 585static __inline u_int16_t
586__inwc(unsigned port) 586__inwc(unsigned port)
587{ 587{
588 u_int16_t data; 588 u_int16_t data;
589 __asm __volatile("inw %w1,%0" : "=a" (data) : "id" (port)); 589 __asm __volatile("inw %w1,%0" : "=a" (data) : "id" (port));
590 return data; 590 return data;
591} 591}
592 592
593static __inline u_int16_t 593static __inline u_int16_t
594__inw(unsigned port) 594__inw(unsigned port)
595{ 595{
596 u_int16_t data; 596 u_int16_t data;
597 __asm __volatile("inw %w1,%0" : "=a" (data) : "d" (port)); 597 __asm __volatile("inw %w1,%0" : "=a" (data) : "d" (port));
598 return data; 598 return data;
599} 599}
600 600
601static __inline void 601static __inline void
602insw(unsigned port, void *addr, int cnt) 602insw(unsigned port, void *addr, int cnt)
603{ 603{
604 void *dummy1; 604 void *dummy1;
605 int dummy2; 605 int dummy2;
606 __asm __volatile("cld\n\trepne\n\tinsw" : 606 __asm __volatile("cld\n\trepne\n\tinsw" :
607 "=D" (dummy1), "=c" (dummy2) : 607 "=D" (dummy1), "=c" (dummy2) :
608 "d" (port), "0" (addr), "1" (cnt) : 608 "d" (port), "0" (addr), "1" (cnt) :
609 "memory"); 609 "memory");
610} 610}
611 611
612#define inl(port) \ 612#define inl(port) \
613 (/* CONSTCOND */ __use_immediate_port(port) ? __inlc(port) : __inl(port)) 613 (/* CONSTCOND */ __use_immediate_port(port) ? __inlc(port) : __inl(port))
614 614
615static __inline u_int32_t 615static __inline u_int32_t
616__inlc(unsigned port) 616__inlc(unsigned port)
617{ 617{
618 u_int32_t data; 618 u_int32_t data;
619 __asm __volatile("inl %w1,%0" : "=a" (data) : "id" (port)); 619 __asm __volatile("inl %w1,%0" : "=a" (data) : "id" (port));
620 return data; 620 return data;
621} 621}
622 622
623static __inline u_int32_t 623static __inline u_int32_t
624__inl(unsigned port) 624__inl(unsigned port)
625{ 625{
626 u_int32_t data; 626 u_int32_t data;
627 __asm __volatile("inl %w1,%0" : "=a" (data) : "d" (port)); 627 __asm __volatile("inl %w1,%0" : "=a" (data) : "d" (port));
628 return data; 628 return data;
629} 629}
630 630
631static __inline void 631static __inline void
632insl(unsigned port, void *addr, int cnt) 632insl(unsigned port, void *addr, int cnt)
633{ 633{
634 void *dummy1; 634 void *dummy1;
635 int dummy2; 635 int dummy2;
636 __asm __volatile("cld\n\trepne\n\tinsl" : 636 __asm __volatile("cld\n\trepne\n\tinsl" :
637 "=D" (dummy1), "=c" (dummy2) : 637 "=D" (dummy1), "=c" (dummy2) :
638 "d" (port), "0" (addr), "1" (cnt) : 638 "d" (port), "0" (addr), "1" (cnt) :
639 "memory"); 639 "memory");
640} 640}
641 641
642#define outb(port, data) \ 642#define outb(port, data) \
643 (/* CONSTCOND */__use_immediate_port(port) ? __outbc(port, data) : \ 643 (/* CONSTCOND */__use_immediate_port(port) ? __outbc(port, data) : \
644 __outb(port, data)) 644 __outb(port, data))
645 645
646static __inline void 646static __inline void
647__outbc(unsigned port, u_int8_t data) 647__outbc(unsigned port, u_int8_t data)
648{ 648{
649 __asm __volatile("outb %0,%w1" : : "a" (data), "id" (port)); 649 __asm __volatile("outb %0,%w1" : : "a" (data), "id" (port));
650} 650}
651 651
652static __inline void 652static __inline void
653__outb(unsigned port, u_int8_t data) 653__outb(unsigned port, u_int8_t data)
654{ 654{
655 __asm __volatile("outb %0,%w1" : : "a" (data), "d" (port)); 655 __asm __volatile("outb %0,%w1" : : "a" (data), "d" (port));
656} 656}
657 657
658static __inline void 658static __inline void
659outsb(unsigned port, const void *addr, int cnt) 659outsb(unsigned port, const void *addr, int cnt)
660{ 660{
661 void *dummy1; 661 void *dummy1;
662 int dummy2; 662 int dummy2;
663 __asm __volatile("cld\n\trepne\n\toutsb" : 663 __asm __volatile("cld\n\trepne\n\toutsb" :
664 "=S" (dummy1), "=c" (dummy2) : 664 "=S" (dummy1), "=c" (dummy2) :
665 "d" (port), "0" (addr), "1" (cnt)); 665 "d" (port), "0" (addr), "1" (cnt));
666} 666}
667 667
668#define outw(port, data) \ 668#define outw(port, data) \
669 (/* CONSTCOND */ __use_immediate_port(port) ? __outwc(port, data) : \ 669 (/* CONSTCOND */ __use_immediate_port(port) ? __outwc(port, data) : \
670 __outw(port, data)) 670 __outw(port, data))
671 671
672static __inline void 672static __inline void
673__outwc(unsigned port, u_int16_t data) 673__outwc(unsigned port, u_int16_t data)
674{ 674{
675 __asm __volatile("outw %0,%w1" : : "a" (data), "id" (port)); 675 __asm __volatile("outw %0,%w1" : : "a" (data), "id" (port));
676} 676}
677 677
678static __inline void 678static __inline void
679__outw(unsigned port, u_int16_t data) 679__outw(unsigned port, u_int16_t data)
680{ 680{
681 __asm __volatile("outw %0,%w1" : : "a" (data), "d" (port)); 681 __asm __volatile("outw %0,%w1" : : "a" (data), "d" (port));
682} 682}
683 683
684static __inline void 684static __inline void
685outsw(unsigned port, const void *addr, int cnt) 685outsw(unsigned port, const void *addr, int cnt)
686{ 686{
687 void *dummy1; 687 void *dummy1;
688 int dummy2; 688 int dummy2;
689 __asm __volatile("cld\n\trepne\n\toutsw" : 689 __asm __volatile("cld\n\trepne\n\toutsw" :
690 "=S" (dummy1), "=c" (dummy2) : 690 "=S" (dummy1), "=c" (dummy2) :
691 "d" (port), "0" (addr), "1" (cnt)); 691 "d" (port), "0" (addr), "1" (cnt));
692} 692}
693 693
694#define outl(port, data) \ 694#define outl(port, data) \
695 (/* CONSTCOND */ __use_immediate_port(port) ? __outlc(port, data) : \ 695 (/* CONSTCOND */ __use_immediate_port(port) ? __outlc(port, data) : \
696 __outl(port, data)) 696 __outl(port, data))
697 697
698static __inline void 698static __inline void
699__outlc(unsigned port, u_int32_t data) 699__outlc(unsigned port, u_int32_t data)
700{ 700{
701 __asm __volatile("outl %0,%w1" : : "a" (data), "id" (port)); 701 __asm __volatile("outl %0,%w1" : : "a" (data), "id" (port));
702} 702}
703 703
704static __inline void 704static __inline void
705__outl(unsigned port, u_int32_t data) 705__outl(unsigned port, u_int32_t data)
706{ 706{
707 __asm __volatile("outl %0,%w1" : : "a" (data), "d" (port)); 707 __asm __volatile("outl %0,%w1" : : "a" (data), "d" (port));
708} 708}
709 709
710static __inline void 710static __inline void
711outsl(unsigned port, const void *addr, int cnt) 711outsl(unsigned port, const void *addr, int cnt)
712{ 712{
713 void *dummy1; 713 void *dummy1;
714 int dummy2; 714 int dummy2;
715 __asm __volatile("cld\n\trepne\n\toutsl" : 715 __asm __volatile("cld\n\trepne\n\toutsl" :
716 "=S" (dummy1), "=c" (dummy2) : 716 "=S" (dummy1), "=c" (dummy2) :
717 "d" (port), "0" (addr), "1" (cnt)); 717 "d" (port), "0" (addr), "1" (cnt));
718} 718}
719 719
720#endif 720#endif
721 721
722 722
723static struct pci_io_handle * 723static struct pci_io_handle *
724pci_device_netbsd_open_legacy_io(struct pci_io_handle *ret, 724pci_device_netbsd_open_legacy_io(struct pci_io_handle *ret,
725 struct pci_device *dev, pciaddr_t base, pciaddr_t size) 725 struct pci_device *dev, pciaddr_t base, pciaddr_t size)
726{ 726{
727#if defined(__i386__) 727#if defined(__i386__)
728 struct i386_iopl_args ia; 728 struct i386_iopl_args ia;
729 729
730 ia.iopl = 1; 730 ia.iopl = 1;
731 if (sysarch(I386_IOPL, &ia)) 731 if (sysarch(I386_IOPL, &ia))
732 return NULL; 732 return NULL;
733 733
734 ret->base = base; 734 ret->base = base;
735 ret->size = size; 735 ret->size = size;
736 ret->is_legacy = 1; 736 ret->is_legacy = 1;
737 return ret; 737 return ret;
738#elif defined(__amd64__) 738#elif defined(__amd64__)
739 struct x86_64_iopl_args ia; 739 struct x86_64_iopl_args ia;
740 740
741 ia.iopl = 1; 741 ia.iopl = 1;
742 if (sysarch(X86_64_IOPL, &ia)) 742 if (sysarch(X86_64_IOPL, &ia))
743 return NULL; 743 return NULL;
744 744
745 ret->base = base; 745 ret->base = base;
746 ret->size = size; 746 ret->size = size;
747 ret->is_legacy = 1; 747 ret->is_legacy = 1;
748 return ret; 748 return ret;
749#else 749#else
750 return NULL; 750 return NULL;
751#endif 751#endif
752} 752}
753 753
754static uint32_t 754static uint32_t
755pci_device_netbsd_read32(struct pci_io_handle *handle, uint32_t reg) 755pci_device_netbsd_read32(struct pci_io_handle *handle, uint32_t reg)
756{ 756{
757#if defined(__i386__) || defined(__amd64__) 757#if defined(__i386__) || defined(__amd64__)
758 return inl(handle->base + reg); 758 return inl(handle->base + reg);
759#else 759#else
760 return *(uint32_t *)((uintptr_t)handle->memory + reg); 760 return *(uint32_t *)((uintptr_t)handle->memory + reg);
761#endif 761#endif
762} 762}
763 763
764static uint16_t 764static uint16_t
765pci_device_netbsd_read16(struct pci_io_handle *handle, uint32_t reg) 765pci_device_netbsd_read16(struct pci_io_handle *handle, uint32_t reg)
766{ 766{
767#if defined(__i386__) || defined(__amd64__) 767#if defined(__i386__) || defined(__amd64__)
768 return inw(handle->base + reg); 768 return inw(handle->base + reg);
769#else 769#else
770 return *(uint16_t *)((uintptr_t)handle->memory + reg); 770 return *(uint16_t *)((uintptr_t)handle->memory + reg);
771#endif 771#endif
772} 772}
773 773
774static uint8_t 774static uint8_t
775pci_device_netbsd_read8(struct pci_io_handle *handle, uint32_t reg) 775pci_device_netbsd_read8(struct pci_io_handle *handle, uint32_t reg)
776{ 776{
777#if defined(__i386__) || defined(__amd64__) 777#if defined(__i386__) || defined(__amd64__)
778 return inb(handle->base + reg); 778 return inb(handle->base + reg);
779#else 779#else
780 return *(uint8_t *)((uintptr_t)handle->memory + reg); 780 return *(uint8_t *)((uintptr_t)handle->memory + reg);
781#endif 781#endif
782} 782}
783 783
784static void 784static void
785pci_device_netbsd_write32(struct pci_io_handle *handle, uint32_t reg, 785pci_device_netbsd_write32(struct pci_io_handle *handle, uint32_t reg,
786 uint32_t data) 786 uint32_t data)
787{ 787{
788#if defined(__i386__) || defined(__amd64__) 788#if defined(__i386__) || defined(__amd64__)
789 outl(handle->base + reg, data); 789 outl(handle->base + reg, data);
790#else 790#else
791 *(uint16_t *)((uintptr_t)handle->memory + reg) = data; 791 *(uint16_t *)((uintptr_t)handle->memory + reg) = data;
792#endif 792#endif
793} 793}
794 794
795static void 795static void
796pci_device_netbsd_write16(struct pci_io_handle *handle, uint32_t reg, 796pci_device_netbsd_write16(struct pci_io_handle *handle, uint32_t reg,
797 uint16_t data) 797 uint16_t data)
798{ 798{
799#if defined(__i386__) || defined(__amd64__) 799#if defined(__i386__) || defined(__amd64__)
800 outw(handle->base + reg, data); 800 outw(handle->base + reg, data);
801#else 801#else
802 *(uint8_t *)((uintptr_t)handle->memory + reg) = data; 802 *(uint8_t *)((uintptr_t)handle->memory + reg) = data;
803#endif 803#endif
804} 804}
805 805
806static void 806static void
807pci_device_netbsd_write8(struct pci_io_handle *handle, uint32_t reg, 807pci_device_netbsd_write8(struct pci_io_handle *handle, uint32_t reg,
808 uint8_t data) 808 uint8_t data)
809{ 809{
810#if defined(__i386__) || defined(__amd64__) 810#if defined(__i386__) || defined(__amd64__)
811 outb(handle->base + reg, data); 811 outb(handle->base + reg, data);
812#else 812#else
813 *(uint32_t *)((uintptr_t)handle->memory + reg) = data; 813 *(uint32_t *)((uintptr_t)handle->memory + reg) = data;
814#endif 814#endif
815} 815}
816 816
817static int 817static int
818pci_device_netbsd_map_legacy(struct pci_device *dev, pciaddr_t base, 818pci_device_netbsd_map_legacy(struct pci_device *dev, pciaddr_t base,
819 pciaddr_t size, unsigned map_flags, void **addr) 819 pciaddr_t size, unsigned map_flags, void **addr)
820{ 820{
821 struct pci_device_mapping map; 821 struct pci_device_mapping map;
822 int err; 822 int err;
823 823
824 map.base = base; 824 map.base = base;
825 map.size = size; 825 map.size = size;
826 map.flags = map_flags; 826 map.flags = map_flags;
827 map.memory = NULL; 827 map.memory = NULL;
828 err = pci_device_netbsd_map_range(dev, &map); 828 err = pci_device_netbsd_map_range(dev, &map);
829 *addr = map.memory; 829 *addr = map.memory;
830 830
831 return err; 831 return err;
832} 832}
833 833
834static int 834static int
835pci_device_netbsd_unmap_legacy(struct pci_device *dev, void *addr, 835pci_device_netbsd_unmap_legacy(struct pci_device *dev, void *addr,
836 pciaddr_t size) 836 pciaddr_t size)
837{ 837{
838 struct pci_device_mapping map; 838 struct pci_device_mapping map;
839 839
840 map.memory = addr; 840 map.memory = addr;
841 map.size = size; 841 map.size = size;
842 map.flags = 0; 842 map.flags = 0;
843 return pci_device_netbsd_unmap_range(dev, &map); 843 return pci_device_netbsd_unmap_range(dev, &map);
844} 844}
845 845
846static int 846static int
847pci_device_netbsd_has_kernel_driver(struct pci_device *dev) 847pci_device_netbsd_has_kernel_driver(struct pci_device *dev)
848{ 848{
849#ifdef PCI_IOC_DRVNAME 849#ifdef PCI_IOC_DRVNAME
850 /* 850 /*
851 * NetBSD PCI_IOC_DRVNAME appears at the same time as pci_drvname(3), 851 * NetBSD PCI_IOC_DRVNAME appears at the same time as pci_drvname(3),
852 * same as the better onbus version. 852 * same as the better onbus version.
853 */ 853 */
854 char drvname[16]; 854 char drvname[16];
855 int i; 855 int i;
856 856
857 if (dev->bus >= nbuses) 857 if (dev->bus >= nbuses)
858 return 0; 858 return 0;
859 859
860 /* 860 /*
861 * vga(4) should be considered "not bound". 861 * vga(4) should be considered "not bound".
862 */ 862 */
863 for (i = 0; i < nbuses; i++) { 863 for (i = 0; i < nbuses; i++) {
864 if (buses[i].num == dev->bus) { 864 if (buses[i].num == dev->bus) {
865 int rv; 865 int rv;
866 866
867#ifdef PCI_IOC_DRVNAMEONBUS 867#ifdef PCI_IOC_DRVNAMEONBUS
868 rv = pci_drvnameonbus(buses[i].fd, dev->bus, 868 rv = pci_drvnameonbus(buses[i].fd, dev->bus,
869 dev->dev, dev->func, drvname, sizeof drvname); 869 dev->dev, dev->func, drvname, sizeof drvname);
870#else 870#else
871 rv = pci_drvname(buses[i].fd, 871 rv = pci_drvname(buses[i].fd,
872 dev->dev, dev->func, drvname, sizeof drvname); 872 dev->dev, dev->func, drvname, sizeof drvname);
873#endif 873#endif
874 if (rv == 0 && strncmp(drvname, "vga", 3) != 0) 874 if (rv == 0 && strncmp(drvname, "vga", 3) != 0)
875 return 1; 875 return 1;
876 return 0; 876 return 0;
877 } 877 }
878 } 878 }
879#endif 879#endif
880 return 0; 880 return 0;
881} 881}
882 882
883static const struct pci_system_methods netbsd_pci_methods = { 883static const struct pci_system_methods netbsd_pci_methods = {
884 .destroy = pci_system_netbsd_destroy, 884 .destroy = pci_system_netbsd_destroy,
885 .destroy_device = NULL, 885 .destroy_device = NULL,
886 .read_rom = pci_device_netbsd_read_rom, 886 .read_rom = pci_device_netbsd_read_rom,
887 .probe = pci_device_netbsd_probe, 887 .probe = pci_device_netbsd_probe,
888 .map_range = pci_device_netbsd_map_range, 888 .map_range = pci_device_netbsd_map_range,
889 .unmap_range = pci_device_netbsd_unmap_range, 889 .unmap_range = pci_device_netbsd_unmap_range,
890 .read = pci_device_netbsd_read, 890 .read = pci_device_netbsd_read,
891 .write = pci_device_netbsd_write, 891 .write = pci_device_netbsd_write,
892 .fill_capabilities = pci_fill_capabilities_generic, 892 .fill_capabilities = pci_fill_capabilities_generic,
893#if defined(WSDISPLAYIO_GET_BUSID) 893#if defined(WSDISPLAYIO_GET_BUSID)
894 .boot_vga = pci_device_netbsd_boot_vga, 894 .boot_vga = pci_device_netbsd_boot_vga,
895#else 895#else
896 .boot_vga = NULL, 896 .boot_vga = NULL,
897#endif 897#endif
898 .open_legacy_io = pci_device_netbsd_open_legacy_io, 898 .open_legacy_io = pci_device_netbsd_open_legacy_io,
899 .read32 = pci_device_netbsd_read32, 899 .read32 = pci_device_netbsd_read32,
900 .read16 = pci_device_netbsd_read16, 900 .read16 = pci_device_netbsd_read16,
901 .read8 = pci_device_netbsd_read8, 901 .read8 = pci_device_netbsd_read8,
902 .write32 = pci_device_netbsd_write32, 902 .write32 = pci_device_netbsd_write32,
903 .write16 = pci_device_netbsd_write16, 903 .write16 = pci_device_netbsd_write16,
904 .write8 = pci_device_netbsd_write8, 904 .write8 = pci_device_netbsd_write8,
905 .map_legacy = pci_device_netbsd_map_legacy, 905 .map_legacy = pci_device_netbsd_map_legacy,
906 .unmap_legacy = pci_device_netbsd_unmap_legacy, 906 .unmap_legacy = pci_device_netbsd_unmap_legacy,
907 .has_kernel_driver = pci_device_netbsd_has_kernel_driver, 907 .has_kernel_driver = pci_device_netbsd_has_kernel_driver,
908}; 908};
909 909
910int 910int
911pci_system_netbsd_create(void) 911pci_system_netbsd_create(void)
912{ 912{
913 struct pci_device_private *device; 913 struct pci_device_private *device;
914 int bus, dev, func, ndevs, nfuncs, domain, pcifd; 914 int bus, dev, func, ndevs, nfuncs, domain, pcifd;
915 uint32_t reg; 915 uint32_t reg;
916 char netbsd_devname[32]; 916 char netbsd_devname[32];
917 struct pciio_businfo businfo; 917 struct pciio_businfo businfo;
918 918
919 pci_sys = calloc(1, sizeof(struct pci_system)); 919 pci_sys = calloc(1, sizeof(struct pci_system));
920 920
921 pci_sys->methods = &netbsd_pci_methods; 921 pci_sys->methods = &netbsd_pci_methods;
922 922
923 ndevs = 0; 923 ndevs = 0;
924 nbuses = 0; 924 nbuses = 0;
925 snprintf(netbsd_devname, 32, "/dev/pci%d", nbuses); 925 snprintf(netbsd_devname, 32, "/dev/pci%d", nbuses);
926 pcifd = open(netbsd_devname, O_RDWR | O_CLOEXEC); 926 pcifd = open(netbsd_devname, O_RDWR | O_CLOEXEC);
927 while (pcifd > 0) { 927 while (pcifd > 0) {
928 ioctl(pcifd, PCI_IOC_BUSINFO, &businfo); 928 ioctl(pcifd, PCI_IOC_BUSINFO, &businfo);
929 buses[nbuses].fd = pcifd; 929 buses[nbuses].fd = pcifd;
930 buses[nbuses].num = bus = businfo.busno; 930 buses[nbuses].num = bus = businfo.busno;
931 buses[nbuses].maxdevs = businfo.maxdevs; 931 buses[nbuses].maxdevs = businfo.maxdevs;
932 domain = nbuses; 932 domain = nbuses;
933 nbuses++; 933 nbuses++;
934 for (dev = 0; dev < businfo.maxdevs; dev++) { 934 for (dev = 0; dev < businfo.maxdevs; dev++) {
935 nfuncs = pci_nfuncs(domain, bus, dev); 935 nfuncs = pci_nfuncs(domain, bus, dev);
936 for (func = 0; func < nfuncs; func++) { 936 for (func = 0; func < nfuncs; func++) {
937 if (pci_read(domain, bus, dev, func, PCI_ID_REG, 937 if (pci_read(domain, bus, dev, func, PCI_ID_REG,
938 &reg) != 0) 938 &reg) != 0)
939 continue; 939 continue;
940 if (PCI_VENDOR(reg) == PCI_VENDOR_INVALID || 940 if (PCI_VENDOR(reg) == PCI_VENDOR_INVALID ||
941 PCI_VENDOR(reg) == 0) 941 PCI_VENDOR(reg) == 0)
942 continue; 942 continue;
943 943
944 ndevs++; 944 ndevs++;
945 } 945 }
946 } 946 }
947 snprintf(netbsd_devname, 32, "/dev/pci%d", nbuses); 947 snprintf(netbsd_devname, 32, "/dev/pci%d", nbuses);
948 pcifd = open(netbsd_devname, O_RDWR); 948 pcifd = open(netbsd_devname, O_RDWR);
949 } 949 }
950 950
951 pci_sys->num_devices = ndevs; 951 pci_sys->num_devices = ndevs;
952 pci_sys->devices = calloc(ndevs, sizeof(struct pci_device_private)); 952 pci_sys->devices = calloc(ndevs, sizeof(struct pci_device_private));
953 if (pci_sys->devices == NULL) { 953 if (pci_sys->devices == NULL) {
954 int i; 954 int i;
955 955
956 for (i = 0; i < nbuses; i++) 956 for (i = 0; i < nbuses; i++)
957 close(buses[i].fd); 957 close(buses[i].fd);
958 free(pci_sys); 958 free(pci_sys);
959 return ENOMEM; 959 return ENOMEM;
960 } 960 }
961 961
962 device = pci_sys->devices; 962 device = pci_sys->devices;
963 for (domain = 0; domain < nbuses; domain++) { 963 for (domain = 0; domain < nbuses; domain++) {
964 bus = buses[domain].num; 964 bus = buses[domain].num;
965 for (dev = 0; dev < buses[domain].maxdevs; dev++) { 965 for (dev = 0; dev < buses[domain].maxdevs; dev++) {
966 nfuncs = pci_nfuncs(domain, bus, dev); 966 nfuncs = pci_nfuncs(domain, bus, dev);
967 for (func = 0; func < nfuncs; func++) { 967 for (func = 0; func < nfuncs; func++) {
968 if (pci_read(domain, bus, dev, func, 968 if (pci_read(domain, bus, dev, func,
969 PCI_ID_REG, &reg) != 0) 969 PCI_ID_REG, &reg) != 0)
970 continue; 970 continue;
971 if (PCI_VENDOR(reg) == PCI_VENDOR_INVALID || 971 if (PCI_VENDOR(reg) == PCI_VENDOR_INVALID ||
972 PCI_VENDOR(reg) == 0) 972 PCI_VENDOR(reg) == 0)
973 continue; 973 continue;
974 974
975 device->base.domain = domain; 975 device->base.domain = domain;
 976 if (domain > 0xffff)
 977 device->base.domain_16 = 0xffff;
 978 else
 979 device->base.domain_16 = domain & 0xffff;
976 device->base.bus = bus; 980 device->base.bus = bus;
977 device->base.dev = dev; 981 device->base.dev = dev;
978 device->base.func = func; 982 device->base.func = func;
979 device->base.vendor_id = PCI_VENDOR(reg); 983 device->base.vendor_id = PCI_VENDOR(reg);
980 device->base.device_id = PCI_PRODUCT(reg); 984 device->base.device_id = PCI_PRODUCT(reg);
981 985
982 if (pci_read(domain, bus, dev, func, 986 if (pci_read(domain, bus, dev, func,
983 PCI_CLASS_REG, &reg) != 0) 987 PCI_CLASS_REG, &reg) != 0)
984 continue; 988 continue;
985 989
986 device->base.device_class = 990 device->base.device_class =
987 PCI_INTERFACE(reg) | PCI_CLASS(reg) << 16 | 991 PCI_INTERFACE(reg) | PCI_CLASS(reg) << 16 |
988 PCI_SUBCLASS(reg) << 8; 992 PCI_SUBCLASS(reg) << 8;
989 device->base.revision = PCI_REVISION(reg); 993 device->base.revision = PCI_REVISION(reg);
990 994
991 if (pci_read(domain, bus, dev, func, 995 if (pci_read(domain, bus, dev, func,
992 PCI_SUBSYS_ID_REG, &reg) != 0) 996 PCI_SUBSYS_ID_REG, &reg) != 0)
993 continue; 997 continue;
994 998
995 device->base.subvendor_id = PCI_VENDOR(reg); 999 device->base.subvendor_id = PCI_VENDOR(reg);
996 device->base.subdevice_id = PCI_PRODUCT(reg); 1000 device->base.subdevice_id = PCI_PRODUCT(reg);
997 1001
998 device++; 1002 device++;
999 } 1003 }
1000 } 1004 }
1001 } 1005 }
1002 1006
1003 return 0; 1007 return 0;
1004} 1008}