From 857503f01dc1fcdefa5439fd2292fad59657fc9a Mon Sep 17 00:00:00 2001 From: gstaples Date: Tue, 28 Feb 2006 03:30:24 +0000 Subject: [PATCH] Support new TORQUE pbs-config build system git-svn-id: svn://opensvn.adaptivecomputing.com/maui/trunk@52 3f5042e3-fb1d-0410-be18-d6ca2573e517 --- configure.ac | 46 +++++++++++++++++++++++++------------ include/Makefile.inc.pbs.in | 5 ++-- src/moab/Makefile | 4 ++-- src/server/Makefile | 6 ++--- 4 files changed, 38 insertions(+), 23 deletions(-) diff --git a/configure.ac b/configure.ac index 2e68eca..f47b0ef 100644 --- a/configure.ac +++ b/configure.ac @@ -135,7 +135,11 @@ AC_ARG_WITH(pbs, [PBSTARGETDIR='FALSE']) if test "$PBSTARGETDIR" != 'FALSE'; then if test "$PBSTARGETDIR" = 'yes'; then - PBSTARGETDIR='/usr/local'; + if pbs-config --prefix 1>/dev/null 2>&1;then + PBSTARGETDIR=`pbs-config --prefix` + else + PBSTARGETDIR='/usr/local'; + fi fi if test "$RMTYPE" = ''; then RMTYPE=PBS @@ -297,21 +301,33 @@ fi if test "$RMTYPE" = ''; then - AC_MSG_WARN([Resource Manager not specified - attempting build with pbs]) - RMTYPE=PBS - AC_SUBST(RMTYPE) - AC_SUBST_FILE(rm_config) - rm_config=include/maui.cfg.dist.inc.rm + AC_MSG_WARN([Resource Manager not specified - attempting build with pbs]) + RMTYPE=PBS + AC_SUBST(RMTYPE) + AC_SUBST_FILE(rm_config) + rm_config=include/maui.cfg.dist.inc.rm + + if pbs-config --prefix 1>/dev/null 2>&1;then + PBSTARGETDIR=`pbs-config --prefix` + else + PBSTARGETDIR='/usr/local'; + fi + + if $PBSTARGETDIR/bin/pbs-config --cflags 1>/dev/null 2>&1;then + PBSCFLAGS=`$PBSTARGETDIR/bin/pbs-config --cflags` + else + PBSCFLAGS=-I$PBSTARGETDIR/include + fi + if $PBSTARGETDIR/bin/pbs-config --libs 1>/dev/null 2>&1;then + PBSLDFLAGS=`$PBSTARGETDIR/bin/pbs-config --libs` + else + PBSLDFLAGS="-L$PBSTARGETDIR/lib -lnet -lpbs" + fi + AC_SUBST(PBSCFLAGS) + AC_SUBST(PBSLDFLAGS) + AC_SUBST_FILE(pbs_definitions) + pbs_definitions=include/Makefile.inc.pbs - if test "$OS" = "OSF"; then - PBSLIBS="$PBSTARGETDIR/ilib/libnet.a -lpbs" - else - PBSLIBS="-lnet -lpbs" - fi - AC_SUBST(PBSTARGETDIR) - AC_SUBST(PBSLIBS) - AC_SUBST_FILE(pbs_definitions) - pbs_definitions=include/Makefile.inc.pbs fi diff --git a/include/Makefile.inc.pbs.in b/include/Makefile.inc.pbs.in index a2cc36d..0eee2fe 100644 --- a/include/Makefile.inc.pbs.in +++ b/include/Makefile.inc.pbs.in @@ -1,5 +1,4 @@ # PBS Definitions export PBSDEF = -D__MPBS -export PBSIP = -I@PBSTARGETDIR@/include -export PBSLP = -L@PBSTARGETDIR@/lib -export PBSLIB = @PBSLIBS@ +export PBSCFLAGS = @PBSCFLAGS@ +export PBSLDFLAGS = @PBSLDFLAGS@ diff --git a/src/moab/Makefile b/src/moab/Makefile index fd5c031..08e9fe8 100644 --- a/src/moab/Makefile +++ b/src/moab/Makefile @@ -14,8 +14,8 @@ SCHEDIP=-I$(INC) -I$(MSCHED_HOME)/include SHELL =/bin/sh - LP =-L$(LIB) $(SCHEDLP) $(LLLP) $(PBSLP) $(MXLP) $(REGEXLP) - IP =$(SCHEDIP) $(LLIP) $(PBSIP) $(REGEXIP) $(MXIP) + LP =-L$(LIB) $(SCHEDLP) $(LLLP) $(MXLP) $(REGEXLP) $(PBSLDFLAGS) + IP =$(SCHEDIP) $(LLIP) $(REGEXIP) $(MXIP) $(PBSCFLAGS) INCS =$(INC)moab.h $(INC)msched.h DEFS =-D$(OPSYS) $(LLDEF) $(SDRDEF) $(PBSDEF) $(OSDEF) $(MXDEF) $(REGEXDEF) \ $(SECDEF) $(RMSDEF) $(THREADDEF) diff --git a/src/server/Makefile b/src/server/Makefile index b339f26..f41175b 100644 --- a/src/server/Makefile +++ b/src/server/Makefile @@ -14,8 +14,8 @@ SCHEDIP=-I$(INC) -I$(TOP)/include SHELL =/bin/sh - LP =-L$(LIB) $(SCHEDLP) $(LLLP) $(PBSLP) $(MXLP) $(REGEXLP) - IP =$(SCHEDIP) $(LLIP) $(PBSIP) $(SGEIP) $(REGEXIP) $(MXIP) + LP =-L$(LIB) $(SCHEDLP) $(LLLP) $(MXLP) $(REGEXLP) $(PBSLDFLAGS) + IP =$(SCHEDIP) $(LLIP) $(SGEIP) $(REGEXIP) $(MXIP) $(PBSCFLAGS) INCS =$(INC)moab.h $(INC)msched-proto.h $(INC)msched-common.h DEFS =-D$(OPSYS) $(LLDEF) $(SDRDEF) $(PBSDEF) $(OSDEF) $(MXDEF) \ $(REGEXDEF) $(RMSDEF) $(SECDEF) $(THREADDEF) @@ -26,7 +26,7 @@ COMLIB =mcom MBINS =$(SERVER) mclient mprof LIBS =-l$(SCHEDLIB) -l$(COMLIB) $(THREADLIB) $(MXLIB) $(LLLIB) $(SDRLIB) \ - $(PBSLIB) $(REGEXLIB) $(SECLIB) -lm + $(REGEXLIB) $(SECLIB) -lm MCLIENTS =canceljob changeparam checkjob checknode diagnose releasehold \ releaseres resetstats runjob schedctl sethold setqos setres setspri \