gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r19229 - in gnunet-update/test/old/test-package: . src


From: gnunet
Subject: [GNUnet-SVN] r19229 - in gnunet-update/test/old/test-package: . src
Date: Wed, 18 Jan 2012 13:40:31 +0100

Author: harsha
Date: 2012-01-18 13:40:31 +0100 (Wed, 18 Jan 2012)
New Revision: 19229

Modified:
   gnunet-update/test/old/test-package/configure.ac
   gnunet-update/test/old/test-package/src/Makefile.am
   gnunet-update/test/old/test-package/src/test-binary.c
Log:
- added support for configuring external library

Modified: gnunet-update/test/old/test-package/configure.ac
===================================================================
--- gnunet-update/test/old/test-package/configure.ac    2012-01-18 11:27:35 UTC 
(rev 19228)
+++ gnunet-update/test/old/test-package/configure.ac    2012-01-18 12:40:31 UTC 
(rev 19229)
@@ -41,4 +41,27 @@
 
 # Checks for library functions.
 
+# Checks for options
+libfake=0
+AC_ARG_WITH([libfake],
+        AS_HELP_STRING([--with-libfake],[Links the code with libfake external
+        library @<:@default=disable@:>@]),
+        [case $with_libfake in
+           no)
+             ;;
+           yes)
+             AC_CHECK_HEADERS(libfake.h,
+                          libfake=1,
+                          AC_MSG_ERROR([--with-libfake specified but libfake.h
+                          not found]))
+             ;;
+           *)
+             AC_DEFINE([HAVE_LIBFAKE_H],[1],[Have libfake])
+             LDFLAGS="-L$with_libfake/lib $LDFLAGS"
+             CPPFLAGS="-I$with_libfake/include $CPPFLAGS"
+             libfake=1
+          esac             
+        ])
+AM_CONDITIONAL([LIBFAKE], [test "$libfake" == 1])
+
 AC_OUTPUT

Modified: gnunet-update/test/old/test-package/src/Makefile.am
===================================================================
--- gnunet-update/test/old/test-package/src/Makefile.am 2012-01-18 11:27:35 UTC 
(rev 19228)
+++ gnunet-update/test/old/test-package/src/Makefile.am 2012-01-18 12:40:31 UTC 
(rev 19229)
@@ -59,6 +59,10 @@
 
 test_binary_SOURCES = test-binary.c
 
+if LIBFAKE
+test_binary_LDADD = -lfake
+endif
+
 test_binary_removed_SOURCES = test-binary-removed.c
 
 test_binary_modified_SOURCES = test-binary-modified.c

Modified: gnunet-update/test/old/test-package/src/test-binary.c
===================================================================
--- gnunet-update/test/old/test-package/src/test-binary.c       2012-01-18 
11:27:35 UTC (rev 19228)
+++ gnunet-update/test/old/test-package/src/test-binary.c       2012-01-18 
12:40:31 UTC (rev 19229)
@@ -24,11 +24,21 @@
  * @author harsha
  */
 
+#include "../config.h"
+
+#ifdef HAVE_LIBFAKE
+#include <libfake.h>
+#endif
+
 /**
  * The main execution function
  */
 int main ()
 {
+#ifdef HAVE_LIBFAKE
+  return FAKE_function();
+#else
   return 0;
+#endif
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]