components/net-snmp-57/Makefile
changeset 5867 445e2cf1c845
parent 5748 e80cda8309df
child 6161 1496c757b097
equal deleted inserted replaced
5866:683c5c035a79 5867:445e2cf1c845
       
     1 #
       
     2 # CDDL HEADER START
       
     3 #
       
     4 # The contents of this file are subject to the terms of the
       
     5 # Common Development and Distribution License (the "License").
       
     6 # You may not use this file except in compliance with the License.
       
     7 #
       
     8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
       
     9 # or http://www.opensolaris.org/os/licensing.
       
    10 # See the License for the specific language governing permissions
       
    11 # and limitations under the License.
       
    12 #
       
    13 # When distributing Covered Code, include this CDDL HEADER in each
       
    14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
       
    15 # If applicable, add the following below this CDDL HEADER, with the
       
    16 # fields enclosed by brackets "[]" replaced with your own identifying
       
    17 # information: Portions Copyright [yyyy] [name of copyright owner]
       
    18 #
       
    19 # CDDL HEADER END
       
    20 #
       
    21 
       
    22 #
       
    23 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
       
    24 #
       
    25 # net-snmp has a "special" build where only 32-bit items are installed into
       
    26 # proto area; so prefer 32-bit to preserve existing sourcing.
       
    27 BUILD_BITS= 32_and_64
       
    28 include ../../make-rules/shared-macros.mk
       
    29 
       
    30 PATH=$(SPRO_VROOT)/bin:$(GNUBIN):$(USRBINDIR)
       
    31 
       
    32 COMPONENT_NAME=		net-snmp
       
    33 COMPONENT_VERSION=	5.7.2.1
       
    34 COMPONENT_PROJECT_URL=	http://www.net-snmp.org/
       
    35 COMPONENT_ARCHIVE_HASH= \
       
    36     sha256:35dd20a2b17849f6d5a0a6109b4f52c1a777a3e1a00c79c4a175c520d23f3497
       
    37 COMPONENT_ARCHIVE_URL=	http://ftp.ntua.gr/mirror/net-snmp/net-snmp/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
       
    38 #COMPONENT_ARCHIVE_URL= http://ftp.ntua.gr/mirror/net-snmp/OldFiles/net-snmp-5.4.x/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
       
    39 COMPONENT_BUGDB=	service/net-snmp utility/net-snmp library/net-snmp
       
    40 
       
    41 TPNO=			13120
       
    42 
       
    43 BUILD_32_and_64 += $(BUILD_DIR_32)/.docs
       
    44 INSTALL_TARGET= build $(INSTALL_32_and_64)
       
    45 include $(WS_MAKE_RULES)/common.mk
       
    46 
       
    47 studio_C99MODE= $(studio_C99_ENABLE)
       
    48 CPPFLAGS += "-DFALSE_SHARING_ALIGN=64"
       
    49 
       
    50 CONFIGURE_ENV +=	PYTHONPROG=$(PYTHON.$(BITS))
       
    51 
       
    52 CONFIGURE_OPTIONS  +=	--with-default-snmp-version=3
       
    53 CONFIGURE_OPTIONS  +=	--with-sys-contact="root@localhost"
       
    54 CONFIGURE_OPTIONS  +=	--with-sys-location=Unknown
       
    55 CONFIGURE_OPTIONS  +=	--with-logfile=$(VARDIR)/log/snmpd.log
       
    56 CONFIGURE_OPTIONS  +=	--with-persistent-directory=$(VARDIR)/net-snmp
       
    57 
       
    58 CONFIGURE_OPTIONS  +=	--with-mibdirs=$(ETCDIR)/net-snmp/snmp/mibs
       
    59 CONFIGURE_OPTIONS  +=	--datadir=$(ETCDIR)/net-snmp
       
    60 CONFIGURE_OPTIONS  +=	--enable-agentx-dom-sock-only
       
    61 CONFIGURE_OPTIONS  +=	--enable-ucd-snmp-compatibility
       
    62 CONFIGURE_OPTIONS  +=	--enable-ipv6
       
    63 CONFIGURE_OPTIONS  +=	--enable-mfd-rewrites
       
    64 CONFIGURE_OPTIONS  +=	--with-openssl=/lib/openssl
       
    65 CONFIGURE_OPTIONS  +=	--with-transports="UDP TCP UDPIPv6 TCPIPv6"
       
    66 CONFIGURE_OPTIONS  +=   --sysconfdir=$(ETCDIR)/net-snmp
       
    67 
       
    68 # Which MIB modules do we want to build
       
    69 MIB_MOBULES.sparc = ucd-snmp/lmSensors
       
    70 MIB_MODULES = host disman/event-mib ucd-snmp/diskio udp-mib tcp-mib if-mib
       
    71 MIB_MOBULES += $(MIB_MODULES.$(MACH))
       
    72 CONFIGURE_OPTIONS  +=	--with-mib-modules="$(MIB_MODULES)"
       
    73 
       
    74 # Python bindings support.
       
    75 PYTHON_ARGS =		--basedir=/usr/bin
       
    76 CONFIGURE_OPTIONS  +=	--with-python-modules="$(PYTHON_ARGS)"
       
    77 
       
    78 # Only build 64 bit Perl support
       
    79 PERL_ARGS =			DESTDIR=$(PROTO_DIR) INSTALLDIRS=vendor
       
    80 CONFIGURE_OPTIONS.32  +=	--disable-embedded-perl
       
    81 CONFIGURE_OPTIONS.32  +=	--without-perl-modules
       
    82 CONFIGURE_OPTIONS.64  +=	PERLPROG="$(PERL)"
       
    83 CONFIGURE_OPTIONS.64  +=	--with-perl-modules="$(PERL_ARGS)"
       
    84 CONFIGURE_OPTIONS.64  +=	--disable-perl-cc-checks
       
    85 
       
    86 COMPONENT_PRE_CONFIGURE_ACTION = \
       
    87 	($(CLONEY) $(SOURCE_DIR) $(@D); $(CLONEY) $(COMPONENT_DIR)/sun $(@D)/sun)
       
    88 
       
    89 # for the goofy definition of ARCH in the extra Makefiles
       
    90 ARCH=32
       
    91 ARCH=$(BITS:64=$(MACH64))
       
    92 
       
    93 CCSMAKE_ARGS =	CC="$(CC)" CFGPREFIX=$(USRDIR) CFGLIB64=$(USRLIBDIR64)
       
    94 CCSMAKE_ARGS +=	CFGLIB=$(USRLIBDIR) ARCH=$(ARCH) ROOT=$(PROTO_DIR)
       
    95 
       
    96 COMPONENT_TEST_DIR =		$(COMPONENT_DIR)
       
    97 COMPONENT_TEST_CMD =		$(KSH93)
       
    98 COMPONENT_TEST_TARGETS =	./run-tests $(BUILD_DIR) $(MACH32) $(MACH64)
       
    99 
       
   100 # perl man pages hiding here in 64-bit PROTO_DIR
       
   101 PKG_PROTO_DIRS += $(BUILD_DIR)/prototype/$(MACH64)
       
   102 
       
   103 $(BUILD_32): COMPONENT_POST_BUILD_ACTION= \
       
   104 	(cd $(BUILD_DIR)/$(MACH32)/sun ; ls agent; $(CCSMAKE) -e $(CCSMAKE_ARGS))
       
   105 
       
   106 $(BUILD_64): COMPONENT_POST_BUILD_ACTION= \
       
   107 	(cd $(BUILD_DIR)/$(MACH64)/sun ; ls agent; $(CCSMAKE) -e $(CCSMAKE_ARGS))
       
   108 
       
   109 $(INSTALL_32): COMPONENT_INSTALL_ARGS += PYTHON_VENDOR_PACKAGES=$(PYTHON_VENDOR_PACKAGES)
       
   110 
       
   111 $(INSTALL_32): COMPONENT_POST_INSTALL_ACTION= \
       
   112 	($(MKDIR) -p $(BUILD_DIR)/prototype/$(MACH)/etc/net-snmp/snmp/mibs; \
       
   113 	 cd $(BUILD_DIR)/$(MACH32)/sun ; ls agent; $(CCSMAKE) -e $(CCSMAKE_ARGS) install)
       
   114 
       
   115 $(INSTALL_64): COMPONENT_POST_INSTALL_ACTION= \
       
   116 	($(MKDIR) -p $(BUILD_DIR)/prototype/$(MACH64)/etc/net-snmp/snmp/mibs; \
       
   117 	 cd $(BUILD_DIR)/$(MACH64)/sun ; ls agent; $(CCSMAKE) -e $(CCSMAKE_ARGS) install)
       
   118 
       
   119 $(INSTALL_64): COMPONENT_INSTALL_ARGS += DESTDIR=$(BUILD_DIR)/prototype/$(MACH64)
       
   120 
       
   121 # build the docs
       
   122 $(BUILD_DIR_32)/.docs:
       
   123 	(cd $(@D) ; $(ENV) srcdir=$(@D) $(DOXYGEN) -u $(@D)/doxygen.conf ; \
       
   124 	    $(ENV) srcdir=$(@D) $(DOXYGEN) $(@D)/doxygen.conf)
       
   125 	$(TOUCH) $@
       
   126 
       
   127 REQUIRED_PACKAGES += developer/documentation-tool/doxygen
       
   128 REQUIRED_PACKAGES += library/security/openssl
       
   129 REQUIRED_PACKAGES += $(PERL_PKG)
       
   130 REQUIRED_PACKAGES += runtime/python-27
       
   131 REQUIRED_PACKAGES += shell/bash
       
   132 REQUIRED_PACKAGES += shell/ksh93
       
   133 REQUIRED_PACKAGES += system/core-os
       
   134 REQUIRED_PACKAGES += system/linker
       
   135 REQUIRED_PACKAGES += system/management/snmp/net-snmp
       
   136 REQUIRED_PACKAGES += system/network