+# To ensure automake --add-missing copies config.guess/config.sub
+AC_CANONICAL_HOST
+
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_PROG_AWK
+
+AC_USE_SYSTEM_EXTENSIONS
+AC_C_INLINE
+AM_PROG_AR
+
+AC_SUBST([STUB_INCLUDES], [@&t@])
+
+AC_CHECK_FUNCS_ONCE([wcwidth])
+AM_CONDITIONAL([HAVE_WCWIDTH], [test x"$ac_cv_func_wcwidth" = x"yes"])
+
+AC_CONFIG_TESTDIR([.], [t:$srcdir/t])
+DX_PROG_AUTOTEST_AM
+
+AC_CACHE_CHECK([for struct option in <getopt.h>], [dx_cv_have_struct_option],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <getopt.h>],
+[[struct option opt = { "aaaa", 2, (void *)0, 'a' };
+return opt.name[opt.flag ? opt.val : opt.has_arg];]])],
+ [dx_cv_have_struct_option=yes], [dx_cv_have_struct_option=no])])
+AS_IF([test x"$dx_cv_have_struct_option" != x"yes"],
+ [AS_VAR_APPEND([STUB_INCLUDES], ['-I${top_srcdir}/t/getopt'])])
+
+AM_CONDITIONAL([HAVE_STRUCT_OPTION],
+ [test x"$dx_cv_have_struct_option" = x"yes"])