Automatically determine whether INCOMPLETE_TYPES_BROKEN should be defined


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@227 632fc199-4ca6-4c93-a231-07263d6284db
diff --git a/configure.ac b/configure.ac
index 262fe8d..a34819a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,8 +10,6 @@
 
 # Always build with prototypes
 AC_DEFINE([HAVE_PROTOTYPES], 1, [Define if your compiler supports prototypes])
-# Don't use undefined types
-AC_DEFINE([INCOMPLETE_TYPES_BROKEN], 1, [Define if you want use complete types])
 
 # Checks for programs.
 SAVED_CFLAGS=${CFLAGS}
@@ -23,6 +21,13 @@
 AC_PROG_LIBTOOL
 AC_PROG_LN_S
 
+# Check whether compiler supports pointers to undefined structures
+AC_MSG_CHECKING(whether compiler supports pointers to undefined structures)
+AC_TRY_COMPILE([ typedef struct undefined_structure * undef_struct_ptr; ], ,
+AC_MSG_RESULT(yes),
+[AC_MSG_RESULT(no)
+AC_DEFINE([INCOMPLETE_TYPES_BROKEN],[1],[Compiler does not support pointers to undefined structures.])])
+
 AC_MSG_CHECKING([whether the linker supports version scripts])
 VERSION_SCRIPT=no
 LDVER=`$LD --help </dev/null 2>&1 | grep "\-\-version-script"`