diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2017-04-11 21:36:07 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2017-04-11 21:38:56 +0300 |
commit | e51f5cd6456a794e3f4464f72c10ad15032b2137 (patch) | |
tree | 5c50a4e5bac136ae656fcc05e2eb9c94a2081a99 /m4/lib-prefix.m4 | |
parent | df295571f2af48d6129704e644fabfec204ed259 (diff) | |
download | libmicrohttpd-e51f5cd6456a794e3f4464f72c10ad15032b2137.tar.gz libmicrohttpd-e51f5cd6456a794e3f4464f72c10ad15032b2137.zip |
Updated more M4 autoconf macros
Diffstat (limited to 'm4/lib-prefix.m4')
-rw-r--r-- | m4/lib-prefix.m4 | 109 |
1 files changed, 63 insertions, 46 deletions
diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4 index 6851031d..a5d56c8d 100644 --- a/m4/lib-prefix.m4 +++ b/m4/lib-prefix.m4 | |||
@@ -1,5 +1,5 @@ | |||
1 | # lib-prefix.m4 serial 7 (gettext-0.18) | 1 | # lib-prefix.m4 serial 8 |
2 | dnl Copyright (C) 2001-2005, 2008-2016 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2001-2005, 2008-2017 Free Software Foundation, Inc. |
3 | dnl This file is free software; the Free Software Foundation | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl gives unlimited permission to copy and/or distribute it, | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl with or without modifications, as long as this notice is preserved. | 5 | dnl with or without modifications, as long as this notice is preserved. |
@@ -174,51 +174,68 @@ AC_DEFUN([AC_LIB_PREPARE_MULTILIB], | |||
174 | dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or | 174 | dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or |
175 | dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. | 175 | dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. |
176 | AC_REQUIRE([AC_CANONICAL_HOST]) | 176 | AC_REQUIRE([AC_CANONICAL_HOST]) |
177 | acl_libdirstem=lib | 177 | dnl Allow the user to override the result by setting acl_cv_libdirstems. |
178 | acl_libdirstem2= | 178 | AC_CACHE_CHECK([for the common suffixes of directories in the library search path], |
179 | case "$host_os" in | 179 | [acl_cv_libdirstems], |
180 | solaris*) | 180 | [acl_libdirstem=lib |
181 | dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment | 181 | acl_libdirstem2= |
182 | dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>. | 182 | case "$host_os" in |
183 | dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." | 183 | solaris*) |
184 | dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the | 184 | dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment |
185 | dnl symlink is missing, so we set acl_libdirstem2 too. | 185 | dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>. |
186 | AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], | 186 | dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." |
187 | [AC_EGREP_CPP([sixtyfour bits], [ | 187 | dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the |
188 | dnl symlink is missing, so we set acl_libdirstem2 too. | ||
189 | AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], | ||
190 | [AC_EGREP_CPP([sixtyfour bits], [ | ||
188 | #ifdef _LP64 | 191 | #ifdef _LP64 |
189 | sixtyfour bits | 192 | sixtyfour bits |
190 | #endif | 193 | #endif |
191 | ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) | 194 | ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) |
192 | ]) | 195 | ]) |
193 | if test $gl_cv_solaris_64bit = yes; then | 196 | if test $gl_cv_solaris_64bit = yes; then |
194 | acl_libdirstem=lib/64 | 197 | acl_libdirstem=lib/64 |
195 | case "$host_cpu" in | 198 | case "$host_cpu" in |
196 | sparc*) acl_libdirstem2=lib/sparcv9 ;; | 199 | sparc*) acl_libdirstem2=lib/sparcv9 ;; |
197 | i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; | 200 | i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; |
198 | esac | 201 | esac |
199 | fi | 202 | fi |
200 | ;; | 203 | ;; |
201 | *) | 204 | *) |
202 | searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` | 205 | dnl The result is a property of the system. However, non-system |
203 | if test -n "$searchpath"; then | 206 | dnl compilers sometimes have odd library search paths. Therefore |
204 | acl_save_IFS="${IFS= }"; IFS=":" | 207 | dnl prefer asking /usr/bin/gcc, if available, rather than $CC. |
205 | for searchdir in $searchpath; do | 208 | searchpath=`(if test -f /usr/bin/gcc \ |
206 | if test -d "$searchdir"; then | 209 | && LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \ |
207 | case "$searchdir" in | 210 | LC_ALL=C /usr/bin/gcc -print-search-dirs; \ |
208 | */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; | 211 | else \ |
209 | */../ | */.. ) | 212 | LC_ALL=C $CC -print-search-dirs; \ |
210 | # Better ignore directories of this form. They are misleading. | 213 | fi) 2>/dev/null \ |
211 | ;; | 214 | | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` |
212 | *) searchdir=`cd "$searchdir" && pwd` | 215 | if test -n "$searchpath"; then |
213 | case "$searchdir" in | 216 | acl_save_IFS="${IFS= }"; IFS=":" |
214 | */lib64 ) acl_libdirstem=lib64 ;; | 217 | for searchdir in $searchpath; do |
215 | esac ;; | 218 | if test -d "$searchdir"; then |
216 | esac | 219 | case "$searchdir" in |
217 | fi | 220 | */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; |
218 | done | 221 | */../ | */.. ) |
219 | IFS="$acl_save_IFS" | 222 | # Better ignore directories of this form. They are misleading. |
220 | fi | 223 | ;; |
221 | ;; | 224 | *) searchdir=`cd "$searchdir" && pwd` |
222 | esac | 225 | case "$searchdir" in |
223 | test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" | 226 | */lib64 ) acl_libdirstem=lib64 ;; |
227 | esac ;; | ||
228 | esac | ||
229 | fi | ||
230 | done | ||
231 | IFS="$acl_save_IFS" | ||
232 | fi | ||
233 | ;; | ||
234 | esac | ||
235 | test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" | ||
236 | acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2" | ||
237 | ]) | ||
238 | # Decompose acl_cv_libdirstems into acl_libdirstem and acl_libdirstem2. | ||
239 | acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` | ||
240 | acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e '/,/s/.*,//'` | ||
224 | ]) | 241 | ]) |