dnl get 64-int interfaces on 32-bit platforms
CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
-AC_TYPE_UID_T
-
dnl Support building Win32 DLLs (must appear *before* AM_PROG_LIBTOOL)
AC_LIBTOOL_WIN32_DLL
AC_CHECK_SIZEOF([long])
-AC_CHECK_TYPE([struct ifreq],
- [AC_DEFINE([HAVE_STRUCT_IFREQ],[1],
- [Defined if struct ifreq exists in net/if.h])],
- [], [[#include <sys/socket.h>
- #include <net/if.h>
- ]])
-
-AC_CHECK_TYPE([struct sockpeercred],
- [AC_DEFINE([HAVE_STRUCT_SOCKPEERCRED], [1],
- [Defined if struct sockpeercred is available])],
- [], [[#include <sys/socket.h>
- ]])
-
AC_CHECK_LIB([intl],[gettext],[])
AC_CHECK_LIB([util],[openpty],[])
endif
+# check various types
+
+types = [
+ [ 'struct ifreq', '#include <sys/socket.h>\n#include <net/if.h>'] ,
+ [ 'struct sockpeercred', '#include <sys/socket.h' ],
+]
+
+foreach type : types
+ if cc.has_type(type[0], prefix: type[1])
+ name = type[0].underscorify().to_upper()
+ conf.set('HAVE_@0@'.format(name), 1)
+ endif
+endforeach
+
+if host_machine.system() == 'windows'
+ uid_types = [
+ 'uid_t',
+ 'gid_t',
+ ]
+ foreach type : uid_types
+ if not cc.has_type(type, prefix: '#include <sys/types.h>')
+ conf.set(type, 'int')
+ endif
+ endforeach
+endif
+
+
# define top include directory
top_inc_dir = include_directories('.')