summaryrefslogtreecommitdiffstats
path: root/make/lib/gluegen-cpptasks-linux-aarch64.xml
blob: 8606fae1d00d9a669f5f8a808f28b2ffb2d7500f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?xml version="1.0" encoding="UTF-8"?>

<!--
    This is an example of how to add custom compiler/linker 
    arguments for a crosscompiler.

    You can use such files with setting the property 'gluegen-cpptasks.file', ie:

        -Dgluegen-cpptasks.file=`pwd`/lib/gluegen-cpptasks-linux-aarch64.xml

    In case you want to compile for 32bit on a 64bit machine,
    you might also need to set the 'os.arch' to 'x86'.
    Example: gluegen/make/make.gluegen.all.linux-x86.sh
  -->

<project name="GlueGen-cpptasks-linux-aarch64" basedir="." >

<!-- Set OS and ARCH for crosscompilation compiler configuration -->
<target name="gluegen.cpptasks.detect.os.custom">
    <property name="gluegen.cpptasks.detected.os"     value="true" /> 
    <property name="isUnix"                           value="true" /> 
    <property name="isLinux"                          value="true" />
    <property name="isLinuxARM64"                     value="true" /> 
    <property name="isX11"                            value="true" /> 
    <property name="jvmDataModel.arg"                 value="-Djnlp.no.jvm.data.model.set=true" /> 
    <property name="isAbiEabiGnuArmhf"                value="true" />
    <echo message="gluegen.cpptasks.detect.os.custom: GLUEGEN_CPPTASKS_FILE 'gluegen-cpptasks-linux-aarch64' done"/>
</target>

<import file="${gluegen.root.abs-path}/make/gluegen-cpptasks-base.xml" optional="false" />

<target name="gluegen.cpptasks.configure.compiler" depends="setup.java.home.dir">
    <echo message="Custom forced compiler Linux aarch64 hard float" />

    <compiler id="compiler.cfg.linux.aarch64" name="gcc">
      <defineset>
        <define name="__unix__"/>
        <define name="__X11__"  if="isX11"/>
        <define name="_DEBUG"   if="c.compiler.use-debug"/>        
        <define name="DEBUG"    if="c.compiler.use-debug"/>        
        <define name="NDEBUG"   unless="c.compiler.use-debug"/>        
      </defineset>
      <compilerarg value="-fpic" /> 
      <compilerarg value="-include"/>
      <compilerarg value="${gluegen.root.abs-path}/make/stub_includes/platform/glibc-compat-symbols.h" />
    </compiler>

    <linker id="linker.cfg.linux.aarch64" name="gcc">
      <linkerarg value="-fpic" /> 
      <linkerarg value="-march=armv8-a" />
      <linkerarg value="-nostdlib" />
      <linkerarg value="-Bdynamic" />
      <linkerarg value="-static-libgcc" if="isGCC"/>
      <linkerarg value="-static-libstdc++" if="isGCC"/>
    </linker>

</target>

</project>