dnl -*- mode: m4; -*-
dnl
dnl $Id: configure.in,v 2.0 1998/10/14 22:46:06 hender Exp $
dnl
dnl This is an autoconf script.
dnl To rebuild the `configure' script from this, execute the command
dnl     autoconf
dnl in the directory containing this script.  You must have autoconf
dnl version 1.9 or later.
dnl
dnl The following text appears in the resulting `configure' script,
dnl explaining how to rebuild it.
dnl

dnl
dnl "dnl" means delete until new-line to m4
dnl It is m4's comment indicator. When it appears after text in
dnl the line please leave it there, it is meant to prevent dangling
dnl white space
dnl

AC_REQUIRE([AC_INIT_BINSH])dnl

###
### This is a configuration script for PBS, it is generated
### automatically from a configure.in file using the autoconf program.
### It is not necessary to regenerate this script unless you are
### a developer making significant changes to the organization of PBS.
###
### To rebuild this configure script (probably unnecessary) run the command:
###     autoconf
### from within this directory. This script depends on autoconf version
### 2.0 or later.

###
### If you are building the PBS distribution then you should run the
### shell script generated by autoconf in the directory where the
### actual build tree will reside. This is not necessarily the 
### directory containing the source tree. You will probably do
### something like:
###    cd to/my/build/dir
###    /path/of/my/source/dir/configure optional_args
###
### configure should be able to figure things out on its own 
### without any optional arguments. If your directory structure or
### environment is strange configure might fail to find things that
### it needs. You may then want to use the various arguments, including
### the (hopefully) useful:
###    /path/of/my/source/dir/configure --help
###     
### Specifying --help will list all available options for the
### configure script.
###
### Configuration and build system for PBS written
###  by Lonhyn T. Jasinskyj (lonhyn@nas.nasa.gov)
###
### (credit for the inspiration for some of this is due to the work of
###  Martin Buchholz who autoconf'ed XEmacs)
###

AC_INIT(src/cmds/qrun.c)

dnl
dnl  Instead of putting a long list of defines on the command line
dnl  for each compile, use a file called "pbs_config.h" that will
dnl  be created in the include directory.
dnl
AC_CONFIG_HEADER(./src/include/pbs_config.h)

###
### The following progname setting lines are blatantly stolen from XEmacs
### Much of the other code here is inspired by things in the XEmacs 
### configure.in file.
###

### Remove any more than one leading "." element from the path name.
### If we don't remove them, then another "./" will be prepended to
### the file name each time we use config.status, and the program name
### will get larger and larger.  This wouldn't be a problem, except
### that since progname gets recorded in all the Makefiles this script
### produces, move-if-change thinks they're different when they're
### not.
###
### It would be nice if we could put the ./ in a \( \) group and then
### apply the * operator to that, so we remove as many leading ./././'s
### as are present, but some seds (like Ultrix's sed) don't allow you to
### apply * to a \( \) group.  Bleah.
progname="`echo $0 | sed 's:^\./\./:\./:'`"

define([USAGE], [ (echo $progname: Usage error:"; echo " $1";
  echo "  Use \'$progname --help\' for more details") >&2 ; exit 1])

AC_CONFIG_AUX_DIR($srcdir/buildutils)
mach_script=$ac_aux_dir/pbs_mach_type
PBS_MKDIRS=buildutils/pbs_mkdirs
AC_SUBST(PBS_MKDIRS)

AC_CANONICAL_HOST


dnl Remove any more than one leading "." element from the path name.
dnl If we do not remove them, then another "./" will be prepended to
dnl the file name each time we use config.status, and the program name
dnl will get larger and larger.  This would not be a problem, except
dnl that since progname gets recorded in all the Makefiles this script
dnl produces, move-if-change thinks they're different when they're
dnl not.
dnl
dnl It would be nice if we could put the ./ in a \( \) group and then
dnl apply the * operator to that, so we remove as many leading './././'s
dnl as are present, but some seds (like Ultrix's sed) don't allow you to
dnl apply * to a \( \) group.  Bleah.
dnl
dnl (This is stolen verbatim from XEmacs)
dnl
progname="`echo $0 | sed 's:^\./\./:\./:'`"


dnl
dnl Figure out what the name of our machine/OS is.
dnl
guesssys=`echo $progname | sed 's/configure$/buildutils\/config.guess/'`
dnl Guess the configuration and remove 4th name component, if present.
if configuration=`$guesssys | \
  sed '[s/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/]'` ; then
    :
else
  AC_MSG_ERROR(["Failed to guess the system type, fix buildutils/config.guess"])
fi

if canonical=`$srcdir/buildutils/config.sub "$configuration"` ; then : ; else
  AC_MSG_ERROR("config.sub failed on $configuration")
fi




#
# the default is to build all the executables but not the documents
#
PART_DOCS=""
PART_SERVER=server
PART_MOM=mom
PART_CLIENTS=clients

AC_ARG_ENABLE(docs,
[
  --enable-docs           build PBS with documentation. This is off by
                          default since it takes a while to build. Man pages
                          will still be installed, however.],
[case "${enableval}" in
  yes) PART_DOCS=doc ;;
  no)  PART_DOCS="" ;;
  *) AC_MSG_ERROR(--enable-docs cannot take a value.) ;;
esac])dnl


AC_ARG_ENABLE(server,
[
  --enable-server         build/not build the server. Can be used to disable
                          the building of the server. Normally all components
                          (docs, server, mom, clients) are built.],
[case "${enableval}" in
  yes) PART_SERVER=server ;;
  no)  PART_SERVER="" ;;
  *) AC_MSG_ERROR(--enable-server cannot take a value.) ;;
esac])dnl


AC_ARG_ENABLE(mom,
[
  --enable-mom            build/not build the mom.],
[case "${enableval}" in
  yes) PART_MOM=mom ;;
  no)  PART_MOM="" ;;
  *) AC_MSG_ERROR(--enable-mom cannot take a value.) ;;
esac])dnl


AC_ARG_ENABLE(clients,
[
  --enable-clients        build/not build the clients.],
[case "${enableval}" in
  yes) PART_CLIENTS=clients ;;
  no)  PART_CLIENTS="" ;;
  *) AC_MSG_ERROR(--enable-clients cannot take a value.) ;;
esac])dnl

AC_SUBST(PART_DOCS)
AC_SUBST(PART_SERVER)
AC_SUBST(PART_MOM)
AC_SUBST(PART_CLIENTS)

INST_MOM_SUBDIRS=""
INST_SERVER_SUBDIRS=""
INST_CLIENTS_SUBDIRS=""

BLD_MOM_SUBDIRS=""
BLD_SERVER_SUBDIRS=""
BLD_CLIENTS_SUBDIRS=""
BLD_LIB=""

if test -n "$PART_SERVER" ; then
    INST_SERVER_SUBDIRS='$(INST_SERVER_SUBDIRS)'
    BLD_SERVER_SUBDIRS='$(BLD_SERVER_SUBDIRS)'
    BLD_LIBS='$(BLD_LIBS)'
fi

if test -n "$PART_MOM" ; then
    INST_MOM_SUBDIRS='$(INST_MOM_SUBDIRS)'
    BLD_MOM_SUBDIRS='$(BLD_MOM_SUBDIRS)'
    BLD_LIBS='$(BLD_LIBS)'
fi

if test -n "$PART_CLIENTS" ; then
    INST_CLIENTS_SUBDIRS='$(INST_CLIENTS_SUBDIRS)'
    BLD_CLIENTS_SUBDIRS='$(BLD_CLIENTS_SUBDIRS)'
    BLD_LIBS='$(BLD_LIBS)'
fi

AC_SUBST(INST_MOM_SUBDIRS)
AC_SUBST(INST_SERVER_SUBDIRS)
AC_SUBST(INST_CLIENTS_SUBDIRS)

AC_SUBST(BLD_MOM_SUBDIRS)
AC_SUBST(BLD_SERVER_SUBDIRS)
AC_SUBST(BLD_CLIENTS_SUBDIRS)
AC_SUBST(BLD_LIBS)




AC_ARG_WITH(tcl,
[
  --with-tcl=DIR_PREFIX   Use this if you want Tcl support. If you are
                          compiling with tclx then you need only use
                          the --with-tcl flag if the Tcl libraries
                          are in a different place than the tclx 
                          libraries. The prefix given here
                          should be something like \"/usr/local\".],
[tcl_dir="${withval}"], [tcl_dir="no"])dnl


AC_ARG_WITH(tclx,
[
  --with-tclx=DIR_PREFIX  Use this if you want TclX support. This implies
                          --with-tcl. The only time it is useful
                          to give both flags is if TclX and Tcl are
                          in two different places. If no DIR_PREFIX
                          is given then the libraries and includes
                          must be installed in places automatically
                          searched by system tools.],
[tclx_dir="${withval}"], [tclx_dir="no"])dnl


AC_ARG_ENABLE(gui,
[
  --enable-gui            build the xpbs GUI. This is on by default but
                          can be turned off with --disable-gui.],
[case "${enableval}" in
  yes) GUI=gui ;;
  no)  GUI="" ;;
  *) AC_MSG_ERROR(--enable-gui cannot take a value.) ;;
esac],[GUI=gui])dnl
AC_SUBST(GUI)



dnl
dnl  At this point the possible values of tcl_dir and tclx_dir are
dnl  "no", "yes", or a path prefix. "yes" means that "--with-tcl(x)"
dnl  was given without a path prefix. In which case the libraries
dnl  are appended but no "-L" is given
dnl
dnl  Specifying --with-tclx automatically assumes --with-tcl.
dnl
dnl  It is assumed that Tcl and Tk are installed in the same area
dnl  but that Tclx may be somewhere else. That is why there is a
dnl  need for separate flags for Tcl and Tclx but not for Tk.
dnl

TK=0; TCL=0; TCLX=0;

dnl
dnl  TCLX is independent of version tests and can be tested for first
dnl
orig_tclx_dir="$tclx_dir"
if test "$tclx_dir" = yes; then
    AC_CACHE_CHECK([Tclx library path prefix], pbs_cv_tclx_dir, [
        AC_LOCATE_LIB(tclx_dir, tclx*, no)
        pbs_cv_tclx_dir="$tclx_dir"
    ])
fi

if test "$tclx_dir" != no; then
    TCLX=1
fi

dnl
dnl  if no tcl dir was mentioned, it is as good as tclx_dir, which may
dnl  or may not be set to something.
dnl
orig_tcl_dir="$tcl_dir"
test "$tcl_dir" = no && tcl_dir="$tclx_dir"

dnl
dnl  if we were not given a --with-tcl(x) but the GUI is enabled, we will
dnl  need to set tcl_dir to yes and then do the appropriate stuff to
dnl  look in directories that are in PATH for Tcl/Tk stuff.
dnl
test -n "$GUI" -a "$tcl_dir" = no && tcl_dir=yes

if test "$tcl_dir" = yes; then
    AC_CACHE_CHECK([Tcl library path prefix], pbs_cv_tcl_dir, [
        dnl  not quite right here since tcl* can match tclx
        AC_LOCATE_LIB(tcl_dir, tcl*, no)
        pbs_cv_tcl_dir="$tcl_dir"
    ])
    AC_LOCATE_LIB(tcl_dir, tcl*, no)
fi

dnl
dnl  figure out whether we have Tcl and Tk, set TCL and TK accordingly
dnl
if test "$tcl_dir" != no; then
    TCL=1
    TCL_DIR="$tcl_dir"

    dnl 
    dnl  check for the presence of Tk where one might find Tcl.
    dnl  This is all for use with the src/tools stuff.
    dnl
    count=`/bin/ls ${tcl_dir}/lib/libtk* 2> /dev/null | wc -l`
    if test "$count" -gt 0 -a -n "$GUI"; then
	TK=1
    fi
fi

dnl
dnl  It is possible that the user has asked for a gui but no Tk
dnl  libraries were found. In this case we must disable the gui.
dnl
if test -n "$GUI" -a "$TK" -ne 1; then
    AC_MSG_WARN([cannot build GUI without Tk library, GUI disabled])
    GUI=""
fi

dnl
dnl  Figure out the Tcl and Tk versions from the #define statements
dnl  found in tcl.h and tk.h. This is the most reliable way to do
dnl  things since these are the actual .h files that will be included
dnl  by PBS. If they do not match the libs, then that is a problem.
dnl
TCL_VER=""; TK_VER=""

if test "$TCL" -eq 1; then
    tcl_h=/dev/null

    #
    # if we did not find tcl.h in include then look for a subdirectory
    # (for example TCL_DIR/include/tcl8.0/tcl.h)
    #
    for i in $TCL_DIR/include/tcl.h \
      `/bin/ls -d $TCL_DIR/include/tcl*/tcl.h 2> /dev/null`; do
        test -r $i && { tcl_h="$i"; break; }
    done

    AC_CACHE_CHECK([Tcl version], pbs_cv_ver_tcl, [
changequote(, )dnl
        if grep "[ \	]TCL_VERSION[ \	]" $tcl_h > /dev/null 2>&1; then
           pbs_cv_ver_tcl=`sed -n \
               -e 's/.*#define.*TCL_VERSION[^"]*"\([^"]*\).*/\1/p' \
               $tcl_h | tail -1`
changequote([, ])dnl
        else
            pbs_cv_ver_tcl=notfound
    fi])

    TCL_VER="$pbs_cv_ver_tcl"
    test "$TCL_VER" = notfound && \
	AC_MSG_ERROR(cannot find Tcl version in $tcl_h);

    dnl
    dnl  because on certain installations the tcl and tk libs are named
    dnl  with the version number without any dots, we need to try both
    dnl  dotted and dotless and get the one that works.
    dnl
    TCL_LIB_VER="$TCL_VER"
    count=`/bin/ls -d $TCL_DIR/lib/libtcl${TCL_LIB_VER}.* 2> /dev/null | wc -l`
    if test "$count" -lt 1; then
        TCL_LIB_VER=`echo $TCL_LIB_VER | sed -e 's/\.//'`
        count=`/bin/ls $TCL_DIR/lib/libtcl${TCL_LIB_VER}.* | wc -l`
        if test "$count" -lt 1; then
            AC_MSG_ERROR(cannot find a Tcl library for version $TCL_VER)
        fi
    fi
fi


dnl
dnl  If we had a Tk library (i.e. TK = 1) go figure out the version of
dnl  Tk from the include file.
dnl
if test "$TK" -eq 1; then

    dnl
    dnl  if we did not find tk.h in include then look for a subdirectory
    dnl  (for example TCL_DIR/include/tk8.0/tk.h)
    dnl
    tk_h=/dev/null
    for i in $TCL_DIR/include/tk.h \
      `/bin/ls -d $TCL_DIR/include/tk*/tk.h 2> /dev/null`; do
        test -r $i && { tk_h="$i"; break; }
    done

    AC_CACHE_CHECK([Tk version], pbs_cv_ver_tk, [
changequote(, )dnl
        if grep "[ \	]TK_VERSION[ \	]" $tk_h > /dev/null 2>&1; then
           pbs_cv_ver_tk=`sed -n \
               -e 's/.*#define.*TK_VERSION[^"]*"\([^"]*\).*/\1/p' \
               $tk_h | tail -1`
changequote([, ])dnl
        else
            pbs_cv_ver_tk=notfound
    fi])

    TK_VER="$pbs_cv_ver_tk"
    test "$TK_VER" = notfound && \
	AC_MSG_ERROR(cannot find Tk version in $tk_h);

    dnl
    dnl  because on certain installations the tcl and tk libs are named
    dnl  with the version number without any dots, we need to try both
    dnl  dotted and dotless and get the one that works.
    dnl
    TK_LIB_VER="$TK_VER"
    count=`/bin/ls $TCL_DIR/lib/libtk${TK_LIB_VER}.* 2> /dev/null | wc -l`
    if test "$count" -lt 1; then
        TK_LIB_VER=`echo $TK_LIB_VER | sed -e 's/\.//'`
        count=`/bin/ls $TCL_DIR/lib/libtk${TK_LIB_VER}.* | wc -l`
        if test "$count" -lt 1; then
            AC_MSG_ERROR(cannot find a Tk library for version $TK_VER)
        fi
    fi
fi



dnl
dnl  Now that we know what the versions are and which components are used 
dnl  assemble appropriate compiler flags for includes and linking.
dnl
TCL_LIBS=""; TCL_INCS=""

if test "$TCLX" -eq 1; then

    dnl
    dnl  Tclx things should go first since it is built on top of Tcl
    dnl
    TCLX_DIR="$tclx_dir"
    TCL_LIBS=$TCL_LIBS' -L$(TCLX_DIR)/lib'
    TCL_INCS=$TCL_INCS' -I$(TCLX_DIR)/include'
    TCL_LIBS=$TCL_LIBS' -ltclx -ltkx'
fi

if test "$TCL" -eq 1; then
    TCL_DIR="$tcl_dir"

    dnl
    dnl  It is likely that if we are using Tcl and Tclx they
    dnl  are installed in the same area but they may not be.
    dnl  If they are not then we need to look in both places.
    dnl
    if test "$tcl_dir" != "$tclx_dir"; then
        TCL_LIBS=$TCL_LIBS' -L$(TCL_DIR)/lib'
    fi

    dnl
    dnl  Look for the Tcl include file in a directory that includes
    dnl  the Tcl version (this happens under some installations)
    dnl  (since symlinks are illegal under POSIX use ls instead of test)
    dnl
    count=`/bin/ls -d ${tcl_dir}/include/tcl${TCL_VER} 2> /dev/null | wc -l`
    if test "$count" -gt 0; then
        TCL_INCS=$TCL_INCS' -I$(TCL_DIR)/include/tcl$(TCL_VER)'
    fi

    dnl
    dnl  Look for the Tk include file in a directory that includes
    dnl  the Tk version (this happens under some installations)
    dnl
    count=`/bin/ls -d ${tcl_dir}/include/tk${TK_VER} 2> /dev/null | wc -l`
    if test "$count" -gt 0; then
        TCL_INCS=$TCL_INCS' -I$(TCL_DIR)/include/tk$(TK_VER)'
    fi

    dnl
    dnl  Look for the Tcl and Tk include files without version names.
    dnl  This is often the case.
    dnl
    count=`/bin/ls -d ${tcl_dir}/include/tcl.h ${tcl_dir}/include/tk.h 2> /dev/null | wc -l`
    if test "$count" -gt 0; then
        TCL_INCS=$TCL_INCS' -I$(TCL_DIR)/include'
    fi

    dnl
    dnl  Now arrange the Tcl and Tk libraries in a pleasing order 
    dnl  (i.e. Tk, then Tcl, then X stuff)
    dnl
    if test "$TK" -eq 1; then
        TCL_INCS=$TCL_INCS' $(X11INC)'
        TCL_LIBS=$TCL_LIBS' $(LIBTK)'
    fi
    TCL_LIBS=$TCL_LIBS' $(LIBTCL)'
    if test "$TK" -eq 1; then
        TCL_LIBS=$TCL_LIBS' $(X11LIB) -lX11'
    fi
fi

test "$tclx_dir" = no -a "$orig_tclx_dir" != no &&
    AC_MSG_ERROR(could not find the Tclx library);

test "$tcl_dir" = no -a \
    \( "$orig_tcl_dir" != no -o "$orig_tclx_dir" != no \) &&
    AC_MSG_ERROR(could not find the Tcl library);


AC_SUBST(TCL_VER)
AC_SUBST(TK_VER)
AC_SUBST(TCL_LIB_VER)
AC_SUBST(TK_LIB_VER)



dnl
dnl  For the src/tools directory, a number of things depend on the
dnl  presence of Tcl and Tk.
dnl
TOOLS_OBJS=""
TOOLS_TARGETS=""
if test "$TCL" -eq 1; then
    TOOLS_OBJS=$TOOLS_OBJS' $(OBJS_TCLTK) $(OBJS_TCL)'
    TOOLS_TARGETS=$TOOLS_TARGETS' pbs_tclsh'
    if test "$TK" -eq 1; then
        TOOLS_OBJS=$TOOLS_OBJS' $(OBJS_TK)'
        TOOLS_TARGETS=$TOOLS_TARGETS' pbs_wish'
    fi
fi

AC_SUBST(TOOLS_OBJS)
AC_SUBST(TOOLS_TARGETS)

dnl
dnl  Find the path for tclsh and wish, needed by the xpbs and xpbsmon GUI
dnl
TCLSH_PATH=""; WISH_PATH=""

if test "$TCL" -eq 1 ; then
    # a loose symlink would be bad here
    AC_CACHE_CHECK([for tclsh], pbs_cv_path_tclsh, [
        pbs_cv_path_tclsh=notfound
        tsh="$tcl_dir/bin/tclsh"
        for i in "${tsh}${TCL_VER}" "${tsh}"; do
            #
            # here we need a way to determine if $i is an executable
            # file. Under POSIX this means that the execute bit
            # is set. The following test is not perfect but is
            # good enough. Symlinks do not exist under POSIX.
            # 
            test -x "$i" -a \! -d "$i" && { pbs_cv_path_tclsh="$i"; break; }
        done
    ])

    test "$pbs_cv_path_tclsh" = notfound &&
        AC_MSG_ERROR(cannot find tclsh in $tcl_dir/bin);

    TCLSH_PATH="$pbs_cv_path_tclsh"
fi


if test "$TK" -eq 1 ; then

    # a loose symbolic link will screw us here
    AC_CACHE_CHECK([for wish], pbs_cv_path_wish, [
        pbs_cv_path_wish=notfound
        wsh="$tcl_dir/bin/wish"
        for i in "${wsh}${TK_VER}" "${wsh}"; do
            test -x "$i" -a \! -d "$i" && { pbs_cv_path_wish="$i"; break; }
        done
    ])

    test "$pbs_cv_path_wish" = notfound &&
        AC_MSG_ERROR(cannot find wish in $tcl_dir/bin);

    WISH_PATH="$pbs_cv_path_wish"
fi

AC_SUBST(TCLSH_PATH)
AC_SUBST(WISH_PATH)



AC_DEFINE_UNQUOTED(TCL, ${TCL})
AC_SUBST(TCL)

AC_DEFINE_UNQUOTED(TCLX, ${TCLX})
AC_SUBST(TCLX)

AC_SUBST(TCL_DIR)
AC_SUBST(TCLX_DIR)

dnl
dnl  The TCL_LIBS variable contains all Tcl related libraries, including
dnl  the tclx library. The same applies to TCL_INCS.
dnl
AC_SUBST(TCL_LIBS)
AC_SUBST(TCL_INCS)



dnl
dnl  If X11 is not in /usr then go and try to find it.
dnl  sometimes the include and lib stuff are in non-corresponding
dnl  places, thus we do them separately
dnl
X11LIB=""
X11INC=""

if test \! -d /usr/include/X11; then
    if test -n "$with_x11" ; then
        X11INC="-I$with_x11"
    else
        for d in /usr/X11R6 /usr/local /usr/X11R5 ; do
            if test -d "$d/include/X11"; then
                X11INC="-I$d/include"
                break
            fi
        done
    fi
fi

count=`/bin/ls /usr/lib/libX11* 2> /dev/null | wc -l`
if test "$count" -eq 0 ; then
    if test -n "$with_x11" ; then
        X11LIB="-L$with_x11"
    else
        for d in /usr/X11R6 /usr/local /usr/X11R5 ; do
	    count=`/bin/ls $d/lib/libX11* 2> /dev/null | wc -l`
	    if test "$count" -gt 0 ; then
                X11LIB="-L$d/lib"
                break
	    fi
        done
    fi
fi
AC_SUBST(X11INC)
AC_SUBST(X11LIB)





dnl
dnl  Whether the user has explicitly used --set-cc AND given it a value.
dnl
user_set_cc_val=no

AC_ARG_SET(cc,
[
  --set-cc=ccprog         set the compiler to use. This will be used to set
                          the CC variable and will override any CC setting
                          in the environment. If only \"--set-cc\" is given
                          then CC will be set to \"cc\".],
[CC="${setval}"; user_set_cc_val=yes], )dnl
test "$CC" = yes && { CC=cc; user_set_cc_val=no; }


AC_ARG_SET(cflags,
[
  --set-cflags=flags      set the compiler flags. This will be used to set
                          the CFLAGS variable. If only \"--set-flags\" is given
                          then CFLAGS will be set to \"\". Normally the flag
                          settings are guessed by configure to be those
                          appropriate for the architecture, compiler,
                          and PBS machine type.],
[cflags="${setval}"], [cflags="not_set"])dnl
test "$cflags" = yes && cflags=""


AC_ARG_ENABLE(debug,
[
  --enable-debug          turn on the DEBUG flag. Off by default.])

if test "${enable_debug}" = "yes" ; then
    AC_DEFINE(DEBUG)
fi



AC_ARG_SET(tmpdir,
[
  --set-tmpdir=DIR        set the tmp directory that pbs_mom will use.
                          This will default to \"/tmp\".],
[TMP_DIR="${setval}"], [TMP_DIR="/tmp"])dnl
test "$TMP_DIR" = yes && TMP_DIR="/tmp"
AC_DEFINE_UNQUOTED(TMP_DIR, "${TMP_DIR}")




AC_ARG_SET(server_home,
[
  --set-server-home=DIR  set the server home/spool directory for PBS use
                          this will default to /usr/spool/PBS if unspecified],
[pbs_server_home="${setval}"], [pbs_server_home="/usr/spool/PBS"])dnl

case "${pbs_server_home}" in
  /*)     AC_DEFINE_UNQUOTED(PBS_SERVER_HOME, "${pbs_server_home}") ;;
  *)      AC_MSG_ERROR(--with-server-home=DIR must be given an absolute path) ;;
esac
PBS_SERVER_HOME="${pbs_server_home}"


AC_ARG_SET(server_name_file,
[
  --set-server-name-file=FILE
                          set the file that will contain the name of
                          the default server for clients to use. If this
                          is not an absolute pathname, it will be evaluated
                          relative to the server home directory that either
                          defaults to /usr/spool/PBS or is set using
                          the --set-server-home option to configure. If this
                          option is not specified, the default name for
                          this file will be set to \"server_name\".],
[PBS_DEFAULT_FILE="${setval}"], [PBS_DEFAULT_FILE="server_name"])dnl

case "${PBS_DEFAULT_FILE}" in
  /*)     PBS_DEFAULT_FILE="${PBS_DEFAULT_FILE}" ;;
  *)      PBS_DEFAULT_FILE="${pbs_server_home}/${PBS_DEFAULT_FILE}" ;;
esac
AC_DEFINE_UNQUOTED(PBS_DEFAULT_FILE, "${PBS_DEFAULT_FILE}")



AC_ARG_SET(default_server,
[
  --set-default-server=HOSTNAME
                          set the name of the computer that clients will
                          access when no machine name is specified as part
                          of the queue name. It defaults to the hostname
                          of the machine on which PBS is being compiled.],
[PBS_DEFAULT_SERVER="${setval}"], [PBS_DEFAULT_SERVER="`uname -n`"])dnl


AC_ARG_SET(environ,
[
  --set-environ=PATH      set the path containing the environment variables
                          for the daemons.  For SP2 and AIX systems,
                          suggest setting to /etc/environment. Defaults
                          to the file "pbs_environment" in the server-home.
                          Relative paths are interpreted within the context
                          of the server-home.],
[pbs_environ="${setval}"], [pbs_environ="no"])dnl

case "${pbs_environ}" in
  yes) AC_MSG_ERROR(--with-environ=PATH must be given a path) ;;
  no)  AC_DEFINE_UNQUOTED(PBS_ENVIRON, "${pbs_server_home}/pbs_environment") ;;
  /*)  AC_DEFINE_UNQUOTED(PBS_ENVIRON, "${pbs_environ}") ;;
  *)   AC_DEFINE_UNQUOTED(PBS_ENVIRON, "${pbs_server_home}/${pbs_environ}") ;;
esac




AC_ARG_ENABLE(plock_daemons,
[
  --enable-plock-daemons  enable daemons to lock themselves into memory:
                          logical-or of 1 for pbs_server, 2 for pbs_scheduler,
                          4 for pbs_mom. (e.g. set to 7 for all three)],
[case "${enableval}" in
  yes) PLOCK_DAEMONS=7 ;;
  no)  PLOCK_DAEMONS=0 ;;
  *) PLOCK_DAEMONS="${enableval}" ;;
esac],[PLOCK_DAEMONS=0])dnl



AC_ARG_ENABLE(syslog,
[
  --enable-syslog         enable the use of syslog for error reporting])

if test "${enable_syslog}" = "yes" ; then
    AC_DEFINE(SYSLOG, 1)
fi


AC_ARG_SET(sched,
[
  --set-sched=TYPE        sets the scheduler type. If TYPE is
                          \"c\" the scheduler will be written in C
                          \"tcl\" the server will use a Tcl based scheduler
                          \"basl\" will use the rule based scheduler
                          \"no\" then their will be no scheduling done
                          (the \"c\" scheduler is the default)],
[case "${setval}" in
  c*|C*)        SCHD_TYPE=cc ;;
  tcl|Tcl)      SCHD_TYPE=tcl ;;
  basl|BASL)    SCHD_TYPE=basl ;;
  *)            SCHD_TYPE=none ;;
esac],[SCHD_TYPE=cc])dnl


AC_ARG_SET(sched_code,
[
  --set-sched-code=PATH
                          sets the name of the file or directory where
                          the code for the scheduler is to be found.
                          This only applies to BASL schedulers and those
                          written in the C language. For C schedulers
                          this should be a directory name and for BASL
                          schedulers a filename ending in \".basl\". If the
                          path given is not absolute, it will be interpreted
                          relative to srctree/src/schedulers.SCHD_TYPE/samples.
                          As an example, an appropriate BASL scheduler
                          realtive path would be \"nas.basl\". The default
                          scheduler code for \"C\" schedulers is \"fifo\".],
[if test "${SCHD_TYPE}" = "cc" -o "${SCHD_TYPE}" = "basl"; then
  case "${setval}" in
    /*)       SCHD_SRC="${setval}"; SCHD_OBJ="${setval}" ;;
    *)        SCHD_SRC='${top_srcdir}/src/scheduler.'${SCHD_TYPE}/samples/${setval}
              SCHD_BUILD='${top_builddir}/src/scheduler.'${SCHD_TYPE}/samples/${setval} ;;
  esac
else
  AC_MSG_ERROR(--set-sched-code was set but sched-type was not \"c\" or \"basl\".)
fi],[SCHD_SRC=none; SCHD_BUILD=none])dnl


dnl
dnl  if the scheduler is the C scheduler then the default code is samples/fifo
dnl
if test "$SCHD_SRC" = none -a "$SCHD_SRC" = none -a "$SCHD_TYPE" = cc; then
    SCHD_SRC='${top_srcdir}/src/scheduler.cc/samples/fifo'
    SCHD_BUILD='${top_builddir}/src/scheduler.cc/samples/fifo'
fi


if test \( "${SCHD_TYPE}" = "cc" -o "${SCHD_TYPE}" = "basl" \) -a "${SCHD_SRC}" = "none"; then
  AC_MSG_ERROR(Must specify --set-sched-code for C and BASL schedulers.])
fi

SCHD_CODE_SUBDIR=""
if test "${SCHD_TYPE}" != none; then
  SCHD_CODE_SUBDIR=scheduler.${SCHD_TYPE}
fi
AC_SUBST(SCHD_CODE_SUBDIR)

AC_ARG_SET(tclatrsep,
[
  --set-tclatrsep=CHAR	set the Tcl attribute separator character
			this will default to \".\" if unspecified],
[tcl_atrsep="${setval}"], [tcl_atrsep="."])dnl
AC_DEFINE_UNQUOTED(TCL_ATRSEP, "${tcl_atrsep}")

AC_ARG_SET(qstatrc-file,
[
  --set-qstatrc-file=FILE
                          set the name of the file that qstat will use
                          if there is no \".qstatrc\" file in the directory
                          where it is being invoked.
                          Relative path names will be evaluated 
                          relative to the server home directory that either
                          defaults to /usr/spool/PBS or is set using
                          the --set-server-home option to configure. If this
                          option is not specified, the default name for
                          this file will be set to \"qstatrc\" (no dot)
                          in the server home directory.],
[case "${setval}" in
  /*)       QSTATRC_PATH="${setval}" ;;
  *)        QSTATRC_PATH="${pbs_server_home}/${setval}" ;;
esac],[QSTATRC_PATH="${pbs_server_home}/qstatrc"])dnl

dnl
dnl Add QSTATRC_PATH to the DEFS list. There is no need to do any 
dnl substitutions since the only place this is used is as a #define
dnl referenced in qstat.c
dnl
AC_DEFINE_UNQUOTED(QSTATRC_PATH, "${QSTATRC_PATH}")


dnl
dnl Declare if scp is to be used for file delivery
dnl The default is pbs_rcp (in mom_rcp) which is Berkley's rcp
dnl We know it always returns a non-zero exit status for any error.
dnl If scp is to be used and it fails, PBS falls back to rcp.
dnl
AC_ARG_WITH(scp,
[
  --with-scp	use scp program to perform file delivery],
[
AC_PATH_PROG(SCP_PATH, "scp", "error")
case "${SCP_PATH}" in
  error) AC_MSG_ERROR(--with-scp scp not found in path) ;;
  *)     AC_DEFINE_UNQUOTED(SCP_PATH, "${SCP_PATH}") ;;
esac])




AC_ARG_ENABLE(shell_pipe,
[
  --enable-shell-pipe     enable this if you want to have the job script 
                          name passed to the shell via a pipe. The default
                          (enabled) behavior is to pass the script on a pipe],
[case "${enableval}" in
  yes) SHELL_INVOKE=1 ;;
  no)  SHELL_INVOKE=0 ;;
  *)   SHELL_INVOKE=0 ;;
esac],[SHELL_INVOKE=1])dnl



#
# run the script in the aux dir to figure out what PBS "machine type" we are on
#
AC_CACHE_CHECK([PBS machine type], pbs_cv_type_mach, [
    pbs_cv_type_mach=`$mach_script`
])
PBS_MACH=$pbs_cv_type_mach
if test "$PBS_MACH" = unknown; then
    AC_MSG_ERROR(Machine type \"$PBS_MACH\" is not supported.)
fi

dnl
dnl  this defines the name of a .c file which is then included in another
dnl  resc_def_all.c
dnl
AC_DEFINE_UNQUOTED(MACH_RESC_DEFS, "resc_def_${PBS_MACH}.c")


MOMLIBS=""
AC_ARG_ENABLE(sp2,

[
  --enable-sp2            setting this informs PBS that it is being
                          built for an SP2.])

if test "${enable_sp2}" = "yes" ; then
    MOMLIBS="-ljm_client -lSDR"
    case "${PBS_MACH}" in
      aix*) AC_DEFINE(IBM_SP2)
            ;;
      *) AC_MSG_ERROR(Cannot --enable-sp2 on a machine not running AIX) ;;
    esac
fi


AC_DEFINE(NEEDNODES, 0)

AC_ARG_ENABLE(tcl-qstat,
[
  --enable-tcl-qstat      setting this builds qstat with Tcl interpreter
                          features. This is normally disabled and is only
                          valid if --with-tcl(x) is already present.])

EXTRA_QSTAT_LIBS=""
if test "${enable_tcl_qstat}" = "yes"; then
    if test "$TCL" -eq 1 ; then
        AC_DEFINE(TCL_QSTAT)
        EXTRA_QSTAT_LIBS='$(EXTRA_QSTAT_LIBS)'
    else
        AC_MSG_ERROR(Cannot enable tcl-qstat without also using \"--with-tcl\(x\)\")
    fi
fi
AC_SUBST(EXTRA_QSTAT_LIBS)



dnl
dnl  irix6 can be changed to irix6array explicitly with an
dnl  --enable-array and irix6array can be made into irix6 with a
dnl  --disable-array.
dnl

AC_ARG_ENABLE(array,
[
  --enable-array          setting this under IRIX enables the SGI Origin 2000
                          parallel support. Normally autodetected from
                          the /etc/config/array file.],
[
    if test "$PBS_MACH" = irix6; then
        if test "$enableval" = yes; then
            AC_MSG_WARN(No array daemon detected but enable-array overrides.)
            PBS_MACH=irix6array
        fi
    elif test "$PBS_MACH" = irix6array; then
        if test "$enableval" = no; then
            AC_MSG_WARN(Array daemon detected but disable-array overrides.)
            PBS_MACH=irix6
        fi
    else
        AC_MSG_ERROR(Cannot use \"--en/disable-array\" unless configuring for IRIX 6.x or above)
    fi
])

if test "$PBS_MACH" = irix6array; then
    MOMLIBS="-larray"
fi


AC_ARG_ENABLE(SRFS,
[
  --enable-srfs           on the Crays you can enable support of SRFS
                          This is disabled by default])

if test "${enable_srfs}" = "yes" ; then
    AC_DEFINE(SRFS, 1)
else
    AC_DEFINE(SRFS, 0)
fi


AC_ARG_ENABLE(DEPEND_CACHE,
[
  --enable-depend-cache   this turns on the ability to cache makedepend
                          information across runs of configure. This can
                          be bad if the user makes certain configuration
                          changes in rerunning configure but it can save
                          significant amounts of time in the hands of
                          experienced developers. Changing the contents
                          of Makefile.in will flush the cache in that
                          directory.
                          This is disabled by default])

if test "${enable_depend_cache}" = "yes" ; then
    DEPEND_CACHE='-c $(srcdir)/Makefile.in'
else
    DEPEND_CACHE=""
fi
AC_SUBST(DEPEND_CACHE)


dnl
dnl find sendmail and add it to defs
dnl
sendmail_maybe_in="/usr/lib:/usr/sbin:/usr/bin:/etc:/usr/etc"
AC_PATH_PROGS(SENDMAIL_CMD, sendmail,
   AC_MSG_ERROR(could not find the sendmail executable), ${sendmail_maybe_in})
AC_DEFINE_UNQUOTED(SENDMAIL_CMD, "${SENDMAIL_CMD}")


dnl
dnl defines caused by user configurable flags
dnl
AC_DEFINE_UNQUOTED(NO_ASN1, ${NO_ASN1})
AC_DEFINE_UNQUOTED(PLOCK_DAEMONS, ${PLOCK_DAEMONS})
AC_DEFINE_UNQUOTED(SCHD_TYPE, "${SCHD_TYPE}")
AC_DEFINE_UNQUOTED(SHELL_INVOKE, ${SHELL_INVOKE})

dnl Checks for programs.
AC_PROG_LEX
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_PROG_YACC

dnl
dnl  Give up on trying to figure out which OS has a good install program
dnl  and which doesn't. It seems a small price to pay for portability
dnl  to use the supplied slow install-sh script.
dnl
AC_USE_INSTALL_SH

dnl
dnl  Check for troff and its family. Prefer groff because we know 
dnl  its fonts whereas various troffs name their fonts differently.
dnl  (e.g. CO vs C)
dnl
AC_CHECK_PROGS(TBL, gtbl tbl, exit)
AC_CHECK_PROGS(PIC, gpic pic, exit)
AC_CHECK_PROGS(ROFF, groff troff, exit)

dnl
dnl  groff requires a compatibility (-C) flag
dnl  (but this seems to be problematic with the ms macros not working
dnl  in compatibility mode. Things are not quite right in regular mode
dnl  so the real solution would be to fix the groff ms macros and the
dnl  document, or to use a different macro package.)
dnl
# test "$ROFF" = groff && ROFF="$ROFF -C"


dnl
dnl  See if make (or whatever $MAKE is set to) understands some
dnl  POSIX constructs such as the initial plus sign and the .POSIX: target
dnl
AC_PROG_MAKE_POSIX_TARGET
AC_PROG_MAKE_POSIX_PLUS


dnl
dnl  save the values of CFLAGS because otherwise AC_PROG_CC will
dnl  set it. Later on we will set our own value since we can
dnl  do a better job. It is possible that the user set it on
dnl  the command line.
dnl
test "$cflags" = not_set || CFLAGS="$cflags"
pbs_save_CFLAGS="$CFLAGS"
AC_PROG_CC
CFLAGS="$pbs_save_CFLAGS"

dnl
dnl  Now for some gore...
dnl  Massage the CFLAGS on a per-machine basis, this must happen after
dnl    the call to AC_PROG_CC. AC_PROG_CC sets various things such as
dnl    GCC and CC.
dnl
if test -z "$CFLAGS"; then
  dnl
  dnl  Following values of CFLAGS are known to work well.
  dnl
  if   test "$GCC" = "yes"; then
    CFLAGS="-g -O2"
  elif test "$CC" = "xlc"; then
    CFLAGS="-O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
  else
    case "$canonical" in
      *-*-irix*) CFLAGS='-O -Wl,-woff,84' ;;
      *-*-hpux*) CFLAGS='-Ae' ;;
      *)	 CFLAGS="-O" ;; dnl The only POSIX-approved flag
    esac
  fi
fi


dnl
dnl  Support for checkpointing, note that under IRIX at this time
dnl  it seems that you must be compiling with the -64 flag to
dnl  get the cpr libraries on O2000s
dnl
MOM_CHECKPOINT=0
case "$PBS_MACH" in
    unicos*) MOM_CHECKPOINT=1 ;;
    irix6*)  AC_CHECK_LIB(cpr, atcheckpoint, [MOM_CHECKPOINT=1])
	     if test "$MOM_CHECKPOINT" = 1 ; then
		MOMLIBS="$MOMLIBS -lcpr"
		#
		# if we are using plain cc then under irix6array
		# make it cc -64 unless the user has explicitly asked for cc
		#
		test "$CC" = cc -a "$user_set_cc_val" = no && {
		   AC_MSG_WARN(Automatically setting CC='cc -64' under irix6.)
		   CC='cc -64'
		}
	      fi ;;
esac
AC_DEFINE_UNQUOTED(MOM_CHECKPOINT, ${MOM_CHECKPOINT})


dnl
dnl  Support for additional files in the resmom, machine-specific
dnl  directories.
dnl
MOM_ADDTL_OBJS=""
case "$PBS_MACH" in
    unicosmk*)  MOM_ADDTL_OBJS="wait_job.o" ;;
esac
AC_SUBST(MOM_ADDTL_OBJS)


dnl
dnl  Check the sizes of various types for DIS
dnl  The cross-compiling sizes are there to shut autoconf up
dnl  and are chosen to all be different so that dis.h uses
dnl  specific routines for each type instead of substituting in the
dnl  unlikely (and unsupported) event of cross-compilation.
dnl
AC_CHECK_SIZEOF(int, 20)
AC_CHECK_SIZEOF(long, 21)
AC_CHECK_SIZEOF(float, 22)
AC_CHECK_SIZEOF(double, 23)
AC_CHECK_SIZEOF(long double, 24)
AC_CHECK_SIZEOF(short, 25)
AC_CHECK_SIZEOF(unsigned, 26)
AC_CHECK_SIZEOF(unsigned int, 27)
AC_CHECK_SIZEOF(unsigned short, 28)
AC_CHECK_SIZEOF(unsigned char, 29)
AC_CHECK_SIZEOF(unsigned long, 30)
AC_CHECK_SIZEOF(signed char, 31)
AC_C_CHAR_UNSIGNED

dnl  under some OSs h_errno is not visible
AC_DECL_H_ERRNO

dnl  see if we need to include sys/select.h to get FD_SET and friends
AC_DECL_FD_SET_SYS_SELECT_H

dnl  under HP-UX seteuid does not exist, look for setresuid instead
AC_FUNC_SETRESUID

dnl
dnl  Checks for libraries.
dnl

#
# nsl is needed on some systems but duplicates libc.a on others (O2000s)
#
AC_CHECK_LIB(c, xdr_int, :, AC_CHECK_LIB(nsl, xdr_int))
AC_CHECK_LIB(c, ruserok, :, AC_CHECK_LIB(socket, ruserok))
AC_CHECK_LIB(c, nlist, :, AC_CHECK_LIB(elf, nlist))
AC_CHECK_LIB(kvm, kvm_open)

dnl
dnl  The dynamic loader interface library needed by Tcl under Linux
dnl
AC_CHECK_LIB(dl, dlopen)

dnl
dnl  Checks for headers
dnl

# if sys/ioctl.h exists then define a symbol
AC_CHECK_HEADER(sys/ioctl.h, [AC_DEFINE(HAVE_SYS_IOCTL_H)])


dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL

dnl
dnl see if atexit() exists, if not check for on_exit(), if that fails, panic
dnl
AC_CHECK_FUNCS(atexit on_exit, [ { found_an_exit=yes; break; } ])
if test "$found_an_exit" != yes; then
    AC_MSG_ERROR(Must have atexit() or on_exit() in libc (used in Libnet/rpp.c))
fi

dnl
dnl Take the host_os and break it back into a leading text part calling
dnl it the pbs_os_type and a trailing part composed of an initial digit
dnl calling that the pbs_os_version
dnl
changequote(, )dnl
pbs_os_type=`echo ${host_os} | sed 's/[[0-9]].*//' | tr "A-Z" "a-z"`
pbs_os_version=`echo ${host_os} | sed 's/^'${pbs_os_type}'//' | tr "A-Z" "a-z"`
changequote([, ])dnl

dnl
dnl other substritutions and inclusions to be performed on Makefiles
dnl
AC_SUBST(mkinclude_subdir)
mkinclude_subdir=buildutils/mkincludes
AC_SUBST(host)
AC_SUBST(host_os)
AC_SUBST(pbs_os_version)
AC_SUBST(pbs_os_type)
AC_SUBST(NO_ASN1)dnl    needed within makefiles, not only in #defines
AC_SUBST(SCHD_TYPE)dnl    needed within makefiles, not only in #defines
AC_SUBST(SCHD_SRC)dnl    needed within makefiles, not in #defines
AC_SUBST(SCHD_BUILD)dnl    needed within makefiles, not in #defines
AC_SUBST(PBS_DEFAULT_FILE)dnl    needed within makefiles, not only in #defines
AC_SUBST(PBS_DEFAULT_SERVER)dnl    needed within makefiles, not in #defines
AC_SUBST(PBS_SERVER_HOME)dnl    needed within pbs_mkdirs
AC_SUBST(MOMLIBS)

AC_SUBST(PBS_MACH)
AC_DEFINE_UNQUOTED(PBS_MACH, "${PBS_MACH}")

fundef=undef
AC_SUBST(fundef)

dnl
dnl do not expand top_srcdir in depend at the moment
dnl
DEPEND='${top_srcdir}/buildutils/makedepend-sh'
AC_SUBST(DEPEND)

dnl
dnl  Always use iff2 for now
dnl
IFF_FILE='iff2'
AC_SUBST(IFF_FILE)


dnl
dnl  Here is one way to do includes in Makefiles, although rather primitive
dnl  We must take care to use the mkincludes directory in the build
dnl  tree and not the src tree.
dnl
mkinclude_dir=./buildutils/mkincludes

mk_cleanup=${mkinclude_dir}/cleanup.mk
mk_dirs=${mkinclude_dir}/dirs.mk
mk_docplan=${mkinclude_dir}/docplan.mk
mk_lib=${mkinclude_dir}/lib.mk
mk_head=${mkinclude_dir}/head.mk
mk_tail=${mkinclude_dir}/tail.mk
mk_tcl=${mkinclude_dir}/tcl.mk
posix_rules=${mkinclude_dir}/posix_rules

AC_SUBST_FILE(mk_cleanup)dnl
AC_SUBST_FILE(mk_dirs)dnl
AC_SUBST_FILE(mk_docplan)dnl
AC_SUBST_FILE(mk_lib)dnl
AC_SUBST_FILE(mk_head)dnl
AC_SUBST_FILE(mk_tail)dnl
AC_SUBST_FILE(mk_tcl)dnl
AC_SUBST_FILE(posix_rules)dnl


# needed for makedepend
MAKERULES="\$(top_srcdir)/$posix_rules"
AC_SUBST(MAKERULES)


dnl
dnl for the C-90
dnl
AC_DEFINE(SRFS, 0)

dnl
dnl  PBS_PUSH_STREAM is used in resmom/mom_inter.c
dnl
if test "$pbs_os_type" = "solaris" ; then
    AC_DEFINE(PBS_PUSH_STREAM)
fi


dnl
dnl This is the list of all files that need treatment as makefiles
dnl These files will have things with @...@ constructs substituted
dnl and new files without the .in suffix will be created
dnl
pbs_makefile_list="

    buildutils/pbs_mkdirs
    buildutils/mkincludes/cleanup.mk
    buildutils/mkincludes/dirs.mk
    buildutils/mkincludes/docplan.mk
    buildutils/mkincludes/lib.mk
    buildutils/mkincludes/head.mk
    buildutils/mkincludes/tail.mk
    buildutils/mkincludes/tcl.mk
    buildutils/Makefile

    ./Makefile
    src/Makefile
    src/server/Makefile
    src/include/Makefile
    src/iff/Makefile
    src/scheduler.tcl/Makefile
    src/tools/Makefile
    src/tools/xpbsmon/Makefile
    src/lib/Makefile
    src/gui/Makefile
    src/gui/Ccode/Makefile
    src/cmds/Makefile
    src/scheduler.basl/Makefile
    src/scheduler.cc/Makefile
    src/scheduler.cc/samples/do_not_delete
    src/scheduler.cc/samples/fifo/Makefile
    src/scheduler.cc/samples/mtask.o2/Makefile
    src/resmom/Makefile
    src/mom_rcp/Makefile
    src/lib/Libattr/Makefile
    src/lib/Libcmds/Makefile
    src/lib/Libpbs/Makefile
    src/lib/Libdis/Makefile
    src/lib/Libifl/Makefile
    src/lib/Liblog/Makefile
    src/lib/Libnet/Makefile
    src/lib/Libsite/Makefile
    doc/Makefile
    doc/test_plan/Makefile
    doc/project_plan/Makefile
    doc/ids/Makefile
    doc/requirement_spec/Makefile
    doc/admin/Makefile
    doc/ers/Makefile
    "

AC_OUTPUT($pbs_makefile_list)
