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