configure.mk revision 3994
2N/A#
2N/A# CDDL HEADER START
2N/A#
2N/A# The contents of this file are subject to the terms of the
2N/A# Common Development and Distribution License (the "License").
2N/A# You may not use this file except in compliance with the License.
2N/A#
2N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A# or http://www.opensolaris.org/os/licensing.
2N/A# See the License for the specific language governing permissions
2N/A# and limitations under the License.
2N/A#
2N/A# When distributing Covered Code, include this CDDL HEADER in each
2N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A# If applicable, add the following below this CDDL HEADER, with the
2N/A# fields enclosed by brackets "[]" replaced with your own identifying
2N/A# information: Portions Copyright [yyyy] [name of copyright owner]
2N/A#
2N/A# CDDL HEADER END
2N/A#
2337N/A# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
2N/A#
2N/A
2N/A#
2N/A# Rules and Macros for building opens source software that uses configure /
2N/A# GNU auto* tools to configure their build for the system they are on. This
2N/A# uses GNU Make to build the components to take advantage of the viewpath
2N/A# support and build multiple version (32/64 bit) from a shared source.
2N/A#
2N/A# To use these rules, include ../make-rules/configure.mk in your Makefile
2N/A# and define "build", "install", and "test" targets appropriate to building
59N/A# your component.
59N/A# Ex:
2N/A#
2N/A# build: $(SOURCE_DIR)/build/$(MACH32)/.built \
2N/A# $(SOURCE_DIR)/build/$(MACH64)/.built
2N/A#
26N/A# install: $(SOURCE_DIR)/build/$(MACH32)/.installed \
26N/A# $(SOURCE_DIR)/build/$(MACH64)/.installed
2N/A#
26N/A# test: $(SOURCE_DIR)/build/$(MACH32)/.tested \
2238N/A# $(SOURCE_DIR)/build/$(MACH64)/.tested
38N/A#
2238N/A# Any additional pre/post configure, build, or install actions can be specified
2238N/A# in your make file by setting them in on of the following macros:
2238N/A# COMPONENT_PRE_CONFIGURE_ACTION, COMPONENT_POST_CONFIGURE_ACTION
181N/A# COMPONENT_PRE_BUILD_ACTION, COMPONENT_POST_BUILD_ACTION
26N/A# COMPONENT_PRE_INSTALL_ACTION, COMPONENT_POST_INSTALL_ACTION
26N/A# COMPONENT_PRE_TEST_ACTION, COMPONENT_POST_TEST_ACTION
26N/A#
26N/A# If component specific make targets need to be used for build or install, they
26N/A# can be specified in
26N/A# COMPONENT_BUILD_TARGETS, COMPONENT_INSTALL_TARGETS
26N/A# COMPONENT_TEST_TARGETS
26N/A#
700N/A
700N/ACONFIGURE_PREFIX = /usr
26N/A
26N/ACONFIGURE_BINDIR.32 = $(CONFIGURE_PREFIX)/bin
26N/ACONFIGURE_BINDIR.64 = $(CONFIGURE_PREFIX)/bin/$(MACH64)
1574N/ACONFIGURE_LIBDIR.32 = $(CONFIGURE_PREFIX)/lib
1574N/ACONFIGURE_LIBDIR.64 = $(CONFIGURE_PREFIX)/lib/$(MACH64)
26N/ACONFIGURE_SBINDIR.32 = $(CONFIGURE_PREFIX)/sbin
1574N/ACONFIGURE_SBINDIR.64 = $(CONFIGURE_PREFIX)/sbin/$(MACH64)
151N/ACONFIGURE_MANDIR = $(CONFIGURE_PREFIX)/share/man
206N/ACONFIGURE_LOCALEDIR = $(CONFIGURE_PREFIX)/share/locale
26N/A# all texinfo documentation seems to go to /usr/share/info no matter what
26N/ACONFIGURE_INFODIR = /usr/share/info
26N/ACONFIGURE_INCLUDEDIR = /usr/include
26N/A
26N/ACONFIGURE_ENV = CONFIG_SHELL="$(CONFIG_SHELL)"
26N/A
3468N/ACONFIGURE_DEFAULT_DIRS?=yes
26N/A
2N/ACONFIGURE_OPTIONS += CC="$(CC)"
26N/ACONFIGURE_OPTIONS += CXX="$(CXX)"
26N/ACONFIGURE_OPTIONS += --prefix=$(CONFIGURE_PREFIX)
26N/Aifeq ($(CONFIGURE_DEFAULT_DIRS),yes)
26N/ACONFIGURE_OPTIONS += --mandir=$(CONFIGURE_MANDIR)
883N/ACONFIGURE_OPTIONS += --bindir=$(CONFIGURE_BINDIR.$(BITS))
26N/ACONFIGURE_OPTIONS += --libdir=$(CONFIGURE_LIBDIR.$(BITS))
26N/ACONFIGURE_OPTIONS += --sbindir=$(CONFIGURE_SBINDIR.$(BITS))
26N/Aendif
26N/ACONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS))
586N/A
26N/ACOMPONENT_INSTALL_ARGS += DESTDIR=$(PROTO_DIR)
93N/A
166N/A$(BUILD_DIR_32)/.configured: BITS=32
26N/A$(BUILD_DIR_64)/.configured: BITS=64
379N/A
379N/ACONFIGURE_ENV += $(CONFIGURE_ENV.$(BITS))
1574N/Aifeq ($(strip $(PARFAIT_BUILD)),yes)
1574N/A# parfait creates '*.bc' files which can confuse configure's
2271N/A# object/exe extension detection. which we really don't need it
2271N/A# to do anyway, so we'll just tell it what they are.
2N/ACONFIGURE_ENV += ac_cv_objext=o
26N/ACONFIGURE_ENV += ac_cv_exeext=""
26N/A# this is fixed in the clang compiler but we can't use it yet
181N/ACONFIGURE_ENV += ac_cv_header_stdbool_h=yes
181N/Aendif
181N/A
99N/A
59N/A# temporarily work around some issues
12N/ACONFIGURE_ENV += "ac_cv_func_realloc_0_nonnull=yes"
30N/ACONFIGURE_ENV += "NM=/usr/gnu/bin/nm"
1622N/ACOMPONENT_BUILD_ENV += "ac_cv_func_realloc_0_nonnull=yes"
1622N/A
1622N/A# configure the unpacked source for building 32 and 64 bit version
3293N/ACONFIGURE_SCRIPT = $(SOURCE_DIR)/configure
1622N/A$(BUILD_DIR)/%/.configured: $(SOURCE_DIR)/.prep
1622N/A ($(RM) -rf $(@D) ; $(MKDIR) $(@D))
1622N/A $(COMPONENT_PRE_CONFIGURE_ACTION)
1622N/A (cd $(@D) ; $(ENV) $(CONFIGURE_ENV) $(CONFIG_SHELL) \
1622N/A $(CONFIGURE_SCRIPT) $(CONFIGURE_OPTIONS))
1622N/A $(COMPONENT_POST_CONFIGURE_ACTION)
1622N/A $(TOUCH) $@
1622N/A
1622N/A# build the configured source
3293N/A$(BUILD_DIR)/%/.built: $(BUILD_DIR)/%/.configured
1622N/A $(COMPONENT_PRE_BUILD_ACTION)
1622N/A (cd $(@D) ; $(ENV) $(COMPONENT_BUILD_ENV) \
1622N/A $(GMAKE) $(COMPONENT_BUILD_ARGS) $(COMPONENT_BUILD_TARGETS))
1622N/A $(COMPONENT_POST_BUILD_ACTION)
1622N/Aifeq ($(strip $(PARFAIT_BUILD)),yes)
1622N/A -$(PARFAIT) $(@D)
1622N/Aendif
3293N/A $(TOUCH) $@
3293N/A
3293N/A# install the built source into a prototype area
3293N/A$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
3293N/A $(COMPONENT_PRE_INSTALL_ACTION)
3293N/A (cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) $(GMAKE) \
3293N/A $(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS))
3293N/A $(COMPONENT_POST_INSTALL_ACTION)
3293N/A $(TOUCH) $@
3293N/A
3293N/A# test the built source
3293N/A$(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
3293N/A $(COMPONENT_PRE_TEST_ACTION)
3293N/A (cd $(@D) ; $(ENV) $(COMPONENT_TEST_ENV) $(GMAKE) \
3293N/A $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS))
3293N/A $(COMPONENT_POST_TEST_ACTION)
3293N/A $(TOUCH) $@
1622N/A
1622N/Aifeq ($(strip $(PARFAIT_BUILD)),yes)
1622N/Aparfait: build
3293N/Aelse
3293N/Aparfait:
1622N/A $(MAKE) PARFAIT_BUILD=yes parfait
26N/Aendif
26N/A
1622N/Aclean::
2N/A $(RM) -r $(BUILD_DIR) $(PROTO_DIR)
26N/A