1 dnl Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
3 dnl This library is free software; you can redistribute it and/or
4 dnl modify it under the terms of the GNU Lesser General Public
5 dnl License as published by the Free Software Foundation; either
6 dnl version 2.1 of the License.
8 dnl This library is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 dnl Lesser General Public License for more details.
13 dnl You should have received a copy of the GNU Lesser General Public
14 dnl License along with this library; if not, write to the Free Software
15 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # This macro can be used to find libBatch and set the associated variables in
22 # a project based on autoconf. You can copy this file in your own project and
23 # eventually modify it according to your own needs.
24 # ----------------------------------------------------------------------------
26 AC_DEFUN([CHECK_LIBBATCH],[
28 AC_MSG_NOTICE(Checking for libBatch library)
30 AC_SUBST(LIBBATCH_INCLUDES)
31 AC_SUBST(LIBBATCH_LIBS)
38 AC_ARG_WITH([libbatch],
39 [AS_HELP_STRING([--with-libbatch=DIR],
40 [root directory path of libBatch installation])],
41 [LIBBATCH_DIR="$withval"],
44 if test "x$LIBBATCH_DIR" = "x" ; then
45 # no --with-libbatch option used
46 if test "x$LIBBATCH_ROOT_DIR" != "x" ; then
47 # LIBBATCH_ROOT_DIR environment variable defined
48 LIBBATCH_DIR=$LIBBATCH_ROOT_DIR
55 if test "x$LIBBATCH_DIR" != "x" ; then
56 LOCAL_INCLUDES="-I$LIBBATCH_DIR/include"
57 if test "x$LIBBATCH_DIR" = "x/usr" ; then
60 LOCAL_LIBS="-L$LIBBATCH_DIR/lib -lBatch"
63 LOCAL_INCLUDES="-I/usr/include"
69 CPPFLAGS_old="$CPPFLAGS"
70 CPPFLAGS="$CPPFLAGS $LOCAL_INCLUDES"
71 AC_CHECK_HEADER(Batch/Batch_BatchManager.hxx,
74 CPPFLAGS="$CPPFLAGS_old"
77 if test "x$libbatch_ok" = "xyes" ; then
81 LIBS="$LIBS $LOCAL_LIBS"
82 # Can't use AC_SEARCH_LIBS or AC_CHECK_LIB here because
83 # they don't work with C++ namespaces
84 # AC_SEARCH_LIBS(Batch::BatchManagerCatalog::getInstance,Batch,
85 # libbatch_ok="yes",libbatch_ok="no")
87 [for library containing Batch::BatchManagerCatalog::getInstance])
88 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
90 class BatchManagerCatalog {
91 public: static void getInstance();
95 [using namespace Batch;
96 BatchManagerCatalog::getInstance();])],
99 AC_MSG_RESULT($libbatch_ok)
104 if test "x$libbatch_ok" = "xyes" ; then
105 LIBBATCH_INCLUDES="$LOCAL_INCLUDES"
106 LIBBATCH_LIBS="$LOCAL_LIBS"
109 AC_MSG_RESULT(for libBatch: $libbatch_ok)