build: Look for mkostemp when configuring

We use this function, but it may be missing on older Linux platforms.

https://bugzilla.gnome.org/show_bug.cgi?id=788705
This commit is contained in:
Emmanuele Bassi 2017-10-09 11:46:48 +01:00
parent 7b15f12f0e
commit f40154e218
3 changed files with 12 additions and 1 deletions

View File

@ -376,6 +376,9 @@
/* Define to 1 if you have the `statvfs' function. */
#mesondefine HAVE_STATVFS
/* Define to 1 if you have the `mkostemp' function. */
#mesondefine HAVE_MKOSTEMP
/* Define to 1 if you have the <stddef.h> header file. */
#mesondefine HAVE_STDDEF_H

View File

@ -880,7 +880,7 @@ int main ()
AC_MSG_RESULT($glib_ssize_type)
# Check for some functions
AC_CHECK_FUNCS(lstat strsignal vsnprintf stpcpy strcasecmp strncasecmp poll vasprintf setenv unsetenv getc_unlocked readlink symlink fdwalk)
AC_CHECK_FUNCS(lstat strsignal vsnprintf stpcpy strcasecmp strncasecmp poll vasprintf setenv unsetenv getc_unlocked readlink symlink fdwalk mkostemp)
AC_CHECK_FUNCS(lchmod lchown fchmod fchown utimes getresuid)
AC_CHECK_FUNCS(getmntent_r setmntent endmntent hasmntopt getfsstat getvfsstat fallocate)
case $host_os in aix*) ac_cv_func_splice=no ;; esac # AIX splice() is something else

View File

@ -451,6 +451,14 @@ else
endif
message('Checking whether to use statfs or statvfs .. ' + stat_func_to_use)
if host_system == 'linux'
if cc.has_function('mkostemp',
prefix: '''#define _GNU_SOURCE
#include <stdlib.h>''')
glib_conf.set('HAVE_MKOSTEMP', 1)
endif
endif
# Mac OS X Carbon support
glib_have_carbon = cc.compiles('''#include <Carbon/Carbon.h>
#include <CoreServices/CoreServices.h>''',