Changeset 216


Ignore:
Timestamp:
04/08/10 15:31:29 (14 years ago)
Author:
bas
Message:

New configure options to determine version and where the libs are installed, borrowed from mpiexec

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.in

    r209 r216  
    55exec_prefix=$(PREFIX)
    66BINDIR=$(PREFIX)/bin
    7 PBSLIB=@pbspath@
    8 
    97
    108DOCDIR=/usr/share/doc/pbs-python
  • trunk/configure

    r177 r216  
    577577PACKAGE_BUGREPORT=
    578578
    579 ac_unique_file="src/pbs.py"
     579ac_unique_file="src/pbs_2.4.py"
    580580ac_subst_vars='SHELL
    581581PATH_SEPARATOR
     
    616616target_alias
    617617pyexecdir
    618 pbspath
     618pbsdir
     619PBSCONFIG
     620pbs_library_dir
     621pbs_version
    619622PYTHON
    620623PYTHON_VERSION
     
    11991202  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
    12001203  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
    1201 
    1202   --with-pbsdir=PATH    directory that contains the torque libraries
     1204  --with-pbsdir=PATH    The torque/pbs install directory
    12031205
    12041206_ACEOF
     
    16261628
    16271629
    1628 
     1630pbsdir_default=''
    16291631
    16301632# Check whether --with-pbsdir was given.
    16311633if test "${with_pbsdir+set}" = set; then
    1632   withval=$with_pbsdir; case "${withval}" in
    1633         *) pbspath="${withval}" ;;
    1634   esac
    1635 else
    1636   pbspath=""
    1637   pbspath=`pbs-config --libs`
    1638 
    1639 fi
     1634  withval=$with_pbsdir; pbsdir=$withval
     1635else
     1636  pbsdir=$pbsdir_default
     1637fi
     1638
     1639
     1640
     1641# Verify the PBS libs are there, but let Makefile handle including them
     1642# on the link line.  First check for modern torque pbs-config program using
     1643# $pbsdir and the rest of PATH, then fall back to looking around for the
     1644# libraries by hand.
     1645# Extract the first word of "pbs-config", so it can be a program name with args.
     1646set dummy pbs-config; ac_word=$2
     1647{ echo "$as_me:$LINENO: checking for $ac_word" >&5
     1648echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
     1649if test "${ac_cv_path_PBSCONFIG+set}" = set; then
     1650  echo $ECHO_N "(cached) $ECHO_C" >&6
     1651else
     1652  case $PBSCONFIG in
     1653  [\\/]* | ?:[\\/]*)
     1654  ac_cv_path_PBSCONFIG="$PBSCONFIG" # Let the user override the test with a path.
     1655  ;;
     1656  *)
     1657  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     1658as_dummy="$pbsdir:$pbsdir/bin:$pbsdir/../bin:$PATH"
     1659for as_dir in $as_dummy
     1660do
     1661  IFS=$as_save_IFS
     1662  test -z "$as_dir" && as_dir=.
     1663  for ac_exec_ext in '' $ac_executable_extensions; do
     1664  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     1665    ac_cv_path_PBSCONFIG="$as_dir/$ac_word$ac_exec_ext"
     1666    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     1667    break 2
     1668  fi
     1669done
     1670done
     1671IFS=$as_save_IFS
     1672
     1673  test -z "$ac_cv_path_PBSCONFIG" && ac_cv_path_PBSCONFIG="none"
     1674  ;;
     1675esac
     1676fi
     1677PBSCONFIG=$ac_cv_path_PBSCONFIG
     1678if test -n "$PBSCONFIG"; then
     1679  { echo "$as_me:$LINENO: result: $PBSCONFIG" >&5
     1680echo "${ECHO_T}$PBSCONFIG" >&6; }
     1681else
     1682  { echo "$as_me:$LINENO: result: no" >&5
     1683echo "${ECHO_T}no" >&6; }
     1684fi
     1685
     1686
     1687if test "$PBSCONFIG" != "none"; then
     1688  pbs_library_dir="`$PBSCONFIG --libs`"
     1689  pbs_version="`$PBSCONFIG --version`"
     1690else
     1691  pbs_library_DIR=""
     1692  pbs_version=""
     1693fi
     1694
     1695
     1696
    16401697
    16411698
     
    24302487target_alias!$target_alias$ac_delim
    24312488pyexecdir!$pyexecdir$ac_delim
    2432 pbspath!$pbspath$ac_delim
     2489pbsdir!$pbsdir$ac_delim
     2490PBSCONFIG!$PBSCONFIG$ac_delim
     2491pbs_library_dir!$pbs_library_dir$ac_delim
     2492pbs_version!$pbs_version$ac_delim
    24332493PYTHON!$PYTHON$ac_delim
    24342494PYTHON_VERSION!$PYTHON_VERSION$ac_delim
     
    24432503_ACEOF
    24442504
    2445   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 49; then
     2505  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 52; then
    24462506    break
    24472507  elif $ac_last_try; then
  • trunk/configure.in

    r177 r216  
    1 AC_INIT(src/pbs.py)
     1AC_INIT(src/pbs_2.4.py)
    22AC_SUBST(prefix)
    33AC_SUBST(exec_prefix)
    44AC_SUBST(pyexecdir)
    5 AC_SUBST(pbspath)
    65
    76
    8 AC_ARG_WITH(pbsdir,
    9 
    10   --with-pbsdir=PATH    directory that contains the torque libraries],
     7pbsdir_default=''
     8AC_ARG_WITH([pbsdir],
     9 [  --with-pbsdir=PATH  The torque/pbs install directory],
     10  pbsdir=$withval, pbsdir=$pbsdir_default)
     11AC_SUBST(pbsdir)
    1112
    12   [case "${withval}" in
    13         *) pbspath="${withval}" ;;
    14   esac],
     13# Verify the PBS libs are there, but let Makefile handle including them
     14# on the link line.  First check for modern torque pbs-config program using
     15# $pbsdir and the rest of PATH, then fall back to looking around for the
     16# libraries by hand.
     17AC_PATH_PROG(PBSCONFIG, pbs-config, none, $pbsdir:$pbsdir/bin:$pbsdir/../bin:$PATH)
     18if test "$PBSCONFIG" != "none"; then
     19  pbs_library_dir="`$PBSCONFIG --libs`"
     20  pbs_version="`$PBSCONFIG --version`"
     21else
     22  pbs_library_DIR=""
     23  pbs_version=""
     24fi
     25AC_SUBST(pbs_library_dir)
     26AC_SUBST(pbs_version)
    1527
    16   [pbspath=""]
    17   [pbspath=`pbs-config --libs`]
    18 )dnl
    1928
    2029AM_PATH_PYTHON
  • trunk/setup.py.in

    r215 r216  
    1313# Try some usefule defaults if not set
    1414#
    15 PBS_LIB_DIR='@pbspath@'
     15PBS_LIB_DIR='@pbs_library_dir@'
    1616NEW_BUILD_SYSTEM=1
    1717
     
    4848### Make symlinks to right torque version
    4949#
     50VERSION = "@pbs_version@"
     51tmp = VERSION.split('.')
     52major_version = '.'.join( tmp[0:2] )
     53
     54
     55
     56os.chdir('src')
     57
     58## Always unlink previous links
     59#
     60try:
     61        os.unlink('pbs.py')
     62        os.unlink('pbs_wrap.c')
     63except OSError:
     64        pass
     65
     66if major_version in [ '2.3', '2.4']:
     67        os.symlink('pbs_wrap_2.4.c', 'pbs_wrap.c')
     68        os.symlink('pbs_2.4.py', 'pbs.py')
     69else:
     70        os.symlink('pbs_wrap_2.1.c', 'pbs_wrap.c')
     71        os.symlink('pbs_2.1.py', 'pbs.py')
     72os.chdir('..')
    5073
    5174setup ( name = 'pbs_python',
Note: See TracChangeset for help on using the changeset viewer.