Permalink
Browse files

Move all C code to src/couchdb/priv

Shuffling bits around to conform to Erlang conventions.



git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@884671 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
davisp committed Nov 26, 2009
1 parent 6838348 commit c452048cae6ff8b275e72a2f4b590ccaeebc35ba
View
@@ -49,12 +49,14 @@ etc/launchd/org.apache.couchdb.plist
etc/logrotate.d/couchdb
src/couchdb/.libs/*
src/couchdb/couch.app
-src/couchdb/couch_erl_driver.la
src/couchdb/couchjs
src/couchdb/edoc-info
src/couchdb/erlang.png
src/couchdb/stylesheet.css
src/couchdb/priv/.deps/
+src/couchdb/priv/.libs/
+src/couchdb/priv/couch_icu_driver.la
+src/couchdb/priv/couchjs
src/couchdb/priv/couchspawnkillable
test/local.ini
test/etap/test_util.erl
View
@@ -53,17 +53,19 @@
^share/www/script/test/lorem*
^src/Makefile
^src/Makefile.in
-^src/couchdb/*.beam
+^src/couchdb/.*beam
^src/couchdb/couch.app.tpl.in
^src/couchdb/.deps/*
-^src/couchdb/.libs/*
+^src/couchdb/couch.app*
^src/couchdb/Makefile
^src/couchdb/Makefile.in
-^src/couchdb/*.o
^src/couchdb/priv/.deps/*
+^src/couchdb/priv/.*o
^src/couchdb/priv/Makefile
^src/couchdb/priv/Makefile.in
+^src/couchdb/priv/couchjs
^src/couchdb/priv/couchspawnkillable
+^src/couchdb/priv/couch_icu_driver.la
^src/couchdb/priv/stat_descriptions.cfg
^src/erlang-oauth/*
^src/etap/*
View
@@ -12,38 +12,12 @@
SUBDIRS = priv
-ICU_LOCAL_FLAGS = $(ICU_LOCAL_CFLAGS) $(ICU_LOCAL_LDFLAGS)
-if WINDOWS
-ICU_LOCAL_LIBS=-licuuc -licudt -licuin
-else
-ICU_LOCAL_LIBS=-licuuc -licudata -licui18n
-endif
-
# devdocdir = $(localdocdir)/developer/couchdb
couchlibdir = $(localerlanglibdir)/couch-$(version)
-couchprivdir = $(couchlibdir)/priv
-couchprivlibdir = $(couchlibdir)/priv/lib
couchincludedir = $(couchlibdir)/include
couchebindir = $(couchlibdir)/ebin
-couchprivlib_LTLIBRARIES = couch_erl_driver.la
-couch_erl_driver_la_SOURCES = couch_erl_driver.c
-couch_erl_driver_la_LDFLAGS = -module -avoid-version $(ICU_LOCAL_FLAGS)
-couch_erl_driver_la_CFLAGS = $(ICU_LOCAL_FLAGS)
-couch_erl_driver_la_LIBADD = $(ICU_LOCAL_LIBS)
-
-locallibbin_PROGRAMS = couchjs
-couchjs_SOURCES = couch_js.c curlhelper.c curlhelper.h
-couchjs_LDFLAGS = $(CURL_LDFLAGS)
-couchjs_CFLAGS = $(CURL_CFLAGS)
-couchjs_LDADD = $(CURL_LDFLAGS) @JSLIB@
-
-if WINDOWS
-couch_erl_driver_la_LDFLAGS += -no-undefined
-endif
-
couchinclude_DATA = couch_db.hrl
-
couchebin_DATA = $(compiled_files)
# dist_devdoc_DATA = $(doc_base) $(doc_modules)
@@ -219,20 +193,3 @@ endif
%.beam: %.erl couch_db.hrl
$(ERLC) $(ERLC_FLAGS) ${TEST} $<;
-install-data-hook:
- if test -f "$(DESTDIR)$(couchprivlibdir)/couch_erl_driver"; then \
- rm -f "$(DESTDIR)$(couchprivlibdir)/couch_erl_driver.so"; \
- cd "$(DESTDIR)$(couchprivlibdir)" && \
- $(LN_S) couch_erl_driver couch_erl_driver.so; \
- fi
-if WINDOWS
- $(INSTALL) $(ICU_LOCAL_BIN)/icuuc42.dll $(bindir)
- $(INSTALL) $(ICU_LOCAL_BIN)/icudt42.dll $(bindir)
- $(INSTALL) $(ICU_LOCAL_BIN)/icuin42.dll $(bindir)
- $(INSTALL) $(JS_LIB_BINARY) $(bindir)
-endif
-
-uninstall-local:
- if test -f "$(DESTDIR)$(couchprivlibdir)/couch_erl_driver"; then \
- rm -f "$(DESTDIR)$(couchprivlibdir)/couch_erl_driver.so"; \
- fi
@@ -39,11 +39,11 @@ priv_dir() ->
end.
start_driver(LibDir) ->
- case erl_ddll:load_driver(LibDir, "couch_erl_driver") of
+ case erl_ddll:load_driver(LibDir, "couch_icu_driver") of
ok ->
ok;
{error, already_loaded} ->
- ok = erl_ddll:reload_driver(LibDir, "couch_erl_driver");
+ ok = erl_ddll:reload_driver(LibDir, "couch_icu_driver");
{error, Error} ->
exit(erl_ddll:format_error(Error))
end.
@@ -191,7 +191,7 @@ implode([H|T], Sep, Acc) ->
drv_port() ->
case get(couch_drv_port) of
undefined ->
- Port = open_port({spawn, "couch_erl_driver"}, []),
+ Port = open_port({spawn, "couch_icu_driver"}, []),
put(couch_drv_port, Port),
Port;
Port ->
@@ -12,6 +12,7 @@
couchlibdir = $(localerlanglibdir)/couch-$(version)
couchprivdir = $(couchlibdir)/priv
+couchprivlibdir = $(couchlibdir)/priv/lib
EXTRA_DIST = \
couchspawnkillable.sh \
@@ -26,21 +27,36 @@ couchpriv_PROGRAMS = couchspawnkillable
cp $< $@
if WINDOWS
-couchspawnkillable_SOURCES = couchspawnkillable_win.c
+couchspawnkillable_SOURCES = spawnkillable/couchspawnkillable_win.c
endif
if !WINDOWS
-couchspawnkillable: couchspawnkillable.sh
+couchspawnkillable: spawnkillable/couchspawnkillable.sh
cp $< $@
endif
-if WINDOWS
-install-data-hook:
# libtool and automake have defeated markh. For each of our executables
# we end up with 2 copies - one directly in the 'target' folder (eg, 'priv')
# and another - the correct one - in .libs. The former doesn't work but is
# what gets installed for 'couchspawnkillable' - but the correct one for
# couchjs.exe *does* get copied. *shrug* So just clobber it with the
-# correct one here... See bug COUCHDB-439
- $(INSTALL) .libs/couchspawnkillable.exe "$(DESTDIR)$(couchprivdir)/couchspawnkillable.exe"
+# correct one as the last step. See bug COUCHDB-439
+install-data-hook:
+ if test -f "$(DESTDIR)$(couchprivlibdir)/couch_icu_driver"; then \
+ rm -f "$(DESTDIR)$(couchprivlibdir)/couch_icu_driver.so"; \
+ cd "$(DESTDIR)$(couchprivlibdir)" && \
+ $(LN_S) couch_icu_driver couch_icu_driver.so; \
+ fi
+if WINDOWS
+ $(INSTALL) $(ICU_LOCAL_BIN)/icuuc42.dll $(bindir)
+ $(INSTALL) $(ICU_LOCAL_BIN)/icudt42.dll $(bindir)
+ $(INSTALL) $(ICU_LOCAL_BIN)/icuin42.dll $(bindir)
+ $(INSTALL) $(JS_LIB_BINARY) $(bindir)
+ $(INSTALL) .libs/couchspawnkillable.exe \
+ "$(DESTDIR)$(couchprivdir)/couchspawnkillable.exe"
endif
+
+uninstall-local:
+ if test -f "$(DESTDIR)$(couchprivlibdir)/couch_erl_driver"; then \
+ rm -f "$(DESTDIR)$(couchprivlibdir)/couch_erl_driver.so"; \
+ fi
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -153,7 +153,7 @@ ErlDrvEntry couch_driver_entry = {
NULL, /* F_PTR output, called when erlang has sent */
NULL, /* F_PTR ready_input, called when input descriptor ready */
NULL, /* F_PTR ready_output, called when output descriptor ready */
- "couch_erl_driver", /* char *driver_name, the argument to open_port */
+ "couch_icu_driver", /* char *driver_name, the argument to open_port */
NULL, /* F_PTR finish, called when unloaded */
NULL, /* Not used */
couch_drv_control, /* F_PTR control, port_command callback */
@@ -171,7 +171,7 @@ ErlDrvEntry couch_driver_entry = {
NULL, /* F_PTR process_exit */
};
-DRIVER_INIT(couch_erl_driver) /* must match name in driver_entry */
+DRIVER_INIT(couch_icu_driver) /* must match name in driver_entry */
{
return &couch_driver_entry;
}
File renamed without changes.
@@ -16,9 +16,9 @@ main(_) ->
test_util:init_code_path(),
etap:plan(3),
etap:is(
- couch_util:start_driver("src/couchdb/.libs"),
+ couch_util:start_driver("src/couchdb/priv/.libs"),
ok,
- "Started couch_erl_driver."
+ "Started couch_icu_driver."
),
etap:is(
couch_util:collate(<<"foo">>, <<"bar">>),

0 comments on commit c452048

Please sign in to comment.