libs.m4 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. # STARPU_HAVE_LIBRARY(NAME, LIBRARY,
  44. # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
  45. # [OTHER-LIBRARIES])
  46. # Like AC_HAVE_LIBRARY, but puts -l flags into $1_LDFLAGS instead of LIBS, and
  47. # AC_SUBSTs it
  48. AC_DEFUN([STARPU_HAVE_LIBRARY], [dnl
  49. STARPU_CHECK_LIB([$1], [$2], main, [$3], [$4], [$5])
  50. ])dnl