termux-packages/packages/openfoam/etc-config.sh-settings.patch
Henrik Grimler cb8e5946b2 openfoam: update to 21.06
Finally a working build :)

Tests done: run cavity tutorial on aarch64 and arm.

TODO/things that would be nice to test:

* Check if we actually need to set WM_{CC,CXX,CFLAGS,CXXFLAGS} in
  etc/config.sh/settings.
* Test compilation with Gcc on device
* Look at the __libc_malloc->malloc patch in sigFpe.C again, and try
  to upstream the fix so that it isn't as glibc specific.

We need to remove -std=c++11 from CXXFLAGS, or else we get errors when building with
our (rather new) version of CGAL, for example:

/data/data/com.termux/files/usr/include/CGAL/array.h:72:44: error: no template named 'index_sequence' in namespace 'std'
make_filled_array_aux(const T& value, std::index_sequence<Is...>)
                                      ~~~~~^

/data/data/com.termux/files/usr/include/CGAL/number_utils.h:320:10: warning: 'decltype(auto)' type specifier is a C++14 extension [-Wc++14-extensions]
  decltype(auto) approximate_sqrt(const NT& nt)
           ^
/data/data/com.termux/files/usr/include/CGAL/number_utils.h:320:1: error: deduced return types are a C++14 extension
  decltype(auto) approximate_sqrt(const NT& nt)
  ^
2021-12-04 14:36:37 +01:00

58 lines
1.8 KiB
Diff

--- ../etc-config.sh-settings.orig 2021-11-30 17:36:32.001059127 +0000
+++ ./etc/config.sh/settings 2021-11-30 17:40:00.390512856 +0000
@@ -32,26 +32,42 @@
Linux)
WM_ARCH=linux
- case "$(uname -m)" in
+ case "$ARCH" in
x86_64)
if [ "$archOption" = 32 ]
then
export WM_ARCH_OPTION=32 # Propagate?
export WM_COMPILER_ARCH=64 # 64-bit compiler, 32-bit target
+ export WM_CC='x86_64-linux-android-clang'
+ export WM_CXX='x86_64-linux-android-clang++'
+ export WM_CFLAGS='-m32 -fPIC'
+ export WM_CXXFLAGS='-m32 -fPIC'
else
WM_ARCH=linux64 # 64-bit compiler/target
export WM_COMPILER_LIB_ARCH=64 # Use lib64
+ export WM_CC='x86_64-linux-android-clang'
+ export WM_CXX='x86_64-linux-android-clang++'
+ export WM_CFLAGS='-fPIC'
+ export WM_CXXFLAGS='-fPIC'
fi
;;
aarch64)
WM_ARCH=linuxARM64
export WM_COMPILER_LIB_ARCH=64 # Use lib64
+ export WM_CC='aarch64-linux-android-clang'
+ export WM_CXX='aarch64-linux-android-clang++'
+ export WM_CFLAGS='-fPIC'
+ export WM_CXXFLAGS='-fPIC'
;;
armv7l)
WM_ARCH=linuxARM7
export WM_COMPILER_LIB_ARCH=32 # Use lib32
+ export WM_CC='arm-linux-androideabi-clang'
+ export WM_CXX='arm-linux-androideabi-clang++'
+ export WM_CFLAGS='-fPIC'
+ export WM_CXXFLAGS='-fPIC'
;;
ppc64)
@@ -66,6 +82,10 @@
i686)
WM_ARCH=linux
+ export WM_CC='i686-linux-android-clang'
+ export WM_CXX='i686-linux-android-clang++'
+ export WM_CFLAGS='-fPIC'
+ export WM_CXXFLAGS='-fPIC'
;;
ia64)