diff options
author | Emmanuel Dreyfus <manu@netbsd.org> | 2012-05-16 06:36:19 +0200 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-05-18 19:17:58 -0700 |
commit | c023c1517a0b8adb3c24ddc6dfa30e4242076ee8 (patch) | |
tree | 955520600f45f030777b058ec81c1443340a6609 /configure.ac | |
parent | b71d314482d572f7e54a306bb566f0f8883b2ce8 (diff) |
Provide missing basename_r and dirname_r
Some systems (e.g.: NetBSD) do not have thread-safe basename(3) and
dirname(3). This is fine with OpenGroup's Single Unix Specification
which allows these functions to use static storage. Unfortunately,
glusterfs uses them a lot and assume thread-safety.
This patch brings FreeBSD's thread-safe basename_r(3) and dirname_r(3)
in the contrib directory, and tweaks the build process so that
NetBSD builds use them instead of libc basename(3) and dirname(3)
BUG: 764655
Change-Id: Ic9a159fffdc7bacc9408f8e90854e4c2db81930c
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.com/3320
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 36e9f08f342..f8f270b9fd4 100644 --- a/configure.ac +++ b/configure.ac @@ -474,6 +474,8 @@ case $host_os in *netbsd*) GF_HOST_OS="GF_BSD_HOST_OS" GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -D_INCOMPLETE_XOPEN_C063" + GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_BASENAME" + GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_DIRNAME" GF_GLUSTERFS_CFLAGS="${GF_CFLAGS}" GF_LDADD="${ARGP_STANDALONE_LDADD}" if test "x$ac_cv_header_execinfo_h" = "xyes"; then @@ -486,6 +488,8 @@ case $host_os in *bsd*) GF_HOST_OS="GF_BSD_HOST_OS" GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -O0" + GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_BASENAME" + GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_DIRNAME" GF_GLUSTERFS_CFLAGS="${GF_CFLAGS}" GF_LDADD="${ARGP_STANDALONE_LDADD}" if test "x$ac_cv_header_execinfo_h" = "xyes"; then @@ -497,6 +501,8 @@ case $host_os in GF_HOST_OS="GF_DARWIN_HOST_OS" LIBTOOL=glibtool GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -D__DARWIN_64_BIT_INO_T -bundle -undefined suppress -flat_namespace -D_XOPEN_SOURCE -O0" + GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_BASENAME" + GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_DIRNAME" GF_GLUSTERFS_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -D__DARWIN_64_BIT_INO_T -undefined suppress -flat_namespace -O0" GF_LDADD="${ARGP_STANDALONE_LDADD}" GF_FUSE_CFLAGS="-I\$(CONTRIBDIR)/macfuse" |