Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix the packaging and the code to work with the latest HDFS.

* Makefile.am: Specify ACLOCAL_AMFLAGS so that...
* bootstrap.sh: ... autoreconf can be used instead of manually invoking
  aclocal/automake/autoconf.
* configure.ac: Use AC_CONFIG_MACRO_DIR to match ACLOCAL_AMFLAGS and call
  AM_INIT_AUTOMAKE with the `foreign' argument to specify that isn't
  supposed to be a GNU package.
* src/HdfsFile.cpp: Remove CPP guards that are now unnecessary since we...
* src/Makefile.am: ... conditionnally compile HdfsFile.cpp depending on
  whether or not HDFS support was enabled at configure time.
  Also specify the additional EXTERNAL_LIBS needed for HDFS support.

Signed-off-by: Benoit Sigoure <tsuna@stumbleupon.com>
  • Loading branch information...
commit e045e83657767fc8f6781ccf76137e9577193a5c 1 parent 9f37699
@tsuna tsuna authored anthonygiardullo committed
View
2  Makefile.am
@@ -1,3 +1,5 @@
+ACLOCAL_AMFLAGS = -I aclocal
+
@GLOBAL_HEADER_MK@
@PRODUCT_MK@
View
4 bootstrap.sh
@@ -1,7 +1,5 @@
#!/bin/sh
# To be safe include -I flag
-aclocal -I ./aclocal
-automake -a
-autoconf
+autoreconf --force --verbose --install
./configure --config-cache $*
View
3  configure.ac
@@ -9,7 +9,8 @@
AC_PREREQ(2.52)
AC_INIT([scribe], [1.5.0])
-#AC_CONFIG_AUX_DIR([/usr/share/automake-1.9])
+AC_CONFIG_MACRO_DIR([aclocal])
+AM_INIT_AUTOMAKE([foreign -Wall])
# To install locally
FB_INITIALIZE([localinstall])
AC_PREFIX_DEFAULT([/usr/local])
View
7 src/HdfsFile.cpp
@@ -9,8 +9,6 @@
#include "file.h"
#include "HdfsFile.h"
-#ifdef USE_SCRIBE_HDFS
-
using namespace std;
HdfsFile::HdfsFile(const std::string& name) : FileInterface(name, false), inputBuffer_(NULL), bufferSize_(0) {
@@ -200,7 +198,7 @@ bool HdfsFile::createSymlink(std::string oldpath, std::string newpath) {
* specified cluster
*/
hdfsFS HdfsFile::connectToPath(const char* uri) {
- char* defaultport = "default:0";
+ const char defaultport[] = "default:0";
char* hostport = (char *)malloc(strlen(uri) + strlen(defaultport) + 1);
char* buf = (char *)malloc(strlen(uri) + strlen(defaultport) + 1);
char* portStr;
@@ -238,6 +236,3 @@ hdfsFS HdfsFile::connectToPath(const char* uri) {
free(buf);
return fs;
}
-
-#endif // USE_SCRIBE_HDFS
-
View
10 src/Makefile.am
@@ -47,8 +47,11 @@ endif
# Set libraries external to this component.
-EXTERNAL_LIBS = -L$(thrift_home)/lib -L$(fb303_home)/lib -L$(hadoop_home)/lib -lfb303 -lthrift -lthriftnb
+EXTERNAL_LIBS = -L$(thrift_home)/lib -L$(fb303_home)/lib -L$(hadoop_home)/lib -lfb303 -lthrift -lthriftnb
EXTERNAL_LIBS += -levent -lpthread
+if USE_SCRIBE_HDFS
+ EXTERNAL_LIBS += -lhdfs -ljvm
+endif
# Section 2 ############################################################################
# Set common flags recognized by automake.
@@ -91,7 +94,10 @@ endif
# Binaries -- multiple progs can be defined.
bin_PROGRAMS = scribed
-scribed_SOURCES = store.cpp store_queue.cpp conf.cpp file.cpp HdfsFile.cpp conn_pool.cpp scribe_server.cpp $(FB_SOURCES)
+scribed_SOURCES = store.cpp store_queue.cpp conf.cpp file.cpp conn_pool.cpp scribe_server.cpp $(FB_SOURCES)
+if USE_SCRIBE_HDFS
+ scribed_SOURCES += HdfsFile.cpp
+endif
scribed_LDADD = $(EXTERNAL_LIBS) $(INTERNAL_LIBS)
if SHARED
Please sign in to comment.
Something went wrong with that request. Please try again.