Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] Re: [platform-core-dev] Building libraries - Suggestion

>>>>> "Jeff" == Jeff McAffer <Jeff_McAffer@xxxxxxx> writes:

Jeff> Its a good idea.  I would modify the idea a little and rather
Jeff> than making a build.native target in build.xml, have the
Jeff> build.xml call out to a target in a new file native.xml.  This
Jeff> way, people don't have to modify the build.xmls that are
Jeff> generated by the build mechanism.

I finally found some time to start working on this.

Appended is a `native.xml' file that I put in my org.eclipse.swt.gtk
directory.  I didn't look at writing a native.xml file for the other
SWT ports (I have no way to test those).

It has a few oddities, so I thought I'd send it before writing the
remaining native.xml files and the support code.

First, this particular one is a bit ugly since it copies some files
around before invoking make.  I didn't see a clearly better way to do
it.  How are the SWT native builds done on eclipse.org?

Second, the Makefile wants to know the location of the JDK
installation.  This is true not only for SWT but also for the other
native builds.  I solved this by requiring the caller of native.xml to
set the `java_home' property appropriately.  The idea is that this can
be set once for the build, and then each native.xml will propagate the
value to make as appropriate.

If this all seems reasonable, I'll write the remaining native.xml
files as time permits.  If there are changes you'd like to see, please
tell me so I can incorporate them.  I'd like to get the issues ironed
out ahead of time.  Once that's done I'll put the native.xml files
into bugzilla (unless you'd prefer some other delivery mechanism).

Tom


<?xml version="1.0" encoding="UTF-8"?>
<project name="native" default="copy.native" basedir=".">

  <property name="os" value="linux"/>
  <property name="arch" value="x86"/>

  <property name="plugindir" value="../org.eclipse.swt"/>
  <property name="java_home" value=""/>

  <property name="gtk_library" value="${plugindir}/Eclipse SWT PI/gtk/library"/>
  <property name="common_library" value="${plugindir}/Eclipse SWT/common/library"/>

  <target name="copy.native" depends="build.native">
    <copy todir="os/${os}/${arch}" overwrite="true" verbose="false">
      <fileset dir="${gtk_library}"
               includes="libswt-*.so" />
    </copy>
  </target>

  <target name="build.native" depends="copies">
    <exec executable="make"
          dir="${gtk_library}" failonerror="true">
          <arg line="IVE_HOME=${java_home} -f make_gtk.mak" />
    </exec>
  </target>

  <!-- Copy some files as neede by the makefile -->
  <target name="copies">
    <copy todir="${plugindir}/Eclipse SWT PI/gtk/library"
          overwrite="true" verbose="false">
      <fileset dir="${plugindir}/Eclipse SWT/common/library"
               includes="callback.c,callback.h,swt.h,make_common.mak" />
    </copy>
  </target>

</project>


Back to the top