1 dnl Copyright (C) 2007-2016 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, or (at your option) any later version.
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
24 # This macro can be used to find libbatch and set the associated variables in
25 # a project based on autoconf. You can copy this file in your own project and
26 # eventually modify it according to your own needs.
27 # ----------------------------------------------------------------------------
29 AC_DEFUN([CHECK_LIBBATCH],[
31 AC_MSG_NOTICE(Checking for libbatch library)
33 AC_SUBST(LIBBATCH_INCLUDES)
34 AC_SUBST(LIBBATCH_LIBS)
41 AC_ARG_WITH([libbatch],
42 [AS_HELP_STRING([--with-libbatch=DIR],
43 [root directory path of libBatch installation])],
44 [LIBBATCH_DIR="$withval"],
47 if test "x$LIBBATCH_DIR" = "x" ; then
48 # no --with-libbatch option used
49 if test "x$LIBBATCH_ROOT_DIR" != "x" ; then
50 # LIBBATCH_ROOT_DIR environment variable defined
51 LIBBATCH_DIR=$LIBBATCH_ROOT_DIR
58 if test "x$LIBBATCH_DIR" != "x" ; then
59 LOCAL_INCLUDES="-I$LIBBATCH_DIR/include"
60 if test "x$LIBBATCH_DIR" = "x/usr" ; then
63 LOCAL_LIBS="-L$LIBBATCH_DIR/lib -lbatch"
66 LOCAL_INCLUDES="-I/usr/include"
72 CPPFLAGS_old="$CPPFLAGS"
73 CPPFLAGS="$CPPFLAGS $LOCAL_INCLUDES"
74 AC_CHECK_HEADER(libbatch/BatchManager.hxx,
77 CPPFLAGS="$CPPFLAGS_old"
80 if test "x$libbatch_ok" = "xyes" ; then
84 LIBS="$LIBS $LOCAL_LIBS"
85 # Can't use AC_SEARCH_LIBS or AC_CHECK_LIB here because
86 # they don't work with C++ namespaces
87 # AC_SEARCH_LIBS(Batch::BatchManagerCatalog::getInstance,Batch,
88 # libbatch_ok="yes",libbatch_ok="no")
90 [for library containing Batch::BatchManagerCatalog::getInstance])
91 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
93 class BatchManagerCatalog {
94 public: static void getInstance();
98 [using namespace Batch;
99 BatchManagerCatalog::getInstance();])],
102 AC_MSG_RESULT($libbatch_ok)
107 if test "x$libbatch_ok" = "xyes" ; then
108 LIBBATCH_INCLUDES="$LOCAL_INCLUDES"
109 LIBBATCH_LIBS="$LOCAL_LIBS"
112 AC_MSG_RESULT(for libbatch: $libbatch_ok)