pbs_decl_h_errno.m4 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Copyright (C) 1994-2018 Altair Engineering, Inc.
  2. # For more information, contact Altair at www.altair.com.
  3. #
  4. # This file is part of the PBS Professional ("PBS Pro") software.
  5. #
  6. # Open Source License Information:
  7. #
  8. # PBS Pro is free software. You can redistribute it and/or modify it under the
  9. # terms of the GNU Affero General Public License as published by the Free
  10. # Software Foundation, either version 3 of the License, or (at your option) any
  11. # later version.
  12. #
  13. # PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
  14. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  15. # FOR A PARTICULAR PURPOSE.
  16. # See the GNU Affero General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU Affero General Public License
  19. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. #
  21. # Commercial License Information:
  22. #
  23. # For a copy of the commercial license terms and conditions,
  24. # go to: (http://www.pbspro.com/UserArea/agreement.html)
  25. # or contact the Altair Legal Department.
  26. #
  27. # Altair’s dual-license business model allows companies, individuals, and
  28. # organizations to create proprietary derivative works of PBS Pro and
  29. # distribute them - whether embedded or bundled with other software -
  30. # under a commercial license agreement.
  31. #
  32. # Use of Altair’s trademarks, including but not limited to "PBS™",
  33. # "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
  34. # trademark licensing policies.
  35. # Test to see whether h_errno is visible when netdb.h is included.
  36. # At least under HP-UX 10.x this is not the case unless
  37. # XOPEN_SOURCE_EXTENDED is declared but then other nasty stuff happens.
  38. # The appropriate thing to do is to call this macro and then
  39. # if it is not available do a "extern int h_errno;" in the code.
  40. AC_DEFUN([PBS_AC_DECL_H_ERRNO],
  41. [AC_CACHE_CHECK([for h_errno declaration in netdb.h],
  42. ac_cv_decl_h_errno,
  43. [AC_TRY_COMPILE([#include <sys/types.h>
  44. #ifdef HAVE_UNISTD_H
  45. #include <unistd.h>
  46. #endif
  47. #include <netdb.h>
  48. ],
  49. [int _ZzQ = (int)(h_errno + 1);],
  50. [ac_cv_decl_h_errno=yes],
  51. [ac_cv_decl_h_errno=no])
  52. ])
  53. AS_IF([test x$ac_cv_decl_h_errno = xyes],
  54. AC_DEFINE(H_ERRNO_DECLARED, [], [Defined when h_errno is declared in netdb.h]))
  55. ])