Skip to content

Commit

Permalink
Skip re-download and re-compile of APR / *SSL when already done befor…
Browse files Browse the repository at this point in the history
…e. (netty#390)

Motivation:

At the moment we redownload and re-compile APR / *SSL when building our static compiled version of netty-tcnative even if it was compiled before and we did not request a "clean" during the build. We should better only do it when "clean" is explicit requested to speed up build times when working on changes.

Modifications:

Verify if we already compiled APR / *SSL and if so skip the step.

Result:

Be able to faster iterate and build
  • Loading branch information
normanmaurer committed Sep 18, 2018
1 parent e47724e commit 68d693b
Show file tree
Hide file tree
Showing 4 changed files with 248 additions and 169 deletions.
70 changes: 40 additions & 30 deletions boringssl-static/pom.xml
Expand Up @@ -135,42 +135,52 @@
<!-- Add the ant tasks from ant-contrib -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties" />

<mkdir dir="${boringsslBuildDir}" />

<if>
<equals arg1="${os.detected.name}" arg2="windows" />
<available file="${boringsslBuildDir}" />
<then>
<!-- On Windows, build with /MT for static linking -->
<property name="cmakeAsmFlags" value="" />
<property name="cmakeCFlags" value="/MT" />
<property name="cmakeCxxFlags" value="/MT" />
<echo message="BoringSSL was already build, skipping the build step." />
</then>
<elseif>
<equals arg1="${os.detected.name}" arg2="linux" />
<then>
<!-- On *nix, add ASM flags to disable executable stack -->
<property name="cmakeAsmFlags" value="-Wa,--noexecstack" />
<property name="cmakeCFlags" value="-std=c99 -O3 -fno-omit-frame-pointer" />
<property name="cmakeCxxFlags" value="-O3 -fno-omit-frame-pointer -Wno-error=maybe-uninitialized" />
</then>
</elseif>
<else>
<!-- On *nix, add ASM flags to disable executable stack -->
<property name="cmakeAsmFlags" value="-Wa,--noexecstack" />
<property name="cmakeCFlags" value="-std=c99 -O3 -fno-omit-frame-pointer" />
<property name="cmakeCxxFlags" value="-O3 -fno-omit-frame-pointer" />
<echo message="Building BoringSSL" />

<mkdir dir="${boringsslBuildDir}" />

<if>
<equals arg1="${os.detected.name}" arg2="windows" />
<then>
<!-- On Windows, build with /MT for static linking -->
<property name="cmakeAsmFlags" value="" />
<property name="cmakeCFlags" value="/MT" />
<property name="cmakeCxxFlags" value="/MT" />
</then>
<elseif>
<equals arg1="${os.detected.name}" arg2="linux" />
<then>
<!-- On *nix, add ASM flags to disable executable stack -->
<property name="cmakeAsmFlags" value="-Wa,--noexecstack" />
<property name="cmakeCFlags" value="-std=c99 -O3 -fno-omit-frame-pointer" />
<property name="cmakeCxxFlags" value="-O3 -fno-omit-frame-pointer -Wno-error=maybe-uninitialized" />
</then>
</elseif>
<else>
<!-- On *nix, add ASM flags to disable executable stack -->
<property name="cmakeAsmFlags" value="-Wa,--noexecstack" />
<property name="cmakeCFlags" value="-std=c99 -O3 -fno-omit-frame-pointer" />
<property name="cmakeCxxFlags" value="-O3 -fno-omit-frame-pointer" />
</else>
</if>
<exec executable="cmake" failonerror="true" dir="${boringsslBuildDir}" resolveexecutable="true">
<arg value="-DCMAKE_POSITION_INDEPENDENT_CODE=TRUE" />
<arg value="-DCMAKE_BUILD_TYPE=Release" />
<arg value="-DCMAKE_ASM_FLAGS=${cmakeAsmFlags}" />
<arg value="-DCMAKE_C_FLAGS_RELEASE=${cmakeCFlags}" />
<arg value="-DCMAKE_CXX_FLAGS_RELEASE=${cmakeCxxFlags}" />
<arg value="-GNinja" />
<arg value=".." />
</exec>
<exec executable="ninja" failonerror="true" dir="${boringsslBuildDir}" resolveexecutable="true" />
</else>
</if>
<exec executable="cmake" failonerror="true" dir="${boringsslBuildDir}" resolveexecutable="true">
<arg value="-DCMAKE_POSITION_INDEPENDENT_CODE=TRUE" />
<arg value="-DCMAKE_BUILD_TYPE=Release" />
<arg value="-DCMAKE_ASM_FLAGS=${cmakeAsmFlags}" />
<arg value="-DCMAKE_C_FLAGS_RELEASE=${cmakeCFlags}" />
<arg value="-DCMAKE_CXX_FLAGS_RELEASE=${cmakeCxxFlags}" />
<arg value="-GNinja" />
<arg value=".." />
</exec>
<exec executable="ninja" failonerror="true" dir="${boringsslBuildDir}" resolveexecutable="true" />
</target>
</configuration>
</execution>
Expand Down
41 changes: 27 additions & 14 deletions libressl-static/pom.xml
Expand Up @@ -172,20 +172,33 @@
</goals>
<configuration>
<target>
<get src="http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/${libresslArchive}" dest="${project.build.directory}/${libresslArchive}" verbose="on" />
<checksum file="${project.build.directory}/${libresslArchive}" algorithm="SHA-256" property="${libresslSha256}" verifyProperty="isEqual" />
<exec executable="tar" failonerror="true" dir="${project.build.directory}/" resolveexecutable="true">
<arg value="xfv" />
<arg value="${libresslArchive}" />
</exec>
<mkdir dir="${sslHome}" />
<exec executable="configure" failonerror="true" dir="${libresslCheckoutDir}" resolveexecutable="true">
<arg line="--disable-shared --prefix=${sslHome} CFLAGS='-O3 -fno-omit-frame-pointer -fPIC'" />
</exec>
<exec executable="make" failonerror="true" dir="${libresslCheckoutDir}" resolveexecutable="true" />
<exec executable="make" failonerror="true" dir="${libresslCheckoutDir}" resolveexecutable="true">
<arg line="install" />
</exec>
<!-- Add the ant tasks from ant-contrib -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties" />

<if>
<available file="${sslHome}" />
<then>
<echo message="LibreSSL was already build, skipping the build step." />
</then>
<else>
<echo message="Downloading and building LibreSSL" />

<get src="http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/${libresslArchive}" dest="${project.build.directory}/${libresslArchive}" verbose="on" />
<checksum file="${project.build.directory}/${libresslArchive}" algorithm="SHA-256" property="${libresslSha256}" verifyProperty="isEqual" />
<exec executable="tar" failonerror="true" dir="${project.build.directory}/" resolveexecutable="true">
<arg value="xfv" />
<arg value="${libresslArchive}" />
</exec>
<mkdir dir="${sslHome}" />
<exec executable="configure" failonerror="true" dir="${libresslCheckoutDir}" resolveexecutable="true">
<arg line="--disable-shared --prefix=${sslHome} CFLAGS='-O3 -fno-omit-frame-pointer -fPIC'" />
</exec>
<exec executable="make" failonerror="true" dir="${libresslCheckoutDir}" resolveexecutable="true" />
<exec executable="make" failonerror="true" dir="${libresslCheckoutDir}" resolveexecutable="true">
<arg line="install" />
</exec>
</else>
</if>
</target>
</configuration>
</execution>
Expand Down

0 comments on commit 68d693b

Please sign in to comment.