diff options
author | dims <dims@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-17 00:23:01 +0000 |
---|---|---|
committer | dims <dims@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-17 00:23:01 +0000 |
commit | bdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a (patch) | |
tree | 38a92061c0793434c4be189f1d70c3458b6bc41d /cpp/sca/antscripts |
Move Tuscany from Incubator to top level.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/sca/antscripts')
-rw-r--r-- | cpp/sca/antscripts/TuscanyMSVC8DevStudioCCompiler.jar | bin | 0 -> 2684 bytes | |||
-rw-r--r-- | cpp/sca/antscripts/compile-targets.xml | 341 | ||||
-rwxr-xr-x | cpp/sca/antscripts/platform.properties | 45 | ||||
-rw-r--r-- | cpp/sca/antscripts/system.xml | 740 |
4 files changed, 1126 insertions, 0 deletions
diff --git a/cpp/sca/antscripts/TuscanyMSVC8DevStudioCCompiler.jar b/cpp/sca/antscripts/TuscanyMSVC8DevStudioCCompiler.jar Binary files differnew file mode 100644 index 0000000000..9ffc08fd1f --- /dev/null +++ b/cpp/sca/antscripts/TuscanyMSVC8DevStudioCCompiler.jar diff --git a/cpp/sca/antscripts/compile-targets.xml b/cpp/sca/antscripts/compile-targets.xml new file mode 100644 index 0000000000..f78236e159 --- /dev/null +++ b/cpp/sca/antscripts/compile-targets.xml @@ -0,0 +1,341 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<project name='compiler-targets'> + + <import file="./system.xml"/> + + <!-- + Do a cpp compilation. + Inherits from "Tuscany-BaseCompiler", which has an include path of: + ${sdo.include.dir} + ${tuscanySCA.root.dir} + ${tuscanySCA.root.src.dir} + ${tuscanySCA.root.src.dir}/core/src + @param objdir - directory where the object files will be written + @param srcdir - directory where the source files are located. + @param infiles - a space seperated list of the files to compile + @param custom-cc-elements - any extra cpp elements, may also be extra <includepath> elements + --> + <macrodef name="cpp-compile"> + <attribute name="objdir" default="."/> + <attribute name="srcdir" default="."/> + <attribute name="infiles" default="*.cpp"/> + <element name="custom-cc-elements" optional="true"/> + <sequential> + <mkdir dir='@{objdir}'/> + <cc subsystem='console' + objdir='@{objdir}' + debug='${debug.compile}'> + <compiler refid='${compiler.name}-Compiler'/> + <fileset dir='@{srcdir}' includes='@{infiles}'/> + <custom-cc-elements/> + </cc> + + </sequential> + </macrodef> + + <!-- + Do a cpp link which results in either a library (linktype of plugin, shared, or static) + or an executable (linktype of executable). + Inherits from "Tuscany-BaseLinker" + cpp-link-core does not link in libtuscany_sca.so, whereas cpp-link does + @param outfile - name of the library to create, OS prefixes and suffixes will be added + @param destdir - directory where the library will be written + @param infiles - a space seperated list of the object files to link + @param linktype - executable, plugin, shared, static + @param custom-ld-elements - any extra cpp elements, may also be extra <libset> elements + --> + <macrodef name="cpp-link-core"> + <attribute name="outfile" default="out"/> + <attribute name="outdir" default="."/> + <attribute name="indir" default="."/> + <attribute name="infiles" default="*${object.ext}"/> + <attribute name="linktype" default="shared"/> + <element name="custom-ld-elements" optional="true"/> + <sequential> + <mkdir dir='@{outdir}'/> + <cc link='@{linktype}' + subsystem='console' + outfile='@{outdir}/@{outfile}' + debug='${debug.compile}'> + <linker refid='${compiler.name}-Linker'/> + <fileset dir='@{indir}' includes='@{infiles}'/> + <libset dir="${sdo.lib.dir}" libs="${sdo.impl.library.name}"/> + <custom-ld-elements/> + </cc> + <cpp-embed-manifest dir="@{outdir}" file="@{outfile}" outtype="@{outtype}"/> + </sequential> + </macrodef> + + <macrodef name="cpp-link"> + <attribute name="outfile" default="out"/> + <attribute name="outdir" default="."/> + <attribute name="indir" default="."/> + <attribute name="infiles" default="*${object.ext}"/> + <attribute name="linktype" default="shared"/> + <element name="custom-ld-elements" optional="true"/> + <sequential> + <mkdir dir='@{outdir}'/> + <cc link='@{linktype}' + subsystem='console' + outfile='@{outdir}/@{outfile}' + debug='${debug.compile}'> + <linker refid='${compiler.name}-Linker'/> + <fileset dir='@{indir}' includes='@{infiles}'/> + <libset dir="${tuscanySCA.install.dir}/lib" libs="tuscany_sca"/> + <libset dir="${sdo.lib.dir}" libs="${sdo.impl.library.name}"/> + <custom-ld-elements/> + </cc> + <cpp-embed-manifest dir="@{outdir}" file="@{outfile}" outtype="@{linktype}"/> + </sequential> + </macrodef> + + <!-- + Do a cpp build which compiles and links, resulting in either a library (linktype + of plugin, shared, or static) or an executable (linktype of executable). + Inherits from both "Tuscany-BaseCompiler" and "Tuscany-BaseLinker" + @param srcdir - directory where the source files are located. + @param infiles - a space seperated list of the source files to compile and link + @param outdir - directory where the output file will be written + @param outfile - name of the library or binary to create, OS prefixes and suffixes may be added + @param outtype - executable, plugin, shared, static + @param custom-build-elements - any extra elements needed for compiling or linking + may also be extra <includepath> or <libset> elements + --> + <macrodef name="cpp-build"> + <attribute name="srcdir" default="."/> + <attribute name="infiles" default="*.cpp"/> + <attribute name="outdir" default="."/> + <attribute name="outfile" default="out"/> + <attribute name="outtype" default="shared"/> + <element name="custom-build-elements" optional="true"/> + <sequential> + <mkdir dir='@{outdir}'/> + <cc outtype='@{outtype}' + subsystem='console' + objdir='@{outdir}' + outfile='@{outdir}/@{outfile}' + debug='${debug.compile}'> + <compiler refid='${compiler.name}-Compiler'/> + <linker refid='${compiler.name}-Linker'/> + <fileset dir='@{srcdir}' includes='@{infiles}'/> + <libset dir="${tuscanySCA.install.dir}/lib" libs="tuscany_sca"/> + <libset dir="${sdo.lib.dir}" libs="${sdo.impl.library.name}"/> + <custom-build-elements/> + </cc> + <cpp-embed-manifest dir="@{outdir}" file="@{outfile}" outtype="@{outtype}"/> + </sequential> + </macrodef> + + <!-- + Install a single file + @param file - file to install + @param srcdir - directory of file to install + @param destdir - Where to install the file + @param executable - set permissions to executable, defaults true + --> + <macrodef name="cpp-install-file"> + <attribute name="srcfile"/> + <attribute name="srcdir" default="."/> + <attribute name="destfile" default="@{srcfile}"/> + <attribute name="destdir"/> + <attribute name="executable" default="true"/> + <sequential> + <mkdir dir="@{destdir}"/> + <copy file="@{srcdir}/@{srcfile}" tofile="@{destdir}/@{destfile}" overwrite='true'/> + <if> + <equals arg1="@{executable}" arg2="true"/> + <then> + <chmod file="@{destdir}/@{destfile}" perm="755"/> + </then> + </if> + </sequential> + </macrodef> + + <!-- + Install multiple files + @param files - space seperated list of files to install + @param srcdir - location of files to install + @param destdir - Where to install files + @param executable - set permissions to executable, defaults false + --> + <macrodef name="cpp-install-files"> + <attribute name="files" default="*.*"/> + <attribute name="srcdir" default="."/> + <attribute name="destdir"/> + <attribute name="executable" default="false"/> + <sequential> + <mkdir dir="@{destdir}"/> + <copy todir="@{destdir}" overwrite='true'> + <fileset dir="@{srcdir}" includes="@{files}"/> + </copy> + <if> + <equals arg1="@{executable}" arg2="true"/> + <then> + <chmod file="@{destdir}/@{files}" perm="755"/> + </then> + </if> + </sequential> + </macrodef> + + <!-- + Install a library + @param lib - library to install + @param srcdir - directory of file to install + @param destdir - Where to install the file + @param executable - set permissions to executable, defaults true + --> + <macrodef name="cpp-install-lib"> + <attribute name="lib"/> + <attribute name="srcdir" default="."/> + <attribute name="destrootdir"/> + <attribute name="version" default="${tuscanySCA.library.version}"/> + <sequential> + <cpp-install-file + srcfile="${lib.prefix}@{lib}${lib.ext}" + srcdir="@{srcdir}" + destfile="${lib.prefix}@{lib}${lib.ext}@{version}" + destdir="@{destrootdir}/lib"/> + <if> + <os family="windows"/> + <then> + <cpp-install-file + srcfile="${lib.prefix}@{lib}${dll.ext}" + srcdir="@{srcdir}" + destfile="${lib.prefix}@{lib}${dll.ext}@{version}" + destdir="@{destrootdir}/bin"/> + </then> + </if> + </sequential> + </macrodef> + + <!-- + Create a symlink on unix and mac only + @param lib - library file to install + @param srclibdir - location of library files to install + @param destlibdir - Where to install library files + --> + <macrodef name="cpp-symlink"> + <attribute name="linkdir" default=""/> + <attribute name="resourcedir" default="."/> + <attribute name="link"/> + <attribute name="resource"/> + <sequential> + <if> + <or> + <os family="unix"/> + <os family="mac"/> + </or> + <then> + <mkdir dir="@{linkdir}"/> + <symlink + link="@{linkdir}/@{link}" + resource="@{resourcedir}/@{resource}" + overwrite="true"/> + </then> + </if> + </sequential> + </macrodef> + + <!-- + Embed the manifest in the library or executable on Windows only + Uses the Microsoft manifest tool "mt" + @param dir - the directory where the lib/exe resides + @param file - the filename with no suffixes or prefixes + @param outtype - the outtype that's passed to the cc task, used to create the filename + --> + <macrodef name="cpp-embed-manifest"> + <attribute name="dir"/> + <attribute name="file"/> + <attribute name="outtype"/> + <sequential> + <if> + <os family="windows"/> + <then> + <if> + <equals arg1="@{outtype}" arg2="executable"/> + <then> + <property name="file.name" value="@{file}${exe.ext}"/> + </then> + </if> + <property name="file.name" value="${lib.prefix}@{file}${dll.ext}"/> + + <exec executable="mt"> + <arg line="-manifest @{dir}/${file.name}.manifest -outputresource:@{dir}/${file.name};2"/> + </exec> + </then> + </if> + </sequential> + </macrodef> + + <!-- + Delete files from a directory, and possible delete the directory + @param files - space seperated list of files to delete + @param headerdir - directory where files to delete are + @param quiet - verbosity, "true" or "false" + @param rmdir - delete the directory after deleting files, "true" or "false" + @param custom-delete-elements - anything else you need done additionally + --> + <macrodef name="cpp-clean-files"> + <attribute name="files" default="*.*"/> + <attribute name="dir" default="."/> + <attribute name="quiet" default="true"/> + <attribute name="rmdir" default="false"/> + <element name="custom-delete-elements" optional="true"/> + <sequential> + <delete quiet="@{quiet}"> + <fileset dir="@{dir}" includes="@{files}"/> + </delete> + <if> + <equals arg1="@{rmdir}" arg2="true"/> + <then> + <delete dir="@{dir}"/> + </then> + </if> + <custom-delete-elements/> + </sequential> + </macrodef> + + <!-- + Delete a library from a root library directory, and possible delete the directory + On windows, it will delete both bin/<library>.dll and lib/<library>.lib + On Unix, it will delete lib/<library> + @param lib - library to delete + @param librootdir - directory where the library to delete is located + @param quiet - verbosity, "true" or "false" + --> + <macrodef name="cpp-clean-lib"> + <attribute name="lib"/> + <attribute name="librootdir"/> + <attribute name="quiet" default="true"/> + <attribute name="version" default="${tuscanySCA.library.version}"/> + <sequential> + <delete quiet="@{quiet}" file="@{librootdir}/lib/${lib.prefix}@{lib}${lib.ext}"/> + <delete quiet="@{quiet}" file="@{librootdir}/lib/${lib.prefix}@{lib}${lib.ext}@{version}"/> + <if> + <os family="windows"/> + <then> + <delete quiet="@{quiet}" file="@{librootdir}/bin/${lib.prefix}@{lib}${dll.ext}@{version}"/> + </then> + </if> + </sequential> + </macrodef> + +</project> diff --git a/cpp/sca/antscripts/platform.properties b/cpp/sca/antscripts/platform.properties new file mode 100755 index 0000000000..99d6be9a02 --- /dev/null +++ b/cpp/sca/antscripts/platform.properties @@ -0,0 +1,45 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +platform.lib.ext= +platform.dll.ext= +platform.exe.ext= +platform.object.ext= +platform.script.ext= +platform.compiler.name= +platform.debug.compile= +platform.external.definitions.file= +platform.sdo.impl.library.name= + +platform.tuscanySCA.root.dir= +platform.tuscanySCA.install.dir= +platform.tuscanySDO.install.dir= + +platform.axis2c.home.dir= +platform.php.include.dir= +platform.php.lib.dir= +platform.php.sca.sdo.include.dir= +platform.php.sca.sdo.lib.dir= +platform.python.include.dir= +platform.python.lib.dir= +platform.python.version= +platform.ruby.include.dir= +platform.ruby.lib.dir= +platform.rest.curl.lib.dir= +platform.rest.curl.include.dir= +platform.rest.httpd.include.dir= +platform.rest.apr.include.dir= diff --git a/cpp/sca/antscripts/system.xml b/cpp/sca/antscripts/system.xml new file mode 100644 index 0000000000..ba718ec76a --- /dev/null +++ b/cpp/sca/antscripts/system.xml @@ -0,0 +1,740 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<project name="system-import"> + + <property file="${basedir}/antscripts/platform.properties"/> + <property environment="env"/> + + <!-- These 3 lines pull in antcontrib and cctasks --> + <taskdef resource="net/sf/antcontrib/antlib.xml"/> + <taskdef resource="cpptasks.tasks"/> + <typedef resource="cpptasks.types"/> + + <!-- + Configure the tuscanySDO.install.dir, sdo.include.dir, and sdo.lib.dir + Take the override value from platform.properties if set + Else take it from the env var TUSCANY_SDOCPP + Else fail since we cant compile without it + --> + <if> + <and> + <isset property="platform.tuscanySDO.install.dir"/> + <length string="${platform.tuscanySDO.install.dir}" when="greater" length="0" trim="true"/> + </and> + <then> + <property name="tuscanySDO.install.dir" location="${platform.tuscanySDO.install.dir}"/> + </then> + <elseif> + <isset property="env.TUSCANY_SDOCPP"/> + <then> + <property name="tuscanySDO.install.dir" location="${env.TUSCANY_SDOCPP}"/> + </then> + </elseif> + <else> + <fail message="Unable to find SDO installation, must be set by TUSCANY_SDOCPP or in platform.properties file"/> + </else> + </if> + <property name="sdo.include.dir" location="${tuscanySDO.install.dir}/include"/> + <property name="sdo.lib.dir" location="${tuscanySDO.install.dir}/lib"/> + + <!-- + Configure the SDO impl library name which allows for sdo impls other than tuscanySDO + Take the override value from platform.properties if set + --> + <if> + <and> + <isset property="platform.sdo.impl.library.name"/> + <length string="${platform.sdo.impl.library.name}" when="greater" length="0" trim="true"/> + </and> + <then> + <property name="sdo.impl.library.name" value="${platform.sdo.impl.library.name}"/> + </then> + <else> + <property name="sdo.impl.library.name" value="tuscany_sdo"/> + </else> + </if> + + <!-- + Configure the tuscanySCA.root.dir + Take the override value from platform.properties if set + --> + <if> + <and> + <isset property="platform.tuscanySCA.root.dir"/> + <length string="${platform.tuscanySCA.root.dir}" when="greater" length="0" trim="true"/> + </and> + <then> + <property name="tuscanySCA.root.dir" location="${platform.tuscanySCA.root.dir}"/> + </then> + <else> + <property name="tuscanySCA.root.dir" location="."/> + </else> + </if> + + <property name="tuscanySCA.root.src.dir" location="${tuscanySCA.root.dir}/runtime"/> + + <!-- + Configure the tuscanySCA.install.dir + Take the override value from platform.properties if set + Else take it from the env var TUSCANY_SCACPP + Else use a default of ${tuscanySCA.root.dir}/deploy + --> + <if> + <and> + <isset property="platform.tuscanySCA.install.dir"/> + <length string="${platform.tuscanySCA.install.dir}" when="greater" length="0" trim="true"/> + </and> + <then> + <property name="tuscanySCA.install.dir" location="${platform.tuscanySCA.install.dir}"/> + </then> + <elseif> + <isset property="env.TUSCANY_SCACPP"/> + <then> + <property name="tuscanySCA.install.dir" location="${env.TUSCANY_SCACPP}"/> + </then> + </elseif> + <else> + <property name="tuscanySCA.install.dir" location="${tuscanySCA.root.dir}/deploy"/> + </else> + </if> + + <!-- + Configure the version for all tuscanySCA libraries + If on windows, set it to empty + Else take the override value from platform.properties if set + Else default it to "0.0.0" + --> + <if> + <os family="windows"/> + <then> + <property name="tuscanySCA.library.version" value=""/> + </then> + <elseif> + <and> + <isset property="platform.tuscanySCA.library.version"/> + <length string="${platform.tuscanySCA.library.version}" when="greater" length="0" trim="true"/> + </and> + <then> + <property name="tuscanySCA.library.version" value="${platform.tuscanySCA.library.version}"/> + </then> + </elseif> + <else> + <property name="tuscanySCA.library.version" value=".0.0.0"/> + </else> + </if> + + <!-- + Configure ${enable_ws} and ${axis2c.home.dir}, which is needed to compile the ws extension + Take the override value from platform.properties if set + Else take it from the env var AXIS2C_HOME + --> + <target name="check.ws"> + <if> + <and> + <isset property="platform.axis2c.home.dir"/> + <length string="${platform.axis2c.home.dir}" when="greater" length="0" trim="true"/> + </and> + <then> + <property name="enable_ws" value="true"/> + <property name="axis2c.home.dir" location="${platform.axis2c.home.dir}"/> + </then> + <elseif> + <isset property="env.AXIS2C_HOME"/> + <then> + <property name="enable_ws" value="true"/> + <property name="axis2c.home.dir" location="${env.AXIS2C_HOME}"/> + </then> + </elseif> + <else> + <echo message="TuscanySCA ws extension is not enabled" level="warning"/> + </else> + </if> + </target> + + <!-- + Configure ${enable_python} and related python properties, which are needed + to compile the python extension + Take the override value from platform.properties if set + Else check env vars PYTHON_LIB, PYTHON_INCLUDE, and PYTHON_VERSION + --> + <target name="check.python"> + <if> + <and> + <isset property="platform.python.version"/> + <isset property="platform.python.include.dir"/> + <isset property="platform.python.lib.dir"/> + <length string="${platform.python.version}" when="greater" length="0" trim="true"/> + <length string="${platform.python.include.dir}" when="greater" length="0" trim="true"/> + <length string="${platform.python.lib.dir}" when="greater" length="0" trim="true"/> + </and> + <then> + <property name="enable_python" value="true"/> + <property name="python.lib.dir" location="${platform.python.lib.dir}"/> + <property name="python.include.dir" location="${platform.python.include.dir}"/> + <property name="python.version" value="${platform.python.version}"/> + </then> + <elseif> + <and> + <isset property="env.PYTHON_LIB"/> + <isset property="env.PYTHON_INCLUDE"/> + <isset property="env.PYTHON_VERSION"/> + </and> + <then> + <property name="enable_python" value="true"/> + <property name="python.lib.dir" location="${env.PYTHON_LIB}"/> + <property name="python.include.dir" location="${env.PYTHON_INCLUDE}"/> + <property name="python.version" value="${env.PYTHON_VERSION}"/> + </then> + </elseif> + <else> + <echo message="TuscanySCA python extension is not enabled" level="warning"/> + </else> + </if> + </target> + + <!-- + Configure ${enable_ruby} and related ruby properties, which are needed + to compile the ruby extension + Take the override value from platform.properties if set + Else check env vars RUBY_LIB and RUBY_INCLUDE + --> + <target name="check.ruby"> + <if> + <and> + <isset property="platform.ruby.include.dir"/> + <isset property="platform.ruby.lib.dir"/> + <length string="${platform.ruby.include.dir}" when="greater" length="0" trim="true"/> + <length string="${platform.ruby.lib.dir}" when="greater" length="0" trim="true"/> + </and> + <then> + <property name="enable_ruby" value="true"/> + <property name="ruby.lib.dir" location="${platform.ruby.lib.dir}"/> + <property name="ruby.include.dir" location="${platform.ruby.include.dir}"/> + </then> + <elseif> + <and> + <isset property="env.RUBY_LIB"/> + <isset property="env.RUBY_INCLUDE"/> + </and> + <then> + <property name="enable_ruby" value="true"/> + <property name="ruby.lib.dir" location="${env.RUBY_LIB}"/> + <property name="ruby.include.dir" location="${env.RUBY_INCLUDE}"/> + </then> + </elseif> + <else> + <echo message="TuscanySCA ruby extension is not enabled" level="warning"/> + </else> + </if> + </target> + + <!-- + Configure ${enable_rest} and related ruby properties, which are needed + to compile the rest extension + Take the override value from platform.properties if set + Else check env vars CURL_LIB, CURL_INCLUDE, HTTPD_INCLUDE, and APR_INCLUDE + --> + <target name="check.rest"> + <if> + <and> + <isset property="platform.rest.include.dir"/> + <isset property="platform.rest.lib.dir"/> + <length string="${platform.rest.include.dir}" when="greater" length="0" trim="true"/> + <length string="${platform.rest.lib.dir}" when="greater" length="0" trim="true"/> + </and> + <then> + <property name="enable_rest" value="true"/> + <property name="rest.curl.lib.dir" location="${platform.rest.curl.lib.dir}"/> + <property name="rest.curl.include.dir" location="${platform.rest.curl.include.dir}"/> + <property name="rest.httpd.include.dir" location="${platform.rest.httpd.include.dir}"/> + <property name="rest.apr.include.dir" location="${platform.rest.apr.include.dir}"/> + </then> + <elseif> + <and> + <isset property="env.CURL_LIB"/> + <isset property="env.CURL_INCLUDE"/> + <isset property="env.HTTPD_INCLUDE"/> + <isset property="env.APR_INCLUDE"/> + </and> + <then> + <property name="enable_rest" value="true"/> + <property name="rest.curl.lib.dir" location="${env.CURL_LIB}"/> + <property name="rest.curl.include.dir" location="${env.CURL_INCLUDE}"/> + <property name="rest.httpd.include.dir" location="${env.HTTPD_INCLUDE}"/> + <property name="rest.apr.include.dir" location="${env.APR_INCLUDE}"/> + </then> + </elseif> + <else> + <echo message="TuscanySCA rest extension is not enabled" level="warning"/> + </else> + </if> + </target> + + <!-- + Configure ${enable_php} and related php properties, which are needed + to compile the php extension + Take the override value from platform.properties if set + Else check env vars CURL_LIB, CURL_INCLUDE, HTTPD_INCLUDE, and APR_INCLUDE + --> + <target name="check.php"> + <if> + <and> + <isset property="platform.php.include.dir"/> + <isset property="platform.php.lib.dir"/> + <isset property="platform.php.sca.sdo.include.dir"/> + <isset property="platform.php.sca.sdo.lib.dir"/> + <length string="${platform.php.include.dir}" when="greater" length="0" trim="true"/> + <length string="${platform.php.lib.dir}" when="greater" length="0" trim="true"/> + <length string="${platform.php.sca.sdo.include.dir}" when="greater" length="0" trim="true"/> + <length string="${platform.php.sca.sdo.lib.dir}" when="greater" length="0" trim="true"/> + </and> + <then> + <property name="enable_php" value="true"/> + <property name="php.include.dir" location="${platform.php.include.dir}"/> + <property name="php.lib.dir" location="${platform.php.lib.dir}"/> + <property name="php.sca.sdo.include.dir" location="${platform.php.sca.sdo.include.dir}"/> + <property name="php.sca.sdo.lib.dir" location="${platform.php.sca.sdo.lib.dir}"/> + </then> + <elseif> + <and> + <isset property="env.PHP_LIB"/> + <isset property="env.PHP_INCLUDE"/> + <isset property="env.PHP_SCA_SDO_LIB"/> + <isset property="env.PHP_SCA_SDO_INCLUDE"/> + </and> + <then> + <property name="enable_php" value="true"/> + <property name="php.include.dir" location="${env.PHP_INCLUDE}"/> + <property name="php.lib.dir" location="${env.PHP_LIB}"/> + <property name="php.sca.sdo.include.dir" location="${env.PHP_SCA_SDO_INCLUDE}"/> + <property name="php.sca.sdo.lib.dir" location="${env.PHP_SCA_SDO_LIB}"/> + </then> + </elseif> + <else> + <echo message="TuscanySCA php extension is not enabled" level="warning"/> + </else> + </if> + </target> + + <!-- + Configure the debug.compile flag + Try looking first on the command line + Then take the override value from platform.properties if set + Else its false + --> + <if> + <isset property="debug"/> + <then> + <!-- Tests if its set on the ant command line "ant -Ddebug=true" --> + <if> + <istrue value="${debug}"/> + <then> + <property name="debug.compile" value="true"/> + </then> + </if> + </then> + <elseif> + <and> + <isset property="platform.debug.compile"/> + <istrue value="${platform.debug.compile}"/> + <length string="${platform.debug.compile}" when="greater" length="0" trim="true"/> + </and> + <then> + <property name="debug.compile" value="true"/> + </then> + </elseif> + </if> + <property name="debug.compile" value="false"/> + + <!-- + Configure the compiler.name + Take the override value from platform.properties if set + Else set it based on the OS + --> + <if> + <and> + <isset property="platform.compiler.name"/> + <length string="${platform.compiler.name}" when="greater" length="0" trim="true"/> + </and> + <then> + <property name="compiler.name" value="${platform.compiler.name}"/> + </then> + <else> + <condition property="compiler.name" value="msvc8"> + <os family="windows"/> + </condition> + + <condition property="compiler.name" value="g++"> + <os family="unix"/> + </condition> + + <condition property="compiler.name" value="mac_g++"> + <os family="mac"/> + </condition> + </else> + </if> + + <!-- + Configure the lib.ext + Take the override value from platform.properties if set + Else set it based on the OS + --> + <if> + <and> + <isset property="platform.lib.ext"/> + <length string="${platform.lib.ext}" when="greater" length="0" trim="true"/> + </and> + <then> + <property name="lib.ext" value="${platform.lib.ext}"/> + </then> + <else> + <condition property="lib.ext" value=".lib"> + <os family="windows"/> + </condition> + + <condition property="lib.ext" value=".dylib"> + <os family="mac"/> + </condition> + + <condition property="lib.ext" value=".so"> + <os family="unix"/> + </condition> + </else> + </if> + + <!-- + Configure the dll.ext, used for windows only + Take the override value from platform.properties if set + Else set it based on the OS + --> + <if> + <and> + <isset property="platform.dll.ext"/> + <length string="${platform.dll.ext}" when="greater" length="0" trim="true"/> + </and> + <then> + <property name="dll.ext" value="${platform.dll.ext}"/> + </then> + <else> + <condition property="dll.ext" value=".dll"> + <os family="windows"/> + </condition> + + <property name="dll.ext" value=""/> + + </else> + </if> + + <!-- + Configure the lib.prefix + Take the override value from platform.properties if set + Else set it based on the OS + --> + <if> + <and> + <isset property="platform.lib.prefix"/> + <length string="${platform.lib.prefix}" when="greater" length="0" trim="true"/> + </and> + <then> + <property name="lib.prefix" value="${platform.lib.prefix}"/> + </then> + <else> + <condition property="lib.prefix" value=""> + <os family="windows"/> + </condition> + + <condition property="lib.prefix" value="lib"> + <or> + <os family="unix"/> + <os family="mac"/> + </or> + </condition> + </else> + </if> + + + <!-- + Configure the object.ext + Take the override value from platform.properties if set + Else set it based on the OS + --> + <if> + <and> + <isset property="platform.object.ext"/> + <length string="${platform.object.ext}" when="greater" length="0" trim="true"/> + </and> + <then> + <property name="object.ext" value="${platform.object.ext}"/> + </then> + <else> + <condition property="object.ext" value=".obj"> + <os family="windows"/> + </condition> + + <condition property="object.ext" value=".o"> + <or> + <os family="unix"/> + <os family="mac"/> + </or> + </condition> + </else> + </if> + + + <!-- + Configure the exe.ext + Take the override value from platform.properties if set + Else set it based on the OS + --> + <if> + <and> + <isset property="platform.exe.ext"/> + <length string="${platform.exe.ext}" when="greater" length="0" trim="true"/> + </and> + <then> + <property name="exe.ext" value="${platform.exe.ext}"/> + </then> + <else> + <condition property="exe.ext" value=".exe"> + <os family="windows"/> + </condition> + + <condition property="exe.ext" value=""> + <or> + <os family="unix"/> + <os family="mac"/> + </or> + </condition> + </else> + </if> + + + <!-- + Configure the script.ext + Take the override value from platform.properties if set + Else set it based on the OS + --> + <if> + <and> + <isset property="platform.script.ext"/> + <length string="${platform.script.ext}" when="greater" length="0" trim="true"/> + </and> + <then> + <property name="script.ext" value="${platform.script.ext}"/> + </then> + <else> + <condition property="script.ext" value=".bat"> + <os family="windows"/> + </condition> + + <condition property="script.ext" value=".sh"> + <or> + <os family="unix"/> + <os family="mac"/> + </or> + </condition> + </else> + </if> + + <condition property="windows" value="true"> + <os family="windows"/> + </condition> + + <condition property="mac" value="true"> + <os family="mac"/> + </condition> + + <condition property="unix" value="true"> + <os family="unix"/> + </condition> + + <!-- + Base compiler definition + --> + <compiler id="Tuscany-BaseCompiler" multithreaded="true" exceptions="true" rtti="true"> + <includepath path="${sdo.include.dir}"/> + <includepath path="${tuscanySCA.root.src.dir}"/> + <includepath path="${tuscanySCA.root.src.dir}/core/src"/> + </compiler> + + <!-- + Specific compiler definitions + The compilerarg location functionality completely omits the arg: antcontrib bug 1794857 + --> + + <!-- MSVC compilers for windows --> + <compiler id="msvc-Compiler" extends="Tuscany-BaseCompiler" name="msvc"> + <defineset define="WIN32,_CRT_SECURE_NO_DEPRECATE,_USRDLL,_WINDOWS"/> + </compiler> + + <!-- The standard msvc ant contrib cc task compiler doesnt work so well, + so we made our own until the bugs are resolved --> + <!--compiler id="msvc8-Compiler" extends="Tuscany-BaseCompiler" name="msvc"--> + <compiler id="msvc8-Compiler" + extends="Tuscany-BaseCompiler" + classname="tuscany.antCompilers.TuscanyMSVC8DevStudioCCompiler"> + <defineset define="WIN32,_CRT_SECURE_NO_DEPRECATE,_USRDLL,_WINDOWS"/> + </compiler> + + <!-- g++ compiler for most Unix platforms --> + <compiler id="g++-Compiler" extends="Tuscany-BaseCompiler" name="g++"/> + + <!-- g++ 32 bit compiler for 64 bit platforms + Used for cross compilation with the -m32 flag --> + <compiler id="g++m32-Compiler" extends="Tuscany-BaseCompiler" name="g++"> + <compilerarg value="-m32"/> + </compiler> + + <!-- g++ compiler for Apple mac --> + <compiler id="mac_g++-Compiler" extends="Tuscany-BaseCompiler" name="g++"> + <defineset define="IS_DARWIN"/> + </compiler> + + <!-- + Specific linker definitions + The linker extends funcionality isnt working correctly: antcontrib bug 1794867 + Specifically, the syslibset for dl was not working on Linux + --> + <linker id="msvc-Linker" name="msvc"> + <syslibset libs="kernel32,user32,ws2_32"/> + </linker> + + <linker id="msvc8-Linker" name="msvc"> + <syslibset libs="kernel32,user32,ws2_32"/> + </linker> + + <linker id="g++-Linker" name="g++"> + <syslibset libs="dl"/> + </linker> + + <linker id="g++m32-Linker" name="g++"> + <syslibset libs="dl"/> + <linkerarg value="-m32"/> + </linker> + + <linker id="mac_g++-Linker" name="g++"> + <syslibset libs="dl"/> + </linker> + + <!-- + Setup the external definitions file, if there is one + --> + <if> + <and> + <isset property="platform.external.definitions.file"/> + <length string="${platform.external.definitions.file}" when="greater" length="0" trim="true"/> + </and> + <then> + <property name="external.definitions.file" value="${platform.external.definitions.file}"/> + <import file="${external.definitions.file}"/> + </then> + </if> + <property name="external.definitions.file" value=""/> + + <target name="display.system" depends="check.ws,check.python,check.php,check.ruby,check.rest"> + + <!-- Tuscany paths, etc --> + <echo message=" "/> + <echo message="TuscanySCA paths"/> + <echo message=" tuscanySCA.install.dir= ${tuscanySCA.install.dir}"/> + <echo message=" tuscanySCA.root.dir= ${tuscanySCA.root.dir}"/> + <echo message=" tuscanySCA.root.src.dir= ${tuscanySCA.root.src.dir}"/> + <echo message=" tuscanySCA.install.dir= ${tuscanySCA.install.dir}"/> + <echo message=" tuscanySCA.library.version= '${tuscanySCA.library.version}'"/> + <echo message=" tuscanySDO.install.dir= ${tuscanySDO.install.dir}"/> + + <!-- compilers, libs, etc --> + <echo message=" "/> + <echo message="TuscanySCA compiler configuration"/> + <echo message=" compiler.name= '${compiler.name}'"/> + <echo message=" debug.compile= '${debug.compile}'"/> + <echo message=" lib.ext= '${lib.ext}'"/> + <echo message=" dll.ext= '${dll.ext}'"/> + <echo message=" lib.prefix= '${lib.prefix}'"/> + <echo message=" object.ext= '${object.ext}'"/> + <echo message=" exe.ext= '${exe.ext}'"/> + <echo message=" script.ext= '${script.ext}'"/> + <echo message=" external.definitions.file= '${external.definitions.file}'"/> + <echo message=" sdo.impl.library.name= '${sdo.impl.library.name}'"/> + + <!-- ws extention --> + <if> + <isset property="enable_ws"/> + <then> + <echo message=" "/> + <echo message="TuscanySCA ws extension enabled"/> + <echo message=" axis2c.home.dir= ${axis2c.home.dir}"/> + </then> + </if> + + <!-- php extention --> + <if> + <isset property="enable_php"/> + <then> + <echo message=" "/> + <echo message="TuscanySCA php extension enabled"/> + <echo message=" php.lib.dir= ${php.lib.dir}"/> + <echo message=" php.include.dir= ${php.include.dir}"/> + <echo message=" php.sca.sdo.lib.dir= ${php.sca.sdo.lib.dir}"/> + <echo message=" php.sca.sdo.include.dir= ${php.sca.sdo.include.dir}"/> + </then> + </if> + + <!-- python extention --> + <if> + <isset property="enable_python"/> + <then> + <echo message=" "/> + <echo message="TuscanySCA python extension enabled"/> + <echo message=" python.lib.dir= ${python.lib.dir}"/> + <echo message=" python.include.dir= ${python.include.dir}"/> + <echo message=" python.version= ${python.version}"/> + </then> + </if> + + <!-- rest extention --> + <if> + <isset property="enable_rest"/> + <then> + <echo message=" "/> + <echo message="TuscanySCA rest extension enabled"/> + <echo message=" rest.curl.lib.dir= ${rest.curl.lib.dir}"/> + <echo message=" rest.curl.include.dir= ${rest.curl.include.dir}"/> + <echo message=" rest.httpd.include.dir= ${rest.httpd.include.dir}"/> + <echo message=" rest.apr.include.dir= ${rest.apr.include.dir}"/> + </then> + </if> + + <!-- ruby extention --> + <if> + <isset property="enable_ruby"/> + <then> + <echo message=" "/> + <echo message="TuscanySCA ruby extension enabled"/> + <echo message=" ruby.lib.dir= ${ruby.lib.dir}"/> + <echo message=" ruby.include.dir= ${ruby.include.dir}"/> + </then> + </if> + + <echo message=" "/> + + </target> + +</project> |