Collection of DPF-based plugins for packaging
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.

51 lines
1.5KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_check_pathfind.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CHECK_PATHFIND
  8. #
  9. # DESCRIPTION
  10. #
  11. # Not all systems have pathfind(3). See if we need to substitute. To make
  12. # this work, you have to do horrible things. See the doc for
  13. # AX_CHECK_STRCSPN.
  14. #
  15. # LICENSE
  16. #
  17. # Copyright (c) 2008 Bruce Korb <bkorb@gnu.org>
  18. #
  19. # Copying and distribution of this file, with or without modification, are
  20. # permitted in any medium without royalty provided the copyright notice
  21. # and this notice are preserved. This file is offered as-is, without any
  22. # warranty.
  23. #serial 6
  24. AU_ALIAS([AG_CHECK_PATHFIND], [AX_CHECK_PATHFIND])
  25. AC_DEFUN([AX_CHECK_PATHFIND],[
  26. AC_MSG_CHECKING([whether pathfind(3) works])
  27. AC_CACHE_VAL([ax_cv_pathfind],[
  28. AC_TRY_RUN([#include <string.h>
  29. #include <stdlib.h>
  30. int main (int argc, char** argv) {
  31. char* pz = pathfind( getenv( "PATH" ), "sh", "x" );
  32. return (pz == 0) ? 1 : 0;
  33. }],[ax_cv_pathfind=yes],[ax_cv_pathfind=no],[ax_cv_pathfind=no]
  34. ) # end of TRY_RUN]) # end of CACHE_VAL
  35. AC_MSG_RESULT([$ax_cv_pathfind])
  36. if test x$ax_cv_pathfind = xyes
  37. then
  38. AC_DEFINE(HAVE_PATHFIND, 1,
  39. [Define this if pathfind(3) works])
  40. else
  41. if test x$ac_cv_lib_gen_pathfind = xyes
  42. then :
  43. else
  44. COMPATOBJ="$COMPATOBJ pathfind.lo"
  45. fi
  46. fi
  47. ]) # end of AC_DEFUN of AX_CHECK_PATHFIND