1 dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 dnl This library is free software; you can redistribute it and/or
7 dnl modify it under the terms of the GNU Lesser General Public
8 dnl License as published by the Free Software Foundation; either
9 dnl version 2.1 of the License.
11 dnl This library is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 dnl Lesser General Public License for more details.
16 dnl You should have received a copy of the GNU Lesser General Public
17 dnl License along with this library; if not, write to the Free Software
18 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 AC_DEFUN([CHECK_OPENPBS],
25 AC_ARG_VAR([OPENPBS], [OpenPBS home directory])
26 AC_ARG_WITH([openpbs],
27 AC_HELP_STRING([--with-openpbs=<path>],
28 [tell configure script to use OpenPBS that is located at <path>]),
29 [test ! x"${withval}" = xyes && OPENPBS=${withval}],
32 dnl AC_ARG_VAR([OPENPBSSERVERNAME], [OpenPBS server_name file])
33 dnl AC_ARG_WITH([openpbs-server-name],
34 dnl AC_HELP_STRING([--with-openpbs-server-name=<path>],
35 dnl [tell configure script to use OpenPBS server_name file that is located at <path>]),
36 dnl [test ! x"${withval}" = xyes && OPENPBSSERVERNAME=${withval}],
37 dnl [with_openpbs_server_name=""])
40 if test -z "${OPENPBS}"
42 AC_MSG_WARN([Environment variable OPENPBS not set. Skipping OpenPBS configuration.])
46 OPENPBS_INCLUDES="-I${OPENPBS}/include"
47 saved_CPPFLAGS=${CPPFLAGS}
48 CPPFLAGS="${CPPFLAGS} ${OPENPBS_INCLUDES}"
49 AC_CHECK_HEADER([pbs_ifl.h], [openpbs_header_found=yes], [openpbs_header_found=no], [])
50 test x${openpbs_header_found} = xno && AC_MSG_WARN([OpenPBS include file not found])
51 CPPFLAGS=${saved_CPPFLAGS}
52 AC_SUBST(OPENPBS_INCLUDES)
54 if test "x${OPENPBS}" = "x/usr"
58 OPENPBS_LIBDIR="-L${OPENPBS}/lib"
61 saved_LDFLAGS=${LDFLAGS}
63 LDFLAGS="${LDFLAGS} ${OPENPBS_LIBDIR}"
64 AC_CHECK_LIB([pbs], [pbs_connect], [openpbs_lib_found=yes], [openpbs_lib_found=no], [])
65 test x${openpbs_lib_found} = xno && AC_MSG_WARN([OpenPBS library not found])
66 LIBS="${LIBS} ${OPENPBS_LIBS}"
67 LDFLAGS=${saved_LDFLAGS}
69 AC_SUBST(OPENPBS_LIBDIR)
70 AC_SUBST(OPENPBS_LIBS)
72 dnl test -z "${OPENPBSSERVERNAME}" && OPENPBSSERVERNAME="/usr/spool/PBS/server_name"
73 dnl AC_CHECK_FILE([${OPENPBSSERVERNAME}], [openpbs_server_name_found=yes], [openpbs_server_name_found=no])
75 test x${openpbs_header_found} = xyes && test x${openpbs_lib_found} = xyes && openpbs_ok="yes"
79 WITHOPENPBS=$openpbs_ok
80 if test x$WITHOPENPBS = x ; then
85 AM_CONDITIONAL(WITH_OPENPBS, test $WITHOPENPBS = yes)