configure.mk revision 119
246N/A#
246N/A# CDDL HEADER START
246N/A#
246N/A# The contents of this file are subject to the terms of the
246N/A# Common Development and Distribution License (the "License").
246N/A# You may not use this file except in compliance with the License.
246N/A#
246N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
246N/A# or http://www.opensolaris.org/os/licensing.
246N/A# See the License for the specific language governing permissions
246N/A# and limitations under the License.
246N/A#
246N/A# When distributing Covered Code, include this CDDL HEADER in each
246N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
246N/A# If applicable, add the following below this CDDL HEADER, with the
246N/A# fields enclosed by brackets "[]" replaced with your own identifying
246N/A# information: Portions Copyright [yyyy] [name of copyright owner]
246N/A#
246N/A# CDDL HEADER END
246N/A#
3661N/A# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
246N/A#
246N/A
246N/A#
246N/A# Rules and Macros for building opens source software that uses configure /
246N/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
246N/A# support and build multiple version (32/64 bit) from a shared source.
246N/A#
246N/A# To use these rules, include ../make-rules/configure.mk in your Makefile
844N/A# and define "build", "install" targets appropriate to building your component.
844N/A# Ex:
313N/A#
1273N/A# build: $(SOURCE_DIR)/build/$(MACH32)/.built \
246N/A# $(SOURCE_DIR)/build/$(MACH64)/.built
3661N/A#
3661N/A# install: $(SOURCE_DIR)/build/$(MACH32)/.installed \
246N/A# $(SOURCE_DIR)/build/$(MACH64)/.installed
246N/A#
246N/A# Any additional pre/post configure, build, or install actions can be specified
246N/A# in your make file by setting them in on of the following macros:
246N/A# COMPONENT_PRE_CONFIGURE_ACTION, COMPONENT_POST_CONFIGURE_ACTION
246N/A# COMPONENT_PRE_BUILD_ACTION, COMPONENT_POST_BUILD_ACTION
246N/A# COMPONENT_PRE_INSTALL_ACTION, COMPONENT_POST_INSTALL_ACTION
246N/A#
246N/A# If component specific make targets need to be used for build or install, they
246N/A# can be specified in
246N/A
246N/A# COMPONENT_BUILD_TARGETS, COMPONENT_INSTALL_TARGETS
246N/A#
246N/A
246N/ACONFIG_SHELL = /bin/bash
392N/A
392N/ACONFIGURE_PREFIX = /usr
392N/A
246N/ACONFIGURE_BINDIR.32 = $(CONFIGURE_PREFIX)/bin
246N/ACONFIGURE_BINDIR.64 = $(CONFIGURE_PREFIX)/bin/$(MACH64)
246N/ACONFIGURE_LIBDIR.32 = $(CONFIGURE_PREFIX)/lib
246N/ACONFIGURE_LIBDIR.64 = $(CONFIGURE_PREFIX)/lib/$(MACH64)
246N/ACONFIGURE_MANDIR = $(CONFIGURE_PREFIX)/share/man
246N/ACONFIGURE_LOCALEDIR = $(CONFIGURE_PREFIX)/share/locale
246N/A# all texinfo documentation seems to go to /usr/share/info no matter what
246N/ACONFIGURE_INFODIR = /usr/share/info
246N/ACONFIGURE_INCLUDEDIR = /usr/include
246N/A
246N/ACONFIGURE_ENV = CONFIG_SHELL="$(CONFIG_SHELL)"
723N/A
246N/ACONFIGURE_OPTIONS += CC="$(CC)"
246N/ACONFIGURE_OPTIONS += CXX="$(CCC)"
246N/ACONFIGURE_OPTIONS += --prefix=$(CONFIGURE_PREFIX)
246N/ACONFIGURE_OPTIONS += --mandir=$(CONFIGURE_MANDIR)
246N/ACONFIGURE_OPTIONS += --bindir=$(CONFIGURE_BINDIR.$(BITS))
246N/ACONFIGURE_OPTIONS += --libdir=$(CONFIGURE_LIBDIR.$(BITS))
246N/ACONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS))
246N/A
249N/ACOMPONENT_INSTALL_ARGS += DESTDIR=$(PROTO_DIR)
246N/A
246N/A$(BUILD_DIR)/$(MACH32)/.configured: BITS=32
246N/A$(BUILD_DIR)/$(MACH64)/.configured: BITS=64
246N/A$(BUILD_DIR)/$(MACH32)/.built: BITS=32
246N/A$(BUILD_DIR)/$(MACH64)/.built: BITS=64
378N/A$(BUILD_DIR)/$(MACH32)/.installed: BITS=32
378N/A$(BUILD_DIR)/$(MACH64)/.installed: BITS=64
378N/A
378N/ACONFIGURE_ENV += $(CONFIGURE_ENV.$(BITS))
378N/ACONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS))
378N/A
378N/A# set the default target for installation of the component
378N/ACOMPONENT_INSTALL_TARGETS = install
378N/A
378N/A# configure the unpacked source for building 32 and 64 bit version
246N/A$(BUILD_DIR)/%/.configured: $(SOURCE_DIR)/.prep
246N/A ($(RM) -rf $(@D) ; $(MKDIR) $(@D))
246N/A $(COMPONENT_PRE_CONFIGURE_ACTION)
246N/A (cd $(@D) ; $(ENV) $(CONFIGURE_ENV) $(CONFIG_SHELL) \
246N/A $(SOURCE_DIR)/configure $(CONFIGURE_OPTIONS))
246N/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_TARGETS))
$(COMPONENT_POST_BUILD_ACTION)
$(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) $@
clean::
$(RM) -r $(BUILD_DIR) $(PROTO_DIR)