#! /bin/sh
#
# This file was generated by a make rule
#
#
#######################################################
# From 'shell_config'
#######################################################
ENABLE_ABYSS_THREADS="yes"
THREAD_LIBS=""
ENABLE_LIBXML2_BACKEND="no"
MUST_BUILD_WININET_CLIENT="no"
MUST_BUILD_CURL_CLIENT="yes"
MUST_BUILD_LIBWWW_CLIENT="yes"
NEED_RPATH="no"
NEED_WL_RPATH="yes"
LIBXMLRPCPP_NAME="xmlrpc++"
SOCKETLIBOPT=""
WININET_LDADD=""
WININET_LIBDIR=""
CURL_LDADD="-Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lcurl"
CURL_LIBDIR="/usr/pkg/lib"
LIBWWW_LDADD="-L/usr/pkg/lib -Wl,-R/usr/pkg/lib -lwwwzip -lwwwinit -lwwwapp -lwwwxml -lexpat -lwwwhtml -lwwwtelnet -lwwwnews -lwwwhttp -lwwwmime -lwwwgopher -lwwwftp -lwwwfile -lwwwdir -lwwwcache -lwwwstream -lwwwmux -lwwwtrans -lwwwcore -lwwwutils -lmd5 -lwwwssl -lexpat -lz -L/usr/lib -lssl -lcrypto"
LIBWWW_LIBDIR="/usr/pkg/lib"
XMLRPC_MAJOR_RELEASE="1"
XMLRPC_MINOR_RELEASE="51"
XMLRPC_POINT_RELEASE="4"
FEATURE_LIST="c++ abyss-server libwww-client curl-client "
PREFIX="/usr/pkg"
HEADERINST_DIR="/usr/pkg/include"
LIBINST_DIR="/usr/pkg/lib"
BLDDIR="/pbulk/work/textproc/xmlrpc-c/work/xmlrpc-c-1.51.04"
ABS_SRCDIR="/pbulk/work/textproc/xmlrpc-c/work/xmlrpc-c-1.51.04"
ABYSS_DOES_OPENSSL="no"
OPENSSL_LDADD=""
#######################################################
usage="Usage: xmlrpc-c-config <feature> ... <option> ...

The features are:
  c++            legacy C++ wrapper API
  c++2           modern C++ API
  client         client functions
  cgi-server     CGI-based server functions
  abyss-server   ABYSS-based server functions
  pstream-server pstream-based server functions
  server-util    basic server functions (implied by *-server)
  abyss          Abyss HTTP server (not necessary with abyss-server)
  openssl        Openssl convenience functions

Options are:
  --version      The version number of the package
  --features     List all features (aka modules) currently installed
  --cflags       C compiler flags to use when '#include'ing package headers
  --libs         Libraries and flags to use when linking programs normally
  --ldadd        Libraries to use with automake
  --ldflags      Flags to use with automake & libtool
  --prefix       The prefix under which the package was installed
"

if test $# -eq 0; then
      echo "You must specify at least one option."
      echo "${usage}" 1>&2
      exit 1
fi

if test "${ENABLE_LIBXML2_BACKEND}" = "yes"; then
  LIBXML=`xml2-config --libs`
else
  LIBXML="-lxmlrpc_xmlparse -lxmlrpc_xmltok"
fi

needCpp=no

the_libdirs=
the_rpath=
the_wl_rpath=
cpp_libs=
# It's important that packetsocket lib go after client, server libs
packetsocket_lib=

# If Xmlrpc-c libraries are installed in the standard linker search
# path on this system, you should remove the following line:

the_libdirs="-L$LIBINST_DIR $the_libdirs"

the_libs="-lxmlrpc  ${LIBXML} -lxmlrpc_util  -pthread "
the_rpath="-R$LIBINST_DIR $the_rpath"
the_wl_rpath="-Wl,-rpath,$LIBINST_DIR $the_wl_rpath"

cflags=
# If Xmlrpc-c library interface header files are installed in the standard
# compiler search path on this system, you should remove the following line:
cflags="-I$HEADERINST_DIR $cflags"

while test $# -gt 0; do
  case $1 in
    c++)
      the_libs="-lxmlrpc_cpp $the_libs"

      # Unfortunately, there is just one legacy CPP library for
      # everything, and it needs all the C libraries -- base, client,
      # and server.  So all legacy C++ programs get linked with client
      # and server libraries, whether they need them or not.

      the_libs="-lxmlrpc_server_abyss $the_libs"
      the_libs="-lxmlrpc_server $the_libs"
      the_libs="-lxmlrpc_client $the_libs"
      ;;
    c++2)
      needCpp=yes
      the_libs="-lxmlrpc_util++ $the_libs"
      the_libs="-l$LIBXMLRPCPP_NAME $the_libs"
      ;;
    openssl)
      the_libs="${OPENSSL_LDADD} $the_libs"
      the_libs="-lxmlrpc_openssl $the_libs"
      ;;
    server-util)
      the_libs="-lxmlrpc_server $the_libs"
      if test "${needCpp}" = "yes"; then
        the_libs="-lxmlrpc_server++ $the_libs"
        fi
      ;;
    cgi-server)
      the_libs="-lxmlrpc_server $the_libs"
      if test "${needCpp}" = "yes"; then
        the_libs="-lxmlrpc_server_cgi++ $the_libs"
        the_libs="-lxmlrpc_server++ $the_libs"
      else
        the_libs="-lxmlrpc_server_cgi $the_libs"
        fi
      ;;
    abyss-server)
      the_libs="${SOCKETLIBOPT} $the_libs"
      if test "${ABYSS_DOES_OPENSSL}" = "yes"; then
        the_libs="${OPENSSL_LDADD} $the_libs"
        cflags="${cflags} ${OPENSSL_CFLAGS}"
        fi
      the_libs="-lxmlrpc_abyss $the_libs"
      the_libs="-lxmlrpc_server $the_libs"
      the_libs="-lxmlrpc_server_abyss $the_libs"
      if test "${needCpp}" = "yes"; then
        the_libs="-lxmlrpc_abyss++ $the_libs"
        the_libs="-lxmlrpc_server++ $the_libs"
        the_libs="-lxmlrpc_server_abyss++ $the_libs"
        fi
      ;;
    pstream-server)
      if test "${needCpp}" = "no"; then
        echo "You must specify the 'c++2' feature before 'pstream-server'."
        echo "Pstream server facilities are available only in a C++ version."
        exit 10
        fi
      the_libs="${SOCKETLIBOPT} $the_libs"
      the_libs="-lxmlrpc_server $the_libs"
      the_libs="-lxmlrpc_server++ $the_libs"
      the_libs="-lxmlrpc_server_pstream++ $the_libs"
      packetsocket_lib="-lxmlrpc_packetsocket"
      ;;
    client|libwww-client)
      # libwww-client is for backward compatibility
      the_libs="-lxmlrpc_client $the_libs"

      if test "${MUST_BUILD_WININET_CLIENT}" = "yes"; then
        the_libs="$the_libs $WININET_LDADD"
        the_rpath="-R$WININET_LIBDIR $the_rpath"
        the_wl_rpath="-Wl,-rpath,$WININET_LIBDIR $the_wl_rpath"
      fi
      if test "${MUST_BUILD_CURL_CLIENT}" = "yes"; then
        the_libs="$the_libs $CURL_LDADD"
        the_rpath="-R$CURL_LIBDIR $the_rpath"
        the_wl_rpath="-Wl,-rpath,$CURL_LIBDIR $the_wl_rpath"
      fi
      if test "${MUST_BUILD_LIBWWW_CLIENT}" = "yes"; then
        the_libs="$the_libs $LIBWWW_LDADD"
        the_rpath="-R$LIBWWW_LIBDIR $the_rpath"
        the_wl_rpath="-Wl,-rpath,$LIBWWW_LIBDIR $the_wl_rpath"
      fi
      if test "${needCpp}" = "yes"; then
        the_libs="-lxmlrpc_client++ $the_libs"
        packetsocket_lib="-lxmlrpc_packetsocket"
        fi
      ;;
    abyss)
      the_libs="${SOCKETLIBOPT} -lxmlrpc_util  -pthread  $the_libs"
      the_libs="-lxmlrpc_abyss $the_libs"
      if test "${needCpp}" = "yes"; then
        the_libs="-lxmlrpc_abyss++ $the_libs"
        fi
      ;;
    --version)
      echo "$XMLRPC_MAJOR_RELEASE.$XMLRPC_MINOR_RELEASE.$XMLRPC_POINT_RELEASE"
      ;;
    --modules)
      echo "$FEATURE_LIST"
      ;;
    --features)
      echo "$FEATURE_LIST"
      ;;
    --cflags)
      echo "$cflags"
      ;;
    --libs)
      if test "$NEED_WL_RPATH" = "yes"; then
          rpath=$the_wl_rpath
      elif test "$NEED_RPATH" = "yes"; then
          rpath=$the_rpath
      else
          rpath=
      fi

      echo "$the_libdirs $rpath $the_libs $packetsocket_lib"
      ;;
    --ldadd)
      echo "$the_libdirs $the_libs $packetsocket_lib"
      ;;
    --ldflags)
      echo "$the_rpath"
      ;;
    --prefix)
      echo "$PREFIX"
      ;;
    --exec-prefix)
      # This is just here for compatibility.  In a conventional autoconf
      # system, "prefix" is the prefix specified at 'configure' time and
      # "exec_prefix" is the prefix as overridden at 'make install' time.
      # The only reason I can think that this program historically had both
      # is that the author didn't understand that.
      echo "$PREFIX"
      ;;
    --help)
      echo "${usage}" 1>&2
      ;;
    *)
      echo "Unrecognized token '$1'"
      echo "${usage}" 1>&2
      exit 1
      ;;
  esac
  shift
done

exit 0
