enable_cpuset.m4 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #
  2. # Copyright (C) 1994-2018 Altair Engineering, Inc.
  3. # For more information, contact Altair at www.altair.com.
  4. #
  5. # This file is part of the PBS Professional ("PBS Pro") software.
  6. #
  7. # Open Source License Information:
  8. #
  9. # PBS Pro is free software. You can redistribute it and/or modify it under the
  10. # terms of the GNU Affero General Public License as published by the Free
  11. # Software Foundation, either version 3 of the License, or (at your option) any
  12. # later version.
  13. #
  14. # PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
  15. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  16. # FOR A PARTICULAR PURPOSE.
  17. # See the GNU Affero General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU Affero General Public License
  20. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. #
  22. # Commercial License Information:
  23. #
  24. # For a copy of the commercial license terms and conditions,
  25. # go to: (http://www.pbspro.com/UserArea/agreement.html)
  26. # or contact the Altair Legal Department.
  27. #
  28. # Altair’s dual-license business model allows companies, individuals, and
  29. # organizations to create proprietary derivative works of PBS Pro and
  30. # distribute them - whether embedded or bundled with other software -
  31. # under a commercial license agreement.
  32. #
  33. # Use of Altair’s trademarks, including but not limited to "PBS™",
  34. # "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
  35. # trademark licensing policies.
  36. #
  37. AC_DEFUN([PBS_AC_ENABLE_CPUSET],
  38. [
  39. AC_MSG_CHECKING([whether native cpuset support was requested])
  40. AC_ARG_ENABLE([cpuset],
  41. AS_HELP_STRING([--enable-cpuset],
  42. [Enable native cpuset support.]
  43. )
  44. )
  45. [cpuset_flags=""]
  46. AS_IF([test x$enable_cpuset = xyes],
  47. AC_MSG_RESULT([yes])
  48. AS_IF([test ! -r /usr/include/cpuset.h],
  49. AC_MSG_ERROR([Missing cpuset header file]))
  50. AS_IF([test -r /usr/include/cpumemset.h],
  51. [cpuset_flags="-DCPUSET_VERSION=2"; cpuset_v4=no],
  52. [cpuset_flags="-DCPUSET_VERSION=4"; cpuset_v4=yes])
  53. AS_IF([test x$cpuset_v4 = xyes],
  54. AS_IF([test ! -r /usr/include/bitmask.h],
  55. AC_MSG_ERROR([Missing libbitmask or bitmask.h header file])))
  56. AS_CASE([$PBS_MACH],
  57. [irix6*],
  58. [cpuset_flags="$cpuset_flags -DIRIX6_CPUSET=1"]
  59. [cpuset_for_irix6=yes],
  60. [cpuset_for_irix6=no]
  61. ),
  62. AC_MSG_RESULT([no])
  63. )
  64. AC_SUBST([cpuset_flags])
  65. AM_CONDITIONAL([CPUSET_ENABLED], [test x$enable_cpuset = xyes])
  66. AM_CONDITIONAL([CPUSET_FOR_IRIX6], [test x$cpuset_for_irix6 = xyes])
  67. AM_CONDITIONAL([CPUSET_V4], [test x$cpuset_v4 = xyes])
  68. ])