with_editline.m4 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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_EDITLINE],
  38. [
  39. AC_ARG_WITH([editline],
  40. AS_HELP_STRING([--with-editline=DIR],
  41. [Specify the directory where editline is installed.]
  42. )
  43. )
  44. AS_IF([test "x$with_editline" != "x"],
  45. editline_dir=["$with_editline"],
  46. editline_dir=["/usr"]
  47. )
  48. AC_MSG_CHECKING([for editline])
  49. AS_IF([test -r "$editline_dir/include/histedit.h"],
  50. AS_IF([test "$editline_dir" != "/usr"],
  51. [editline_inc="-I$editline_dir/include"]),
  52. AC_MSG_ERROR([editline headers not found.]))
  53. AS_IF([test "$editline_dir" = "/usr"],
  54. # Using system installed editline
  55. AS_IF([test -r /usr/lib64/libedit.so],
  56. [editline_lib="-ledit"],
  57. AS_IF([test -r /usr/lib/libedit.so],
  58. [editline_lib="-ledit"],
  59. AS_IF([test -r /usr/lib/x86_64-linux-gnu/libedit.so],
  60. [editline_lib="-ledit"],
  61. AC_MSG_ERROR([editline shared object library not found.])))),
  62. # Using developer installed editline
  63. AS_IF([test -r "${editline_dir}/lib64/libedit.a"],
  64. [editline_lib="${editline_dir}/lib64/libedit.a"],
  65. AS_IF([test -r "${editline_dir}/lib/libedit.a"],
  66. [editline_lib="${editline_dir}/lib/libedit.a"],
  67. AC_MSG_ERROR([editline library not found.])
  68. )
  69. )
  70. )
  71. AC_MSG_RESULT([$editline_dir])
  72. AC_CHECK_LIB([ncurses], [tgetent],
  73. [curses_lib="-lncurses"],
  74. AC_CHECK_LIB([curses], [tgetent],
  75. [curses_lib="-lcurses"],
  76. AC_MSG_ERROR([curses library not found.])))
  77. [editline_lib="$editline_lib $curses_lib"]
  78. AC_SUBST(editline_inc)
  79. AC_SUBST(editline_lib)
  80. AC_DEFINE([QMGR_HAVE_HIST], [], [Defined when editline is available])
  81. ])