]> oss.titaniummirror.com Git - msp430-binutils.git/blobdiff - gas/acinclude.m4
Imported binutils-2.20
[msp430-binutils.git] / gas / acinclude.m4
index fa4c1bc6e9f5110b5a0169e5c69e50b4083058d5..40722c6888a26ce416800ad5955f0c66cc616eb0 100644 (file)
@@ -54,3 +54,41 @@ for _gas_uniq_i in _gas_uniq_dummy [$]_gas_uniq_list ; do
 done
 $1=[$]_gas_uniq_newlist
 ])dnl
+dnl
+dnl Check for existence of member $2 in type $1 in time.h
+dnl
+AC_DEFUN([GAS_HAVE_TIME_TYPE_MEMBER],
+[AC_MSG_CHECKING([for $1.$2 in time.h])
+ AC_CACHE_VAL(gas_cv_have_time_type_member_$2,
+   [AC_TRY_COMPILE([
+#define _BSD_SOURCE 1
+#include <time.h>],
+      [$1 avar; void* aref = (void*) &avar.$2],
+      gas_cv_have_time_type_member_$2=yes,
+      gas_cv_have_time_type_member_$2=no
+   )])
+ if test $gas_cv_have_time_type_member_$2 = yes; then
+   AC_DEFINE([HAVE_]translit($2, [a-z], [A-Z]), 1,
+            [Define if <time.h> has $1.$2.])
+ fi
+ AC_MSG_RESULT($gas_cv_have_time_type_member_$2)
+])dnl
+dnl
+dnl Check for existence of member $2.$3 in type $1 in sys/stat.h
+dnl
+AC_DEFUN([GAS_HAVE_SYS_STAT_TYPE_MEMBER],
+[AC_MSG_CHECKING([for $1.$2.$3 in sys/stat.h])
+ AC_CACHE_VAL(gas_cv_have_sys_stat_type_member_$2_$3,
+   [AC_TRY_COMPILE([
+#define _BSD_SOURCE 1
+#include <sys/stat.h>],
+      [$1 avar; void* aref = (void*) &avar.$2.$3],
+      gas_cv_have_sys_stat_type_member_$2_$3=yes,
+      gas_cv_have_sys_stat_type_member_$2_$3=no
+   )])
+ if test $gas_cv_have_sys_stat_type_member_$2_$3 = yes; then
+   AC_DEFINE([HAVE_]translit($2, [a-z], [A-Z])[_]translit($3, [a-z], [A-Z]), 1,
+            [Define if <sys/stat.h> has $1.$2.$3])
+ fi
+ AC_MSG_RESULT($gas_cv_have_sys_stat_type_member_$2_$3)
+])dnl