view build-src/build-macosx-defs.xml @ 4:5a537ec76c6e

RT-18421: Build files in openjfx/2.1/master have the wrong copyright Reviewed by: jgiles
author kcr
date Fri, 13 Jan 2012 15:52:47 -0800
parents 8d968b638b49
children
line wrap: on
line source
<?xml version="1.0" encoding="UTF-8"?>
<project name="build-macosx-defs" basedir=".">

<!--
/*
 * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Oracle designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Oracle in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */
-->

    <description>

        Defines common properties and macrodefs that are specific to the
        system being used and the various system installed tools on the
        systems. Such as Visual Studio, GNU make, Mac XCode, C/C++ compilers,
        etc.

        *** Sub-repositories should NOT import this file. ***

        This file is imported by the build-defs.xml file.

    </description>

    <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

    <!-- Only certain repositories trigger a need for native compilation tools. -->
    <condition property="jfx.build.needs.xcodebuild.utility">
        <available file="${jfx.root.dir}/media" type="dir"/>
    </condition>

    <condition property="jfx.build.needs.gcc.compiler">
        <or>
            <available file="${jfx.root.dir}/media" type="dir"/>
            <available file="${jfx.root.dir}/rt-closed" type="dir"/>
        </or>
    </condition>

    <condition property="jfx.build.needs.make.utility">
        <or>
            <available file="${jfx.root.dir}/media" type="dir"/>
            <available file="${jfx.root.dir}/rt-closed" type="dir"/>
        </or>
    </condition>

    <property name="gcc.utility"        value="gcc"/>
    <property name="make.utility"       value="make"/>
    <property name="xcodebuild.utility" value="xcodebuild"/>

    <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
    <!-- Macrodefs for system specific tools to be shared by everyone. -->

    <macrodef name="do-gcc">
        <!-- Does a GNU gcc compilation -->
        <attribute name="dir"/>
        <attribute name="options" default=""/>
        <sequential>
            <echo message="STARTING: DO-GCC dir @{dir}"/>
            <echo message="cd @{dir} ; ${gcc.utility} @{options}"/>
            <exec dir="@{dir}"
                  executable="${gcc.utility}"
                  failonerror="true">
                <arg line="@{options}"/>
            </exec>
            <echo message="FINISHED: DO-GCC dir @{dir}"/>
        </sequential>
    </macrodef>

    <macrodef name="do-make">
        <!-- Does a Makefile build -->
        <attribute name="dir"/>
        <attribute name="target"/>
        <attribute name="options" default=""/>
        <sequential>
            <echo message="STARTING: DO-MAKE dir @{dir}"/>
            <echo message="cd @{dir} ; ${make.utility} @{target}"/>
            <exec dir="@{dir}"
                  executable="${make.utility}"
                  failonerror="true">
                <env key="JAVA_HOME"     value="${platform.home}"/>
                <env key="JDK_HOME"      value="${platform.home}"/>
                <arg line="@{options}"/>
                <arg value="@{target}"/>
            </exec>
            <echo message="FINISHED: DO-MAKE dir @{dir}"/>
        </sequential>
    </macrodef>

    <macrodef name="do-xcodebuild">
        <!-- Does a Mac XCode project build -->
        <attribute name="outdir"/>
        <attribute name="srcdir"/>
        <attribute name="target"/>
        <attribute name="project"/>
        <sequential>
            <echo message="STARTING: DO-XCODEBUILD project @{project}"/>
            <echo message="${xcodebuild.utility} -project @{project} -target @{target}"/>
            <property name="xcode.outdir.path" location="@{outdir}"/>
            <property name="xcode.build.jni.dir.path" location="${build.jni.dir}"/>
            <exec dir="@{srcdir}"
                  executable="${xcodebuild.utility}"
                  failonerror="true">
                <arg line="-project @{project}"/>
                <arg line="-target @{target}"/>
                <arg line="BUILT_PRODUCTS_DIR=${xcode.outdir.path}"/>
                <arg line="OBJROOT=${xcode.outdir.path}"/>
                <arg line="SYMROOT=${xcode.outdir.path}"/>
                <arg line="DSTROOT=${xcode.outdir.path}"/>
                <arg line="USER_HEADER_SEARCH_PATHS=${xcode.build.jni.dir.path}"/>
            </exec>
            <echo message="FINISHED: DO-XCODEBUILD project @{project}"/>
        </sequential>
    </macrodef>

    <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

    <target name="needs-gcc"
            if="jfx.build.needs.gcc.compiler"
            unless="jfx.skip.platform.checks">
        <do-gcc dir="." options="--version"/>
    </target>

    <target name="needs-make"
            if="jfx.build.needs.make.utility"
            unless="jfx.skip.platform.checks">
        <do-make dir="." target="-version"/>
    </target>

    <target name="needs-xcodebuild"
            if="jfx.build.needs.xcodebuild.utility"
            unless="jfx.skip.platform.checks">
        <echo message="Using ${xcodebuild.utility} to get version."/>
        <exec executable="${xcodebuild.utility}" failonerror="true">
            <arg value="-version"/>
        </exec>
    </target>

    <target name="-init-platform-defs"
            depends="needs-make,
                     needs-gcc,
                     needs-xcodebuild">
    </target>

    <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

</project>