Rich Burridge
2015-01-28 8d70f82a01bb895e344e4d551a8ee5de7ac63dbb
commit | author | age
b83771 1 #
GT-SM-BI 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 #
1d7251 21 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
b83771 22 #
GT-SM-BI 23 include ../../make-rules/shared-macros.mk
24
25 PATH=$(SPRO_VROOT)/bin:/usr/gnu/bin:/usr/bin
26 DOXYGEN=/usr/bin/doxygen
27
28 COMPONENT_NAME=        net-snmp
29 COMPONENT_VERSION=    5.4.1
0cc452 30 COMPONENT_PATCHLEVEL=    2
fa2fbb 31 COMPONENT_REVISION=    3
0cc452 32 IPS_COMPONENT_VERSION=  $(COMPONENT_VERSION).$(COMPONENT_PATCHLEVEL)
60e6e0 33 COMPONENT_PROJECT_URL=    http://www.net-snmp.org/
0cc452 34 COMPONENT_SRC=        $(COMPONENT_NAME)-$(COMPONENT_VERSION).$(COMPONENT_PATCHLEVEL)
b83771 35 COMPONENT_ARCHIVE=    $(COMPONENT_SRC).tar.gz
35e110 36 COMPONENT_ARCHIVE_HASH= \
0cc452 37     sha256:17d67076ab5c5fb6dfaffe70a2757526f99b0638bca102dec27af08ec01a9068
b83771 38 COMPONENT_ARCHIVE_URL= http://ftp.ntua.gr/mirror/net-snmp/OldFiles/net-snmp-5.4.x/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
3b89c9 39 COMPONENT_BUGDB=    service/net-snmp utility/net-snmp library/net-snmp
b83771 40
GT-SM-BI 41 include $(WS_TOP)/make-rules/prep.mk
42 include $(WS_TOP)/make-rules/configure.mk
43 include $(WS_TOP)/make-rules/ips.mk
44
06dc6f 45 COMPONENT_BUILD_ARGS=
AP 46
b83771 47 CPPFLAGS += "-DFALSE_SHARING_ALIGN=64"
0cc452 48
AP 49 CONFIGURE_ENV      +=   PERLPROG=$(PERL)
b83771 50
GT-SM-BI 51 CONFIGURE_OPTIONS  +=    --with-default-snmp-version=3
52 CONFIGURE_OPTIONS  +=    --with-sys-contact="root@localhost"
53 CONFIGURE_OPTIONS  +=    --with-sys-location=Unknown
54 CONFIGURE_OPTIONS  +=    --with-logfile=/var/log/snmpd.log
55 CONFIGURE_OPTIONS  +=    --with-persistent-directory=/var/net-snmp
56
57 CONFIGURE_OPTIONS  +=    --with-mibdirs=/etc/net-snmp/snmp/mibs
17e85f 58 CONFIGURE_OPTIONS  +=    --datadir=/etc/net-snmp
b83771 59 CONFIGURE_OPTIONS  +=    --enable-agentx-dom-sock-only
GT-SM-BI 60 CONFIGURE_OPTIONS  +=    --enable-ucd-snmp-compatibility
61 CONFIGURE_OPTIONS  +=    --enable-ipv6
62 CONFIGURE_OPTIONS  +=    --enable-mfd-rewrites
63 CONFIGURE_OPTIONS  +=    --with-pkcs
64 CONFIGURE_OPTIONS  +=    --with-transports="UDP TCP UDPIPv6 TCPIPv6"
0cc452 65
AP 66 # Embedded perl is disabled, because it causes 
67 # failures during illumos build 
68 # (  https://www.illumos.org/issues/4190 )
69 # If you want to enable it, also turn on --enable-as-needed,
70 # uncomment #dep_rpath="$dep_rpath $flag" in ltmain.sh patch
71 # and add necessary patches to pass -fstack-protector option
72 # to libtool ( one of the options is to patch Makefiles.in )
73 CONFIGURE_OPTIONS  +=    --disable-embedded-perl
74 #CONFIGURE_OPTIONS  +=    --enable-as-needed
b83771 75
GT-SM-BI 76 # Which MIB modules do we want to build
77 MIB_MOBULES.sparc = ucd-snmp/lmSensors
78 MIB_MODULES = host disman/event-mib ucd-snmp/diskio udp-mib tcp-mib if-mib
79 MIB_MOBULES += $(MIB_MODULES.$(MACH))
80 CONFIGURE_OPTIONS  +=    --with-mib-modules="$(MIB_MODULES)"
81
1d7251 82 # Python bindings support.
RB 83 PYTHON_ARGS =        --basedir=/usr/bin
84 CONFIGURE_OPTIONS  +=    --with-python-modules="$(PYTHON_ARGS)"
85
b83771 86 # Only build 32 bit Perl support
GT-SM-BI 87 PERL_ARGS =            DESTDIR=$(PROTO_DIR) INSTALLDIRS=vendor
720c9a 88 CONFIGURE_OPTIONS.32  +=    PERLPROG="$(PERL)"
b83771 89 CONFIGURE_OPTIONS.32  +=    --with-perl-modules="$(PERL_ARGS)"
GT-SM-BI 90 CONFIGURE_OPTIONS.32  +=    --disable-perl-cc-checks
91
92 CONFIGURE_OPTIONS.64  +=    --without-perl-modules
93
94 CONFIGURE_OPTIONS    +=    CFLAGS="$(CFLAGS)"
95 CONFIGURE_OPTIONS    +=    CPPFLAGS="$(CPPFLAGS)"
96 CONFIGURE_OPTIONS    +=    CC="$(CC)"
97
98 PKG_MACROS +=    BUILD_DIR=$(BUILD_DIR)
99
0cc452 100 COMPONENT_PREP_ACTION = \
AP 101         (cd $(@D) ; \
102             autoconf ; )
103
104
b83771 105 COMPONENT_PRE_CONFIGURE_ACTION = \
GT-SM-BI 106     ($(CLONEY) $(SOURCE_DIR) $(@D); $(CLONEY) $(COMPONENT_DIR)/sun $(@D)/sun)
107
1d7251 108 # After we have configured, make a copy of the python bits so we
RB 109 # can build separate python 2.7 support.
4ed1c0 110 COMPONENT_POST_CONFIGURE_ACTION = (cd $(@D) ; cp -rp python python2.7)
1d7251 111
b83771 112 # for the goofy definition of ARCH in the extra Makefiles
GT-SM-BI 113 ARCH=32
114 ARCH=$(BITS:64=$(MACH64))
115
116 CCSMAKE_ARGS =    CC="$(CC)" CFGPREFIX=/usr CFGLIB64=/usr/lib/$(MACH64)
117 CCSMAKE_ARGS +=    CFGLIB=/usr/lib ARCH=$(ARCH) ROOT=$(PROTO_DIR)
118
8d70f8 119 COMPONENT_TEST_DIR =        $(COMPONENT_DIR)
RB 120 COMPONENT_TEST_CMD =        $(KSH93)
121 COMPONENT_TEST_TARGETS =    ./run-tests $(BUILD_DIR) $(MACH32) $(MACH64)
122
b83771 123 $(BUILD_32): COMPONENT_POST_BUILD_ACTION= \
GT-SM-BI 124     (cd $(BUILD_DIR)/$(MACH32)/sun ; ls agent; $(CCSMAKE) -e $(CCSMAKE_ARGS))
125
126 $(BUILD_64): COMPONENT_POST_BUILD_ACTION= \
127     (cd $(BUILD_DIR)/$(MACH64)/sun ; ls agent; $(CCSMAKE) -e $(CCSMAKE_ARGS))
128
1d7251 129 $(INSTALL_32): COMPONENT_INSTALL_ARGS += PYTHON_VENDOR_PACKAGES=$(PYTHON_VENDOR_PACKAGES)
RB 130
b83771 131 $(INSTALL_32): COMPONENT_POST_INSTALL_ACTION= \
GT-SM-BI 132     ($(MKDIR) -p $(BUILD_DIR)/prototype/$(MACH)/etc/net-snmp/snmp/mibs; \
4ed1c0 133      cd $(BUILD_DIR)/$(MACH32)/sun ; ls agent; $(CCSMAKE) -e $(CCSMAKE_ARGS) install) ;\
AP 134     (cd $(@D)/python2.7 ; env PYTHON=$(PYTHON.2.7.$(BITS)) \
135       $(PYTHON.2.7.$(BITS)) ./setup.py install \
136                 --root $(PROTO_DIR) \
137                 --install-lib=$(PYTHON.2.7.VENDOR_PACKAGES))
b83771 138
GT-SM-BI 139 $(INSTALL_64): COMPONENT_POST_INSTALL_ACTION= \
140     ($(MKDIR) -p $(BUILD_DIR)/prototype/$(MACH64)/etc/net-snmp/snmp/mibs; \
141      cd $(BUILD_DIR)/$(MACH64)/sun ; ls agent; $(CCSMAKE) -e $(CCSMAKE_ARGS) install)
142
143 # common targets
144 build:    $(BUILD_32_and_64) $(BUILD_DIR_32)/.docs
145
146 $(INSTALL_64): COMPONENT_INSTALL_ARGS += DESTDIR=$(BUILD_DIR)/prototype/$(MACH64)
147
148 install:    build $(INSTALL_32_and_64)
149
8d70f8 150 test:    $(TEST_32_and_64)
b83771 151
GT-SM-BI 152 # build the docs
153 $(BUILD_DIR_32)/.docs:
154     (cd $(@D) ; $(ENV) srcdir=$(@D) $(DOXYGEN) -u $(@D)/doxygen.conf ; \
155         $(ENV) srcdir=$(@D) $(DOXYGEN) $(@D)/doxygen.conf)
156     $(TOUCH) $@