Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Create trunk from releases/scribe-2.0

  • Loading branch information...
commit a267fd882c2c3b151ffd6f7467b325375376a313 0 parents
authored

Showing 51 changed files with 8,091 additions and 0 deletions. Show diff stats Hide diff stats

  1. 177  LICENSE
  2. 12  Makefile.am
  3. 151  README.BUILD
  4. 253  acinclude.m4
  5. 198  aclocal/ax_boost_base.m4
  6. 110  aclocal/ax_boost_filesystem.m4
  7. 118  aclocal/ax_boost_system.m4
  8. 7  bootstrap.sh
  9. 102  configure.ac
  10. 172  examples/README
  11. 57  examples/example1.conf
  12. 108  examples/example2central.conf
  13. 59  examples/example2client.conf
  14. 60  examples/scribe_cat
  15. 46  examples/scribe_ctrl
  16. 2  global_footer.mk
  17. 19  global_header.mk
  18. 39  if/scribe.thrift
  19. 22  lib/py/Makefile.am
  20. 1  lib/py/scribe/__init__.py
  21. 9  lib/py/scribe/constants.py
  22. 60  lib/py/scribe/scribe-remote
  23. 157  lib/py/scribe/scribe.py
  24. 65  lib/py/scribe/ttypes.py
  25. 7  lib/py/setup.py
  26. 127  src/Makefile.am
  27. 74  src/common.h
  28. 186  src/conf.cpp
  29. 74  src/conf.h
  30. 309  src/conn_pool.cpp
  31. 96  src/conn_pool.h
  32. 78  src/env_default.h
  33. 240  src/file.cpp
  34. 89  src/file.h
  35. 710  src/scribe_server.cpp
  36. 92  src/scribe_server.h
  37. 2,110  src/store.cpp
  38. 531  src/store.h
  39. 343  src/store_queue.cpp
  40. 119  src/store_queue.h
  41. 45  test/many_connections.php
  42. 42  test/resultChecker/makefile
  43. 96  test/resultChecker/resultChecker.cpp
  44. 124  test/scribe.conf.test
  45. 76  test/scribe.conf.test2
  46. 23  test/shutdown.php
  47. 23  test/simple_test.php
  48. 23  test/strange_input.php
  49. 31  test/stress.php
  50. 316  test/tests.php
  51. 103  test/tests.txt
177  LICENSE
... ...
@@ -0,0 +1,177 @@
  1
+
  2
+                                 Apache License
  3
+                           Version 2.0, January 2004
  4
+                        http://www.apache.org/licenses/
  5
+
  6
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
  7
+
  8
+   1. Definitions.
  9
+
  10
+      "License" shall mean the terms and conditions for use, reproduction,
  11
+      and distribution as defined by Sections 1 through 9 of this document.
  12
+
  13
+      "Licensor" shall mean the copyright owner or entity authorized by
  14
+      the copyright owner that is granting the License.
  15
+
  16
+      "Legal Entity" shall mean the union of the acting entity and all
  17
+      other entities that control, are controlled by, or are under common
  18
+      control with that entity. For the purposes of this definition,
  19
+      "control" means (i) the power, direct or indirect, to cause the
  20
+      direction or management of such entity, whether by contract or
  21
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
  22
+      outstanding shares, or (iii) beneficial ownership of such entity.
  23
+
  24
+      "You" (or "Your") shall mean an individual or Legal Entity
  25
+      exercising permissions granted by this License.
  26
+
  27
+      "Source" form shall mean the preferred form for making modifications,
  28
+      including but not limited to software source code, documentation
  29
+      source, and configuration files.
  30
+
  31
+      "Object" form shall mean any form resulting from mechanical
  32
+      transformation or translation of a Source form, including but
  33
+      not limited to compiled object code, generated documentation,
  34
+      and conversions to other media types.
  35
+
  36
+      "Work" shall mean the work of authorship, whether in Source or
  37
+      Object form, made available under the License, as indicated by a
  38
+      copyright notice that is included in or attached to the work
  39
+      (an example is provided in the Appendix below).
  40
+
  41
+      "Derivative Works" shall mean any work, whether in Source or Object
  42
+      form, that is based on (or derived from) the Work and for which the
  43
+      editorial revisions, annotations, elaborations, or other modifications
  44
+      represent, as a whole, an original work of authorship. For the purposes
  45
+      of this License, Derivative Works shall not include works that remain
  46
+      separable from, or merely link (or bind by name) to the interfaces of,
  47
+      the Work and Derivative Works thereof.
  48
+
  49
+      "Contribution" shall mean any work of authorship, including
  50
+      the original version of the Work and any modifications or additions
  51
+      to that Work or Derivative Works thereof, that is intentionally
  52
+      submitted to Licensor for inclusion in the Work by the copyright owner
  53
+      or by an individual or Legal Entity authorized to submit on behalf of
  54
+      the copyright owner. For the purposes of this definition, "submitted"
  55
+      means any form of electronic, verbal, or written communication sent
  56
+      to the Licensor or its representatives, including but not limited to
  57
+      communication on electronic mailing lists, source code control systems,
  58
+      and issue tracking systems that are managed by, or on behalf of, the
  59
+      Licensor for the purpose of discussing and improving the Work, but
  60
+      excluding communication that is conspicuously marked or otherwise
  61
+      designated in writing by the copyright owner as "Not a Contribution."
  62
+
  63
+      "Contributor" shall mean Licensor and any individual or Legal Entity
  64
+      on behalf of whom a Contribution has been received by Licensor and
  65
+      subsequently incorporated within the Work.
  66
+
  67
+   2. Grant of Copyright License. Subject to the terms and conditions of
  68
+      this License, each Contributor hereby grants to You a perpetual,
  69
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
  70
+      copyright license to reproduce, prepare Derivative Works of,
  71
+      publicly display, publicly perform, sublicense, and distribute the
  72
+      Work and such Derivative Works in Source or Object form.
  73
+
  74
+   3. Grant of Patent License. Subject to the terms and conditions of
  75
+      this License, each Contributor hereby grants to You a perpetual,
  76
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
  77
+      (except as stated in this section) patent license to make, have made,
  78
+      use, offer to sell, sell, import, and otherwise transfer the Work,
  79
+      where such license applies only to those patent claims licensable
  80
+      by such Contributor that are necessarily infringed by their
  81
+      Contribution(s) alone or by combination of their Contribution(s)
  82
+      with the Work to which such Contribution(s) was submitted. If You
  83
+      institute patent litigation against any entity (including a
  84
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
  85
+      or a Contribution incorporated within the Work constitutes direct
  86
+      or contributory patent infringement, then any patent licenses
  87
+      granted to You under this License for that Work shall terminate
  88
+      as of the date such litigation is filed.
  89
+
  90
+   4. Redistribution. You may reproduce and distribute copies of the
  91
+      Work or Derivative Works thereof in any medium, with or without
  92
+      modifications, and in Source or Object form, provided that You
  93
+      meet the following conditions:
  94
+
  95
+      (a) You must give any other recipients of the Work or
  96
+          Derivative Works a copy of this License; and
  97
+
  98
+      (b) You must cause any modified files to carry prominent notices
  99
+          stating that You changed the files; and
  100
+
  101
+      (c) You must retain, in the Source form of any Derivative Works
  102
+          that You distribute, all copyright, patent, trademark, and
  103
+          attribution notices from the Source form of the Work,
  104
+          excluding those notices that do not pertain to any part of
  105
+          the Derivative Works; and
  106
+
  107
+      (d) If the Work includes a "NOTICE" text file as part of its
  108
+          distribution, then any Derivative Works that You distribute must
  109
+          include a readable copy of the attribution notices contained
  110
+          within such NOTICE file, excluding those notices that do not
  111
+          pertain to any part of the Derivative Works, in at least one
  112
+          of the following places: within a NOTICE text file distributed
  113
+          as part of the Derivative Works; within the Source form or
  114
+          documentation, if provided along with the Derivative Works; or,
  115
+          within a display generated by the Derivative Works, if and
  116
+          wherever such third-party notices normally appear. The contents
  117
+          of the NOTICE file are for informational purposes only and
  118
+          do not modify the License. You may add Your own attribution
  119
+          notices within Derivative Works that You distribute, alongside
  120
+          or as an addendum to the NOTICE text from the Work, provided
  121
+          that such additional attribution notices cannot be construed
  122
+          as modifying the License.
  123
+
  124
+      You may add Your own copyright statement to Your modifications and
  125
+      may provide additional or different license terms and conditions
  126
+      for use, reproduction, or distribution of Your modifications, or
  127
+      for any such Derivative Works as a whole, provided Your use,
  128
+      reproduction, and distribution of the Work otherwise complies with
  129
+      the conditions stated in this License.
  130
+
  131
+   5. Submission of Contributions. Unless You explicitly state otherwise,
  132
+      any Contribution intentionally submitted for inclusion in the Work
  133
+      by You to the Licensor shall be under the terms and conditions of
  134
+      this License, without any additional terms or conditions.
  135
+      Notwithstanding the above, nothing herein shall supersede or modify
  136
+      the terms of any separate license agreement you may have executed
  137
+      with Licensor regarding such Contributions.
  138
+
  139
+   6. Trademarks. This License does not grant permission to use the trade
  140
+      names, trademarks, service marks, or product names of the Licensor,
  141
+      except as required for reasonable and customary use in describing the
  142
+      origin of the Work and reproducing the content of the NOTICE file.
  143
+
  144
+   7. Disclaimer of Warranty. Unless required by applicable law or
  145
+      agreed to in writing, Licensor provides the Work (and each
  146
+      Contributor provides its Contributions) on an "AS IS" BASIS,
  147
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  148
+      implied, including, without limitation, any warranties or conditions
  149
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
  150
+      PARTICULAR PURPOSE. You are solely responsible for determining the
  151
+      appropriateness of using or redistributing the Work and assume any
  152
+      risks associated with Your exercise of permissions under this License.
  153
+
  154
+   8. Limitation of Liability. In no event and under no legal theory,
  155
+      whether in tort (including negligence), contract, or otherwise,
  156
+      unless required by applicable law (such as deliberate and grossly
  157
+      negligent acts) or agreed to in writing, shall any Contributor be
  158
+      liable to You for damages, including any direct, indirect, special,
  159
+      incidental, or consequential damages of any character arising as a
  160
+      result of this License or out of the use or inability to use the
  161
+      Work (including but not limited to damages for loss of goodwill,
  162
+      work stoppage, computer failure or malfunction, or any and all
  163
+      other commercial damages or losses), even if such Contributor
  164
+      has been advised of the possibility of such damages.
  165
+
  166
+   9. Accepting Warranty or Additional Liability. While redistributing
  167
+      the Work or Derivative Works thereof, You may choose to offer,
  168
+      and charge a fee for, acceptance of support, warranty, indemnity,
  169
+      or other liability obligations and/or rights consistent with this
  170
+      License. However, in accepting such obligations, You may act only
  171
+      on Your own behalf and on Your sole responsibility, not on behalf
  172
+      of any other Contributor, and only if You agree to indemnify,
  173
+      defend, and hold each Contributor harmless for any liability
  174
+      incurred by, or claims asserted against, such Contributor by reason
  175
+      of your accepting any such warranty or additional liability.
  176
+
  177
+   END OF TERMS AND CONDITIONS
12  Makefile.am
... ...
@@ -0,0 +1,12 @@
  1
+@GLOBAL_HEADER_MK@
  2
+
  3
+@PRODUCT_MK@
  4
+
  5
+SUBDIRS = . src lib/py
  6
+
  7
+BUILT_SOURCES =
  8
+
  9
+
  10
+clean-local: clean-common
  11
+
  12
+@GLOBAL_FOOTER_MK@
151  README.BUILD
... ...
@@ -0,0 +1,151 @@
  1
+Scribe
  2
+
  3
+Last Modified: 2008-Sep-18
  4
+
  5
+
  6
+Introduction
  7
+============
  8
+
  9
+Scribe is a server for aggregating log data that's streamed in real
  10
+time from clients. It is designed to be scalable and reliable.
  11
+
  12
+License (See LICENSE file for full license)
  13
+===========================================
  14
+Copyright 2007-2008 Facebook
  15
+
  16
+Licensed under the Apache License, Version 2.0 (the "License");
  17
+you may not use this file except in compliance with the License.
  18
+You may obtain a copy of the License at
  19
+
  20
+    http://www.apache.org/licenses/LICENSE-2.0
  21
+
  22
+Unless required by applicable law or agreed to in writing, software
  23
+distributed under the License is distributed on an "AS IS" BASIS,
  24
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  25
+See the License for the specific language governing permissions and
  26
+limitations under the License.
  27
+
  28
+
  29
+Heirarchy
  30
+=========
  31
+
  32
+scribe/
  33
+
  34
+  aclocal/
  35
+    Contains scripts for building/linking with Boost
  36
+
  37
+  examples/
  38
+    Contains simple examples of using Scribe
  39
+
  40
+  if/
  41
+    Contains Thrift interface for Scribe
  42
+
  43
+  lib/
  44
+    Contains Python package for Scribe
  45
+
  46
+  src/
  47
+    Contains Scribe source
  48
+
  49
+  test/
  50
+    Contain php scripts for testing scribe
  51
+
  52
+
  53
+Requirements
  54
+============
  55
+
  56
+[libevent] Event Notification library
  57
+[boost] Boost C++ library (version 1.36 or later)
  58
+[thrift] Thrift framework
  59
+[fb303] Facebook Bassline (included in thrift/contrib/fb303/)
  60
+   fb303 r697294 or later is required.
  61
+
  62
+These libraries are open source and may be freely obtained, but they are not
  63
+provided as a part of this distribution.
  64
+
  65
+
  66
+Helpful tips:
  67
+-Thrift, fb303, and scribe installation expects python to be installed
  68
+ under /usr.  See PY_PREFIX option in 'configure --help' to change this path.
  69
+-Some python installs do not include python site-packages in the default
  70
+ python include path.  If python cannot find the installed packages for
  71
+ scribe or fb303, try setting the environment variable PYTHONPATH to the
  72
+ location of the installed packages.  This path gets output during
  73
+ 'make install'. (Eg: PYTHONPATH='/usr/lib/python2.5/site-packages').
  74
+
  75
+
  76
+Resources
  77
+=========
  78
+
  79
+More information about Scribe can be obtained on the Scribe webpage at:
  80
+
  81
+     http://developers.facebook.com/scribe
  82
+
  83
+
  84
+To build
  85
+========
  86
+
  87
+./bootstrap.sh <configure options>
  88
+make
  89
+
  90
+(If you have multiple versions of Boost installed, see Boost configure options below.)
  91
+
  92
+Subsequent builds
  93
+=================
  94
+
  95
+./bootstrap <configure options>
  96
+make
  97
+
  98
+OR
  99
+
  100
+./configure <configure options>
  101
+make
  102
+
  103
+NOTE: After the first run with bootstrap.sh you can use "[ ./bootstrap | ./configure ] <options>" followed by "make"
  104
+to create builds with different configurations. "bootstrap" can be passed the same arguments as "configure".
  105
+
  106
+Make sure that if you change configure.ac and|or add macros run "bootstrap.sh".
  107
+to regenerate configure. In short whenever in doubt run "bootstrap.sh".
  108
+
  109
+
  110
+Configure options
  111
+=================
  112
+
  113
+To find all available configure options run
  114
+./configure --help
  115
+
  116
+Use *only* the listed options.
  117
+
  118
+Examples:
  119
+# To disable optimized builds and turn on debug. [ default has been set to optimized]
  120
+./configure --disable-opt
  121
+
  122
+# To disable static libraries and enable shared libraries. [ default has been set to static]
  123
+./configure --disable-static
  124
+
  125
+# To set thrift home to a non-default location
  126
+./configure --with-thriftpath=/myhome/local/thrift
  127
+
  128
+# If Boost is installed in a non-default location or there are multiple Boost versions
  129
+# installed, you will need to specify the Boost path and library names
  130
+./configure --with-boost /usr/local/lib --with-boost-system=boost_system-gcc40-mt-1_36 --with-boost-filesystem=boost_filesystem-gcc40-mt-1_36
  131
+
  132
+
  133
+Install
  134
+=======
  135
+
  136
+as root:
  137
+make install
  138
+
  139
+
  140
+Run
  141
+===
  142
+
  143
+See the examples directory to learn how to use Scribe.
  144
+
  145
+
  146
+Acknowledgements
  147
+================
  148
+The build process for Scribe uses autoconf macros to compile/link with Boost.
  149
+These macros were written by Thomas Porschberg, Michael Tindal, and
  150
+Daniel Casimiro.  See ax_boost_base.m4, ax_boost_filesystem.m4, and
  151
+ax_boost_system.m4 in the aclocal subdirectory for more information.
253  acinclude.m4
... ...
@@ -0,0 +1,253 @@
  1
+AC_DEFUN([FB_INITIALIZE],
  2
+[
  3
+AM_INIT_AUTOMAKE([ foreign 1.9.5 no-define ])
  4
+if test "x$1" = "xlocalinstall"; then
  5
+wdir=`pwd`
  6
+# To use $wdir undef quote.
  7
+#
  8
+##########
  9
+AC_PREFIX_DEFAULT([`pwd`/install])
  10
+echo
  11
+fi
  12
+AC_PROG_CC
  13
+AC_PROG_CXX
  14
+AC_PROG_RANLIB(RANLIB, ranlib)
  15
+AC_PATH_PROGS(BASH, bash)
  16
+AC_PATH_PROGS(PERL, perl)
  17
+AC_PATH_PROGS(PYTHON, python)
  18
+AC_PATH_PROGS(AR, ar)
  19
+AC_PATH_PROGS(ANT, ant)
  20
+PRODUCT_MK=""
  21
+])
  22
+
  23
+AC_DEFUN([FB_WITH_EXTERNAL_PATH],
  24
+[
  25
+cdir=`pwd`
  26
+AC_MSG_CHECKING([Checking EXTERNAL_PATH set to])
  27
+AC_ARG_WITH([externalpath],
  28
+  [ --with-externalpath=DIR User specified path to external facebook components.],
  29
+  [
  30
+    if test "x${EXTERNAL_PATH}" != "x"; then
  31
+       echo ""
  32
+       echo "ERROR: You have already set EXTERNAL_PATH in your environment"
  33
+       echo "Cannot override it using --with-externalpath. Unset EXTERNAL_PATH to use this option"
  34
+       exit 1
  35
+    fi
  36
+    EXTERNAL_PATH=$withval
  37
+  ],
  38
+  [
  39
+    if test "x${EXTERNAL_PATH}" = "x"; then
  40
+       EXTERNAL_PATH=$1
  41
+    fi
  42
+  ]
  43
+)
  44
+if test "x${EXTERNAL_PATH}" = "x"; then
  45
+   export EXTERNAL_PATH="$cdir/external"
  46
+   GLOBAL_HEADER_MK="include ${EXTERNAL_PATH}/global_header.mk"
  47
+   GLOBAL_FOOTER_MK="include ${EXTERNAL_PATH}/global_footer.mk"
  48
+else
  49
+   export EXTERNAL_PATH
  50
+   GLOBAL_HEADER_MK="include ${EXTERNAL_PATH}/global_header.mk"
  51
+   GLOBAL_FOOTER_MK="include ${EXTERNAL_PATH}/global_footer.mk"
  52
+fi
  53
+AC_MSG_RESULT($EXTERNAL_PATH)
  54
+if test ! -d ${EXTERNAL_PATH}; then
  55
+       echo ""
  56
+       echo "ERROR: EXTERNAL_PATH set to an nonexistent directory ${EXTERNAL_PATH}"
  57
+       exit 1
  58
+fi
  59
+AC_SUBST(EXTERNAL_PATH)
  60
+AC_SUBST(GLOBAL_HEADER_MK)
  61
+AC_SUBST(GLOBAL_FOOTER_MK)
  62
+])
  63
+
  64
+# Set option to enable shared mode. Set DEBUG and OPT for use in Makefile.am.
  65
+AC_DEFUN([FB_ENABLE_DEFAULT_OPT_BUILD],
  66
+[
  67
+AC_MSG_CHECKING([whether to enable optimized build])
  68
+AC_ARG_ENABLE([opt],
  69
+  [  --disable-opt     Set up debug mode.],
  70
+  [
  71
+     ENABLED_OPT=$enableval
  72
+  ],
  73
+  [
  74
+     ENABLED_OPT="yes"
  75
+  ]
  76
+)
  77
+if test "$ENABLED_OPT" = "yes"
  78
+then
  79
+     CFLAGS="-Wall -O3"
  80
+     CXXFLAGS="-Wall -O3"
  81
+else
  82
+     CFLAGS="-Wall -g"
  83
+     CXXFLAGS="-Wall -g"
  84
+fi
  85
+AC_MSG_RESULT($ENABLED_OPT)
  86
+AM_CONDITIONAL([OPT], [test "$ENABLED_OPT" = yes])
  87
+AM_CONDITIONAL([DEBUG], [test "$ENABLED_OPT" = no])
  88
+])
  89
+
  90
+# Set option to enable debug mode. Set DEBUG and OPT for use in Makefile.am.
  91
+AC_DEFUN([FB_ENABLE_DEFAULT_DEBUG_BUILD],
  92
+[
  93
+AC_MSG_CHECKING([whether to enable debug build])
  94
+AC_ARG_ENABLE([debug],
  95
+  [  --disable-debug     Set up opt mode.],
  96
+  [
  97
+     ENABLED_DEBUG=$enableval
  98
+  ],
  99
+  [
  100
+     ENABLED_DEBUG="yes"
  101
+  ]
  102
+)
  103
+if test "$ENABLED_DEBUG" = "yes"
  104
+then
  105
+     CFLAGS="-Wall -g"
  106
+     CXXFLAGS="-Wall -g"
  107
+else
  108
+     CFLAGS="-Wall -O3"
  109
+     CXXFLAGS="-Wall -O3"
  110
+fi
  111
+AC_MSG_RESULT($ENABLED_DEBUG)
  112
+AM_CONDITIONAL([DEBUG], [test "$ENABLED_DEBUG" = yes])
  113
+AM_CONDITIONAL([OPT], [test "$ENABLED_DEBUG" = no])
  114
+])
  115
+
  116
+# Set option to enable static libs.
  117
+AC_DEFUN([FB_ENABLE_DEFAULT_STATIC],
  118
+[
  119
+SHARED=""
  120
+STATIC=""
  121
+AC_MSG_CHECKING([whether to enable static mode])
  122
+AC_ARG_ENABLE([static],
  123
+  [  --disable-static     Set up shared mode.],
  124
+  [
  125
+     ENABLED_STATIC=$enableval
  126
+  ],
  127
+  [
  128
+     ENABLED_STATIC="yes"
  129
+  ]
  130
+)
  131
+if test "$ENABLED_STATIC" = "yes"
  132
+then
  133
+     LTYPE=".a"
  134
+else
  135
+     LTYPE=".so"
  136
+     SHARED_CXXFLAGS="-fPIC"
  137
+     SHARED_CFLAGS="-fPIC"
  138
+     SHARED_LDFLAGS="-shared -fPIC"
  139
+     AC_SUBST(SHARED_CXXFLAGS)
  140
+     AC_SUBST(SHARED_CFLAGS)
  141
+     AC_SUBST(SHARED_LDFLAGS)
  142
+fi
  143
+AC_MSG_RESULT($ENABLED_STATIC)
  144
+AC_SUBST(LTYPE)
  145
+AM_CONDITIONAL([STATIC], [test "$ENABLED_STATIC" = yes])
  146
+AM_CONDITIONAL([SHARED], [test "$ENABLED_STATIC" = no])
  147
+])
  148
+
  149
+# Set option to enable shared libs.
  150
+AC_DEFUN([FB_ENABLE_DEFAULT_SHARED],
  151
+[
  152
+SHARED=""
  153
+STATIC=""
  154
+AC_MSG_CHECKING([whether to enable shared mode])
  155
+AC_ARG_ENABLE([shared],
  156
+  [  --disable-shared     Set up static mode.],
  157
+  [
  158
+    ENABLED_SHARED=$enableval
  159
+  ],
  160
+  [
  161
+     ENABLED_SHARED="yes"
  162
+  ]
  163
+)
  164
+if test "$ENABLED_SHARED" = "yes"
  165
+then
  166
+     LTYPE=".so"
  167
+     SHARED_CXXFLAGS="-fPIC"
  168
+     SHARED_CFLAGS="-fPIC"
  169
+     SHARED_LDFLAGS="-shared -fPIC"
  170
+     AC_SUBST(SHARED_CXXFLAGS)
  171
+     AC_SUBST(SHARED_CFLAGS)
  172
+     AC_SUBST(SHARED_LDFLAGS)
  173
+else
  174
+     LTYPE=".a"
  175
+fi
  176
+AC_MSG_RESULT($ENABLED_SHARED)
  177
+AC_SUBST(LTYPE)
  178
+AM_CONDITIONAL([SHARED], [test "$ENABLED_SHARED" = yes])
  179
+AM_CONDITIONAL([STATIC], [test "$ENABLED_SHARED" = no])
  180
+])
  181
+
  182
+# Generates define flags and conditionals as specified by user.
  183
+# This gets enabled *only* if user selects --enable-<FEATURE> otion.
  184
+AC_DEFUN([FB_ENABLE_FEATURE],
  185
+[
  186
+ENABLE=""
  187
+flag="$1"
  188
+value="$3"
  189
+AC_MSG_CHECKING([whether to enable $1])
  190
+AC_ARG_ENABLE([$2],
  191
+  [  --enable-$2     Enable $2.],
  192
+  [
  193
+     ENABLE=$enableval
  194
+  ],
  195
+  [
  196
+     ENABLE="no"
  197
+  ]
  198
+)
  199
+AM_CONDITIONAL([$1], [test "$ENABLE" = yes])
  200
+if test "$ENABLE" = "yes"
  201
+then
  202
+   if test "x${value}" = "x"
  203
+   then
  204
+       AC_DEFINE([$1])
  205
+   else
  206
+       AC_DEFINE_UNQUOTED([$1], [$value])
  207
+   fi
  208
+fi
  209
+AC_MSG_RESULT($ENABLE)
  210
+])
  211
+
  212
+
  213
+# can also use eval $2=$withval;AC_SUBST($2)
  214
+AC_DEFUN([FB_WITH_PATH],
  215
+[
  216
+USRFLAG=""
  217
+USRFLAG=$1
  218
+AC_MSG_CHECKING([Checking $1 set to])
  219
+AC_ARG_WITH([$2],
  220
+  [ --with-$2=DIR User specified path.],
  221
+  [
  222
+    LOC=$withval
  223
+    eval $USRFLAG=$withval
  224
+  ],
  225
+  [
  226
+    LOC=$3
  227
+    eval $USRFLAG=$3
  228
+  ]
  229
+)
  230
+AC_SUBST([$1])
  231
+AC_MSG_RESULT($LOC)
  232
+])
  233
+
  234
+AC_DEFUN([FB_SET_FLAG_VALUE],
  235
+[
  236
+SETFLAG=""
  237
+AC_MSG_CHECKING([Checking $1 set to])
  238
+SETFLAG=$1
  239
+eval $SETFLAG=\"$2\"
  240
+AC_SUBST([$SETFLAG])
  241
+AC_MSG_RESULT($2)
  242
+])
  243
+
  244
+# NOTES
  245
+# if using if else bourne stmt you must have more than a macro in it.
  246
+# EX1 is not correct. EX2 is correct
  247
+# EX1: if test "$XX" = "yes"; then
  248
+#        AC_SUBST(xx)
  249
+#      fi
  250
+# EX2: if test "$XX" = "yes"; then
  251
+#        xx="foo"
  252
+#        AC_SUBST(xx)
  253
+#      fi
198  aclocal/ax_boost_base.m4
... ...
@@ -0,0 +1,198 @@
  1
+##### http://autoconf-archive.cryp.to/ax_boost_base.html
  2
+#
  3
+# SYNOPSIS
  4
+#
  5
+#   AX_BOOST_BASE([MINIMUM-VERSION])
  6
+#
  7
+# DESCRIPTION
  8
+#
  9
+#   Test for the Boost C++ libraries of a particular version (or newer)
  10
+#
  11
+#   If no path to the installed boost library is given the macro
  12
+#   searchs under /usr, /usr/local, /opt and /opt/local and evaluates
  13
+#   the $BOOST_ROOT environment variable. Further documentation is
  14
+#   available at <http://randspringer.de/boost/index.html>.
  15
+#
  16
+#   This macro calls:
  17
+#
  18
+#     AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)
  19
+#
  20
+#   And sets:
  21
+#
  22
+#     HAVE_BOOST
  23
+#
  24
+# LAST MODIFICATION
  25
+#
  26
+#   2007-07-28
  27
+#
  28
+# COPYLEFT
  29
+#
  30
+#   Copyright (c) 2007 Thomas Porschberg <thomas@randspringer.de>
  31
+#
  32
+#   Copying and distribution of this file, with or without
  33
+#   modification, are permitted in any medium without royalty provided
  34
+#   the copyright notice and this notice are preserved.
  35
+
  36
+AC_DEFUN([AX_BOOST_BASE],
  37
+[
  38
+AC_ARG_WITH([boost],
  39
+	AS_HELP_STRING([--with-boost@<:@=DIR@:>@], [use boost (default is yes) - it is possible to specify the root directory for boost (optional)]),
  40
+	[
  41
+    if test "$withval" = "no"; then
  42
+		want_boost="no"
  43
+    elif test "$withval" = "yes"; then
  44
+        want_boost="yes"
  45
+        ac_boost_path=""
  46
+    else
  47
+	    want_boost="yes"
  48
+        ac_boost_path="$withval"
  49
+	fi
  50
+    ],
  51
+    [want_boost="yes"])
  52
+
  53
+if test "x$want_boost" = "xyes"; then
  54
+	boost_lib_version_req=ifelse([$1], ,1.20.0,$1)
  55
+	boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
  56
+	boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'`
  57
+	boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
  58
+	boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
  59
+	if test "x$boost_lib_version_req_sub_minor" = "x" ; then
  60
+		boost_lib_version_req_sub_minor="0"
  61
+    	fi
  62
+	WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+  $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor`
  63
+	AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req)
  64
+	succeeded=no
  65
+
  66
+	dnl first we check the system location for boost libraries
  67
+	dnl this location ist chosen if boost libraries are installed with the --layout=system option
  68
+	dnl or if you install boost with RPM
  69
+	if test "$ac_boost_path" != ""; then
  70
+		BOOST_LDFLAGS="-L$ac_boost_path/lib"
  71
+		BOOST_CPPFLAGS="-I$ac_boost_path/include"
  72
+	else
  73
+		for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
  74
+			if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
  75
+				BOOST_LDFLAGS="-L$ac_boost_path_tmp/lib"
  76
+				BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
  77
+				break;
  78
+			fi
  79
+		done
  80
+	fi
  81
+
  82
+	CPPFLAGS_SAVED="$CPPFLAGS"
  83
+	CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
  84
+	export CPPFLAGS
  85
+
  86
+	LDFLAGS_SAVED="$LDFLAGS"
  87
+	LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
  88
+	export LDFLAGS
  89
+
  90
+	AC_LANG_PUSH(C++)
  91
+     	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  92
+	@%:@include <boost/version.hpp>
  93
+	]], [[
  94
+	#if BOOST_VERSION >= $WANT_BOOST_VERSION
  95
+	// Everything is okay
  96
+	#else
  97
+	#  error Boost version is too old
  98
+	#endif
  99
+	]])],[
  100
+        AC_MSG_RESULT(yes)
  101
+	succeeded=yes
  102
+	found_system=yes
  103
+       	],[
  104
+       	])
  105
+	AC_LANG_POP([C++])
  106
+
  107
+
  108
+
  109
+	dnl if we found no boost with system layout we search for boost libraries
  110
+	dnl built and installed without the --layout=system option or for a staged(not installed) version
  111
+	if test "x$succeeded" != "xyes"; then
  112
+		_version=0
  113
+		if test "$ac_boost_path" != ""; then
  114
+               		BOOST_LDFLAGS="-L$ac_boost_path/lib"
  115
+			if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
  116
+				for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
  117
+					_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
  118
+					V_CHECK=`expr $_version_tmp \> $_version`
  119
+					if test "$V_CHECK" = "1" ; then
  120
+						_version=$_version_tmp
  121
+					fi
  122
+					VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
  123
+					BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE"
  124
+				done
  125
+			fi
  126
+		else
  127
+			for ac_boost_path in /usr /usr/local /opt /opt/local ; do
  128
+				if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
  129
+					for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
  130
+						_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
  131
+						V_CHECK=`expr $_version_tmp \> $_version`
  132
+						if test "$V_CHECK" = "1" ; then
  133
+							_version=$_version_tmp
  134
+	               					best_path=$ac_boost_path
  135
+						fi
  136
+					done
  137
+				fi
  138
+			done
  139
+
  140
+			VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
  141
+			BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
  142
+			BOOST_LDFLAGS="-L$best_path/lib"
  143
+
  144
+	    		if test "x$BOOST_ROOT" != "x"; then
  145
+				if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/lib" && test -r "$BOOST_ROOT/stage/lib"; then
  146
+					version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'`
  147
+					stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
  148
+			        	stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
  149
+					V_CHECK=`expr $stage_version_shorten \>\= $_version`
  150
+				        if test "$V_CHECK" = "1" ; then
  151
+						AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
  152
+						BOOST_CPPFLAGS="-I$BOOST_ROOT"
  153
+						BOOST_LDFLAGS="-L$BOOST_ROOT/stage/lib"
  154
+					fi
  155
+				fi
  156
+	    		fi
  157
+		fi
  158
+
  159
+		CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
  160
+		export CPPFLAGS
  161
+		LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
  162
+		export LDFLAGS
  163
+
  164
+		AC_LANG_PUSH(C++)
  165
+	     	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  166
+		@%:@include <boost/version.hpp>
  167
+		]], [[
  168
+		#if BOOST_VERSION >= $WANT_BOOST_VERSION
  169
+		// Everything is okay
  170
+		#else
  171
+		#  error Boost version is too old
  172
+		#endif
  173
+		]])],[
  174
+        	AC_MSG_RESULT(yes)
  175
+		succeeded=yes
  176
+		found_system=yes
  177
+       		],[
  178
+	       	])
  179
+		AC_LANG_POP([C++])
  180
+	fi
  181
+
  182
+	if test "$succeeded" != "yes" ; then
  183
+		if test "$_version" = "0" ; then
  184
+			AC_MSG_ERROR([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option.  If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
  185
+		else
  186
+			AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
  187
+		fi
  188
+	else
  189
+		AC_SUBST(BOOST_CPPFLAGS)
  190
+		AC_SUBST(BOOST_LDFLAGS)
  191
+		AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
  192
+	fi
  193
+
  194
+        CPPFLAGS="$CPPFLAGS_SAVED"
  195
+       	LDFLAGS="$LDFLAGS_SAVED"
  196
+fi
  197
+
  198
+])
110  aclocal/ax_boost_filesystem.m4
... ...
@@ -0,0 +1,110 @@
  1
+# ===========================================================================
  2
+#          http://autoconf-archive.cryp.to/ax_boost_filesystem.html
  3
+# ===========================================================================
  4
+#
  5
+# SYNOPSIS
  6
+#
  7
+#   AX_BOOST_FILESYSTEM
  8
+#
  9
+# DESCRIPTION
  10
+#
  11
+#   Test for Filesystem library from the Boost C++ libraries. The macro
  12
+#   requires a preceding call to AX_BOOST_BASE. Further documentation is
  13
+#   available at <http://randspringer.de/boost/index.html>.
  14
+#
  15
+#   This macro calls:
  16
+#
  17
+#     AC_SUBST(BOOST_FILESYSTEM_LIB)
  18
+#
  19
+#   And sets:
  20
+#
  21
+#     HAVE_BOOST_FILESYSTEM
  22
+#
  23
+# LAST MODIFICATION
  24
+#
  25
+#   2008-04-12
  26
+#
  27
+# COPYLEFT
  28
+#
  29
+#   Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
  30
+#   Copyright (c) 2008 Michael Tindal
  31
+#
  32
+#   Copying and distribution of this file, with or without modification, are
  33
+#   permitted in any medium without royalty provided the copyright notice
  34
+#   and this notice are preserved.
  35
+
  36
+AC_DEFUN([AX_BOOST_FILESYSTEM],
  37
+[
  38
+	AC_ARG_WITH([boost-filesystem],
  39
+	AS_HELP_STRING([--with-boost-filesystem@<:@=special-lib@:>@],
  40
+                   [use the Filesystem library from boost - it is possible to specify a certain library for the linker
  41
+                        e.g. --with-boost-filesystem=boost_filesystem-gcc-mt ]),
  42
+        [
  43
+        if test "$withval" = "no"; then
  44
+			want_boost="no"
  45
+        elif test "$withval" = "yes"; then
  46
+            want_boost="yes"
  47
+            ax_boost_user_filesystem_lib=""
  48
+        else
  49
+		    want_boost="yes"
  50
+        	ax_boost_user_filesystem_lib="$withval"
  51
+		fi
  52
+        ],
  53
+        [want_boost="yes"]
  54
+	)
  55
+
  56
+	if test "x$want_boost" = "xyes"; then
  57
+        AC_REQUIRE([AC_PROG_CC])
  58
+		CPPFLAGS_SAVED="$CPPFLAGS"
  59
+		CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
  60
+		export CPPFLAGS
  61
+
  62
+		LDFLAGS_SAVED="$LDFLAGS"
  63
+		LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
  64
+		export LDFLAGS
  65
+
  66
+        AC_CACHE_CHECK(whether the Boost::Filesystem library is available,
  67
+					   ax_cv_boost_filesystem,
  68
+        [AC_LANG_PUSH([C++])
  69
+         AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/filesystem/path.hpp>]],
  70
+                                   [[using namespace boost::filesystem;
  71
+                                   path my_path( "foo/bar/data.txt" );
  72
+                                   return 0;]]),
  73
+            				       ax_cv_boost_filesystem=yes, ax_cv_boost_filesystem=no)
  74
+         AC_LANG_POP([C++])
  75
+		])
  76
+		if test "x$ax_cv_boost_filesystem" = "xyes"; then
  77
+			AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available])
  78
+            BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
  79
+            if test "x$ax_boost_user_filesystem_lib" = "x"; then
  80
+                for libextension in `ls $BOOSTLIBDIR/libboost_filesystem*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_filesystem.*\)\.so.*$;\1;' -e 's;^lib\(boost_filesystem.*\)\.a*$;\1;'` ; do
  81
+                     ax_lib=${libextension}
  82
+				    AC_CHECK_LIB($ax_lib, exit,
  83
+                                 [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
  84
+                                 [link_filesystem="no"])
  85
+  				done
  86
+                if test "x$link_program_options" != "xyes"; then
  87
+                for libextension in `ls $BOOSTLIBDIR/boost_filesystem*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_filesystem.*\)\.dll.*$;\1;' -e 's;^\(boost_filesystem.*\)\.a*$;\1;'` ; do
  88
+                     ax_lib=${libextension}
  89
+				    AC_CHECK_LIB($ax_lib, exit,
  90
+                                 [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
  91
+                                 [link_filesystem="no"])
  92
+  				done
  93
+	            fi
  94
+            else
  95
+               for ax_lib in $ax_boost_user_filesystem_lib boost_filesystem-$ax_boost_user_filesystem_lib; do
  96
+				      AC_CHECK_LIB($ax_lib, exit,
  97
+                                   [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
  98
+                                   [link_filesystem="no"])
  99
+                  done
  100
+
  101
+            fi
  102
+			if test "x$link_filesystem" != "xyes"; then
  103
+				AC_MSG_ERROR(Could not link against $ax_lib !)
  104
+			fi
  105
+		fi
  106
+
  107
+		CPPFLAGS="$CPPFLAGS_SAVED"
  108
+    	LDFLAGS="$LDFLAGS_SAVED"
  109
+	fi
  110
+])
118  aclocal/ax_boost_system.m4
... ...
@@ -0,0 +1,118 @@
  1
+# ===========================================================================
  2
+#            http://autoconf-archive.cryp.to/ax_boost_system.html
  3
+# ===========================================================================
  4
+#
  5
+# SYNOPSIS
  6
+#
  7
+#   AX_BOOST_SYSTEM
  8
+#
  9
+# DESCRIPTION
  10
+#
  11
+#   Test for System library from the Boost C++ libraries. The macro requires
  12
+#   a preceding call to AX_BOOST_BASE. Further documentation is available at
  13
+#   <http://randspringer.de/boost/index.html>.
  14
+#
  15
+#   This macro calls:
  16
+#
  17
+#     AC_SUBST(BOOST_SYSTEM_LIB)
  18
+#
  19
+#   And sets:
  20
+#
  21
+#     HAVE_BOOST_SYSTEM
  22
+#
  23
+# LAST MODIFICATION
  24
+#
  25
+#   2008-04-12
  26
+#
  27
+# COPYLEFT
  28
+#
  29
+#   Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
  30
+#   Copyright (c) 2008 Michael Tindal
  31
+#   Copyright (c) 2008 Daniel Casimiro <dan.casimiro@gmail.com>
  32
+#
  33
+#   Copying and distribution of this file, with or without modification, are
  34
+#   permitted in any medium without royalty provided the copyright notice
  35
+#   and this notice are preserved.
  36
+
  37
+AC_DEFUN([AX_BOOST_SYSTEM],
  38
+[
  39
+	AC_ARG_WITH([boost-system],
  40
+	AS_HELP_STRING([--with-boost-system@<:@=special-lib@:>@],
  41
+                   [use the System library from boost - it is possible to specify a certain library for the linker
  42
+                        e.g. --with-boost-system=boost_system-gcc-mt ]),
  43
+        [
  44
+        if test "$withval" = "no"; then
  45
+			want_boost="no"
  46
+        elif test "$withval" = "yes"; then
  47
+            want_boost="yes"
  48
+            ax_boost_user_system_lib=""
  49
+        else
  50
+		    want_boost="yes"
  51
+        	ax_boost_user_system_lib="$withval"
  52
+		fi
  53
+        ],
  54
+        [want_boost="yes"]
  55
+	)
  56
+
  57
+	if test "x$want_boost" = "xyes"; then
  58
+        AC_REQUIRE([AC_PROG_CC])
  59
+        AC_REQUIRE([AC_CANONICAL_BUILD])
  60
+		CPPFLAGS_SAVED="$CPPFLAGS"
  61
+		CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
  62
+		export CPPFLAGS
  63
+
  64
+		LDFLAGS_SAVED="$LDFLAGS"
  65
+		LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
  66
+		export LDFLAGS
  67
+
  68
+        AC_CACHE_CHECK(whether the Boost::System library is available,
  69
+					   ax_cv_boost_system,
  70
+        [AC_LANG_PUSH([C++])
  71
+			 CXXFLAGS_SAVE=$CXXFLAGS
  72
+
  73
+			 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/system/error_code.hpp>]],
  74
+                                   [[boost::system::system_category]]),
  75
+                   ax_cv_boost_system=yes, ax_cv_boost_system=no)
  76
+			 CXXFLAGS=$CXXFLAGS_SAVE
  77
+             AC_LANG_POP([C++])
  78
+		])
  79
+		if test "x$ax_cv_boost_system" = "xyes"; then
  80
+			AC_SUBST(BOOST_CPPFLAGS)
  81
+
  82
+			AC_DEFINE(HAVE_BOOST_SYSTEM,,[define if the Boost::System library is available])
  83
+            BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
  84
+
  85
+			LDFLAGS_SAVE=$LDFLAGS
  86
+            if test "x$ax_boost_user_system_lib" = "x"; then
  87
+                for libextension in `ls $BOOSTLIBDIR/libboost_system*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_system.*\)\.so.*$;\1;' -e 's;^lib\(boost_system.*\)\.a*$;\1;'` ; do
  88
+                     ax_lib=${libextension}
  89
+				    AC_CHECK_LIB($ax_lib, exit,
  90
+                                 [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
  91
+                                 [link_system="no"])
  92
+  				done
  93
+                if test "x$link_system" != "xyes"; then
  94
+                for libextension in `ls $BOOSTLIBDIR/boost_system*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_system.*\)\.dll.*$;\1;' -e 's;^\(boost_system.*\)\.a*$;\1;'` ; do
  95
+                     ax_lib=${libextension}
  96
+				    AC_CHECK_LIB($ax_lib, exit,
  97
+                                 [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
  98
+                                 [link_system="no"])
  99
+  				done
  100
+                fi
  101
+
  102
+            else
  103
+               for ax_lib in $ax_boost_user_system_lib boost_system-$ax_boost_user_system_lib; do
  104
+				      AC_CHECK_LIB($ax_lib, exit,
  105
+                                   [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
  106
+                                   [link_system="no"])
  107
+                  done
  108
+
  109
+            fi
  110
+			if test "x$link_system" = "xno"; then
  111
+				AC_MSG_ERROR(Could not link against $ax_lib !)
  112
+			fi
  113
+		fi
  114
+
  115
+		CPPFLAGS="$CPPFLAGS_SAVED"
  116
+    	LDFLAGS="$LDFLAGS_SAVED"
  117
+	fi
  118
+])
7  bootstrap.sh
... ...
@@ -0,0 +1,7 @@
  1
+#!/bin/sh
  2
+
  3
+# To be safe include -I flag
  4
+aclocal -I ./aclocal
  5
+automake -a
  6
+autoconf
  7
+./configure --config-cache $*
102  configure.ac
... ...
@@ -0,0 +1,102 @@
  1
+# Autoconf input file
  2
+# $Id$
  3
+
  4
+# AC - autoconf
  5
+# FB - facebook
  6
+
  7
+#########################################################################
  8
+# DO NOT TOUCH EXCEPT TO CHANGE REV# IN AC_INIT
  9
+
  10
+AC_PREREQ(2.52)
  11
+AC_INIT([scribe], [1.5.0])
  12
+#AC_CONFIG_AUX_DIR([/usr/share/automake-1.9])
  13
+# To install locally
  14
+FB_INITIALIZE([localinstall])
  15
+AC_PREFIX_DEFAULT([/usr/local])
  16
+
  17
+############################################################################
  18
+# User Configurable. Change With CAUTION!
  19
+# User can include custom makefile rules. Uncomment and update only <name> in PRODUCT_MK.
  20
+# Include where appropriate in any Makefile.am as @PRODUCT_MK@
  21
+
  22
+#PRODUCT_MK="include ${EXTERNAL_PATH}/shared/build/<name>.mk"
  23
+
  24
+# Default path to external Facebook components and shared build toools I.e fb303 etc.
  25
+# To point to other locations set  environment variable EXTERNAL_PATH.
  26
+# To change the current default you must change bootstrap.sh.
  27
+FB_WITH_EXTERNAL_PATH([`pwd`])
  28
+
  29
+AC_ARG_VAR([PY_PREFIX], [Prefix for installing Python modules.
  30
+                         (Normal --prefix is ignored for Python because
  31
+                         Python has different conventions.)
  32
+                         Default = "/usr"])
  33
+AS_IF([test "x$PY_PREFIX" = x], [PY_PREFIX="/usr"])
  34
+
  35
+##########################################################################
  36
+# User Configurable
  37
+
  38
+# Pre-defined macro to set opt build mode. Run with --disable-shared option to turn off optimization.
  39
+FB_ENABLE_DEFAULT_OPT_BUILD
  40
+
  41
+# Predefined macro to set static library mode. Run with --disable-static option to turn off static lib mode.
  42
+FB_ENABLE_DEFAULT_STATIC
  43
+
  44
+# Personalized feature generator. Creates defines/conditionals and --enable --disable command line options.
  45
+# FB_ENABLE_FEATURE([FEATURE], [feature]) OR FB_ENABLE_FEATURE([FEATURE], [feature], [\"<value>\"])
  46
+
  47
+# Example: Macro supplies -DFACEBOOK at compile time and "if FACEBOOK endif" capabilities.
  48
+FB_ENABLE_FEATURE([FACEBOOK], [facebook])
  49
+
  50
+# Personalized path generator Sets default paths. Provides --with-xx=DIR options.
  51
+# FB_WITH_PATH([<var>_home], [<var>path], [<default location>]
  52
+
  53
+# Example: sets $(thrift_home) variable with default path set to /usr/local.
  54
+FB_WITH_PATH([thrift_home], [thriftpath], [/usr/local])
  55
+FB_WITH_PATH([jvm_lib], [jvmpath], [/usr/local/java/jre/lib/amd64/server])
  56
+FB_WITH_PATH([fb303_home], [fb303path], [/usr/local])
  57
+FB_WITH_PATH([smc_home], [smcpath], [${EXTERNAL_PATH}/services/trunk/src])
  58
+FB_WITH_PATH([fb_home], [fbpath], [${EXTERNAL_PATH}/libfacebook])
  59
+
  60
+# Require boost 1.36 with system and filesytem libraries
  61
+AX_BOOST_BASE([1.36])
  62
+AX_BOOST_SYSTEM
  63
+AX_BOOST_FILESYSTEM
  64
+
  65
+# Generates Makefile from Makefile.am. Modify when new subdirs are added.
  66
+# Change Makefile.am also to add subdirectly.
  67
+AC_CONFIG_FILES(Makefile src/Makefile lib/py/Makefile)
  68
+
  69
+############################################################################
  70
+# DO NOT TOUCH.
  71
+
  72
+AC_SUBST(PRODUCT_MK)
  73
+AC_OUTPUT
  74
+
  75
+#############################################################################
  76
+######### FINISH ############################################################
  77
+
  78
+echo "EXTERNAL_PATH $EXTERNAL_PATH"
  79
+
  80
+#make clean
  81
+
  82
+#
  83
+# NOTES FOR USER
  84
+# Short cut to create conditional flags.
  85
+#enable_facebook="yes"
  86
+#AM_CONDITIONAL([FACEBOOK], [test "$enable_facebook" = yes])
  87
+
  88
+# Enable options with --enable and --disable configurable.
  89
+#AC_MSG_CHECKING([whether to enable FACEBOOK])
  90
+#FACEBOOK=""
  91
+#AC_ARG_ENABLE([facebook],
  92
+#  [  --enable-facebook     Enable facebook.],
  93
+#  [
  94
+#     ENABLE_FACEBOOK=$enableval
  95
+#  ],
  96
+#  [
  97
+#     ENABLE_FACEBOOK="no"
  98
+#  ]
  99
+#)
  100
+#AM_CONDITIONAL([FACEBOOK], [test "$ENABLE_FACEBOOK" = yes])
  101
+#AC_MSG_RESULT($ENABLE_FACEBOOK)
  102
+
172  examples/README
... ...
@@ -0,0 +1,172 @@
  1
+##  Copyright (c) 2007-2008 Facebook
  2
+##
  3
+##  Licensed under the Apache License, Version 2.0 (the "License");
  4
+##  you may not use this file except in compliance with the License.
  5
+##  You may obtain a copy of the License at
  6
+##
  7
+##      http://www.apache.org/licenses/LICENSE-2.0
  8
+##
  9
+##  Unless required by applicable law or agreed to in writing, software
  10
+##  distributed under the License is distributed on an "AS IS" BASIS,
  11
+##  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12
+##  See the License for the specific language governing permissions and
  13
+##  limitations under the License.
  14
+##
  15
+## See accompanying file LICENSE or visit the Scribe site at:
  16
+## http://developers.facebook.com/scribe/
  17
+
  18
+
  19
+# This file contains a couple of simple examples of how to configure and use
  20
+# Scribe.
  21
+#
  22
+# Example code in this directory:
  23
+#  scribe_cat: a simple example of a client that can send messages to Scribe
  24
+#  scribe_ctrl: a script that manages a running Scribe instance (requires root)
  25
+#  example1.conf: sample configuration file for running Example 1
  26
+#  example2.conf: sample configuration file for running Example 2
  27
+
  28
+#
  29
+# EXAMPLE 1
  30
+#
  31
+
  32
+# This is a simple example that shows how to configure and send messages to
  33
+# Scribe.
  34
+
  35
+#Create a directory to log messages:
  36