Blame configure.ac

Packit 13e616
dnl Process this file with autoconf to produce a configure script.
Packit 13e616
Packit 13e616
AC_PREREQ(2.57)
Packit 13e616
AC_INIT(opensm, 3.3.23, linux-rdma@vger.kernel.org)
Packit 13e616
AC_CONFIG_SRCDIR([opensm/osm_opensm.c])
Packit 13e616
AC_CONFIG_AUX_DIR(config)
Packit 13e616
AC_CONFIG_MACRO_DIR(config)
Packit 13e616
AC_CONFIG_HEADERS(include/config.h include/opensm/osm_config.h)
Packit 13e616
AM_INIT_AUTOMAKE([subdir-objects])
Packit 13e616
Packit 13e616
AC_SUBST(RELEASE, ${RELEASE:-${VERSION}})
Packit 13e616
AC_SUBST(TARBALL, ${TARBALL:-${PACKAGE}-${VERSION}.tar.gz})
Packit 13e616
Packit 13e616
default_rdma_service=openibd
Packit 13e616
AC_ARG_WITH([rdma_service],
Packit 13e616
    AC_HELP_STRING([--with-rdma-service=name],
Packit 13e616
                   [name of the RDMA service: "rdma" when using /etc/init.d/rdma to start RDMA services; "openibd" when using /etc/init.d/openibd to start RDMA services [default=${default_rdma_service}]]))
Packit 13e616
AC_SUBST(RDMA_SERVICE, ${with_rdma_service:-${default_rdma_service}})
Packit 13e616
Packit 13e616
if { rpm -q sles-release || rpm -q openSUSE-release; } >/dev/null 2>&1; then
Packit 13e616
   default_stop="0 1 4 6"
Packit 13e616
else
Packit 13e616
   default_stop="0 1 6"
Packit 13e616
fi
Packit 13e616
Packit 13e616
default_start="null"
Packit 13e616
Packit 13e616
AC_SUBST(DEFAULT_START, $default_start)
Packit 13e616
AC_SUBST(DEFAULT_STOP, $default_stop)
Packit 13e616
Packit 13e616
dnl NOTE: AC_DEFINE's and AC_DEFINE_UNQUOTED's which are used in header files
Packit 13e616
dnl       MUST have a corresponding entry in include/opensm/osm_config.h.in to
Packit 13e616
dnl       ensure plugin compatibility.
Packit 13e616
AC_DEFINE(_OSM_CONFIG_H_, 1, mark config.h inclusion)
Packit 13e616
Packit 13e616
dnl Defines the Language
Packit 13e616
AC_LANG_C
Packit 13e616
Packit 13e616
dnl Required for cases make defines a MAKE=make ??? Why
Packit 13e616
AC_PROG_MAKE_SET
Packit 13e616
AC_PROG_CC
Packit 13e616
AC_PROG_LIBTOOL
Packit 13e616
AC_PROG_INSTALL
Packit 13e616
AC_PROG_LN_S
Packit 13e616
AC_PROG_MAKE_SET
Packit 13e616
AC_PROG_YACC
Packit 13e616
AC_PROG_LEX
Packit 13e616
Packit 13e616
AC_CHECK_PROGS(_YACC_,$YACC,none)
Packit 13e616
if test "$_YACC_" = "none"
Packit 13e616
then
Packit 13e616
  AC_MSG_ERROR([No bison/byacc/yacc found.])
Packit 13e616
fi
Packit 13e616
Packit 13e616
AC_CHECK_PROGS(_LEX_,$LEX,none)
Packit 13e616
if test "$_LEX_" = "none"
Packit 13e616
then
Packit 13e616
  AC_MSG_ERROR([No flex/lex found.])
Packit 13e616
fi
Packit 13e616
Packit 13e616
dnl Checks for libraries
Packit 13e616
AC_CHECK_LIB(pthread, pthread_mutex_init, [],
Packit 13e616
	AC_MSG_ERROR([pthread_mutex_init() not found.  libosmcomp requires libpthread.]))
Packit 13e616
AC_CHECK_LIB(dl, dlopen, [],
Packit 13e616
	AC_MSG_ERROR([dlopen() not found. OpenSM requires libdl.]))
Packit 13e616
Packit 13e616
dnl Checks for typedefs, structures, and compiler characteristics.
Packit 13e616
AC_C_CONST
Packit 13e616
AC_C_INLINE
Packit 13e616
AC_TYPE_PID_T
Packit 13e616
AC_TYPE_SIZE_T
Packit 13e616
AC_HEADER_TIME
Packit 13e616
AC_STRUCT_TM
Packit 13e616
AC_C_VOLATILE
Packit 13e616
Packit 13e616
dnl See if we have __builtin_expect
Packit 13e616
AC_MSG_CHECKING([if the compiler supports __builtin_expect])
Packit 13e616
AC_TRY_COMPILE(, [ return __builtin_expect(1, 1) ? 1 : 0],
Packit 13e616
		 [ have_builtin_expect=yes
Packit 13e616
		   AC_MSG_RESULT([yes]) ],
Packit 13e616
		 [ have_builtin_expect=no
Packit 13e616
		   AC_MSG_RESULT([no])  ])
Packit 13e616
if test "x_$have_builtin_expect" = "x_yes" ; then
Packit 13e616
	AC_DEFINE([HAVE_BUILTIN_EXPECT], [1], [Define to 1 if the compiler supports __builtin_expect.])
Packit 13e616
fi
Packit 13e616
Packit 13e616
dnl We use --version-script with ld if possible
Packit 13e616
AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script,
Packit 13e616
if test -n "`$LD --help < /dev/null 2>/dev/null | grep version-script`"; then
Packit 13e616
	ac_cv_version_script=yes
Packit 13e616
else
Packit 13e616
	ac_cv_version_script=no
Packit 13e616
fi)
Packit 13e616
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$ac_cv_version_script" = "yes")
Packit 13e616
Packit 13e616
dnl Define an input config option to control debug compile
Packit 13e616
AC_ARG_ENABLE(debug,    [  --enable-debug          Turn on debugging],
Packit 13e616
[case "${enableval}" in
Packit 13e616
	yes) debug=true ;;
Packit 13e616
	no)  debug=false ;;
Packit 13e616
	*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
Packit 13e616
esac],debug=false)
Packit 13e616
if test x$debug = xtrue ; then
Packit 13e616
	AC_DEFINE(OSM_DEBUG, 1, [ define 1 if OpenSM build is in a debug mode ])
Packit 13e616
	AC_DEFINE(_DEBUG_, 1, [ define 1 if OpenSM build is in a debug mode ])
Packit 13e616
fi
Packit 13e616
AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
Packit 13e616
Packit 13e616
AC_ARG_ENABLE(libcheck, [  --disable-libcheck      do not test for presence of ib libraries],
Packit 13e616
[if test x$enableval = xno ; then
Packit 13e616
	disable_libcheck=yes
Packit 13e616
fi])
Packit 13e616
Packit 13e616
dnl check if they want the socket console
Packit 13e616
OPENIB_OSM_CONSOLE_SOCKET_SEL
Packit 13e616
Packit 13e616
dnl select performance manager or not
Packit 13e616
OPENIB_OSM_PERF_MGR_SEL
Packit 13e616
Packit 13e616
dnl resolve <sysconfdir> config dir.
Packit 13e616
conf_dir_tmp1="`eval echo ${sysconfdir} | sed 's/^NONE/$ac_default_prefix/'`"
Packit 13e616
SYS_CONFIG_DIR="`eval echo $conf_dir_tmp1`"
Packit 13e616
Packit 13e616
dnl Check for a different subdir for the config files.
Packit 13e616
OPENSM_CONFIG_SUB_DIR=opensm
Packit 13e616
AC_MSG_CHECKING(for --with-opensm-conf-sub-dir)
Packit 13e616
AC_ARG_WITH(opensm-conf-sub-dir,
Packit 13e616
    AC_HELP_STRING([--with-opensm-conf-sub-dir=dir],
Packit 13e616
                   [define a directory name for opensm's conf files <sysconfdir>/<dir> (default "opensm")]),
Packit 13e616
    [ case "$withval" in
Packit 13e616
    no)
Packit 13e616
        ;;
Packit 13e616
    *)
Packit 13e616
        OPENSM_CONFIG_SUB_DIR=$withval
Packit 13e616
        ;;
Packit 13e616
    esac ]
Packit 13e616
)
Packit 13e616
dnl this needs to be configured for rpmbuilds separate from the full path
Packit 13e616
dnl "OPENSM_CONFIG_DIR"
Packit 13e616
AC_SUBST(OPENSM_CONFIG_SUB_DIR)
Packit 13e616
Packit 13e616
OPENSM_CONFIG_DIR=$SYS_CONFIG_DIR/$OPENSM_CONFIG_SUB_DIR
Packit 13e616
AC_MSG_RESULT($OPENSM_CONFIG_DIR)
Packit 13e616
AC_DEFINE_UNQUOTED(OPENSM_CONFIG_DIR,
Packit 13e616
	["$OPENSM_CONFIG_DIR"],
Packit 13e616
	[Define OpenSM config directory])
Packit 13e616
AC_SUBST(OPENSM_CONFIG_DIR)
Packit 13e616
Packit 13e616
dnl Check for a different default OpenSm config file
Packit 13e616
OPENSM_CONFIG_FILE=opensm.conf
Packit 13e616
AC_MSG_CHECKING(for --with-opensm-conf-file )
Packit 13e616
AC_ARG_WITH(opensm-conf-file,
Packit 13e616
    AC_HELP_STRING([--with-opensm-conf-file=file],
Packit 13e616
                   [define a default OpenSM config file (default opensm.conf)]),
Packit 13e616
    [ case "$withval" in
Packit 13e616
    no)
Packit 13e616
        ;;
Packit 13e616
    *)
Packit 13e616
        OPENSM_CONFIG_FILE=$withval
Packit 13e616
        ;;
Packit 13e616
    esac ]
Packit 13e616
)
Packit 13e616
AC_MSG_RESULT(${OPENSM_CONFIG_FILE})
Packit 13e616
AC_DEFINE_UNQUOTED(HAVE_DEFAULT_OPENSM_CONFIG_FILE,
Packit 13e616
	["$OPENSM_CONFIG_DIR/$OPENSM_CONFIG_FILE"],
Packit 13e616
	[Define a default OpenSM config file])
Packit 13e616
AC_SUBST(OPENSM_CONFIG_FILE)
Packit 13e616
Packit 13e616
dnl Check for a different default node name map file
Packit 13e616
NODENAMEMAPFILE=ib-node-name-map
Packit 13e616
AC_MSG_CHECKING(for --with-node-name-map )
Packit 13e616
AC_ARG_WITH(node-name-map,
Packit 13e616
    AC_HELP_STRING([--with-node-name-map=file],
Packit 13e616
                   [define a default node name map file (default ib-node-name-map)]),
Packit 13e616
    [ case "$withval" in
Packit 13e616
    no)
Packit 13e616
        ;;
Packit 13e616
    *)
Packit 13e616
        NODENAMEMAPFILE=$withval
Packit 13e616
        ;;
Packit 13e616
    esac ]
Packit 13e616
)
Packit 13e616
AC_MSG_RESULT($NODENAMEMAPFILE)
Packit 13e616
AC_DEFINE_UNQUOTED(HAVE_DEFAULT_NODENAME_MAP,
Packit 13e616
	["$OPENSM_CONFIG_DIR/$NODENAMEMAPFILE"],
Packit 13e616
	[Define a default node name map file])
Packit 13e616
AC_SUBST(NODENAMEMAPFILE)
Packit 13e616
Packit 13e616
dnl Check for a different partition conf file
Packit 13e616
PARTITION_CONFIG_FILE=partitions.conf
Packit 13e616
AC_MSG_CHECKING(for --with-partitions-conf)
Packit 13e616
AC_ARG_WITH(partitions-conf,
Packit 13e616
    AC_HELP_STRING([--with-partitions-conf=file],
Packit 13e616
                   [define a partitions config file (default partitions.conf)]),
Packit 13e616
    [ case "$withval" in
Packit 13e616
    no)
Packit 13e616
        ;;
Packit 13e616
    *)
Packit 13e616
        PARTITION_CONFIG_FILE=$withval
Packit 13e616
        ;;
Packit 13e616
    esac ]
Packit 13e616
)
Packit 13e616
AC_MSG_RESULT($PARTITION_CONFIG_FILE)
Packit 13e616
AC_DEFINE_UNQUOTED(HAVE_DEFAULT_PARTITION_CONFIG_FILE,
Packit 13e616
	["$OPENSM_CONFIG_DIR/$PARTITION_CONFIG_FILE"],
Packit 13e616
	[Define a Partition config file])
Packit 13e616
AC_SUBST(PARTITION_CONFIG_FILE)
Packit 13e616
Packit 13e616
dnl Check for a different QOS policy file
Packit 13e616
QOS_POLICY_FILE=qos-policy.conf
Packit 13e616
AC_MSG_CHECKING(for --with-qos-policy-conf)
Packit 13e616
AC_ARG_WITH(qos-policy-conf,
Packit 13e616
    AC_HELP_STRING([--with-qos-policy-conf=file],
Packit 13e616
                   [define a QOS policy config file (default qos-policy.conf)]),
Packit 13e616
    [ case "$withval" in
Packit 13e616
    no)
Packit 13e616
        ;;
Packit 13e616
    *)
Packit 13e616
        QOS_POLICY_FILE=$withval
Packit 13e616
        ;;
Packit 13e616
    esac ]
Packit 13e616
)
Packit 13e616
AC_MSG_RESULT($QOS_POLICY_FILE)
Packit 13e616
AC_DEFINE_UNQUOTED(HAVE_DEFAULT_QOS_POLICY_FILE,
Packit 13e616
	["$OPENSM_CONFIG_DIR/$QOS_POLICY_FILE"],
Packit 13e616
	[Define a QOS policy config file])
Packit 13e616
AC_SUBST(QOS_POLICY_FILE)
Packit 13e616
Packit 13e616
dnl For now, this does not need to be configurable
Packit 13e616
TORUS2QOS_CONF_FILE=torus-2QoS.conf
Packit 13e616
AC_SUBST(TORUS2QOS_CONF_FILE)
Packit 13e616
Packit 13e616
dnl Check for a different prefix-routes file
Packit 13e616
PREFIX_ROUTES_FILE=prefix-routes.conf
Packit 13e616
AC_MSG_CHECKING(for --with-prefix-routes-conf)
Packit 13e616
AC_ARG_WITH(prefix-routes-conf,
Packit 13e616
    AC_HELP_STRING([--with-prefix-routes-conf=file],
Packit 13e616
                   [define a Prefix Routes config file (default is prefix-routes.conf)]),
Packit 13e616
    [ case "$withval" in
Packit 13e616
    no)
Packit 13e616
        ;;
Packit 13e616
    *)
Packit 13e616
        PREFIX_ROUTES_FILE=$withval
Packit 13e616
        ;;
Packit 13e616
    esac ]
Packit 13e616
)
Packit 13e616
AC_MSG_RESULT($PREFIX_ROUTES_FILE)
Packit 13e616
AC_DEFINE_UNQUOTED(HAVE_DEFAULT_PREFIX_ROUTES_FILE,
Packit 13e616
	["$OPENSM_CONFIG_DIR/$PREFIX_ROUTES_FILE"],
Packit 13e616
	[Define a Prefix Routes config file])
Packit 13e616
AC_SUBST(PREFIX_ROUTES_FILE)
Packit 13e616
Packit 13e616
dnl Check for a different per-module-logging file
Packit 13e616
PER_MOD_LOGGING_FILE=per-module-logging.conf
Packit 13e616
AC_MSG_CHECKING(for --with-per-module-logging-conf)
Packit 13e616
AC_ARG_WITH(per-module-logging.conf,
Packit 13e616
    AC_HELP_STRING([--with-per-module-logging-conf=file],
Packit 13e616
                   [define a Per Module Logging config file (default is per-module-logging.conf)]),
Packit 13e616
    [ case "$withval" in
Packit 13e616
    no)
Packit 13e616
        ;;
Packit 13e616
    *)
Packit 13e616
        PER_MOD_LOGGING_FILE=$withval
Packit 13e616
        ;;
Packit 13e616
    esac ]
Packit 13e616
)
Packit 13e616
AC_MSG_RESULT($PER_MOD_LOGGING_FILE)
Packit 13e616
AC_DEFINE_UNQUOTED(HAVE_DEFAULT_PER_MOD_LOGGING_FILE,
Packit 13e616
        ["$OPENSM_CONFIG_DIR/$PER_MOD_LOGGING_FILE"],
Packit 13e616
        [Define a Per Module Logging config file])
Packit 13e616
AC_SUBST(PER_MOD_LOGGING_FILE)
Packit 13e616
Packit 13e616
dnl select example event plugin or not
Packit 13e616
OPENIB_OSM_DEFAULT_EVENT_PLUGIN_SEL
Packit 13e616
Packit 13e616
dnl Provide user option to select vendor
Packit 13e616
OPENIB_APP_OSMV_SEL
Packit 13e616
Packit 13e616
dnl Checks for headers and libraries
Packit 13e616
OPENIB_APP_OSMV_CHECK_HEADER
Packit 13e616
OPENIB_APP_OSMV_CHECK_LIB
Packit 13e616
Packit 13e616
dnl Provide user option to enable metis support for nue
Packit 13e616
METIS_SEL
Packit 13e616
Packit 13e616
dnl Checks for headers and libraries
Packit 13e616
METIS_CHECK_HEADER
Packit 13e616
METIS_CHECK_LIB
Packit 13e616
Packit 13e616
AC_CONFIG_FILES([man/opensm.8 man/torus-2QoS.8 man/torus-2QoS.conf.5 scripts/opensm.init scripts/redhat-opensm.init scripts/sldd.sh])
Packit 13e616
Packit 13e616
dnl Create the following Makefiles
Packit 13e616
AC_OUTPUT([include/opensm/osm_version.h Makefile include/Makefile complib/Makefile libopensm/Makefile libvendor/Makefile opensm/Makefile osmeventplugin/Makefile osmroutingplugin/Makefile osmtest/Makefile opensm.spec])