couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rand...@apache.org
Subject svn commit: r1133287 - in /couchdb/trunk: configure.ac src/couchdb/priv/Makefile.am src/couchdb/priv/icu_driver/couch_icu_driver.c
Date Wed, 08 Jun 2011 08:44:13 GMT
Author: randall
Date: Wed Jun  8 08:44:13 2011
New Revision: 1133287

URL: http://svn.apache.org/viewvc?rev=1133287&view=rev
Log:
let icu decide how to link itself

icu-config on my Ubuntu 11.04 system gives back -ansi.
I changed the comments to conform and icu driver compiles.

Modified:
    couchdb/trunk/configure.ac
    couchdb/trunk/src/couchdb/priv/Makefile.am
    couchdb/trunk/src/couchdb/priv/icu_driver/couch_icu_driver.c

Modified: couchdb/trunk/configure.ac
URL: http://svn.apache.org/viewvc/couchdb/trunk/configure.ac?rev=1133287&r1=1133286&r2=1133287&view=diff
==============================================================================
--- couchdb/trunk/configure.ac (original)
+++ couchdb/trunk/configure.ac Wed Jun  8 08:44:13 2011
@@ -167,8 +167,6 @@ case "$(uname -s)" in
   *)
     # XP_UNIX required for jsapi.h and has been tested to work on Linux and Darwin.
     JS_CLAGS="-DXP_UNIX $JS_CFLAGS"
-    # manually linking libm is requred for FreeBSD 7.0
-    LDFLAGS="-lm $LDFLAGS"
     ;;
 esac
 
@@ -261,21 +259,17 @@ AC_LANG_POP(C)
 
 AC_ARG_WITH([win32-icu-binaries], [AC_HELP_STRING([--with-win32-icu-binaries=PATH],
     [set PATH to the Win32 native ICU binaries directory])], [
-    ICU_CONFIG="" # supposed to be a command to query options...
-    ICU_LOCAL_CFLAGS="-I$withval/include"
-    ICU_LOCAL_LDFLAGS="-L$withval/lib"
-    ICU_LOCAL_BIN=$withval/bin
+    ICU_CFLAGS="-I$withval/include"
+    ICU_LIBS="-L$withval/lib -licuuc -licudt -licuin"
+    ICU_BIN=$withval/bin
 ], [
     AC_CHECK_ICU([3.4.1])
-    ICU_LOCAL_CFLAGS=`$ICU_CONFIG --cppflags-searchpath`
-    ICU_LOCAL_LDFLAGS=`$ICU_CONFIG --ldflags-searchpath`
-    ICU_LOCAL_BIN=
+    ICU_BIN=
 ])
 
-AC_SUBST(ICU_CONFIG)
-AC_SUBST(ICU_LOCAL_CFLAGS)
-AC_SUBST(ICU_LOCAL_LDFLAGS)
-AC_SUBST(ICU_LOCAL_BIN)
+AC_SUBST(ICU_CFLAGS)
+AC_SUBST(ICU_LIBS)
+AC_SUBST(ICU_BIN)
 
 use_curl=yes
 AC_ARG_WITH([win32-curl], [AC_HELP_STRING([--with-win32-curl=PATH],

Modified: couchdb/trunk/src/couchdb/priv/Makefile.am
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/priv/Makefile.am?rev=1133287&r1=1133286&r2=1133287&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/priv/Makefile.am (original)
+++ couchdb/trunk/src/couchdb/priv/Makefile.am Wed Jun  8 08:44:13 2011
@@ -20,18 +20,11 @@ EXTRA_DIST = \
 
 CLEANFILES = stat_descriptions.cfg
 
-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
-
 couchprivlib_LTLIBRARIES = couch_icu_driver.la
 couch_icu_driver_la_SOURCES = icu_driver/couch_icu_driver.c
 couch_icu_driver_la_LDFLAGS = -module -avoid-version
-couch_icu_driver_la_CFLAGS = $(ICU_LOCAL_FLAGS) $(ERLANG_FLAGS)
-couch_icu_driver_la_LIBADD = $(ICU_LOCAL_LIBS)
+couch_icu_driver_la_CFLAGS = $(ICU_CFLAGS) $(ERLANG_FLAGS)
+couch_icu_driver_la_LIBADD = $(ICU_LIBS)
 
 if WINDOWS
 couch_icu_driver_la_LDFLAGS += -no-undefined
@@ -78,9 +71,9 @@ install-data-hook:
 	        $(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) $(ICU_BIN)/icuuc42.dll $(bindir)
+	$(INSTALL) $(ICU_BIN)/icudt42.dll $(bindir)
+	$(INSTALL) $(ICU_BIN)/icuin42.dll $(bindir)
 	$(INSTALL) $(JS_LIB_BINARY) $(bindir)
 	$(INSTALL) .libs/couchspawnkillable.exe \
 		"$(DESTDIR)$(couchprivdir)/couchspawnkillable.exe"

Modified: couchdb/trunk/src/couchdb/priv/icu_driver/couch_icu_driver.c
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/priv/icu_driver/couch_icu_driver.c?rev=1133287&r1=1133286&r2=1133287&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/priv/icu_driver/couch_icu_driver.c (original)
+++ couchdb/trunk/src/couchdb/priv/icu_driver/couch_icu_driver.c Wed Jun  8 08:44:13 2011
@@ -13,9 +13,10 @@ specific language governing permissions 
 
 */
 
-// This file is the C port driver for Erlang. It provides a low overhead
-// means of calling into C code, however coding errors in this module can
-// crash the entire Erlang server.
+/* This file is the C port driver for Erlang. It provides a low overhead
+ * means of calling into C code, however coding errors in this module can
+ * crash the entire Erlang server.
+ */
 
 #ifdef DARWIN
 #define U_HIDE_DRAFT_API 1
@@ -26,7 +27,7 @@ specific language governing permissions 
 #include "unicode/ucol.h"
 #include "unicode/ucasemap.h"
 #ifndef WIN32
-#include <string.h> // for memcpy
+#include <string.h> /* for memcpy */
 #endif
 
 typedef struct {
@@ -96,8 +97,8 @@ static int couch_drv_control(ErlDrvData 
 
     couch_drv_data* pData = (couch_drv_data*)drv_data;
     switch(command) {
-    case 0: // COLLATE
-    case 1: // COLLATE_NO_CASE:
+    case 0: /* COLLATE */
+    case 1: /* COLLATE_NO_CASE: */
         {
         UErrorCode status = U_ZERO_ERROR;
         int collResult;
@@ -106,37 +107,38 @@ static int couch_drv_control(ErlDrvData 
         UCharIterator iterB;
         int32_t length;
 
-        // 2 strings are in the buffer, consecutively
-        // The strings begin first with a 32 bit integer byte length, then the actual
-        // string bytes follow.
+        /* 2 strings are in the buffer, consecutively
+         * The strings begin first with a 32 bit integer byte length, then the actual
+         * string bytes follow.
+         */
 
-        // first 32bits are the length
+        /* first 32bits are the length */
         memcpy(&length, pBuf, sizeof(length));
         pBuf += sizeof(length);
 
-        // point the iterator at it.
+        /* point the iterator at it. */
         uiter_setUTF8(&iterA, pBuf, length);
 
-        pBuf += length; // now on to string b
+        pBuf += length; /* now on to string b */
 
-        // first 32bits are the length
+        /* first 32bits are the length */
         memcpy(&length, pBuf, sizeof(length));
         pBuf += sizeof(length);
 
-        // point the iterator at it.
+        /* point the iterator at it. */
         uiter_setUTF8(&iterB, pBuf, length);
 
-        if (command == 0) // COLLATE
+        if (command == 0) /* COLLATE */
           collResult = ucol_strcollIter(pData->coll, &iterA, &iterB, &status);
-        else              // COLLATE_NO_CASE
+        else              /* COLLATE_NO_CASE */
           collResult = ucol_strcollIter(pData->collNoCase, &iterA, &iterB, &status);
 
         if (collResult < 0)
-          response = 0; //lt
+          response = 0; /*lt*/
         else if (collResult > 0)
-          response = 2; //gt
+          response = 2; /*gt*/
         else
-          response = 1; //eq
+          response = 1; /*eq*/
 
         return return_control_result(&response, sizeof(response), rbuf, rlen);
         }



Mime
View raw message