configure.mk revision 4239
184N/A#
184N/A# CDDL HEADER START
184N/A#
184N/A# The contents of this file are subject to the terms of the
184N/A# Common Development and Distribution License (the "License").
184N/A# You may not use this file except in compliance with the License.
184N/A#
184N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
184N/A# or http://www.opensolaris.org/os/licensing.
184N/A# See the License for the specific language governing permissions
184N/A# and limitations under the License.
184N/A#
184N/A# When distributing Covered Code, include this CDDL HEADER in each
184N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
184N/A# If applicable, add the following below this CDDL HEADER, with the
184N/A# fields enclosed by brackets "[]" replaced with your own identifying
184N/A# information: Portions Copyright [yyyy] [name of copyright owner]
184N/A#
184N/A# CDDL HEADER END
184N/A#
184N/A# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
184N/A#
844N/A
184N/A#
184N/A# Rules and Macros for building opens source software that uses configure /
184N/A# GNU auto* tools to configure their build for the system they are on. This
184N/A# uses GNU Make to build the components to take advantage of the viewpath
184N/A# support and build multiple version (32/64 bit) from a shared source.
184N/A#
618N/A# To use these rules, include $(WS_MAKE_RULES)/configure.mk in your Makefile
184N/A# and define "build", "install", and "test" targets appropriate to building
184N/A# your component.
844N/A# Ex:
844N/A#
184N/A# build: $(SOURCE_DIR)/build/$(MACH32)/.built \
1273N/A# $(SOURCE_DIR)/build/$(MACH64)/.built
184N/A#
184N/A# install: $(SOURCE_DIR)/build/$(MACH32)/.installed \
184N/A# $(SOURCE_DIR)/build/$(MACH64)/.installed
184N/A#
184N/A# test: $(SOURCE_DIR)/build/$(MACH32)/.tested \
184N/A# $(SOURCE_DIR)/build/$(MACH64)/.tested
881N/A#
881N/A# Any additional pre/post configure, build, or install actions can be specified
881N/A# in your make file by setting them in on of the following macros:
881N/A# COMPONENT_PRE_CONFIGURE_ACTION, COMPONENT_POST_CONFIGURE_ACTION
881N/A# COMPONENT_PRE_BUILD_ACTION, COMPONENT_POST_BUILD_ACTION
881N/A# COMPONENT_PRE_INSTALL_ACTION, COMPONENT_POST_INSTALL_ACTION
881N/A# COMPONENT_PRE_TEST_ACTION, COMPONENT_POST_TEST_ACTION
881N/A#
881N/A# If component specific make targets need to be used for build or install, they
881N/A# can be specified in
881N/A# COMPONENT_BUILD_TARGETS, COMPONENT_INSTALL_TARGETS
881N/A# COMPONENT_TEST_TARGETS
881N/A#
881N/A
184N/ACONFIGURE_PREFIX = /usr
881N/A
184N/ACONFIGURE_BINDIR.32 = $(CONFIGURE_PREFIX)/bin
881N/ACONFIGURE_BINDIR.64 = $(CONFIGURE_PREFIX)/bin/$(MACH64)
881N/ACONFIGURE_LIBDIR.32 = $(CONFIGURE_PREFIX)/lib
881N/ACONFIGURE_LIBDIR.64 = $(CONFIGURE_PREFIX)/lib/$(MACH64)
184N/ACONFIGURE_SBINDIR.32 = $(CONFIGURE_PREFIX)/sbin
184N/ACONFIGURE_SBINDIR.64 = $(CONFIGURE_PREFIX)/sbin/$(MACH64)
184N/ACONFIGURE_MANDIR = $(CONFIGURE_PREFIX)/share/man
184N/ACONFIGURE_LOCALEDIR = $(CONFIGURE_PREFIX)/share/locale
881N/A# all texinfo documentation seems to go to /usr/share/info no matter what
881N/ACONFIGURE_INFODIR = /usr/share/info
881N/ACONFIGURE_INCLUDEDIR = /usr/include
881N/A
881N/ACONFIGURE_ENV = CONFIG_SHELL="$(CONFIG_SHELL)"
881N/A
881N/ACONFIGURE_DEFAULT_DIRS?=yes
881N/A
881N/ACONFIGURE_OPTIONS += CC="$(CC)"
881N/ACONFIGURE_OPTIONS += CXX="$(CXX)"
184N/ACONFIGURE_OPTIONS += --prefix=$(CONFIGURE_PREFIX)
881N/Aifeq ($(CONFIGURE_DEFAULT_DIRS),yes)
881N/ACONFIGURE_OPTIONS += --mandir=$(CONFIGURE_MANDIR)
881N/ACONFIGURE_OPTIONS += --bindir=$(CONFIGURE_BINDIR.$(BITS))
184N/ACONFIGURE_OPTIONS += --libdir=$(CONFIGURE_LIBDIR.$(BITS))
184N/ACONFIGURE_OPTIONS += --sbindir=$(CONFIGURE_SBINDIR.$(BITS))
184N/Aendif
184N/ACONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS))
184N/A
184N/ACOMPONENT_INSTALL_ARGS += DESTDIR=$(PROTO_DIR)
184N/A
184N/A$(BUILD_DIR_32)/.configured: BITS=32
184N/A$(BUILD_DIR_64)/.configured: BITS=64
881N/A
184N/ACONFIGURE_ENV += $(CONFIGURE_ENV.$(BITS))
184N/Aifeq ($(strip $(PARFAIT_BUILD)),yes)
184N/A# parfait creates '*.bc' files which can confuse configure's
184N/A# object/exe extension detection. which we really don't need it
184N/A# to do anyway, so we'll just tell it what they are.
881N/ACONFIGURE_ENV += ac_cv_objext=o
881N/ACONFIGURE_ENV += ac_cv_exeext=""
881N/A# this is fixed in the clang compiler but we can't use it yet
881N/ACONFIGURE_ENV += ac_cv_header_stdbool_h=yes
881N/Aendif
184N/A
184N/A
184N/A# temporarily work around some issues
184N/ACONFIGURE_ENV += "ac_cv_func_realloc_0_nonnull=yes"
184N/ACONFIGURE_ENV += "NM=/usr/gnu/bin/nm"
184N/ACOMPONENT_BUILD_ENV += "ac_cv_func_realloc_0_nonnull=yes"
184N/A
184N/A# configure the unpacked source for building 32 and 64 bit version
184N/ACONFIGURE_SCRIPT = $(SOURCE_DIR)/configure
881N/A$(BUILD_DIR)/%/.configured: $(SOURCE_DIR)/.prep
881N/A ($(RM) -rf $(@D) ; $(MKDIR) $(@D))
881N/A $(COMPONENT_PRE_CONFIGURE_ACTION)
184N/A (cd $(@D) ; $(ENV) $(CONFIGURE_ENV) $(CONFIG_SHELL) \
184N/A $(CONFIGURE_SCRIPT) $(CONFIGURE_OPTIONS))
184N/A $(COMPONENT_POST_CONFIGURE_ACTION)
$(TOUCH) $@
# build the configured source
$(BUILD_DIR)/%/.built: $(BUILD_DIR)/%/.configured
$(COMPONENT_PRE_BUILD_ACTION)
(cd $(@D) ; $(ENV) $(COMPONENT_BUILD_ENV) \
$(GMAKE) $(COMPONENT_BUILD_ARGS) $(COMPONENT_BUILD_TARGETS))
$(COMPONENT_POST_BUILD_ACTION)
ifeq ($(strip $(PARFAIT_BUILD)),yes)
-$(PARFAIT) $(@D)
endif
$(TOUCH) $@
# install the built source into a prototype area
$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
$(COMPONENT_PRE_INSTALL_ACTION)
(cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) $(GMAKE) \
$(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS))
$(COMPONENT_POST_INSTALL_ACTION)
$(TOUCH) $@
# test the built source
$(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
$(COMPONENT_PRE_TEST_ACTION)
(cd $(@D) ; $(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) $(GMAKE) \
$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS))
$(COMPONENT_POST_TEST_ACTION)
$(TOUCH) $@
ifeq ($(strip $(PARFAIT_BUILD)),yes)
parfait: build
else
parfait:
$(MAKE) PARFAIT_BUILD=yes parfait
endif
clean::
$(RM) -r $(BUILD_DIR) $(PROTO_DIR)
REQUIRED_PACKAGES += developer/build/autoconf
REQUIRED_PACKAGES += developer/build/automake-110
REQUIRED_PACKAGES += developer/build/gnu-make
REQUIRED_PACKAGES += developer/build/libtool
REQUIRED_PACKAGES += developer/build/pkg-config
REQUIRED_PACKAGES += developer/macro/gnu-m4
REQUIRED_PACKAGES += file/gnu-coreutils
REQUIRED_PACKAGES += library/libtool/libltdl