libs.m4 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2011 Université de Bordeaux 1
  4. #
  5. # StarPU is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU Lesser General Public License as published by
  7. # the Free Software Foundation; either version 2.1 of the License, or (at
  8. # your option) any later version.
  9. #
  10. # StarPU is distributed in the hope that it will be useful, but
  11. # WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. #
  14. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. # STARPU_SEARCH_LIBS(NAME, FUNCTION, SEARCH-LIBS,
  16. # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
  17. # [OTHER-LIBRARIES])
  18. #
  19. # Like AC_SEARCH_LIBS, but puts -l flags into $1_LDFLAGS instead of LIBS, and
  20. # AC_SUBSTs it
  21. AC_DEFUN([STARPU_SEARCH_LIBS], [dnl
  22. _LIBS_SAV="$LIBS"
  23. LIBS=""
  24. AC_SEARCH_LIBS([$2], [$3], [$4], [$5], [$6])
  25. STARPU_$1_LDFLAGS="$STARPU_$1_LDFLAGS $LIBS"
  26. LIBS=$_LIBS_SAV
  27. AC_SUBST(STARPU_$1_LDFLAGS)
  28. ])dnl
  29. # STARPU_CHECK_LIB(NAME, LIBRARY, FUNCTION,
  30. # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
  31. # [OTHER-LIBRARIES])
  32. #
  33. # Like AC_CHECK_LIB, but puts -l flags into $1_LDFLAGS instead of LIBS, and
  34. # AC_SUBSTs it
  35. AC_DEFUN([STARPU_CHECK_LIB], [dnl
  36. _LIBS_SAV="$LIBS"
  37. LIBS=""
  38. AC_CHECK_LIB([$2], [$3], [$4], [$5], [$6])
  39. STARPU_$1_LDFLAGS="$STARPU_$1_LDFLAGS $LIBS"
  40. LIBS=$_LIBS_SAV
  41. AC_SUBST(STARPU_$1_LDFLAGS)
  42. ])dnl
  43. # AC_HAVE_LIBRARY(NAME, LIBRARY,
  44. # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
  45. # [OTHER-LIBRARIES])
  46. AC_DEFUN([STARPU_HAVE_LIBRARY], [dnl
  47. STARPU_CHECK_LIB([$1], [$2], main, [$3], [$4], [$5])
  48. ])dnl