5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
3b4098640dd85040270f39b9a5ee5e22de99d3d6Mark Andrews# CDDL HEADER START
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# The contents of this file are subject to the terms of the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Common Development and Distribution License (the "License").
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# You may not use this file except in compliance with the License.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# or http://www.opensolaris.org/os/licensing.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# See the License for the specific language governing permissions
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# and limitations under the License.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# If applicable, add the following below this CDDL HEADER, with the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# fields enclosed by brackets "[]" replaced with your own identifying
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# CDDL HEADER END
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsBUILD_BITS= 64_and_32
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude ../../make-rules/shared-macros.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_NAME= readline
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_VERSION= 6.3
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_PROJECT_URL= http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_ARCHIVE_HASH= \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews sha256:56ba6071b9462f980c5a72ab0023893b65ba6debb4eeb475d7a563dc65cafd43
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_BUGDB= library/readline
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTPNO_V6= 22356
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTPNO_V5= 9042
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# For now, we want to continue to provide the libreadline and libhistory so's
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# (and their links) from readline 5.2.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_VERSION_1 = 5.2
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_SRC_1 = $(COMPONENT_NAME)-$(COMPONENT_VERSION_1)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_ARCHIVE_1 = $(COMPONENT_SRC_1).tar.gz
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_ARCHIVE_HASH_1 = \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews sha256:12e88d96aee2cd1192500356f0535540db499282ca7f76339fb4228c31249f45
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_ARCHIVE_URL_1 = http://ftp.gnu.org/gnu/readline/$(COMPONENT_ARCHIVE_1)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsSOURCE_DIR_1 = $(COMPONENT_DIR)/$(COMPONENT_SRC_1)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsBUILD_TARGET=
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsINSTALL_TARGET=
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTEST_TARGET= install $(TEST_32_and_64)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsSYSTEM_TEST_TARGET= configure $(SYSTEM_TEST_32_and_64)
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrewsinclude $(WS_MAKE_RULES)/gnu-component.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsLINT_FLAGS += -I$(PROTOUSRINCDIR)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# readline likes to use ld directly and this is the easiest
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# way to get it to add -lc
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsLDFLAGS += -lc
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark AndrewsCONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCONFIGURE_OPTIONS += --enable-shared
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Build the readline examples as well.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_BUILD_TARGETS = everything
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_TEST_DIR = $(@D)/examples
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_TEST_CMD = $(CAT) $(SOURCE_DIR)/examples/Inputrc | ./rlcat
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_TEST_TARGETS =
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Master test results are the same for 32-bit and 64-bit, so override
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# here, rather than create multiple identical master files.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Needed to build the test program.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_PRE_SYSTEM_TEST_ACTION += \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews (cd $(@D) ; $(GMAKE) libreadline.a ) ;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Build the test program.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_PRE_SYSTEM_TEST_ACTION += \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews (cd $(@D)/examples ; $(GMAKE) rlcat ) ;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Get correct libreadline.so.6 from the proto area.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTEST_LIBPATH.32 = $(PROTOUSRLIBDIR)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTEST_LIBPATH.64 = $(PROTOUSRLIBDIR64)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_TEST_ENV += LD_LIBRARY_PATH=$(TEST_LIBPATH.$(BITS))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_SYSTEM_TEST_DIR = $(@D)/examples
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_SYSTEM_TEST_CMD = $(CAT) $(SOURCE_DIR)/examples/Inputrc | ./rlcat
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_SYSTEM_TEST_TARGETS =
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews# Macros to configure, build, and install the old version for the time being.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsBUILD_OLD_DIR_32 = $(COMPONENT_DIR)/build/$(COMPONENT_VERSION_1)-$(MACH32)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsBUILD_OLD_DIR_64 = $(COMPONENT_DIR)/build/$(COMPONENT_VERSION_1)-$(MACH64)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(BUILD_OLD_DIR_32)/.configured: CONFIGURE_SCRIPT = $(SOURCE_DIR_1)/configure
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(BUILD_OLD_DIR_64)/.configured: CONFIGURE_SCRIPT = $(SOURCE_DIR_1)/configure
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(BUILD_OLD_DIR_32)/.configured: BITS=32
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews$(BUILD_OLD_DIR_64)/.configured: BITS=64
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsBUILD_32 += $(BUILD_OLD_DIR_32)/.built
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsBUILD_64 += $(BUILD_OLD_DIR_64)/.built
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsINSTALL_32 += $(BUILD_OLD_DIR_32)/.installed
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark AndrewsINSTALL_64 += $(BUILD_OLD_DIR_64)/.installed
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# install the old version first
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(BUILD_DIR_32)/.installed: $(BUILD_OLD_DIR_32)/.installed
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(BUILD_DIR_64)/.installed: $(BUILD_OLD_DIR_64)/.installed
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsPKG_MACROS += COMPONENT_VERSION_1=$(COMPONENT_VERSION_1)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsbuild: $(BUILD_32_and_64)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinstall: $(INSTALL_32_and_64)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews