2015-02-03 09:19:22 +03:00
|
|
|
dnl -*- shell-script -*-
|
|
|
|
dnl
|
|
|
|
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
dnl University Research and Technology
|
|
|
|
dnl Corporation. All rights reserved.
|
|
|
|
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
dnl of Tennessee Research Foundation. All rights
|
|
|
|
dnl reserved.
|
|
|
|
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
dnl University of Stuttgart. All rights reserved.
|
|
|
|
dnl Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
dnl All rights reserved.
|
|
|
|
dnl Copyright (c) 2008-2009 Cisco Systems, Inc. All rights reserved.
|
|
|
|
dnl Copyright (c) 2014 Intel, Inc. All rights reserved.
|
|
|
|
dnl Copyright (c) 2015 Research Organization for Information Science
|
|
|
|
dnl and Technology (RIST). All rights reserved.
|
|
|
|
dnl $COPYRIGHT$
|
|
|
|
dnl
|
|
|
|
dnl Additional copyrights may follow
|
|
|
|
dnl
|
|
|
|
dnl $HEADER$
|
|
|
|
dnl
|
2009-03-07 00:48:36 +03:00
|
|
|
|
2014-05-07 01:16:29 +04:00
|
|
|
# OPAL_SETUP_COMPONENT_PACKAGE(1: framework_name,
|
2009-03-07 00:48:36 +03:00
|
|
|
# 2: component_name,
|
|
|
|
# 3: option_name,
|
|
|
|
# 4: withdir_dir_check_file,
|
|
|
|
# 5: withdir_libdir_check_file,
|
|
|
|
# 6: header,
|
|
|
|
# 7: library,
|
|
|
|
# 8: function,
|
|
|
|
# 9: extra-libraries,
|
|
|
|
# 10: [action-if-found],
|
|
|
|
# 11: [action-if-not-found])
|
|
|
|
# ------------------------------------------------
|
|
|
|
# Many components need to just check for one package, and if it's all
|
|
|
|
# good, set themselves up with appropriate CPPFLAGS, LDFLAGS, and
|
|
|
|
# LIBS. This macro templates all of that for the common case.
|
|
|
|
#
|
|
|
|
# This macro does the following:
|
|
|
|
#
|
|
|
|
# - Assumes that this component should be built by default if all
|
|
|
|
# headers and libraries can be found
|
|
|
|
# - Adds --with-<name> and --with-<name>-libdir options to configure
|
|
|
|
# - Sanity checks directory names given to the above options (i.e.,
|
|
|
|
# look for a token file in each, but only if the directory argument
|
|
|
|
# is given)
|
|
|
|
# - Assumes that if --with-<name> is supplied and we can't build the
|
|
|
|
# component, it's a fatal error.
|
|
|
|
# - Assumes that if --with-<name> is NOT supplied and we can't build
|
|
|
|
# the component, it's NOT a fatal error.
|
2014-05-01 18:24:56 +04:00
|
|
|
# - Run OPAL_CHECK_PACKAGE (check for the specific presence of header
|
2009-03-07 00:48:36 +03:00
|
|
|
# files and/or libraries) to determine if the package is available
|
|
|
|
# - Set and AC_SUBST <framework>_<component>_CPPFLAGS
|
|
|
|
# - Set and AC_SUBST <framework>_<component>_CFLAGS
|
|
|
|
# - Set and AC_SUBST <framework>_<component>_LDFLAGS
|
|
|
|
# - Set and AC_SUBST <framework>_<component>_LIBS
|
|
|
|
#
|
|
|
|
# Enjoy.
|
|
|
|
#
|
|
|
|
AC_DEFUN([OPAL_SETUP_COMPONENT_PACKAGE],[
|
|
|
|
AC_ARG_WITH([$3],
|
|
|
|
[AC_HELP_STRING([--with-$3(=DIR)],
|
2009-04-11 02:10:07 +04:00
|
|
|
[Build $3 support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])])
|
2014-05-01 19:38:07 +04:00
|
|
|
OPAL_CHECK_WITHDIR([$3], [$with_$3], [$4])
|
2009-03-07 00:48:36 +03:00
|
|
|
AC_ARG_WITH([$3-libdir],
|
|
|
|
[AC_HELP_STRING([--with-$3-libdir=DIR],
|
|
|
|
[Search for the $3 libraries in DIR])])
|
2014-05-01 19:38:07 +04:00
|
|
|
OPAL_CHECK_WITHDIR([$3-libdir], [$with_$3_libdir], [$5])
|
2009-03-07 00:48:36 +03:00
|
|
|
|
2015-02-03 09:19:22 +03:00
|
|
|
AS_IF([test ! -z "$with_$3" && test "$with_$3" != "yes"],
|
2009-03-07 00:48:36 +03:00
|
|
|
[$1_$2_dir="$with_$3"])
|
2015-02-03 09:19:22 +03:00
|
|
|
AS_IF([test ! -z "$with_$3_libdir" && test "$with_$3_libdir" != "yes"],
|
2009-03-07 00:48:36 +03:00
|
|
|
[$1_$2_libdir="$with_$3_libdir"])
|
|
|
|
|
|
|
|
AS_IF([test "$with_$3" = "no"],
|
|
|
|
[$1_$2_happy="no"],
|
|
|
|
[$1_$2_happy="yes"])
|
|
|
|
|
|
|
|
AS_IF([test "$$1_$2_happy" = "yes"],
|
2014-05-01 18:24:56 +04:00
|
|
|
[OPAL_CHECK_PACKAGE([$1_$2],
|
2009-03-07 00:48:36 +03:00
|
|
|
[$6],
|
|
|
|
[$7],
|
|
|
|
[$8],
|
|
|
|
[$9],
|
|
|
|
[$$1_$2_dir],
|
|
|
|
[$$1_$2_libdir],
|
|
|
|
[$1_$2_happy="yes"],
|
|
|
|
[$1_$2_happy="no"])])
|
|
|
|
|
|
|
|
AS_IF([test "$$1_$2_happy" = "yes"],
|
2013-01-29 04:00:43 +04:00
|
|
|
[$10],
|
2009-03-07 00:48:36 +03:00
|
|
|
[$11])
|
|
|
|
|
|
|
|
# sanity check
|
|
|
|
AS_IF([test "$$1_$2_happy" = "no"],
|
2015-02-03 09:19:22 +03:00
|
|
|
[AS_IF([test "$with_$3" != "no" && test ! -z "$with_$3"],
|
2009-03-07 00:48:36 +03:00
|
|
|
[AC_MSG_WARN([$1:$2 requested but not found])
|
|
|
|
AC_MSG_ERROR([Cannot continue])])])
|
|
|
|
|
|
|
|
AC_SUBST([$1_$2_CFLAGS])
|
|
|
|
AC_SUBST([$1_$2_CPPFLAGS])
|
|
|
|
AC_SUBST([$1_$2_LDFLAGS])
|
|
|
|
AC_SUBST([$1_$2_LIBS])
|
|
|
|
])
|