with_python.m4 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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_WITH_PYTHON],
  38. [
  39. AC_ARG_WITH([python],
  40. AS_HELP_STRING([--with-python=DIR],
  41. [Specify the directory where Python is installed.]
  42. )
  43. )
  44. AS_IF([test "x$with_python" != "x"],
  45. [PYTHON="$with_python/bin/python"]
  46. )
  47. AM_PATH_PYTHON([2.6])
  48. AS_IF([test "$PYTHON_VERSION" != "2.6" -a "$PYTHON_VERSION" != "2.7"],
  49. AC_MSG_ERROR([Python must be version 2.6 or 2.7]))
  50. [PYTHON_INCLUDES=`$PYTHON ${srcdir}/buildutils/python-autoconf.py --includes`]
  51. AC_SUBST(PYTHON_INCLUDES)
  52. [PYTHON_CFLAGS=`$PYTHON ${srcdir}/buildutils/python-autoconf.py --cflags`]
  53. AC_SUBST(PYTHON_CFLAGS)
  54. [PYTHON_LDFLAGS=`$PYTHON ${srcdir}/buildutils/python-autoconf.py --ldflags`]
  55. AC_SUBST(PYTHON_LDFLAGS)
  56. [PYTHON_LIBS=`$PYTHON ${srcdir}/buildutils/python-autoconf.py --libs`]
  57. AC_SUBST(PYTHON_LIBS)
  58. [PYTHON_STD_LIBDIR=`$PYTHON ${srcdir}/buildutils/python-autoconf.py --stdlibdir`]
  59. AC_SUBST(PYTHON_STD_LIBDIR)
  60. [PYTHON_STD_MODULE_DIR=`$PYTHON ${srcdir}/buildutils/python-autoconf.py --stdlibmoddir`]
  61. AC_SUBST(PYTHON_STD_MODULE_DIR)
  62. [PYTHON_STD_MODULE_SHARED_DIR=`$PYTHON ${srcdir}/buildutils/python-autoconf.py --stdlibmodshareddir`]
  63. AC_SUBST(PYTHON_STD_MODULE_SHARED_DIR)
  64. [PBS_PYTHON_DESTLIB="python/altair"]
  65. AC_SUBST(PBS_PYTHON_DESTLIB)
  66. [PYTHON_STD_DESTLIB="python/python${PYTHON_VERSION}"]
  67. AC_SUBST(PYTHON_STD_DESTLIB)
  68. [PYTHON_STD_DESTSHAREDLIB="python/python${PYTHON_VERSION}/shared"]
  69. AC_SUBST(PYTHON_STD_DESTSHAREDLIB)
  70. [PYTHON_PBS_IFL_OBJ="pbs_ifl_wrap.o"]
  71. AC_SUBST(PYTHON_PBS_IFL_OBJ)
  72. AC_DEFINE([PYTHON], [], [Defined when Python is available])
  73. AS_IF([test "x$with_python" == "x"],
  74. [AC_DEFINE_UNQUOTED([SYSTEM_PYTHON_PATH], ["$PYTHON"], [Python executable path])]
  75. )
  76. ])