"Fossies" - the Fresh Open Source Software Archive

Member "opensaf-5.21.09/configure.ac" (14 Sep 2021, 22716 Bytes) of package /linux/misc/opensaf-5.21.09.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.ac": 5.21.06_vs_5.21.09.

    1 #      -*- OpenSAF  -*-
    2 #
    3 # (C) Copyright 2008 The OpenSAF Foundation
    4 # Copyright Ericsson AB 2008, 2017 - All Rights Reserved.
    5 #
    6 # This program is distributed in the hope that it will be useful, but
    7 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    8 # or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
    9 # under the GNU Lesser General Public License Version 2.1, February 1999.
   10 # The complete license can be accessed from the following location:
   11 # http://opensource.org/licenses/lgpl-license.php
   12 # See the Copying file included with the OpenSAF distribution for full
   13 # licensing terms.
   14 #
   15 # Author(s): Wind River Systems
   16 #
   17 
   18 AC_PREREQ([2.64])
   19 AC_INIT([opensaf], [5.21.09], [opensaf-users@lists.sourceforge.net], [opensaf], [http://opensaf.sourceforge.net/])
   20 AC_CONFIG_AUX_DIR([.])
   21 AC_CANONICAL_SYSTEM
   22 AC_CONFIG_SRCDIR([opensaf.spec.in])
   23 AC_CONFIG_HEADER([src/osaf/config.h])
   24 AC_CONFIG_MACRO_DIR([m4])
   25 
   26 AM_INIT_AUTOMAKE([1.11.1 subdir-objects])
   27 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
   28 AC_USE_SYSTEM_EXTENSIONS
   29 
   30 # (major version) = (first number) - (third number)
   31 # (minor version) = (third number)
   32 # (patch version) = (second number)
   33 OPENSAF_LIB_VERSION=0:0:0
   34 AC_SUBST([OPENSAF_LIB_VERSION])
   35 
   36 INTERNAL_VERSION_ID=@OSAF_LONG_GIT_REV@
   37 AC_SUBST([INTERNAL_VERSION_ID])
   38 
   39 # FIXME: Until the m4 macro gets cleaned for DSO symbol tests and not executable
   40 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "yes" = "yes")
   41 #m4_include([m4/linker-script.m4])
   42 #gl_LINKER_SCRIPT
   43 
   44 OPENSAF_RELEASE=$PACKAGE_VERSION
   45 OPENSAF_BUGREPORT=$PACKAGE_BUGREPORT
   46 AC_SUBST([OPENSAF_RELEASE])
   47 AC_SUBST([OPENSAF_BUGREPORT])
   48 AC_SUBST([ac_configure_args])
   49 
   50 
   51 #
   52 # Check if rpath is enabled
   53 #
   54 AC_MSG_CHECKING([whether to build with rpath enabled])
   55 AC_ARG_ENABLE([rpath],
   56 	[AC_HELP_STRING([--disable-rpath],
   57 		[patches libtool to not use rpath in the libraries produced.
   58 		[Default=no]])],
   59 	[],
   60 	[enable_rpath=yes])
   61 AC_MSG_RESULT([$enable_rpath])
   62 
   63 LT_PREREQ([2.2.6])
   64 LT_INIT([disable-static pic-only])
   65 AC_CONFIG_COMMANDS([libtool-rpath-patch],
   66 	[if test "$libtool_patch_use_rpath" = "no"; then
   67 		sed < libtool > libtool-2 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=""/'
   68 		mv libtool-2 libtool
   69 		sed < libtool > libtool-2 's/^runpath_var=LD_RUN_PATH$'/'runpath_var=DIE_RPATH_DIE/'
   70 		mv libtool-2 libtool
   71 		chmod 755 libtool
   72 	fi],
   73 [libtool_patch_use_rpath=$enable_rpath])
   74 
   75 
   76 #
   77 # The RPM spec file has a container for the package release number (default to
   78 # one), it is possible to customize that value with this configure option.
   79 #
   80 AC_ARG_WITH([rpm-release],
   81         [AS_HELP_STRING([--with-rpm-release=@<:@ARG@:>@],
   82                 [set the RPM release value to be current timestamp (ARG=timestamp);
   83                 set the RPM release value to be the global revision (ARG=global-rev);
   84                 set the RPM release value to be the local revision (ARG=local-rev);
   85                 set the RPM release value to be <val> (ARG=<val>, [default=1])])],
   86         [
   87         if test "$withval" = timestamp; then
   88                 with_rpm_release=`date +%Y%m%d%H%M`
   89         elif test "$withval" = global-rev; then
   90                 with_rpm_release=`git rev-parse HEAD`
   91         elif test "$withval" = local-rev; then
   92                 with_rpm_release=`git rev-parse HEAD`
   93         else
   94                 with_rpm_release=$withval
   95         fi
   96         ],
   97         [with_rpm_release=1])
   98 
   99 AC_SUBST([OPENSAF_RPM_RELEASE], ["$with_rpm_release"])
  100 
  101 
  102 #
  103 # OpenSAF supports linking with various SAHPI interface version, by default it
  104 # will autodetect the version by looking at the SaHpi.h used at compilation,
  105 # when cross-compiling this is not possible, it's possible to provide the
  106 # version manually
  107 #
  108 AC_ARG_WITH([hpi-interface],
  109         [AS_HELP_STRING([--with-hpi-interface=@<:@ARG@:>@],
  110                 [autodetect the SAHPI_INTERFACE_VERSION (ARG=check [default]);
  111                 set the SAHPI_INTERFACE_VERSION to A.01.01 (ARG=A01);
  112                 set the SAHPI_INTERFACE_VERSION to B.01.01 (ARG=B01);
  113                 set the SAHPI_INTERFACE_VERSION to B.02.01 (ARG=B02);
  114                 set the SAHPI_INTERFACE_VERSION to B.03.01 (ARG=B03)])],
  115         [
  116         if test "$withval" = A01; then
  117                 with_hpi_interface=check
  118         elif test "$withval" = A01; then
  119                 with_hpi_interface=A01
  120                 AC_DEFINE([HAVE_HPI_A01], 1)
  121         elif test "$withval" = B01; then
  122                 with_hpi_interface=B01
  123                 AC_DEFINE([HAVE_HPI_B01], 1)
  124         elif test "$withval" = B02; then
  125                 with_hpi_interface=B02
  126                 AC_DEFINE([HAVE_HPI_B02], 1)
  127         elif test "$withval" = B03; then
  128                 with_hpi_interface=B03
  129                 AC_DEFINE([HAVE_HPI_B03], 1)
  130         else
  131                 AC_ERROR([Invalid SAHPI_INTERFACE_VERSION specified])
  132         fi
  133         ],
  134         [with_hpi_interface=check])
  135 
  136 AC_SUBST([WITH_HPI_INTERFACE], ["$with_hpi_interface"])
  137 
  138 
  139 #
  140 # Some build systems support their own 'make rpm' rule, offer the possibility to
  141 # disable the one provided with OpenSAF
  142 #
  143 AC_MSG_CHECKING([whether to enable the make rpm target])
  144 AC_ARG_ENABLE([rpm-target],
  145         [AS_HELP_STRING([--disable-rpm-target],
  146                 [disable support for the "make rpm" target [default=no]])],
  147         [],
  148         [enable_rpm_target=yes])
  149 AC_MSG_RESULT([$enable_rpm_target])
  150 
  151 AM_CONDITIONAL([ENABLE_RPM_TARGET], [test "$enable_rpm_target" = yes])
  152 
  153 #
  154 # Many distros use different init.d directory depending on their LSB compliance
  155 # support. Use this option to point to the init.d directory used by your distro.
  156 # Default to /etc/init.d
  157 #
  158 AC_ARG_WITH([initscriptdir],
  159         [AS_HELP_STRING([--with-initscriptdir=@<:@DIR@:>@],
  160                 [use DIR as the directory containing the init.d scripts.
  161 		 [default=/etc/init.d]])],
  162         [
  163         if test -d $withval; then
  164                 with_initscriptdir=$withval
  165         else
  166                 AC_ERROR([$withval is an invalid path])
  167         fi
  168         ],
  169         [with_initscriptdir=/etc/init.d])
  170 
  171 AC_SUBST([initscriptdir], ["$with_initscriptdir"])
  172 
  173 #
  174 # Enable/disable experimental code
  175 #
  176 AC_MSG_CHECKING([whether to build experimental code])
  177 AC_ARG_ENABLE([experimental],
  178 	[AS_HELP_STRING([--enable-experimental],
  179 		[enable experimental code [default=no]])],
  180 	[],
  181 	[enable_experimental=no])
  182 AC_MSG_RESULT([$enable_experimental])
  183 
  184 if test "$enable_experimental" = yes; then
  185 	AC_DEFINE([HAVE_EXPERIMENTAL], 1, [Define if experimental code is enabled])
  186 fi
  187 
  188 AM_CONDITIONAL([ENABLE_EXPERIMENTAL], [test "$enable_experimental" = yes])
  189 AC_SUBST([EXPERIMENTAL_ENABLED], ["$enable_experimental"])
  190 
  191 #
  192 # Enable/disable gcov
  193 #
  194 AC_MSG_CHECKING([whether to build with gcov])
  195 AC_ARG_ENABLE([gcov],
  196         [AS_HELP_STRING([--enable-gcov],
  197                 [enable building with gcov [default=no]])],
  198         [],
  199         [enable_gcov=no])
  200 AC_MSG_RESULT([$enable_gcov])
  201 
  202 if test "$enable_gcov" = yes; then
  203         AC_DEFINE([ENABLE_GCOV], 1, [Define if gcov is enabled])
  204 fi
  205 
  206 AM_CONDITIONAL([ENABLE_GCOV], [test "$enable_gcov" = yes])
  207 AC_SUBST([GCOV_ENABLED], ["$enable_gcov"])
  208 
  209 #
  210 # Enable/disable the Python AIS bindings
  211 #
  212 AC_MSG_CHECKING([whether to enable the Python AIS bindings])
  213 AC_ARG_ENABLE([python],
  214         [AS_HELP_STRING([--enable-python],
  215                 [enable the Python AIS bindings [default=no]])],
  216         [],
  217         [enable_python=no])
  218 AC_MSG_RESULT([$enable_python])
  219 
  220 AM_CONDITIONAL([ENABLE_PYTHON], [test "$enable_python" = yes])
  221 AC_SUBST([PYTHON_ENABLED], ["$enable_python"])
  222 
  223 #
  224 # If the AM4J API library isn't in the standard CLASSPATH, it can be configured
  225 # with a parameter instead
  226 AC_ARG_WITH([am4j-api-jar],
  227         [AS_HELP_STRING([--with-am4j-api-jar=@<:@FILE@:>@],
  228                 [use FILE as the AM4J API JAR])],
  229         [
  230         if test -f $withval; then
  231                 with_am4j_api_jar=$withval
  232         else
  233                 AC_ERROR([$withval is an invalid filename])
  234         fi
  235         ],
  236         [with_am4j_api_jar=no])
  237 
  238 #
  239 # Enable/disable the Java AIS interface mapping components
  240 #
  241 m4_include([m4/java.m4])
  242 
  243 AC_MSG_CHECKING([whether to enable the Java AIS interface mapping])
  244 AC_ARG_ENABLE([java],
  245         [AS_HELP_STRING([--enable-java],
  246                 [enable the Java AIS interface mapping [default=no]])],
  247         [],
  248         [enable_java=no])
  249 AC_MSG_RESULT([$enable_java])
  250 
  251 AM_CONDITIONAL([ENABLE_JAVA], [test "$enable_java" = yes])
  252 AC_SUBST([JAVA_ENABLED], ["$enable_java"])
  253 
  254 #
  255 # Enable/disable the AM4J agent
  256 #
  257 AC_MSG_CHECKING([whether to enable the AM4J agent])
  258 AC_ARG_ENABLE([am4j],
  259         [AS_HELP_STRING([--enable-am4j],
  260                 [enable the AM4J agent [default=no]])],
  261         [],
  262         [enable_am4j=no])
  263 
  264 AC_MSG_RESULT([$enable_am4j])
  265 AM_CONDITIONAL([ENABLE_AM4J], [test "$enable_am4j" = yes])
  266 AC_SUBST([AM4J_ENABLED], ["$enable_am4j"])
  267 
  268 #
  269 # Enable/disable TIPC transport
  270 #
  271 AC_MSG_CHECKING([whether to use TIPC as the transport])
  272 AC_ARG_ENABLE([tipc],
  273         [AS_HELP_STRING([--enable-tipc],
  274                 [enable building the TIPC [default=no]])],
  275         [],
  276         [enable_tipc=no])
  277 AC_MSG_RESULT([$enable_tipc])
  278  
  279 if test "$enable_tipc" = yes; then
  280         AC_DEFINE([ENABLE_TIPC_TRANSPORT], 1, [Define if TIPC is enabled])
  281 fi
  282  
  283 AM_CONDITIONAL([ENABLE_TIPC_TRANSPORT], [test "$enable_tipc" = yes])
  284 AC_SUBST([TIPC_TRANSPORT_ENABLED], ["$enable_tipc"])
  285 
  286 #
  287 # Enable/disable use of systemd
  288 #
  289 PKG_CHECK_MODULES([SYSTEMD], [systemd >= 219], [enable_systemd=yes],
  290         [enable_systemd=no])
  291 
  292 if test "$enable_systemd" = yes; then
  293         AC_DEFINE([ENABLE_SYSTEMD], 1, [Define if systemd is enabled])
  294         systemdunitdir=$(pkg-config --variable=systemdsystemunitdir systemd)
  295         systemdversion=$(pkg-config --modversion systemd)
  296         if test "$systemdversion" -ge 227; then
  297                 systemdtasksmax="TasksMax=infinity"$'\n'
  298         else
  299                 systemdtasksmax=""
  300         fi
  301 fi
  302 
  303 AM_CONDITIONAL([ENABLE_SYSTEMD], [test "$enable_systemd" = yes])
  304 AC_SUBST([SYSTEMD_ENABLED], ["$enable_systemd"])
  305 AC_SUBST([systemdsystemunitdir], ["$systemdunitdir"])
  306 AC_SUBST([systemdmodversion], ["$systemdversion"])
  307 AC_SUBST([systemdtasksmax], ["$systemdtasksmax"])
  308 AM_SUBST_NOTMAKE([systemdtasksmax])
  309 
  310 #
  311 # Enable/disable building the OpenSAF tests
  312 #
  313 AC_MSG_CHECKING([whether to enable building the OpenSAF tests])
  314 AC_ARG_ENABLE([tests],
  315         [AS_HELP_STRING([--enable-tests],
  316                 [enable building the OpenSAF testing programs [default=no]])],
  317         [],
  318         [enable_tests=no])
  319 AC_MSG_RESULT([$enable_tests])
  320 
  321 #
  322 # If tests are enabled, then compile not just test programs but any code 
  323 # anywhere bracketed by "HAVE_TESTS"
  324 #
  325 if test "$enable_tests" = yes; then
  326 	AC_DEFINE([HAVE_TESTS], 1, [Define if we built OpenSAF tests])
  327 fi
  328 
  329 AM_CONDITIONAL([ENABLE_TESTS], [test "$enable_tests" = yes])
  330 AC_SUBST([TESTS_ENABLED], ["$enable_tests"])
  331 
  332 #
  333 # Enable/disable IMM Persistent Backend
  334 #
  335 AC_MSG_CHECKING([whether to use the IMM persistent backend])
  336 AC_ARG_ENABLE([imm-pbe],
  337 	[AS_HELP_STRING([--enable-imm-pbe],
  338 		[enable the IMM Persistent Backend Interface [default=no]])],
  339 	[],
  340 	[enable_imm_pbe=no])
  341 AC_MSG_RESULT([$enable_imm_pbe])
  342 
  343 if test "$enable_imm_pbe" = yes; then
  344 	AC_DEFINE([HAVE_IMM_PBE], 1, [Define if we have IMM_PBE enabled])
  345 fi
  346 
  347 AM_CONDITIONAL([ENABLE_IMM_PBE], [test "$enable_imm_pbe" = yes])
  348 AC_SUBST([IMM_PBE_ENABLED], ["$enable_imm_pbe"])
  349 
  350 
  351 #
  352 # Enable/disable NTF Information Model Change Notifier (ntf-imcn)
  353 #
  354 AC_MSG_CHECKING([whether to use the Information Model Change Notifier])
  355 AC_ARG_ENABLE([ntf-imcn],
  356 	[AS_HELP_STRING([--enable-ntf-imcn],
  357 		[enable the NTF Information Model Notification producer [default=no]])],
  358 	[],
  359 	[enable_ntf_imcn=no])
  360 AC_MSG_RESULT([$enable_ntf_imcn])
  361 
  362 if test "$enable_ntf_imcn" = yes; then
  363 	AC_DEFINE([HAVE_NTFIMCN], 1, [Define if we have NTFIMCN enabled])
  364 fi
  365 
  366 AM_CONDITIONAL([ENABLE_NTFIMCN], [test "$enable_ntf_imcn" = yes])
  367 AC_SUBST([NTFIMCN_ENABLED], ["$enable_ntf_imcn"])
  368 
  369 
  370 #
  371 # Enable/disable building some of the OpenSAF AIS Services
  372 #
  373 AC_MSG_CHECKING([whether to build the SAI-AIS-CKPT service])
  374 AC_ARG_ENABLE([ais-ckpt],
  375 	[AS_HELP_STRING([--disable-ais-ckpt],
  376 		[disable building the SAI-AIS-CKPT service [default=no]])],
  377 	[],
  378 	[enable_ais_ckpt=yes])
  379 AC_MSG_RESULT([$enable_ais_ckpt])
  380 
  381 AM_CONDITIONAL([ENABLE_AIS_CKPT], [test "$enable_ais_ckpt" = yes])
  382 AC_SUBST([AIS_CKPT_ENABLED], ["$enable_ais_ckpt"])
  383 
  384 
  385 AC_MSG_CHECKING([whether to build the SAI-AIS-EVT service])
  386 AC_ARG_ENABLE([ais-evt],
  387 	[AS_HELP_STRING([--disable-ais-evt],
  388 		[disable building the SAI-AIS-EVT service [default=no]])],
  389 	[],
  390 	[enable_ais_evt=yes])
  391 AC_MSG_RESULT([$enable_ais_evt])
  392 
  393 AM_CONDITIONAL([ENABLE_AIS_EVT], [test "$enable_ais_evt" = yes])
  394 AC_SUBST([AIS_EVT_ENABLED], ["$enable_ais_evt"])
  395 
  396 
  397 AC_MSG_CHECKING([whether to build the SAI-AIS-LCK service])
  398 AC_ARG_ENABLE([ais-lck],
  399 	[AS_HELP_STRING([--disable-ais-lck],
  400 		[disable building the SAI-AIS-LCK service [default=no]])],
  401 	[],
  402 	[enable_ais_lck=yes])
  403 AC_MSG_RESULT([$enable_ais_lck])
  404 
  405 AM_CONDITIONAL([ENABLE_AIS_LCK], [test "$enable_ais_lck" = yes])
  406 AC_SUBST([AIS_LCK_ENABLED], ["$enable_ais_lck"])
  407 
  408 
  409 AC_MSG_CHECKING([whether to build the SAI-AIS-MSG service])
  410 AC_ARG_ENABLE([ais-msg],
  411 	[AS_HELP_STRING([--disable-ais-msg],
  412 		[disable building the SAI-AIS-MSG service [default=no]])],
  413 	[],
  414 	[enable_ais_msg=yes])
  415 AC_MSG_RESULT([$enable_ais_msg])
  416 
  417 AM_CONDITIONAL([ENABLE_AIS_MSG], [test "$enable_ais_msg" = yes])
  418 AC_SUBST([AIS_MSG_ENABLED], ["$enable_ais_msg"])
  419 
  420 
  421 AC_MSG_CHECKING([whether to build the SAI-AIS-SMF service])
  422 AC_ARG_ENABLE([ais-smf],
  423 	[AS_HELP_STRING([--disable-ais-smf],
  424 		[disable building the SAI-AIS-SMF service [default=no]])],
  425 	[],
  426 	[enable_ais_smf=yes])
  427 AC_MSG_RESULT([$enable_ais_smf])
  428 
  429 AM_CONDITIONAL([ENABLE_AIS_SMF], [test "$enable_ais_smf" = yes])
  430 AC_SUBST([AIS_SMF_ENABLED], ["$enable_ais_smf"])
  431 
  432 AC_MSG_CHECKING([whether to build the SAI-AIS-PLM service])
  433 AC_ARG_ENABLE([ais-plm],
  434 	[AS_HELP_STRING([--disable-ais-plm],
  435 		[disable building the SAI-AIS-PLM service [default=yes]])],
  436 	[],
  437 	[enable_ais_plm=no])
  438 AC_MSG_RESULT([$enable_ais_plm])
  439 
  440 if test "$enable_ais_plm" = yes; then
  441 	AC_DEFINE([ENABLE_AIS_PLM], 1, [Define if PLM is enabled])
  442 fi
  443 
  444 AM_CONDITIONAL([ENABLE_AIS_PLM], [test "$enable_ais_plm" = yes])
  445 AC_SUBST([AIS_PLM_ENABLED], ["$enable_ais_plm"])
  446 
  447 
  448 AC_MSG_CHECKING([whether to install the immxml tools])
  449 AC_ARG_ENABLE([immxml],
  450 	[AS_HELP_STRING([--disable-immxml],
  451 		[disable installing the immxml tools [default=no]])],
  452 	[],
  453 	[enable_immxml=yes])
  454 AC_MSG_RESULT([$enable_immxml])
  455 
  456 AM_CONDITIONAL([ENABLE_IMMXML], [test "$enable_immxml" = yes])
  457 AC_SUBST([IMMXML_ENABLED], ["$enable_immxml"])
  458 
  459 #
  460 # unless explicitly set, drop previx from sysconfdir
  461 # and localstatedir
  462 #
  463 if test "$sysconfdir" = '${prefix}/etc' ; then
  464         if test "$prefix" = 'NONE' ; then
  465                 sysconfdir="/etc"
  466         else
  467                 sysconfdir="$prefix"/etc
  468         fi
  469 fi
  470 
  471 AC_SUBST([sysconfdir])
  472 
  473 if test "$localstatedir" = '${prefix}/var' ; then
  474         if test "$prefix" = 'NONE' ; then
  475                 localstatedir="/var"
  476         else
  477                 localstatedir="$prefix"/var
  478         fi
  479 fi
  480 
  481 AC_SUBST([localstatedir])
  482 
  483 
  484 #############################################
  485 # Checks for programs.
  486 #############################################
  487 AC_PROG_CC
  488 AC_PROG_CXX
  489 AC_PROG_INSTALL
  490 AC_PROG_LIBTOOL
  491 AC_PROG_MAKE_SET
  492 AM_PROG_CC_C_O
  493 
  494 if test "$enable_python" = yes; then
  495         AM_PATH_PYTHON([2.7])
  496 fi
  497 
  498 if test "$enable_java" = yes; then
  499         AC_JAVA_WITH_JDK
  500 
  501         if test "$ac_java_jvm_dir" != ""; then
  502                 AC_SUBST([JAVAC], [$ac_java_jvm_dir"bin/javac"])
  503                 AC_SUBST([JAVADOC], [$ac_java_jvm_dir"bin/javadoc"])
  504         else
  505                 AC_PROG_JAVAC
  506                 AC_PROG_JAVADOC
  507         fi
  508 
  509         AC_JAVA_ANT
  510         AC_SUBST([JAVA_HOME], [$ac_java_jvm_dir])
  511 
  512         # Only handle AM4J if it's enabled explicitly or by configuring the AM4J API jar
  513         if test "$enable_am4j" = yes || test "$with_am4j_api_jar" != no ; then
  514                 enable_am4j=yes
  515                 AC_PROG_AM4J_API
  516                 AC_SUBST([AM4J_API_JAR], ["$with_am4j_api_jar"])
  517                 AM_CONDITIONAL([ENABLE_AM4J], [test "$enable_am4j" = yes])
  518                 AC_SUBST([AM4J_ENABLED], ["$enable_am4j"])
  519         fi
  520 fi
  521 
  522 if test "$enable_java" = no; then
  523         if test "$with_am4j_api_jar" != no || test "$enable_am4j" != no; then
  524                 AC_ERROR([Can't build AM4J support without enabling Java])
  525         fi
  526 fi
  527 
  528 #############################################
  529 # Checks for libraries.
  530 #############################################
  531 PKG_CHECK_MODULES([XML2], [libxml-2.0])
  532 
  533 if test "$enable_ais_plm" = yes; then
  534     PKG_CHECK_MODULES([HPI], [openhpi])
  535     PKG_CHECK_MODULES([LIBVIRT], [libvirt])
  536     PKG_CHECK_MODULES([LIBSYSTEMD], [libsystemd])
  537 
  538     if test "$with_hpi_interface" = check; then
  539        if test "$cross_compiling" = no; then
  540           # Test for the SAHPI_INTERFACE_VERSION
  541           AC_RUN_IFELSE(
  542              [AC_LANG_PROGRAM(
  543                 [#include <openhpi/SaHpi.h>],
  544                 [if (SAHPI_INTERFACE_VERSION != 0x010101) return 1;]
  545              )],
  546              AC_DEFINE(
  547                 [HAVE_HPI_A01], 1, [SAHPI_INTERFACE_VERSION == A01]
  548              )
  549           )
  550           AC_RUN_IFELSE(
  551              [AC_LANG_PROGRAM(
  552                 [#include <openhpi/SaHpi.h>],
  553                 [if (SAHPI_INTERFACE_VERSION != 0x020101) return 1;]
  554              )],
  555              AC_DEFINE(
  556                 [HAVE_HPI_B01], 1, [SAHPI_INTERFACE_VERSION == B01]
  557              )
  558           )
  559           AC_RUN_IFELSE(
  560              [AC_LANG_PROGRAM(
  561                 [#include <openhpi/SaHpi.h>],
  562                 [if (SAHPI_INTERFACE_VERSION != 0x020201) return 1;]
  563              )],
  564              AC_DEFINE(
  565                 [HAVE_HPI_B02], 1, [SAHPI_INTERFACE_VERSION == B02]
  566              )
  567           )
  568           AC_RUN_IFELSE(
  569              [AC_LANG_PROGRAM(
  570                 [#include <openhpi/SaHpi.h>],
  571                 [if (SAHPI_INTERFACE_VERSION != 0x020301) return 1;]
  572              )],
  573              AC_DEFINE(
  574                 [HAVE_HPI_B03], 1, [SAHPI_INTERFACE_VERSION == B03]
  575              )
  576           )
  577        else
  578          AC_ERROR([Autodecting HPI interface version isn't supported while
  579          cross-compiling, force --with-hpi-version])
  580        fi
  581     fi
  582 fi
  583 
  584 if test "$enable_imm_pbe" = yes; then
  585 	PKG_CHECK_MODULES([SQLITE3], [sqlite3])
  586 fi
  587 
  588 if test -z "$OSAF_HARDEN_FLAGS"; then
  589 	# _FORTIFY_SOURCE requires optimization, so only enable it in optimized
  590 	# builds, i.e. when -O is present in both CFLAGS and CXXFLAGS.
  591 	if echo "${CFLAGS}" | grep -q -- -O; then
  592 		if echo "${CXXFLAGS}" | grep -q -- -O; then
  593 			OSAF_HARDEN_FLAGS="-D_FORTIFY_SOURCE=2"
  594 		fi
  595 	fi
  596 	# Also check for -O0 (which explicitly disables optimisation)
  597 	if echo "${CFLAGS} ${CXXFLAGS}" | grep -q -- -O0; then
  598 		OSAF_HARDEN_FLAGS=""
  599 	fi
  600 	OSAF_HARDEN_FLAGS="${OSAF_HARDEN_FLAGS} -fstack-protector --param ssp-buffer-size=4 -fPIE -pie -zrelro -znow"
  601 fi
  602 AC_SUBST(OSAF_HARDEN_FLAGS)
  603 
  604 #############################################
  605 # List the output Makefiles
  606 #############################################
  607 AC_CONFIG_FILES([
  608 	src/ais/lib/opensaf-amf.pc
  609 	src/ais/lib/opensaf-ckpt.pc
  610 	src/ais/lib/opensaf-clm.pc
  611 	src/ais/lib/opensaf-evt.pc
  612 	src/ais/lib/opensaf-imm.pc
  613 	src/ais/lib/opensaf-lck.pc
  614 	src/ais/lib/opensaf-log.pc
  615 	src/ais/lib/opensaf-msg.pc
  616 	src/ais/lib/opensaf-ntf.pc
  617 	src/ais/lib/opensaf-plm.pc
  618 	src/ais/lib/opensaf-smf.pc
  619 	src/amf/amfd/osaf-amfd
  620 	src/amf/amfnd/osaf-amfnd
  621 	src/amf/amfwd/osaf-amfwd
  622 	src/ckpt/ckptd/osaf-ckptd
  623 	src/ckpt/ckptnd/osaf-ckptnd
  624 	src/clm/clmd/osaf-clmd
  625 	src/clm/clmnd/osaf-clmna
  626 	src/dtm/dtmnd/osaf-dtm
  627 	src/dtm/transport/osaf-transport
  628 	src/evt/evtd/osaf-evtd
  629 	src/fm/fmd/osaf-fmd
  630 	src/imm/immd/osaf-immd
  631 	src/imm/immnd/osaf-immnd
  632 	src/lck/lckd/osaf-lckd
  633 	src/lck/lcknd/osaf-lcknd
  634 	src/log/logd/osaf-logd
  635 	src/msg/msgd/osaf-msgd
  636 	src/msg/msgnd/osaf-msgnd
  637 	src/nid/configure_tipc
  638 	src/nid/opensafd
  639 	src/nid/opensafd.service
  640 	src/ntf/ntfd/osaf-ntfd
  641 	src/plm/plmcd/plmcboot
  642 	src/plm/plmcd/plmcboot.service
  643 	src/plm/plmcd/plmcd
  644 	src/plm/plmcd/plmcd.service
  645 	src/plm/plmd/osaf-plmd
  646 	src/rde/rded/osaf-rded
  647 	src/smf/smfd/osaf-smfd
  648 	src/smf/smfnd/osaf-smfnd
  649         Doxyfile
  650         Makefile
  651         opensaf.spec
  652         pkgconfig/opensaf.pc])
  653 
  654 AC_OUTPUT
  655 
  656 echo ""
  657 echo "======================================================="
  658 echo "OpenSAF Build Configuration Summary"
  659 echo "======================================================="
  660 echo " Version: $VERSION"
  661 echo " Release: $OPENSAF_RPM_RELEASE"
  662 echo ""
  663 echo " Installation Directories:"
  664 echo "${ECHO_T}  prefix: ${prefix}"
  665 echo "${ECHO_T}  exec_prefix: ${exec_prefix}"
  666 echo "${ECHO_T}  bindir: ${bindir}"
  667 echo "${ECHO_T}  sbindir: ${sbindir}"
  668 echo "${ECHO_T}  datadir: ${datadir}"
  669 echo "${ECHO_T}  sysconfdir: ${sysconfdir}"
  670 echo "${ECHO_T}  docdir: ${docdir}"
  671 echo "${ECHO_T}  localstatedir: ${localstatedir}"
  672 echo "${ECHO_T}  includedir: ${includedir}"
  673 echo "${ECHO_T}  libdir: ${libdir}"
  674 echo ""
  675 echo " Compiling Options:"
  676 echo "${ECHO_T}  C Compiler: ${CC}"
  677 echo "${ECHO_T}  C++ Compiler: ${CXX}"
  678 echo "${ECHO_T}  CPPFLAGS: ${CPPFLAGS} ${AM_CPPFLAGS}"
  679 echo "${ECHO_T}  CFLAGS: ${CFLAGS} ${AM_CFLAGS}"
  680 echo "${ECHO_T}  CXXFLAGS: ${CXXFLAGS} ${AM_CXXFLAGS}"
  681 echo "${ECHO_T}  OSAF_HARDEN_FLAGS: ${OSAF_HARDEN_FLAGS}"
  682 echo "${ECHO_T}  LDFLAGS: ${LDFLAGS}"
  683 echo "${ECHO_T}  Enable RPATH: ${enable_rpath}"
  684 
  685 if test "$srcdir" == "."; then
  686         echo "${ECHO_T}  Using VPATH: no"
  687 else
  688         echo "${ECHO_T}  Using VPATH: yes"
  689 fi
  690 
  691 AM_CONDITIONAL([WITH_VPATH], [test "$srcdir" != "."])
  692 
  693 echo ""
  694 echo " Dependencies Options:"
  695 
  696 if test "$enable_ais_plm" = yes; then
  697         echo "${ECHO_T}  HPI_CFLAGS: ${HPI_CFLAGS}"
  698         echo "${ECHO_T}  HPI_LIBS: ${HPI_LIBS}"
  699         echo "${ECHO_T}  LIBVIRT_CFLAGS: ${LIBVIRT_CFLAGS}"
  700         echo "${ECHO_T}  LIBVIRT_LIBS: ${LIBVIRT_LIBS}"
  701         echo "${ECHO_T}  SYSTEMD_CFLAGS: ${LIBSYSTEMD_CFLAGS}"
  702         echo "${ECHO_T}  SYSTEMD_LIBS: ${LIBSYSTEMD_LIBS}"
  703 fi
  704 
  705 if test "$enable_imm_pbe" = yes; then
  706         echo "${ECHO_T}  SQLITE3_CFLAGS: ${SQLITE3_CFLAGS}"
  707         echo "${ECHO_T}  SQLITE3_LIBS: ${SQLITE3_LIBS}"
  708 fi
  709 
  710 echo "${ECHO_T}  XML2_CFLAGS: ${XML2_CFLAGS}"
  711 echo "${ECHO_T}  XML2_LIBS: ${XML2_LIBS}"
  712 echo ""
  713 echo " OpenSAF Options:"
  714 echo "${ECHO_T}  Enable Python AIS Bindings: ${enable_python}"
  715 echo "${ECHO_T}  Enable Java AIS Mapping: ${enable_java}"
  716 echo "${ECHO_T}  Enable AM4J: ${enable_am4j}"
  717 echo "${ECHO_T}  Enable PLM support: ${enable_ais_plm}"
  718 echo "${ECHO_T}  Enable TIPC transport: ${enable_tipc}"
  719 echo "${ECHO_T}  Enable systemd: ${enable_systemd}"
  720 echo "======================================================="
  721 echo ""