Author: sbanacho
Date: Thu Oct 15 15:39:08 2009
New Revision: 825526

URL: http://svn.apache.org/viewvc?rev=825526&view=rev
Log:
AVRO-147. Use configure to create makefile for C++ builds.

Added:
    hadoop/avro/trunk/src/c++/Makefile.in   (with props)
    hadoop/avro/trunk/src/c++/aclocal.m4   (with props)
    hadoop/avro/trunk/src/c++/configure   (with props)
    hadoop/avro/trunk/src/c++/configure.in   (with props)
    hadoop/avro/trunk/src/c++/m4/
    hadoop/avro/trunk/src/c++/m4/README   (with props)
    hadoop/avro/trunk/src/c++/m4/m4_ax_boost_base.m4   (with props)
    hadoop/avro/trunk/src/c++/m4/m4_ax_boost_regex.m4   (with props)
Removed:
    hadoop/avro/trunk/src/c++/Makefile
    hadoop/avro/trunk/src/c++/System.Darwin.mk
    hadoop/avro/trunk/src/c++/System.Linux.mk
Modified:
    hadoop/avro/trunk/CHANGES.txt
    hadoop/avro/trunk/src/c++/README.txt
    hadoop/avro/trunk/src/c++/test/testgen.cc

Modified: hadoop/avro/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/avro/trunk/CHANGES.txt?rev=825526&r1=825525&r2=825526&view=diff
==============================================================================
--- hadoop/avro/trunk/CHANGES.txt (original)
+++ hadoop/avro/trunk/CHANGES.txt Thu Oct 15 15:39:08 2009
@@ -11,6 +11,8 @@
     AVRO-142. Remove some Java unused fields and imports.  Start
     running checkstyle on Java test code.  (Philip Zeyliger via cutting)
 
+    AVRO-147. Use configure to create makefile for C++ builds. (sbanacho)
+
   OPTIMIZATIONS
 
   BUG FIXES

Added: hadoop/avro/trunk/src/c++/Makefile.in
URL: 
http://svn.apache.org/viewvc/hadoop/avro/trunk/src/c%2B%2B/Makefile.in?rev=825526&view=auto
==============================================================================
--- hadoop/avro/trunk/src/c++/Makefile.in (added)
+++ hadoop/avro/trunk/src/c++/Makefile.in Thu Oct 15 15:39:08 2009
@@ -0,0 +1,116 @@
+
+
+SHELL = /bin/sh
+VPATH = @srcdir@
+
+subdirs = @subdirs@
+top_srcdir = @top_srcdir@
+srcdir = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = $(exec_prefix)/bin
+infodir = $(prefix)/info
+libdir = $(prefix)/lib/gnudl
+mandir = $(prefix)/man/man1
+
+CXX = @CXX@
+CPPFLAGS = @CPPFLAGS@
+CFLAGS = $(CPPFLAGS) @CFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+INSTALL = @INSTALL@
+LEX = @LEX@
+YACC = @YACC@
+DOXYGEN = @DOXYGEN@
+BOOST_CPPFLAGS = @BOOST_CPPFLAGS@
+BOOST_LDFLAGS = @BOOST_LDFLAGS@
+BOOST_REGEX_LIB = @BOOST_REGEX_LIB@
+
+AVROINCLUDES = $(srcdir)/api
+AVROSOURCES = $(srcdir)/impl
+AVROPARSER = $(srcdir)/parser
+AVROSCHEMAS = $(srcdir)/jsonschemas
+AVROTEST = $(srcdir)/test
+AVROSCRIPTS = $(srcdir)/scripts
+
+EXECS = unittest testparser precompile testgen
+EXECSDIR = obj
+AVROEXECS = $(EXECS:%=$(EXECSDIR)/%)
+
+INCFLAGS = -I$(AVROINCLUDES) -I$(AVROPARSER) 
+INCFLAGS += $(BOOST_CPPFLAGS)
+
+LIBS += $(BOOST_LDFLAGS) $(BOOST_REGEX_LIB)
+
+OBJDIR = obj
+
+HEADERS    := $(wildcard $(AVROINCLUDES)/*.hh)
+SOURCES := $(wildcard $(AVROSOURCES)/*.cc)
+files := $(SOURCES:$(AVROSOURCES)/%.cc=%)
+OBJS := $(files:%=$(OBJDIR)/%.o)
+DEPENDS := $(files:%=$(OBJDIR)/%.d)
+
+OJBS += $(OBJDIR)/parserlib.o
+
+GENERATED = avro.tab.h avro.tab.c lex.yy.cc
+GENERATEDSRCS = $(GENERATED:%=$(OBJDIR)/%)
+GENERATEDobjs = $(addsuffix .o, $(sort $(basename $(GENERATED))) )
+GENERATEDOBJS = $(GENERATEDobjs:%=$(OBJDIR)/%)
+
+all : $(OBJDIR)/avrolib.a 
+
+check: $(AVROEXECS)
+       $(EXECSDIR)/unittest
+       $(EXECSDIR)/testgen $(AVROSCHEMAS)/bigrecord
+
+CXXFLAGS = -Wall -g $(CPPFLAGS)
+
+$(OBJDIR)/avrolib.a : $(OBJS) $(GENERATEDOBJS)
+       ar ruc $@ $^ 
+       ranlib $@
+
+$(EXECSDIR)/unittest : $(AVROTEST)/unittest.cc $(OBJDIR)/avrolib.a $(HEADERS)
+       $(CXX) $(CXXFLAGS) $(INCFLAGS) -o $@ $< $(OBJDIR)/avrolib.a $(LIBS)
+
+$(OBJDIR)/%.o : $(AVROSOURCES)/%.cc
+       $(CXX) $(CXXFLAGS) $(INCFLAGS) -c -o $@ $<
+
+$(OBJDIR)/%.d : $(AVROSOURCES)/%.cc 
+       mkdir -p $(OBJDIR)
+       $(CXX) $(CXXFLAGS) $(INCFLAGS) -MM -MP -MT $(OBJDIR)/$*.o -MT $@ -MF $@ 
$< 
+
+$(OBJDIR)/lex.yy.cc : $(AVROPARSER)/avro.l $(OBJDIR)/avro.tab.h
+       $(LEX) -o$(OBJDIR)/lex.yy.cc $(AVROPARSER)/avro.l
+
+$(OBJDIR)/avro.tab.h $(OBJDIR)/avro.tab.c : $(AVROPARSER)/avro.y
+       $(YACC) -d --file-prefix=$(OBJDIR)/avro $(AVROPARSER)/avro.y
+
+$(OBJDIR)/avro.tab.o : $(OBJDIR)/avro.tab.c $(OBJDIR)/avro.tab.h
+       $(CXX) $(CXXFLAGS) $(INCFLAGS) -c -o $@ $< 
+
+$(OBJDIR)/lex.yy.o : $(OBJDIR)/lex.yy.cc
+       $(CXX) $(CXXFLAGS)  -Wno-unused $(INCFLAGS) -c -o $@ $< 
+
+$(EXECSDIR)/testparser: $(AVROTEST)/testparser.cc $(OBJDIR)/avrolib.a 
+       $(CXX) $(CXXFLAGS) $(INCFLAGS) -o $@ $^ $(LIBS)
+
+$(EXECSDIR)/precompile: $(AVROTEST)/precompile.cc $(OBJDIR)/avrolib.a 
+       $(CXX) $(CXXFLAGS) $(INCFLAGS) -o $@ $^ $(LIBS)
+
+$(AVROTEST)/code.hh: $(AVROSCRIPTS)/gen.py $(EXECSDIR)/precompile 
$(AVROSCHEMAS)/bigrecord
+       $(EXECSDIR)/precompile < $(AVROSCHEMAS)/bigrecord > obj/bigrecord.flat
+       python $(AVROSCRIPTS)/gen.py < obj/bigrecord.flat > $(AVROTEST)/code.hh
+
+$(EXECSDIR)/testgen: $(AVROTEST)/code.hh $(AVROTEST)/testgen.cc 
$(OBJDIR)/avrolib.a 
+       $(CXX) $(CXXFLAGS) $(INCFLAGS) -o $@ $^ $(LIBS)
+
+doc/html/index.html: $(SOURCES) $(HEADERS) ./Doxyfile
+       $(DOXYGEN) ./Doxyfile
+
+.PHONY: doc
+doc: doc/html/index.html
+
+-include $(DEPENDS)
+
+clean :
+       rm -rf $(AVROEXECS) $(OBJS) $(OBJDIR)/avrolib.a $(GENERATEDSRCS) 
$(GENERATEDOBJS) core

Propchange: hadoop/avro/trunk/src/c++/Makefile.in
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: hadoop/avro/trunk/src/c++/README.txt
URL: 
http://svn.apache.org/viewvc/hadoop/avro/trunk/src/c%2B%2B/README.txt?rev=825526&r1=825525&r2=825526&view=diff
==============================================================================
--- hadoop/avro/trunk/src/c++/README.txt (original)
+++ hadoop/avro/trunk/src/c++/README.txt Thu Oct 15 15:39:08 2009
@@ -32,18 +32,24 @@
 To compile requires boost headers, and the boost regex library.
 Additionally, to generate the avro spec compiler requires flex and bison.
 
-As of yet, there is no automatic configuration, so to get started:
+There is a configure file generated by autoconf.  Use:
 
-1. Setup compiler variables in System.*.mk
+    ./configure 
 
-Edit (or add) the System.XXX.mk file, where XXX is the result of `uname` on
-your machine, to include the paths for:
+to generate a Makefile.
 
-BOOSTINC (location of boost headers) 
-BOOSTREGEX (location of libboost-regex_*.a for your boost)
-LEX (path to flex)
-YACC (path to bison)
+If it doesn't work, either you are missing some packages (boost, flex or 
bison),
+or you need to help configure locate them.
 
-2.  Make
+Type ./configure --help if you need help.
+
+If the Makefile is configured correctly, then you can make and run tests:
+
+    make
+    make check
+
+Before running tests, you may need to set LD_LIBRARY_PATH to the boost
+libraries if they are staged instead of installed.
+
+The install target is not yet set up (coming soon!)
 
-Then type gmake, and it should build everything and run some unit tests.

Added: hadoop/avro/trunk/src/c++/aclocal.m4
URL: 
http://svn.apache.org/viewvc/hadoop/avro/trunk/src/c%2B%2B/aclocal.m4?rev=825526&view=auto
==============================================================================
--- hadoop/avro/trunk/src/c++/aclocal.m4 (added)
+++ hadoop/avro/trunk/src/c++/aclocal.m4 Thu Oct 15 15:39:08 2009
@@ -0,0 +1,15 @@
+# generated automatically by aclocal 1.10 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006  Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_include([m4/m4_ax_boost_base.m4])
+m4_include([m4/m4_ax_boost_regex.m4])

Propchange: hadoop/avro/trunk/src/c++/aclocal.m4
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to