OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

244 lines
9.5 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../strongswan/strongswan-add-lib-prefix.m4.patch
  5. # Copyright (C) 2010 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. diff -ruN strongswan-4.4.1-orig/m4/config/lib-prefix.m4 strongswan-4.4.1/m4/config/lib-prefix.m4
  17. --- strongswan-4.4.1-orig/m4/config/lib-prefix.m4 1970-01-01 01:00:00.000000000 +0100
  18. +++ strongswan-4.4.1/m4/config/lib-prefix.m4 2010-09-17 13:47:59.004053352 +0200
  19. @@ -0,0 +1,224 @@
  20. +# lib-prefix.m4 serial 7 (gettext-0.18)
  21. +dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc.
  22. +dnl This file is free software; the Free Software Foundation
  23. +dnl gives unlimited permission to copy and/or distribute it,
  24. +dnl with or without modifications, as long as this notice is preserved.
  25. +
  26. +dnl From Bruno Haible.
  27. +
  28. +dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
  29. +dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
  30. +dnl require excessive bracketing.
  31. +ifdef([AC_HELP_STRING],
  32. +[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
  33. +[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
  34. +
  35. +dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
  36. +dnl to access previously installed libraries. The basic assumption is that
  37. +dnl a user will want packages to use other packages he previously installed
  38. +dnl with the same --prefix option.
  39. +dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
  40. +dnl libraries, but is otherwise very convenient.
  41. +AC_DEFUN([AC_LIB_PREFIX],
  42. +[
  43. + AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
  44. + AC_REQUIRE([AC_PROG_CC])
  45. + AC_REQUIRE([AC_CANONICAL_HOST])
  46. + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
  47. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  48. + dnl By default, look in $includedir and $libdir.
  49. + use_additional=yes
  50. + AC_LIB_WITH_FINAL_PREFIX([
  51. + eval additional_includedir=\"$includedir\"
  52. + eval additional_libdir=\"$libdir\"
  53. + ])
  54. + AC_LIB_ARG_WITH([lib-prefix],
  55. +[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
  56. + --without-lib-prefix don't search for libraries in includedir and libdir],
  57. +[
  58. + if test "X$withval" = "Xno"; then
  59. + use_additional=no
  60. + else
  61. + if test "X$withval" = "X"; then
  62. + AC_LIB_WITH_FINAL_PREFIX([
  63. + eval additional_includedir=\"$includedir\"
  64. + eval additional_libdir=\"$libdir\"
  65. + ])
  66. + else
  67. + additional_includedir="$withval/include"
  68. + additional_libdir="$withval/$acl_libdirstem"
  69. + fi
  70. + fi
  71. +])
  72. + if test $use_additional = yes; then
  73. + dnl Potentially add $additional_includedir to $CPPFLAGS.
  74. + dnl But don't add it
  75. + dnl 1. if it's the standard /usr/include,
  76. + dnl 2. if it's already present in $CPPFLAGS,
  77. + dnl 3. if it's /usr/local/include and we are using GCC on Linux,
  78. + dnl 4. if it doesn't exist as a directory.
  79. + if test "X$additional_includedir" != "X/usr/include"; then
  80. + haveit=
  81. + for x in $CPPFLAGS; do
  82. + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  83. + if test "X$x" = "X-I$additional_includedir"; then
  84. + haveit=yes
  85. + break
  86. + fi
  87. + done
  88. + if test -z "$haveit"; then
  89. + if test "X$additional_includedir" = "X/usr/local/include"; then
  90. + if test -n "$GCC"; then
  91. + case $host_os in
  92. + linux* | gnu* | k*bsd*-gnu) haveit=yes;;
  93. + esac
  94. + fi
  95. + fi
  96. + if test -z "$haveit"; then
  97. + if test -d "$additional_includedir"; then
  98. + dnl Really add $additional_includedir to $CPPFLAGS.
  99. + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
  100. + fi
  101. + fi
  102. + fi
  103. + fi
  104. + dnl Potentially add $additional_libdir to $LDFLAGS.
  105. + dnl But don't add it
  106. + dnl 1. if it's the standard /usr/lib,
  107. + dnl 2. if it's already present in $LDFLAGS,
  108. + dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
  109. + dnl 4. if it doesn't exist as a directory.
  110. + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
  111. + haveit=
  112. + for x in $LDFLAGS; do
  113. + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  114. + if test "X$x" = "X-L$additional_libdir"; then
  115. + haveit=yes
  116. + break
  117. + fi
  118. + done
  119. + if test -z "$haveit"; then
  120. + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
  121. + if test -n "$GCC"; then
  122. + case $host_os in
  123. + linux*) haveit=yes;;
  124. + esac
  125. + fi
  126. + fi
  127. + if test -z "$haveit"; then
  128. + if test -d "$additional_libdir"; then
  129. + dnl Really add $additional_libdir to $LDFLAGS.
  130. + LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
  131. + fi
  132. + fi
  133. + fi
  134. + fi
  135. + fi
  136. +])
  137. +
  138. +dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
  139. +dnl acl_final_exec_prefix, containing the values to which $prefix and
  140. +dnl $exec_prefix will expand at the end of the configure script.
  141. +AC_DEFUN([AC_LIB_PREPARE_PREFIX],
  142. +[
  143. + dnl Unfortunately, prefix and exec_prefix get only finally determined
  144. + dnl at the end of configure.
  145. + if test "X$prefix" = "XNONE"; then
  146. + acl_final_prefix="$ac_default_prefix"
  147. + else
  148. + acl_final_prefix="$prefix"
  149. + fi
  150. + if test "X$exec_prefix" = "XNONE"; then
  151. + acl_final_exec_prefix='${prefix}'
  152. + else
  153. + acl_final_exec_prefix="$exec_prefix"
  154. + fi
  155. + acl_save_prefix="$prefix"
  156. + prefix="$acl_final_prefix"
  157. + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
  158. + prefix="$acl_save_prefix"
  159. +])
  160. +
  161. +dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
  162. +dnl variables prefix and exec_prefix bound to the values they will have
  163. +dnl at the end of the configure script.
  164. +AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
  165. +[
  166. + acl_save_prefix="$prefix"
  167. + prefix="$acl_final_prefix"
  168. + acl_save_exec_prefix="$exec_prefix"
  169. + exec_prefix="$acl_final_exec_prefix"
  170. + $1
  171. + exec_prefix="$acl_save_exec_prefix"
  172. + prefix="$acl_save_prefix"
  173. +])
  174. +
  175. +dnl AC_LIB_PREPARE_MULTILIB creates
  176. +dnl - a variable acl_libdirstem, containing the basename of the libdir, either
  177. +dnl "lib" or "lib64" or "lib/64",
  178. +dnl - a variable acl_libdirstem2, as a secondary possible value for
  179. +dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
  180. +dnl "lib/amd64".
  181. +AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
  182. +[
  183. + dnl There is no formal standard regarding lib and lib64.
  184. + dnl On glibc systems, the current practice is that on a system supporting
  185. + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
  186. + dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
  187. + dnl the compiler's default mode by looking at the compiler's library search
  188. + dnl path. If at least one of its elements ends in /lib64 or points to a
  189. + dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
  190. + dnl Otherwise we use the default, namely "lib".
  191. + dnl On Solaris systems, the current practice is that on a system supporting
  192. + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
  193. + dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
  194. + dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
  195. + AC_REQUIRE([AC_CANONICAL_HOST])
  196. + acl_libdirstem=lib
  197. + acl_libdirstem2=
  198. + case "$host_os" in
  199. + solaris*)
  200. + dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
  201. + dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
  202. + dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
  203. + dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
  204. + dnl symlink is missing, so we set acl_libdirstem2 too.
  205. + AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
  206. + [AC_EGREP_CPP([sixtyfour bits], [
  207. +#ifdef _LP64
  208. +sixtyfour bits
  209. +#endif
  210. + ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
  211. + ])
  212. + if test $gl_cv_solaris_64bit = yes; then
  213. + acl_libdirstem=lib/64
  214. + case "$host_cpu" in
  215. + sparc*) acl_libdirstem2=lib/sparcv9 ;;
  216. + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
  217. + esac
  218. + fi
  219. + ;;
  220. + *)
  221. + searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
  222. + if test -n "$searchpath"; then
  223. + acl_save_IFS="${IFS= }"; IFS=":"
  224. + for searchdir in $searchpath; do
  225. + if test -d "$searchdir"; then
  226. + case "$searchdir" in
  227. + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
  228. + */../ | */.. )
  229. + # Better ignore directories of this form. They are misleading.
  230. + ;;
  231. + *) searchdir=`cd "$searchdir" && pwd`
  232. + case "$searchdir" in
  233. + */lib64 ) acl_libdirstem=lib64 ;;
  234. + esac ;;
  235. + esac
  236. + fi
  237. + done
  238. + IFS="$acl_save_IFS"
  239. + fi
  240. + ;;
  241. + esac
  242. + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
  243. +])