Author: dreiss Date: Tue May 18 16:52:48 2010 New Revision: 945744 URL: http://svn.apache.org/viewvc?rev=945744&view=rev Log: THRIFT-646. erlang: Misc build cleanups
- Use AC_ERLANG_PATH_ERLC to find erlc, instead of the generic AC_PATH_PROG. - Also check for erl, just in case it is used internally by checks. - Use AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR instead of manual hackery to find the location where Erlang libraries should be installed. (This doesn't use the discovered version of Erlang, though. See http://lists.gnu.org/archive/html/bug-autoconf/2010-05/msg00003.html .) - Minor style changes in Makefile.am - Remove some hacks we were using in the old makefile that were necessary because we were not using automake. - Remove ebin in a "maintainer-clean-local" rule to avoid shadowing the default "maintainer-clean" rule which handles MAINTAINERCLEANFILES. Modified: incubator/thrift/trunk/configure.ac incubator/thrift/trunk/lib/erl/Makefile.am Modified: incubator/thrift/trunk/configure.ac URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/configure.ac?rev=945744&r1=945743&r2=945744&view=diff ============================================================================== --- incubator/thrift/trunk/configure.ac (original) +++ incubator/thrift/trunk/configure.ac Tue May 18 16:52:48 2010 @@ -98,9 +98,11 @@ AM_CONDITIONAL([WITH_JAVA], AX_THRIFT_LIB(erlang, [Erlang], yes) if test "$with_erlang" = "yes"; then - AC_PATH_PROG([ERLC], [erlc]) + AC_ERLANG_PATH_ERL + AC_ERLANG_PATH_ERLC + AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) fi -AM_CONDITIONAL(WITH_ERLANG, [test -n "$ERLC"]) +AM_CONDITIONAL(WITH_ERLANG, [test -n "$ERL" -a -n "$ERLC"]) AX_THRIFT_LIB(py, [Python], yes) if test "$with_py" = "yes"; then Modified: incubator/thrift/trunk/lib/erl/Makefile.am URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/erl/Makefile.am?rev=945744&r1=945743&r2=945744&view=diff ============================================================================== --- incubator/thrift/trunk/lib/erl/Makefile.am (original) +++ incubator/thrift/trunk/lib/erl/Makefile.am Tue May 18 16:52:48 2010 @@ -17,9 +17,6 @@ # under the License. # -# directory where erlang library code should live -ERL_LIB_ROOT_DIR=$(shell erl -eval 'io:format("~s~n", [code:lib_dir()])' -s init stop -noshell) - MODULES = \ src @@ -28,30 +25,20 @@ all clean docs: (cd $$dir; ${MAKE} $@); \ done -ERLLIBDIR=$(DESTDIR)$(ERL_LIB_ROOT_DIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION) - install: all - mkdir -p $(ERLLIBDIR) ; \ - mkdir -p $(ERLLIBDIR)/ebin ; \ - mkdir -p $(ERLLIBDIR)/include ; \ - mkdir -p $(ERLLIBDIR)/src ; \ - for i in ebin/*.app* ; do $(INSTALL) $$i $(ERLLIBDIR)/$$i ; done ; \ - for i in ebin/*.beam ; do $(INSTALL) $$i $(ERLLIBDIR)/$$i ; done ; \ - for i in include/*.hrl ; do $(INSTALL) $$i $(ERLLIBDIR)/$$i ; done ; \ - for i in src/*.erl ; do $(INSTALL) $$i $(ERLLIBDIR)/$$i ; done + mkdir -p $(ERLANG_INSTALL_LIB_DIR_thrift) ; \ + mkdir -p $(ERLANG_INSTALL_LIB_DIR_thrift)/ebin ; \ + mkdir -p $(ERLANG_INSTALL_LIB_DIR_thrift)/include ; \ + mkdir -p $(ERLANG_INSTALL_LIB_DIR_thrift)/src ; \ + for i in ebin/*.app* ebin/*.beam include/*.hrl src/*.erl ; \ + do $(INSTALL) $$p $(ERLANG_INSTALL_LIB_DIR_thrift)/$$p ; \ + done uninstall: - rm -rf $(ERLLIBDIR) + rm -rf $(ERLANG_INSTALL_LIB_DIR_thrift) -check: all -distclean: clean - -# Hack to make "make dist" work. -# This should not work, but it appears to. -distdir: +maintainer-clean-local: + rm -rf ebin MAINTAINERCLEANFILES = Makefile.in - -maintainer-clean: - test ! -d ebin || rm -rf ebin
