Use ICU_CPPFLAGS instead of _CFLAGS This removes the need for c4f6ff9c6cf5512546d5799f05dd445a4da979b3 which was made in response to -ansi coming from icu-config on my system. Instead, it's more sensible to use the preprocessor flags from icu-config which provides the -I header locations and -D definitions but doesn't add a bunch of excessive warning flags or ansi conformance.
This reverts commit c4f6ff9c6cf5512546d5799f05dd445a4da979b3. Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/32fb9f8e Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/32fb9f8e Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/32fb9f8e Branch: refs/heads/COUCHDB-1342 Commit: 32fb9f8e0416910a2431227b5fbdeef93ccd94bc Parents: 3f2537f Author: Randall Leeds <rand...@apache.org> Authored: Tue Jan 3 14:14:55 2012 -0500 Committer: Randall Leeds <rand...@apache.org> Committed: Tue Jan 3 14:44:47 2012 -0500 ---------------------------------------------------------------------- configure.ac | 3 ++- src/couchdb/priv/Makefile.am | 4 ++-- src/couchdb/priv/icu_driver/couch_icu_driver.c | 8 ++------ 3 files changed, 6 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/32fb9f8e/configure.ac ---------------------------------------------------------------------- diff --git a/configure.ac b/configure.ac index 5eb2e69..646b8a8 100644 --- a/configure.ac +++ b/configure.ac @@ -323,7 +323,7 @@ CPPFLAGS="$OLD_CPPFLAGS" AC_ARG_WITH([win32-icu-binaries], [AC_HELP_STRING([--with-win32-icu-binaries=PATH], [set PATH to the Win32 native ICU binaries directory])], [ - ICU_CFLAGS="-I$withval/include" + ICU_CPPFLAGS="-I$withval/include" ICU_LIBS="-L$withval/lib -licuuc -licudt -licuin" ICU_BIN=$withval/bin ], [ @@ -336,6 +336,7 @@ AC_ARG_WITH([win32-icu-binaries], [AC_HELP_STRING([--with-win32-icu-binaries=PAT ]) AC_SUBST(ICU_CFLAGS) +AC_SUBST(ICU_CPPFLAGS) AC_SUBST(ICU_LIBS) AC_SUBST(ICU_BIN) http://git-wip-us.apache.org/repos/asf/couchdb/blob/32fb9f8e/src/couchdb/priv/Makefile.am ---------------------------------------------------------------------- diff --git a/src/couchdb/priv/Makefile.am b/src/couchdb/priv/Makefile.am index 1080b01..02f7a7f 100644 --- a/src/couchdb/priv/Makefile.am +++ b/src/couchdb/priv/Makefile.am @@ -32,7 +32,7 @@ couchprivlib_LTLIBRARIES = couch_icu_driver.la if USE_EJSON_COMPARE_NIF couchprivlib_LTLIBRARIES += couch_ejson_compare.la couch_ejson_compare_la_SOURCES = couch_ejson_compare/couch_ejson_compare.c -couch_ejson_compare_la_CFLAGS = -D_BSD_SOURCE $(ICU_CFLAGS) $(ERLANG_FLAGS) +couch_ejson_compare_la_CPPFLAGS = -D_BSD_SOURCE $(ICU_CPPFLAGS) $(ERLANG_FLAGS) couch_ejson_compare_la_LDFLAGS = -module -avoid-version couch_ejson_compare_la_LIBADD = $(ICU_LIBS) if WINDOWS @@ -41,7 +41,7 @@ endif endif 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_CFLAGS) $(ERLANG_FLAGS) +couch_icu_driver_la_CPPFLAGS = $(ICU_CPPFLAGS) $(ERLANG_FLAGS) couch_icu_driver_la_LIBADD = $(ICU_LIBS) if WINDOWS http://git-wip-us.apache.org/repos/asf/couchdb/blob/32fb9f8e/src/couchdb/priv/icu_driver/couch_icu_driver.c ---------------------------------------------------------------------- diff --git a/src/couchdb/priv/icu_driver/couch_icu_driver.c b/src/couchdb/priv/icu_driver/couch_icu_driver.c index c627fca..edfd84a 100644 --- a/src/couchdb/priv/icu_driver/couch_icu_driver.c +++ b/src/couchdb/priv/icu_driver/couch_icu_driver.c @@ -30,10 +30,6 @@ specific language governing permissions and limitations under the License. #include <string.h> /* for memcpy */ #endif -#define DRIVER_NAME "couch_icu_driver" - -DRIVER_INIT(DRIVER_NAME); /* prototype for erl_driver entry point */ - typedef struct { ErlDrvPort port; UCollator* collNoCase; @@ -159,7 +155,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 */ - (char*)DRIVER_NAME, /* 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 */ @@ -177,7 +173,7 @@ ErlDrvEntry couch_driver_entry = { NULL, /* F_PTR process_exit */ }; -DRIVER_INIT(DRIVER_NAME) /* must match name in driver_entry */ +DRIVER_INIT(couch_icu_driver) /* must match name in driver_entry */ { return &couch_driver_entry; }