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