Added a check for a scanf that knows about %as.
authorIvo Timmermans <ivo@lychnis.net>
Wed, 29 Nov 2000 01:37:50 +0000 (01:37 +0000)
committerIvo Timmermans <ivo@lychnis.net>
Wed, 29 Nov 2000 01:37:50 +0000 (01:37 +0000)
acconfig.h
configure.in
m4/gnuscanf.m4 [new file with mode: 0644]
system.h

index 7bb8efe164af36d8133f010b2cbbbbf45355713c..031a337bffe7384cac672f56b210b470774dcafd 100644 (file)
@@ -64,3 +64,6 @@
 
 /* Define to 1 if checkpoint tracing is enabled */
 #undef ENABLE_TRACING
 
 /* Define to 1 if checkpoint tracing is enabled */
 #undef ENABLE_TRACING
+
+/* Define to 1 if scanf and friends understand %as */
+#undef HAVE_SCANF_AS
index ed5f4469e939a0ebd41abb4c02120dce124e8813..70b767f883df0c614f266b20d35a591499a71fd7 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 
 dnl Process this file with autoconf to produce a configure script.
 
-dnl $Id: configure.in,v 1.13.2.27 2000/11/29 00:33:15 zarq Exp $
+dnl $Id: configure.in,v 1.13.2.28 2000/11/29 01:37:50 zarq Exp $
 
 AC_INIT(src/tincd.c)
 AM_INIT_AUTOMAKE(tinc, 1.0pre4-cvs)
 
 AC_INIT(src/tincd.c)
 AM_INIT_AUTOMAKE(tinc, 1.0pre4-cvs)
@@ -71,9 +71,6 @@ jm_FUNC_REALLOC
 AM_GNU_GETTEXT
 
 
 AM_GNU_GETTEXT
 
 
-dnl Crypto stuff
-tinc_OPENSSL
-
 dnl Support for SunOS
 
 AC_CHECK_FUNC(socket, [], [
 dnl Support for SunOS
 
 AC_CHECK_FUNC(socket, [], [
@@ -84,8 +81,11 @@ AC_CHECK_FUNC(gethostbyname, [], [
 ])
 
 
 ])
 
 
-dnl Check for TUN/TAP support in the kernel
+dnl These are defined in files in m4/
 tinc_TUNTAP
 tinc_TUNTAP
+tinc_OPENSSL
+tinc_SCANF_AS
+
 
 dnl Check if checkpoint tracing has to be enabled
 AC_ARG_ENABLE(tracing,
 
 dnl Check if checkpoint tracing has to be enabled
 AC_ARG_ENABLE(tracing,
diff --git a/m4/gnuscanf.m4 b/m4/gnuscanf.m4
new file mode 100644 (file)
index 0000000..fd8de46
--- /dev/null
@@ -0,0 +1,25 @@
+dnl Check for a scanf that understands about %as as format specifier
+
+AC_DEFUN(tinc_SCANF_AS,
+[
+  AC_CACHE_CHECK([for a scanf that groks %as], tinc_cv_scanf_as,
+  [
+    AC_TRY_RUN([
+/* Very naive program which will probably give a segmentation
+   fault if the sscanf doesn't work as expected. */
+#include <stdio.h>
+int main() {
+  char*s = NULL;
+  sscanf("string\n", "%as\n", &s);
+  if(s == NULL)
+    return 1;
+  return strcmp("string", s);
+}
+    ], [tinc_cv_scanf_as="yes"], [tinc_cv_scanf_as="no"])
+  ])
+
+if test "$tinc_cv_scanf_as" = "yes" ; then
+  AC_DEFINE(HAVE_SCANF_AS)
+  AC_SUBST(HAVE_SCANF_AS)
+fi
+])
index 5691d8bcaa5f3775d2faaa56f41d45d8bd43f7a5..51adca0b785679c8ae34069a32e4483d69412426 100644 (file)
--- a/system.h
+++ b/system.h
@@ -45,5 +45,8 @@
 # define strsignal(p) ""
 #endif
 
 # define strsignal(p) ""
 #endif
 
+/* Other functions */
+#include <dropin.h>
+
 #endif /* __TINC_SYSTEM_H__ */
 
 #endif /* __TINC_SYSTEM_H__ */