configure.mk revision 57
248N/A#
248N/A# CDDL HEADER START
248N/A#
248N/A# The contents of this file are subject to the terms of the
248N/A# Common Development and Distribution License (the "License").
248N/A# You may not use this file except in compliance with the License.
248N/A#
248N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
248N/A# or http://www.opensolaris.org/os/licensing.
248N/A# See the License for the specific language governing permissions
248N/A# and limitations under the License.
248N/A#
248N/A# When distributing Covered Code, include this CDDL HEADER in each
248N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
248N/A# If applicable, add the following below this CDDL HEADER, with the
248N/A# fields enclosed by brackets "[]" replaced with your own identifying
248N/A# information: Portions Copyright [yyyy] [name of copyright owner]
248N/A#
248N/A# CDDL HEADER END
248N/A#
248N/A# Copyright (c) 2010, 2011 Oracle and/or it's affiliates. All rights reserved.
248N/A#
248N/A
248N/A#
248N/A# Rules and Macros for building opens source software that uses configure /
248N/A# GNU auto* tools to configure their build for the system they are on. This
248N/A# uses GNU Make to build the components to take advantage of the viewpath
248N/A# support and build multiple version (32/64 bit) from a shared source.
248N/A#
248N/A# To use these rules, include ../make-rules/configure.mk in your Makefile
248N/A# and define "build", "install" targets appropriate to building your component.
248N/A# Ex:
248N/A#
248N/A# build: $(COMPONENT_SRC)/build-$(MACH32)/.built \
248N/A# $(COMPONENT_SRC)/build-$(MACH64)/.built
248N/A#
248N/A# install: $(COMPONENT_SRC)/build-$(MACH32)/.installed \
248N/A# $(COMPONENT_SRC)/build-$(MACH64)/.installed
248N/A#
248N/A# Any additional pre/post configure, build, or install actions can be specified
248N/A# in your make file by setting them in on of the following macros:
248N/A# COMPONENT_PRE_CONFIGURE_ACTION, COMPONENT_POST_CONFIGURE_ACTION
248N/A# COMPONENT_PRE_BUILD_ACTION, COMPONENT_POST_BUILD_ACTION
248N/A# COMPONENT_PRE_INSTALL_ACTION, COMPONENT_POST_INSTALL_ACTION
248N/A#
248N/A# If component specific make targets need to be used for build or install, they
248N/A# can be specified in
248N/A# COMPONENT_BUILD_TARGETS, COMPONENT_INSTALL_TARGETS
248N/A#
248N/A
248N/ACONFIG_SHELL = /bin/bash
248N/A
248N/ACONFIGURE_ENV = CONFIG_SHELL="$(CONFIG_SHELL)"
248N/A
248N/ACONFIGURE_OPTIONS += --prefix=/usr
248N/ACONFIGURE_OPTIONS += CC="$(CC)"
248N/ACONFIGURE_OPTIONS += CXX="$(CCC)"
248N/ACONFIGURE_OPTIONS.32 += --bindir=/usr/bin
248N/ACONFIGURE_OPTIONS.32 += --libdir=/usr/lib
248N/ACONFIGURE_OPTIONS.64 += --bindir=/usr/bin/$(MACH64)
248N/ACONFIGURE_OPTIONS.64 += --libdir=/usr/lib/$(MACH64)
248N/A
248N/A$(COMPONENT_SRC)/build-$(MACH32)/.configured: BITS=32
248N/A$(COMPONENT_SRC)/build-$(MACH64)/.configured: BITS=64
248N/A
248N/ACONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS))
248N/A
248N/A# set the default target for installation of the component
248N/ACOMPONENT_INSTALL_TARGETS = install
248N/A
248N/A# configure the unpacked source for building 32 and 64 bit version
248N/A$(COMPONENT_SRC)/build-%/.configured: $(COMPONENT_SRC)/.prep
248N/A ($(RM) -rf $(@D) ; $(MKDIR) $(@D))
248N/A $(COMPONENT_PRE_CONFIGURE_ACTION)
248N/A (cd $(@D) ; $(ENV) $(CONFIGURE_ENV) $(CONFIG_SHELL) \
248N/A ../configure $(CONFIGURE_OPTIONS))
248N/A $(COMPONENT_POST_CONFIGURE_ACTION)
248N/A $(TOUCH) $@
248N/A
248N/A# build the configured source
248N/A$(COMPONENT_SRC)/build-%/.built: $(COMPONENT_SRC)/build-%/.configured
248N/A $(COMPONENT_PRE_BUILD_ACTION)
248N/A (cd $(@D) ; $(ENV) $(COMPONENT_BUILD_ENV) \
248N/A $(GMAKE) $(COMPONENT_BUILD_TARGETS))
$(COMPONENT_POST_BUILD_ACTION)
$(TOUCH) $@
# install the built source into a prototype area
$(COMPONENT_SRC)/build-%/.installed: $(COMPONENT_SRC)/build-%/.built
$(COMPONENT_PRE_INSTALL_ACTION)
(cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) $(GMAKE) \
DESTDIR=$(PROTO_DIR) $(COMPONENT_INSTALL_TARGETS))
$(COMPONENT_POST_INSTALL_ACTION)
$(TOUCH) $@