libs.m4 2.0 KB

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