Skip to main content
summaryrefslogtreecommitdiffstats
blob: 82a550600fad2232ab92b050363e279f228425eb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
dnl
dnl

AC_PREREQ([2.50])

AC_INIT([org.eclipse.ptp.slurm], [2.1])
AC_CONFIG_SRCDIR([src/ptp_slurm_proxy.c])

AM_INIT_AUTOMAKE([-Wall -Werror foreign])

AC_CANONICAL_BUILD

dnl
dnl Eclipse adds version number to end of package when deploying via update site
dnl

UTILS="../../core/org.eclipse.ptp.utils"
if test ! -d $UTILS; then
	UTILS="`echo ${UTILS}_${PACKAGE_VERSION}.*`"
	if test ! -d $UTILS; then
		AC_MSG_ERROR([utils directory not found])
	fi
fi

PROXY="../../core/org.eclipse.ptp.proxy"
if test ! -d $PROXY; then
	PROXY="`echo ${PROXY}_${PACKAGE_VERSION}.*`"
	if test ! -d $PROXY; then
		AC_MSG_ERROR([proxy directory not found])
	fi
fi

dnl SLURM

AC_ARG_WITH([slurm], AS_HELP_STRING([--with-slurm],
	[Specify the top dir of installed SLURM rms.@<:@REQUIRED@:>@]),[],[with_slurm=no])

SLURMDIR=
AS_IF([test "x$with_slurm" != xno],[AC_SUBST([SLURMDIR],[$with_slurm])],
       AC_MSG_ERROR([The top installation directory of SLURM rms must be specified via "--with-slurm=DIR".]))


dnl
dnl Check for programs.
dnl

AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_RANLIB

CFLAGS="$CFLAGS -Wall -I$UTILS/include -I$PROXY/include -I$SLURMDIR/include"
LIBS="$LIBS -L$UTILS -L$PROXY -L$SLURMDIR/lib"
CPPFLAGS="$CPPFLAGS -I$SLURMDIR/include"

dnl
dnl Check for libraries.
dnl

AC_CHECK_LIB([utils], [bitset_new])
AC_CHECK_LIB([proxysvr], [proxy_svr_init])
AC_CHECK_LIB([slurm],[slurm_ping],[],
			[AC_MSG_ERROR([libslurm.so/.a not found. Make sure --with-slurm specify correct dir.])])

dnl
dnl Check for header files.
dnl

AC_HEADER_STDC
AC_CHECK_HEADERS([slurm/slurm.h slurm/slurm_errno.h],[],
				[AC_MSG_ERROR([slurm.h or slurm_errno.h not found])])

dnl
dnl Check for types
dnl
AC_TYPE_SIGNAL

AC_PATH_PROG(SRUN, [srun], no)
if test "$ac_cv_path_SRUN" != no; then
	AC_DEFINE([HAVE_SRUN],[1],[Enable SLURM rms support.])
else
	AC_MSG_ERROR([srun command not found. Make sure SLURM rms installed.])
fi


AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

Back to the top