+cat > $srcdir/conffoo.h <<EOF
+#define CONFFOO 1
+EOF
+echo $ac_n "checking for a working inclusion macro""... $ac_c" 1>&6
+echo "configure:2348: checking for a working inclusion macro" >&5
+cat > conftest.$ac_ext <<EOF
+#line 2350 "configure"
+#include "confdefs.h"
+
+int main() {
+
+#define SMART_INCLUDE(path,file) <path/file>
+#define CONFFOO_H_PATH $srcdir
+#define CONFFOO_INCLUDE(file) SMART_INCLUDE (CONFFOO_H_PATH,file)
+#include CONFFOO_INCLUDE(conffoo.h)
+
+; return 0; }
+EOF
+if { (eval echo configure:2362: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""direct" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
+ Defining SMART_INCLUDE_INDIRECTIONS = 0
+EOF
+cat >> confdefs.h <<\EOF
+#define SMART_INCLUDE_INDIRECTIONS 0
+EOF
+}
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 2377 "configure"
+#include "confdefs.h"
+
+int main() {
+
+#define GLUE_INCLUDE(path,file) <##path##/##file##>
+#define SMART_INCLUDE(path,file) GLUE_INCLUDE(path,file)
+#define CONFFOO_H_PATH $srcdir
+#define CONFFOO_INCLUDE(file) SMART_INCLUDE(CONFFOO_H_PATH,file)
+#include CONFFOO_INCLUDE(conffoo.h)
+
+; return 0; }
+EOF
+if { (eval echo configure:2390: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""simple" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
+ Defining SMART_INCLUDE_INDIRECTIONS = 1
+EOF
+cat >> confdefs.h <<\EOF
+#define SMART_INCLUDE_INDIRECTIONS 1
+EOF
+}
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 2405 "configure"
+#include "confdefs.h"
+
+int main() {
+
+#define GLUE_INCLUDE_2(path,file) <##path##/##file##>
+#define GLUE_INCLUDE_1(path,file) GLUE_INCLUDE_2(path,file)
+#define SMART_INCLUDE(path,file) GLUE_INCLUDE_1(path,file)
+#define CONFFOO_H_PATH $srcdir
+#define CONFFOO_INCLUDE(file) SMART_INCLUDE (CONFFOO_H_PATH,file)
+#include CONFFOO_INCLUDE(conffoo.h)
+
+; return 0; }
+EOF
+if { (eval echo configure:2419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""double" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
+ Defining SMART_INCLUDE_INDIRECTIONS = 2
+EOF
+cat >> confdefs.h <<\EOF
+#define SMART_INCLUDE_INDIRECTIONS 2
+EOF
+}
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ { echo "configure: error: Cannot define a proper SMART_INCLUDE macro. Please report." 1>&2; exit 1; }
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+rm -f $srcdir/conffoo.h
+
+
+