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.

190 lines
7.0 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../ppl/ppl-0.11.2-update-ac_check_gmp.m4.patch
  5. # Copyright (C) 2012 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. get a more decent way to specify gmp libdir and includedir
  17. --- ppl-0.11.2/m4/ac_check_gmp.m4 2011-02-27 10:07:47.000000000 +0100
  18. +++ ppl-1.0/m4/ac_check_gmp.m4 2012-06-28 12:50:33.000000000 +0200
  19. @@ -1,6 +1,6 @@
  20. dnl A function to check for the existence and usability of GMP.
  21. dnl Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
  22. -dnl Copyright (C) 2010-2011 BUGSENG srl (http://bugseng.com)
  23. +dnl Copyright (C) 2010-2012 BUGSENG srl (http://bugseng.com)
  24. dnl
  25. dnl This file is part of the Parma Polyhedra Library (PPL).
  26. dnl
  27. @@ -19,45 +19,72 @@
  28. dnl Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
  29. dnl
  30. dnl For the most up-to-date information see the Parma Polyhedra Library
  31. -dnl site: http://www.cs.unipr.it/ppl/ .
  32. +dnl site: http://bugseng.com/products/ppl/ .
  33. AC_DEFUN([AC_CHECK_GMP],
  34. [
  35. -dnl Since libgmp and libgmpxx are usually installed in the same location,
  36. -dnl let the prefixes default from each other.
  37. -if test -n "$with_libgmpxx_prefix" && test -z "$with_libgmp_prefix"; then
  38. - with_libgmp_prefix="$with_libgmpxx_prefix"
  39. -else
  40. - if test -n "$with_libgmp_prefix" && test -z "$with_libgmpxx_prefix"; then
  41. - with_libgmpxx_prefix="$with_libgmp_prefix"
  42. - fi
  43. +AC_ARG_WITH(gmp,
  44. + AS_HELP_STRING([--with-gmp=DIR],
  45. + [search for libgmp/libgmpxx in DIR/include and DIR/lib]))
  46. +
  47. +AC_ARG_WITH(gmp-include,
  48. + AS_HELP_STRING([--with-gmp-include=DIR],
  49. + [search for libgmp/libgmpxx headers in DIR]))
  50. +
  51. +AC_ARG_WITH(gmp-lib,
  52. + AS_HELP_STRING([--with-gmp-lib=DIR],
  53. + [search for libgmp/libgmpxx library objects in DIR]))
  54. +
  55. +if test -n "$with_gmp"
  56. +then
  57. + gmp_include_options="-I$with_gmp/include"
  58. + gmp_library_paths="$with_gmp/lib"
  59. + gmp_library_options="-L$gmp_library_paths"
  60. +fi
  61. +
  62. +if test -n "$with_gmp_include"
  63. +then
  64. + gmp_include_options="-I$with_gmp_include"
  65. +fi
  66. +
  67. +if test -n "$with_gmp_lib"
  68. +then
  69. + gmp_library_paths="$with_gmp_lib"
  70. + gmp_library_options="-L$gmp_library_paths"
  71. fi
  72. +gmp_libs="-lgmpxx -lgmp"
  73. +
  74. AC_ARG_WITH(gmp-build,
  75. AS_HELP_STRING([--with-gmp-build=DIR],
  76. [use a non-installed build of GMP in DIR]),
  77. gmp_build_dir=$with_gmp_build
  78. - if test -z "$with_libgmp_prefix"
  79. + if test -n "$with_gmp" \
  80. + || test -n "$with_gmp_include" || test -n "$with_gmp_lib"
  81. then
  82. - CPPFLAGS="$CPPFLAGS -I$gmp_build_dir -I$gmp_build_dir/tune"
  83. - LDFLAGS="$LDFLAGS -L$gmp_build_dir -L$gmp_build_dir/.libs"
  84. - LDFLAGS="$LDFLAGS -L$gmp_build_dir/tune"
  85. + AC_MSG_ERROR([cannot use --with-gmp-build and other --with-gmp* options together])
  86. else
  87. - AC_MSG_ERROR([cannot use --with-gmp-build and --with-gmp-prefix together])
  88. + gmp_srcdir=`echo @abs_srcdir@ | $gmp_build_dir/config.status --file=-`
  89. + gmp_include_options="-I$gmp_build_dir -I$gmp_build_dir/tune -I$gmp_srcdir"
  90. + gmp_libs="$gmp_build_dir/libgmp.la $gmp_build_dir/libgmpxx.la"
  91. fi)
  92. -dnl Both libgmp and libbmpxx come from the gmp package.
  93. -AC_LIB_FROMPACKAGE([gmp], [gmp])
  94. -AC_LIB_FROMPACKAGE([gmpxx], [gmp])
  95. +gmp_library_options="$gmp_library_options $gmp_libs"
  96. -dnl Check how to link with libgmp.
  97. -AC_LIB_LINKFLAGS([gmp])
  98. -
  99. -dnl Check how to link with libgmpxx.
  100. -AC_LIB_LINKFLAGS([gmpxx], [gmp])
  101. +if test -n "$with_gmp_build"
  102. +then
  103. + ac_save_CXX="$CXX"
  104. + CXX="libtool --mode=link --tag=CXX $CXX"
  105. +fi
  106. +ac_save_CPPFLAGS="$CPPFLAGS"
  107. +CPPFLAGS="$CPPFLAGS $gmp_include_options"
  108. ac_save_LIBS="$LIBS"
  109. -LIBS="$LIBS $LIBGMPXX"
  110. +LIBS="$LIBS $gmp_library_options"
  111. +eval ac_save_shared_library_path="\$$shared_library_path_env_var"
  112. +eval $shared_library_path_env_var=\"$gmp_library_paths:$ac_save_shared_library_path\"
  113. +export $shared_library_path_env_var
  114. +
  115. AC_LANG_PUSH(C++)
  116. AC_MSG_CHECKING([for the GMP library version 4.1.3 or above])
  117. @@ -96,7 +123,7 @@
  118. if (header_version != library_version) {
  119. std::cerr
  120. - << "GMP header (gmp.h) and library (ligmp.*) version mismatch:\n"
  121. + << "GMP header (gmpxx.h) and library (ligmpxx.*) version mismatch:\n"
  122. << "header gives " << header_version << ";\n"
  123. << "library gives " << library_version << "." << std::endl;
  124. return 1;
  125. @@ -105,7 +132,7 @@
  126. if (sizeof(mp_limb_t)*CHAR_BIT != BITS_PER_MP_LIMB
  127. || BITS_PER_MP_LIMB != mp_bits_per_limb) {
  128. std::cerr
  129. - << "GMP header (gmp.h) and library (ligmp.*) bits-per-limb mismatch:\n"
  130. + << "GMP header (gmpxx.h) and library (ligmpxx.*) bits-per-limb mismatch:\n"
  131. << "header gives " << BITS_PER_MP_LIMB << ";\n"
  132. << "library gives " << mp_bits_per_limb << ".\n"
  133. << "This probably means you are on a bi-arch system and\n"
  134. @@ -197,8 +224,12 @@
  135. fi
  136. AC_LANG_POP(C++)
  137. +eval $shared_library_path_env_var=\"$ac_save_shared_library_path\"
  138. LIBS="$ac_save_LIBS"
  139. +CPPFLAGS="$ac_save_CPPFLAGS"
  140. -dnl We use libtool, therefore we take $LTLIBGMPXX, not $LIBGMPXX.
  141. -gmp_library_option="$LTLIBGMPXX"
  142. +if test -n "$with_gmp_build"
  143. +then
  144. + CXX="$ac_save_CXX"
  145. +fi
  146. ])
  147. --- ppl-0.11.2/m4/lib-prefix.m4.orig 2012-08-07 16:08:22.686543774 +0200
  148. +++ ppl-0.11.2/m4/lib-prefix.m4 2012-08-07 16:09:39.651742841 +0200
  149. @@ -199,7 +199,7 @@
  150. fi
  151. ;;
  152. *)
  153. - searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
  154. + # searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
  155. if test -n "$searchpath"; then
  156. acl_save_IFS="${IFS= }"; IFS=":"
  157. for searchdir in $searchpath; do
  158. --- ppl-0.11.2/configure.ac.orig 2012-08-07 14:44:02.350070691 +0200
  159. +++ ppl-0.11.2/configure.ac 2012-08-07 14:45:50.050986072 +0200
  160. @@ -777,8 +777,8 @@
  161. *** Please report this to ppl-devel@cs.unipr.it.])
  162. fi
  163. -extra_includes="${extra_includes}${extra_includes:+ }${gmp_includes_option}"
  164. -extra_libraries="${extra_libraries}${extra_libraries:+ }${gmp_library_option}"
  165. +extra_includes="${extra_includes}${extra_includes:+ }${gmp_includes_options}"
  166. +extra_libraries="${extra_libraries}${extra_libraries:+ }${gmp_library_options}"
  167. enableval=yes
  168. AC_MSG_CHECKING([whether to build the Parma Watchdog Library])
  169. @@ -1291,7 +1291,7 @@
  170. required_instantiations=`echo "${enableval}" | sed -e 's/[[ ]][[ ]]*/ /g' -e 's/[[ ]]*\([[@<>,]]\)/\1/g' -e 's/\([[@<>,]]\)[[ ]]*/\1/g' -e 's/>>/> >/g' -e 's/^[[ ]]//g' -e 's/[[ ]]$//g'`
  171. # Check the specified instantiations for validity.
  172. ac_save_CPPFLAGS="$CPPFLAGS"
  173. - CPPFLAGS="$CPPFLAGS -I${srcdir}"
  174. + CPPFLAGS="$CPPFLAGS -I${srcdir} ${gmp_include_options}"
  175. old_IFS="${IFS}"
  176. IFS=@
  177. set -- ${required_instantiations}