]> git.draconx.ca Git - dxcommon.git/blobdiff - configure.ac
Add common option formatting routines.
[dxcommon.git] / configure.ac
index 6150d4c565332a8b86f1db37d536fec08ba94317..75a4b949139837f34e66fb6f776494bdef3ec4d4 100644 (file)
@@ -24,5 +24,13 @@ AC_CONFIG_TESTDIR([.])
 DX_PROG_AUTOTEST
 AM_CONDITIONAL([HAVE_AUTOTEST], [test x"$dx_cv_autotest_works" = x"yes"])
 
+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])])
+AM_CONDITIONAL([HAVE_STRUCT_OPTION],
+  [test x"$dx_cv_have_struct_option" = x"yes"])
+
 AC_CONFIG_FILES([Makefile atlocal])
 AC_OUTPUT