Android doesn’t have mkstemps
authorMoritz Angermann <moritz.angermann@gmail.com>
Tue, 9 May 2017 07:49:43 +0000 (15:49 +0800)
committerHerbert Valerio Riedel <hvr@gnu.org>
Thu, 11 May 2017 16:26:19 +0000 (18:26 +0200)
However the check similarly to tell and seekdir succeeds. However we will generate the following error down the line:
```
/var/folders/fv/xqjrpfj516n5xq_m_ljpsjx00000gn/T/ghc13524_0/ghc_2.c:11:104: error:
     warning: implicit declaration of function 'mkstemps' is invalid in C99 [-Wimplicit-function-declaration]
   |
11 | HsInt32 ghczuwrapperZC1ZCunixzm2zi7zi2zi1ZCSystemziPosixziTempZCmkstemps(void* a1, HsInt32 a2) {return mkstemps(a1, a2);}
   |                                                                                                        ^
HsInt32 ghczuwrapperZC1ZCunixzm2zi7zi2zi1ZCSystemziPosixziTempZCmkstemps(void* a1, HsInt32 a2) {return mkstemps(a1, a2);}
                                                                                                       ^
```

configure.ac

index 32f7174..b23caef 100644 (file)
@@ -73,7 +73,8 @@ AC_CHECK_FUNCS([utimensat futimens])
 AC_CHECK_FUNCS([lutimes futimes])
 
 # Additional temp functions
-AC_CHECK_FUNCS([mkstemps mkdtemp])
+dnl androids bionic doesn't have mkstemps
+AS_CASE([$target_os],[*-android*],[AC_CHECK_FUNCS([mkdtemp])],[AC_CHECK_FUNCS([mkstemps mkdtemp])])
 
 # Functions for file synchronization and allocation control
 AC_CHECK_FUNCS([fsync])