summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Joseph Davis <davisp@apache.org>2009-11-26 19:29:35 +0000
committerPaul Joseph Davis <davisp@apache.org>2009-11-26 19:29:35 +0000
commitc452048cae6ff8b275e72a2f4b590ccaeebc35ba (patch)
tree1f3948d9b61173c0b4a81557708aad0f6e4de763
parent683834888cfad2e6da1564161eda3447620374f5 (diff)
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
-rw-r--r--.gitignore4
-rw-r--r--license.skip8
-rw-r--r--src/couchdb/Makefile.am43
-rw-r--r--src/couchdb/couch_util.erl6
-rw-r--r--src/couchdb/priv/Makefile.am28
-rw-r--r--src/couchdb/priv/couch_js/couch_js.c (renamed from src/couchdb/couch_js.c)0
-rw-r--r--src/couchdb/priv/couch_js/curlhelper.c (renamed from src/couchdb/curlhelper.c)0
-rw-r--r--src/couchdb/priv/couch_js/curlhelper.h (renamed from src/couchdb/curlhelper.h)0
-rw-r--r--src/couchdb/priv/icu_driver/couch_icu_driver.c (renamed from src/couchdb/couch_erl_driver.c)4
-rw-r--r--[-rwxr-xr-x]src/couchdb/priv/spawnkillable/couchspawnkillable.sh (renamed from src/couchdb/priv/couchspawnkillable.sh)0
-rw-r--r--src/couchdb/priv/spawnkillable/couchspawnkillable_win.c (renamed from src/couchdb/priv/couchspawnkillable_win.c)0
-rw-r--r--test/etap/002-icu-driver.t (renamed from test/etap/002-erl-driver.t)4
12 files changed, 37 insertions, 60 deletions
diff --git a/.gitignore b/.gitignore
index 6bbffabd..69e07e9a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
diff --git a/license.skip b/license.skip
index e88d42d2..f33902ee 100644
--- a/license.skip
+++ b/license.skip
@@ -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/*
diff --git a/src/couchdb/Makefile.am b/src/couchdb/Makefile.am
index 5842521b..9e909964 100644
--- a/src/couchdb/Makefile.am
+++ b/src/couchdb/Makefile.am
@@ -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
diff --git a/src/couchdb/couch_util.erl b/src/couchdb/couch_util.erl
index da62375c..8e2c66df 100644
--- a/src/couchdb/couch_util.erl
+++ b/src/couchdb/couch_util.erl
@@ -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 ->
diff --git a/src/couchdb/priv/Makefile.am b/src/couchdb/priv/Makefile.am
index fecaa64b..d4c759c1 100644
--- a/src/couchdb/priv/Makefile.am
+++ b/src/couchdb/priv/Makefile.am
@@ -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
diff --git a/src/couchdb/couch_js.c b/src/couchdb/priv/couch_js/couch_js.c
index 0acc5b55..0acc5b55 100644
--- a/src/couchdb/couch_js.c
+++ b/src/couchdb/priv/couch_js/couch_js.c
diff --git a/src/couchdb/curlhelper.c b/src/couchdb/priv/couch_js/curlhelper.c
index 738ac64a..738ac64a 100644
--- a/src/couchdb/curlhelper.c
+++ b/src/couchdb/priv/couch_js/curlhelper.c
diff --git a/src/couchdb/curlhelper.h b/src/couchdb/priv/couch_js/curlhelper.h
index 098bdf02..098bdf02 100644
--- a/src/couchdb/curlhelper.h
+++ b/src/couchdb/priv/couch_js/curlhelper.h
diff --git a/src/couchdb/couch_erl_driver.c b/src/couchdb/priv/icu_driver/couch_icu_driver.c
index 07f33867..1afe8eac 100644
--- a/src/couchdb/couch_erl_driver.c
+++ b/src/couchdb/priv/icu_driver/couch_icu_driver.c
@@ -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;
}
diff --git a/src/couchdb/priv/couchspawnkillable.sh b/src/couchdb/priv/spawnkillable/couchspawnkillable.sh
index f8d042e3..f8d042e3 100755..100644
--- a/src/couchdb/priv/couchspawnkillable.sh
+++ b/src/couchdb/priv/spawnkillable/couchspawnkillable.sh
diff --git a/src/couchdb/priv/couchspawnkillable_win.c b/src/couchdb/priv/spawnkillable/couchspawnkillable_win.c
index f812711e..f812711e 100644
--- a/src/couchdb/priv/couchspawnkillable_win.c
+++ b/src/couchdb/priv/spawnkillable/couchspawnkillable_win.c
diff --git a/test/etap/002-erl-driver.t b/test/etap/002-icu-driver.t
index f353eda4..d70f3303 100644
--- a/test/etap/002-erl-driver.t
+++ b/test/etap/002-icu-driver.t
@@ -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">>),