source: trunk/m4/ax_pbs.m4 @ 12

Revision 12, 2.2 KB checked in by mmamonski, 11 years ago (diff)

version 1.0.7 release candidate

  • Property svn:keywords set to Id
Line 
1# $Id$
2#
3# SYNOPSIS
4#
5#   AX_PBS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
6#
7# DESCRIPTION
8#
9#   Check for PBS libraries and headers.
10#
11#   This macro calls::
12#
13#     AC_SUBST(PBS_INCLUDES)
14#     AC_SUBST(PBS_LIBS)
15#     AC_SUBST(PBS_LDFLAGS)
16#
17# LAST MODIFICATION
18#
19#   2008-06-13
20#
21# LICENSE
22#
23#   Written by Łukasz Cieśnik <lukasz.ciesnik@gmail.com>
24#   and placed under Public Domain
25#
26
27AC_DEFUN([AX_PBS],[
28AC_ARG_WITH([pbs], [AC_HELP_STRING([--with-pbs=<pbs-prefix>],
29                [Path to existing PBS installation root])])
30AC_SUBST(PBS_INCLUDES)
31AC_SUBST(PBS_LIBS)
32AC_SUBST(PBS_LDFLAGS)
33
34if test x"$with_pbs" != x; then
35        PBS_INCLUDES="-I${with_pbs}/include "
36        PBS_LDFLAGS="-L${with_pbs}/lib "
37else
38        T1=`which pbsnodes`
39        if test x"$T1" != x; then
40                T2=`dirname $T1`
41                PBS_HOME=`dirname $T2`
42                PBS_INCLUDES="-I${PBS_HOME}/include "
43                PBS_LDFLAGS="-L${PBS_HOME}/lib "
44        fi
45fi
46
47LDFLAGS_save="$LDFLAGS"
48CPPFLAGS_save="$CPPFLAGS"
49LDFLAGS="$LDFLAGS $PBS_LDFLAGS"
50CPPFLAGS="$CPPFLAGS $PBS_INCLUDES"
51
52ax_pbs_ok="no"
53
54AH_TEMPLATE([PBS_PROFESSIONAL], [compiling against PBS Professional])
55
56if test x"$ax_pbs_ok" = xno; then
57        ax_pbs_ok="yes"
58        AC_CHECK_LIB([pbs], [pbs_submit], [:], [ax_pbs_ok="no"])
59        AC_CHECK_LIB([log], [pbse_to_txt], [:], [ax_pbs_ok="no"])
60        if test x"$ax_pbs_ok" = xyes; then
61                ax_pbs_libs="-lpbs -llog"
62        fi
63fi
64
65AS_UNSET([ac_cv_lib_pbs_pbs_submit])
66AS_UNSET([ac_cv_lib_log_pbse_to_txt])
67
68if test x"$ax_pbs_ok" = xno; then
69        ax_pbs_ok="yes"
70        AC_CHECK_LIB([pbs], [pbs_submit], [:], [ax_pbs_ok="no"], [-lssl -lcrypto])
71        AC_CHECK_LIB([log], [pbse_to_txt], [:], [ax_pbs_ok="no"], [-lssl -lcrypto] )
72        if test x"$ax_pbs_ok" = xyes; then
73                ax_pbs_libs="-lpbs -llog -lssl -lcrypto"
74        fi
75fi
76
77
78if test x"$ax_pbs_ok" = xno; then
79        ax_pbs_ok="yes"
80        AC_CHECK_LIB([torque], [pbs_submit], [:], [ax_pbs_ok="no"])
81        AC_CHECK_LIB([torque], [pbse_to_txt], [:], [ax_pbs_ok="no"])
82        if test x"$ax_pbs_ok" = xyes; then
83                ax_pbs_libs="-ltorque"
84        fi
85else
86        AC_DEFINE(PBS_PROFESSIONAL,[1])
87fi
88
89if test x"$ax_pbs_ok" = xyes; then
90        AC_CHECK_HEADERS([pbs_ifl.h pbs_error.h],[:],[ax_pbs_ok="no"])
91fi
92
93LDFLAGS="$LDFLAGS_save"
94CPPFLAGS="$CPPFLAGS_save"
95
96if test x"$ax_pbs_ok" = xyes; then
97        PBS_LIBS="$ax_pbs_libs"
98        ifelse($1, , :, $1)
99else
100        ifelse($2, , :, $2)
101fi
102])
Note: See TracBrowser for help on using the repository browser.