view build-src/build-windows-defs.xml @ 10:4f06f91bdcf4

Update URL for repo in README file to 2.2.6
author kcr
date Sat, 08 Dec 2012 16:27:50 -0800
parents 8d968b638b49
children
line wrap: on
line source
<?xml version="1.0" encoding="UTF-8"?>
<project name="build-windows-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.visual.studio">
        <or>
            <available file="${jfx.root.dir}/media" type="dir"/>
            <available file="${jfx.root.dir}/rt-closed" type="dir"/>
            <available file="${jfx.root.dir}/deploy" type="dir"/>
        </or>
    </condition>

    <!-- No longer used -->
    <condition property="jfx.build.needs.gplusplus.compiler">
        <istrue value="false"/>
    </condition>

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

    <property name="vs.property.generator"
              location="${jfx.root.build.src.dir}/genVSproperties.bat"/>
    <condition property="run.vs.property.generator">
        <and>
            <available file="${vs.property.generator}" type="file"/>
            <isset property="jfx.build.needs.visual.studio"/>
        </and>
    </condition>

    <!-- Our properties for the Visual Studio env variable values. -->
    <property name="vs.properties"
              location="${jfx.build.dir}/vs.properties"/>

    <!-- Location of windows cmd utility. -->
    <property name="cmd.utility" location="${systemroot.path}/System32/cmd.exe"/>
    <!-- Macrodefs for system specific tools to be shared by everyone. -->

    <macrodef name="get-cygwin-path">
        <sequential>
            <exec executable="cygpath" outputproperty="cygwin.path" failonerror="true">
                <arg value="-m"/>
                <arg value="-s"/>
                <arg value="/"/>
            </exec>
            <property name="gplusplus3.utility" 
                      location="${cygwin.path}/bin/g++-3.exe"/>
            <condition property="gplusplus.utility" 
                       value="${gplusplus3.utility}"
                       else="${cygwin.path}/bin/g++.exe">
                <available file="${gplusplus3.utility}" type="file"/>
            </condition>
            <property name="make.utility"      
                      location="${cygwin.path}/bin/make.exe"/>
        </sequential>
    </macrodef>

    <macrodef name="do-cl">
        <!-- Does a Visual Studio compilation -->
        <attribute name="dir"/>
        <attribute name="options" default=""/>
        <sequential>
            <property file="${vs.properties}"/>
            <property name="cl.utility" location="${windows.vs.MSVCDIR}/bin/cl.exe"/>
            <echo message="STARTING: cd @{dir} ; ${cmd.utility} /A /C ${cl.utility} @{options}"/>
            <exec dir="@{dir}"
                  executable="${cmd.utility}"
                  failonerror="true">
                <env key="VCINSTALLDIR"  value="${windows.vs.VCINSTALLDIR}"/>
                <env key="VSINSTALLDIR"  value="${windows.vs.VSINSTALLDIR}"/>
                <env key="DEVENVDIR"     value="${windows.vs.DEVENVDIR}"/>
                <env key="MSVCDIR"       value="${windows.vs.MSVCDIR}"/>
                <env key="INCLUDE"       value="${windows.vs.INCLUDE}"/>
                <env key="LIB"           value="${windows.vs.LIB}"/>
                <env key="LIBPATH"       value="${windows.vs.LIBPATH}"/>
                <env key="PATH"          value="${platform.home}/bin;${windows.vs.PATH}"/>
                <env key="CONF"          value="${build.conf}"/>
                <env key="JAVA_HOME"     value="${platform.home}"/>
                <env key="JDK_HOME"      value="${platform.home}"/>
                <env key="WMSDK_DIR"     value="${wmsdk.path}"/>
                <env key="DXSDK_DIR"     value="${dxsdk.path}"/>
                <arg value="/A"/>
                <arg value="/C"/>
                <arg value="${cl.utility}"/>
                <arg line="@{options}"/>
            </exec>
            <echo message="FINISHED: cd @{dir} ; ${cmd.utility} /A /C ${cl.utility} @{options}"/>
        </sequential>
    </macrodef>

    <macrodef name="do-gplusplus">
        <attribute name="dir"/>
        <attribute name="options" default=""/>
        <sequential>
            <get-cygwin-path/>
            <echo message="STARTING: DO-GCC dir @{dir}"/>
            <echo message="cd @{dir} ; ${cmd.utility} /A /C ${gplusplus.utility} @{options}"/>
            <exec dir="@{dir}"
                  executable="${cmd.utility}"
                  failonerror="true">
                <arg value="/A"/>
                <arg value="/C"/>
                <arg value="${gplusplus.utility}"/>
                <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>
            <get-cygwin-path/>
            <property file="${vs.properties}"/>
            <echo message="STARTING: DO-MAKE dir @{dir}"/>
            <echo message="cd @{dir} ; ${cmd.utility} /A /C ${make.utility} @{options} @{target}"/>
            <exec dir="@{dir}"
                  executable="${cmd.utility}"
                  failonerror="true">
                <env key="VCINSTALLDIR"  value="${windows.vs.VCINSTALLDIR}"/>
                <env key="VSINSTALLDIR"  value="${windows.vs.VSINSTALLDIR}"/>
                <env key="DEVENVDIR"     value="${windows.vs.DEVENVDIR}"/>
                <env key="MSVCDIR"       value="${windows.vs.MSVCDIR}"/>
                <env key="INCLUDE"       value="${windows.vs.INCLUDE}"/>
                <env key="LIB"           value="${windows.vs.LIB}"/>
                <env key="LIBPATH"       value="${windows.vs.LIBPATH}"/>
                <!-- <env key="PATH"          value="${windows.vs.PATH}"/> -->
                <env key="CONF"          value="${build.conf}"/>
                <env key="JAVA_HOME"     value="${platform.home}"/>
                <env key="JDK_HOME"      value="${platform.home}"/>
                <env key="WMSDK_DIR"     value="${wmsdk.path}"/>
                <env key="DXSDK_DIR"     value="${dxsdk.path}"/>
                <arg value="/A"/>
                <arg value="/C"/>
                <arg value="${make.utility}"/>
                <arg line="@{options}"/>
                <arg value="@{target}"/>
            </exec>
            <echo message="FINISHED: DO-MAKE dir @{dir}"/>
        </sequential>
    </macrodef>

    <macrodef name="do-vs-build">
        <!-- Does a Visual Studio project build -->
        <attribute name="proj-dir"/>
        <attribute name="build-type"/> <!-- "release" or "debug" -->
        <attribute name="project"/>
        <sequential>
            <property file="${vs.properties}"/>
            <property name="devenv.utility"  location="${windows.vs.DEVENVCMD}"/>
            <echo message="STARTING: ${devenv.utility} @{proj-dir}"/>
            <echo message="${devenv.utility} /build @{build-type} @{project}"/>
            <exec executable="${devenv.utility}" failonerror="true"
                  dir="@{proj-dir}">
                <env key="VCINSTALLDIR"  value="${windows.vs.VCINSTALLDIR}"/>
                <env key="VSINSTALLDIR"  value="${windows.vs.VSINSTALLDIR}"/>
                <env key="DEVENVDIR"     value="${windows.vs.DEVENVDIR}"/>
                <env key="MSVCDIR"       value="${windows.vs.MSVCDIR}"/>
                <env key="INCLUDE"       value="${windows.vs.INCLUDE}"/>
                <env key="LIB"           value="${windows.vs.LIB}"/>
                <env key="LIBPATH"       value="${windows.vs.LIBPATH}"/>
                <env key="PATH"          value="${platform.home}/bin;${windows.vs.PATH}"/>
                <env key="CONF"          value="${build.conf}"/>
                <env key="JAVA_HOME"     value="${platform.home}"/>
                <env key="JDK_HOME"      value="${platform.home}"/>
                <env key="WMSDK_DIR"     value="${wmsdk.path}"/>
                <env key="DXSDK_DIR"     value="${dxsdk.path}"/>
                <arg value="/build"/>
                <arg value="@{build-type}"/>
                <arg value="@{project}"/>
            </exec>
            <echo message="FINISHED: proj-dir @{proj-dir}"/>
        </sequential>
    </macrodef>

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

    <target name="needs-cl"
            if="jfx.build.needs.visual.studio"
            unless="jfx.skip.platform.checks">
        <property file="${vs.properties}"/>
        <property name="cl.utility" location="${windows.vs.MSVCDIR}/bin/cl.exe"/>
        <echo message="Using ${cl.utility}."/>
        <do-file-check file="${cl.utility}"/>
        <!-- VS2008 fails on the following call. Disable. -->
        <!-- <do-cl dir="."/> -->
    </target>

    <target name="needs-devenv"
            if="jfx.build.needs.visual.studio"
            unless="jfx.skip.platform.checks">
        <property file="${vs.properties}"/>
        <property name="devenv.utility" location="${windows.vs.DEVENVCMD}"/>
        <echo message="Using ${devenv.utility}."/>
        <do-file-check file="${devenv.utility}"/>
    </target>

    <target name="needs-gplusplus"
            if="jfx.build.needs.gplusplus.compiler"
            unless="jfx.skip.platform.checks">
        <get-cygwin-path/>
        <echo message="Using ${gplusplus.utility}."/>
        <do-file-check file="${gplusplus.utility}"/>
    </target>

    <target name="needs-make"
            if="jfx.build.needs.make.utility"
            unless="jfx.skip.platform.checks">
        <get-cygwin-path/>
        <echo message="Using ${make.utility}."/>
        <do-file-check file="${make.utility}"/>
        <do-make dir="." target="-version"/>
    </target>

    <!-- This target must be executed first to get windows.vs.* properties. -->
    <target name="needs-vs-properties"
            if="run.vs.property.generator">
        <echo message="Using ${vs.property.generator} to get VS properties."/>
        <condition property="vcvarsall.arch" value="amd64" else="x86">
            <equals arg1="${native.build.arch}" arg2="x64"/>
        </condition>
        <condition property="setenv.arch" value="/x64" else="/x86">
            <equals arg1="${native.build.arch}" arg2="x64"/>
        </condition>
        <condition property="build.conf" value="Debug" else="Release">
            <equals arg1="${build.debug}" arg2="true"/>
        </condition>
        <mkdir dir="${jfx.build.dir}"/>
        <exec dir="." executable="cmd" output="${vs.properties}">
            <env key="WINSDKPATH" value="${winsdk.path}"/>
            <env key="CONF" value="/${build.conf}"/>
            <env key="VCARCH" value="${vcvarsall.arch}"/>
            <env key="SDKARCH" value="${setenv.arch}"/>
            <arg value="/q"/>
            <arg value="/c"/>
            <arg value="${vs.property.generator}"/>
        </exec>
        <replace file="${vs.properties}" token="\" value="/"/>
        <replace file="${vs.properties}" token="/@@ENDOFLINE@@" value=""/>
        <replace file="${vs.properties}" token="@@ENDOFLINE@@" value=""/>
        <replace file="${vs.properties}" token="//" value="/"/>
        <property file="${vs.properties}"/>
        <property name="devenv.utility" location="${windows.vs.DEVENVCMD}"/>
        <property name="cl.utility" location="${windows.vs.MSVCDIR}/bin/cl.exe"/>
    </target>

    <target name="-init-platform-defs"
            depends="
                needs-vs-properties,
                needs-gplusplus,
                needs-make,
                needs-devenv,
                needs-cl
                ">
        <do-file-check file="${cmd.utility}"/>
    </target>

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

</project>