Move compiler/linker flags from profiles to aol.properties

This is to make cross-compiling for i386 on amd64 easier, by adding
-m32/64 or -arch flags where appropriate.

This commit also adds a gcc linker on Linux and macOS, replacing the
default g++ linker. It's roughly equivalent, but means the shared
library has fewer dependencies (e.g. it doesn't link against libstdc++).
master
Graham 5 years ago
parent 61a5951f82
commit e35384c1a9
  1. 103
      aol.properties
  2. 85
      pom.xml

@ -0,0 +1,103 @@
# Linux i386
i386.Linux.linker=gcc
i386.Linux.gcc.c.compiler=gcc
i386.Linux.gcc.c.defines=
i386.Linux.gcc.c.options=-m32 -Wall -Wextra -pedantic -Wno-int-to-void-pointer-cast -Wno-unused-parameter
i386.Linux.gcc.c.includes=**/*.c
i386.Linux.gcc.c.excludes=
i386.Linux.gcc.java.include=include;include/linux
i386.Linux.gcc.java.runtimeDirectory=jre/lib/i386/client
i386.Linux.gcc.linker.options=-m32 -fPIC
i386.Linux.gcc.lib.prefix=lib
i386.Linux.gcc.shared.prefix=lib
i386.Linux.gcc.static.extension=a
i386.Linux.gcc.shared.extension=so*
i386.Linux.gcc.plugin.extension=so
i386.Linux.gcc.jni.extension=so
i386.Linux.gcc.executable.extension=
# Linux amd64
amd64.Linux.linker=gcc
amd64.Linux.gcc.c.compiler=gcc
amd64.Linux.gcc.c.defines=
amd64.Linux.gcc.c.options=-m64 -Wall -Wextra -pedantic -Wno-int-to-void-pointer-cast -Wno-unused-parameter
amd64.Linux.gcc.c.includes=**/*.c
amd64.Linux.gcc.c.excludes=
amd64.Linux.gcc.java.include=include;include/linux
amd64.Linux.gcc.java.runtimeDirectory=jre/lib/amd64/server
amd64.Linux.gcc.linker.options=-m64 -fPIC
amd64.Linux.gcc.lib.prefix=lib
amd64.Linux.gcc.shared.prefix=lib
amd64.Linux.gcc.static.extension=a
amd64.Linux.gcc.shared.extension=so*
amd64.Linux.gcc.plugin.extension=so
amd64.Linux.gcc.jni.extension=so
amd64.Linux.gcc.executable.extension=
# macOS i386
i386.MacOSX.linker=gcc
i386.MacOSX.gcc.c.compiler=gcc
i386.MacOSX.gcc.c.defines=
i386.MacOSX.gcc.c.options=-arch i386 -x objective-c -Wall -Wextra -pedantic -Wno-int-to-void-pointer-cast -Wno-unused-parameter
i386.MacOSX.gcc.c.includes=**/*.c
i386.MacOSX.gcc.c.excludes=
i386.MacOSX.gcc.java.include=include;include/darwin
i386.MacOSX.gcc.java.runtimeDirectory=IGNORED
i386.MacOSX.gcc.linker.options=-arch i386
i386.MacOSX.gcc.lib.prefix=lib
i386.MacOSX.gcc.shared.prefix=lib
i386.MacOSX.gcc.static.extension=a
i386.MacOSX.gcc.shared.extension=dylib
i386.MacOSX.gcc.plugin.extension=bundle
i386.MacOSX.gcc.jni.extension=jnilib
i386.MacOSX.gcc.executable.extension=
# macOS amd64
x86_64.MacOSX.linker=gcc
x86_64.MacOSX.gcc.c.compiler=gcc
x86_64.MacOSX.gcc.c.defines=
x86_64.MacOSX.gcc.c.options=-arch x86_64 -x objective-c -Wall -Wextra -pedantic -Wno-int-to-void-pointer-cast -Wno-unused-parameter
x86_64.MacOSX.gcc.c.includes=**/*.c
x86_64.MacOSX.gcc.c.excludes=
x86_64.MacOSX.gcc.java.include=include;include/darwin
x86_64.MacOSX.gcc.java.runtimeDirectory=IGNORED
x86_64.MacOSX.gcc.linker.options=-arch x86_64
x86_64.MacOSX.gcc.lib.prefix=lib
x86_64.MacOSX.gcc.shared.prefix=lib
x86_64.MacOSX.gcc.static.extension=a
x86_64.MacOSX.gcc.shared.extension=dylib
x86_64.MacOSX.gcc.plugin.extension=bundle
x86_64.MacOSX.gcc.jni.extension=jnilib
x86_64.MacOSX.gcc.executable.extension=
# Windows i386
x86.Windows.msvc.c.defines=WIN32_LEAN_AND_MEAN
# C1400: unused parameter
# C4201: non-standard extension: nameless struct/union (in jawt_md.h)
# C4204: non-standard extension: non-constant aggregate initializer
# C4255: no function prototype given (in winuser.h)
# C4305: type cast: truncation from <type> to <type> (only on 32-bit machines)
# C4668: undefined processor macro (in vcruntime.h and winioctl.h)
# C4820: padding after data member (in jawt.h and jni.h)
# C5045: compiler will insert Spectre mitigation
x86.Windows.msvc.c.options=/Wall /wd4100 /wd4201 /wd4204 /wd4255 /wd4305 /wd4668 /wd4820 /wd5045
# Windows amd64
amd64.Windows.msvc.c.defines=WIN32_LEAN_AND_MEAN
amd64.Windows.msvc.c.options=/Wall /wd4100 /wd4201 /wd4204 /wd4255 /wd4305 /wd4668 /wd4820 /wd5045

@ -353,33 +353,6 @@
<modules> <modules>
<module>gl-natives</module> <module>gl-natives</module>
</modules> </modules>
<build>
<plugins>
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<configuration>
<c>
<options>
<option>-x</option>
<option>objective-c</option>
<option>-Wall</option>
<option>-Wextra</option>
<option>-pedantic</option>
<option>-Wno-int-to-void-pointer-cast</option>
<option>-Wno-unused-parameter</option>
</options>
</c>
<linker>
<options>
<option>-arch</option>
<option>${nar.arch}</option>
</options>
</linker>
</configuration>
</plugin>
</plugins>
</build>
</profile> </profile>
<profile> <profile>
<id>unix</id> <id>unix</id>
@ -393,30 +366,6 @@
<module>gl-natives</module> <module>gl-natives</module>
<module>gl-dri-natives</module> <module>gl-dri-natives</module>
</modules> </modules>
<build>
<plugins>
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<configuration>
<c>
<options>
<option>-Wall</option>
<option>-Wextra</option>
<option>-pedantic</option>
<option>-Wno-int-to-void-pointer-cast</option>
<option>-Wno-unused-parameter</option>
</options>
</c>
<linker>
<options>
<option>-fPIC</option>
</options>
</linker>
</configuration>
</plugin>
</plugins>
</build>
</profile> </profile>
<profile> <profile>
<id>windows</id> <id>windows</id>
@ -429,40 +378,6 @@
<module>gl-natives</module> <module>gl-natives</module>
<module>misc-natives</module> <module>misc-natives</module>
</modules> </modules>
<build>
<plugins>
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<configuration>
<c>
<defines>
<define>WIN32_LEAN_AND_MEAN</define>
</defines>
<options>
<option>/Wall</option>
<!-- unused parameter -->
<option>/wd4100</option>
<!-- non-standard extension: nameless struct/union (in jawt_md.h) -->
<option>/wd4201</option>
<!-- non-standard extension: non-constant aggregate initializer -->
<option>/wd4204</option>
<!-- no function prototype given (in winuser.h) -->
<option>/wd4255</option>
<!-- type cast: truncation from <type> to <type> (only on 32-bit machines) -->
<option>/wd4305</option>
<!-- undefined processor macro (in vcruntime.h and winioctl.h) -->
<option>/wd4668</option>
<!-- padding after data member (in jawt.h and jni.h) -->
<option>/wd4820</option>
<!-- compiler will insert Spectre mitigation -->
<option>/wd5045</option>
</options>
</c>
</configuration>
</plugin>
</plugins>
</build>
</profile> </profile>
</profiles> </profiles>
</project> </project>

Loading…
Cancel
Save