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