diff --git a/configure b/configure
index 8916c159..2df96379 100755
--- a/configure
+++ b/configure
@@ -3248,9 +3248,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
 case "$host_os" in
-  linux* ) CFLAGS="$CFLAGS -D_XOPEN_SOURCE=501" # unfortunate, but needed to
-                                                # pick up strdup() declaration
-                                                # in <string.h>
+  linux* ) CFLAGS="$CFLAGS -D_BSD_SOURCE"
   ;;
   solaris* ) CFLAGS="$CFLAGS -D__EXTENSIONS__"  # for strdup() from <string.h>
   ;;
diff --git a/configure.ac b/configure.ac
index 689e0975..c625078a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,9 +45,7 @@ AC_PROG_CPP
 # Checks for programs.
 AC_CANONICAL_HOST
 case "$host_os" in
-  linux* ) CFLAGS="$CFLAGS -D_XOPEN_SOURCE=501" # unfortunate, but needed to
-                                                # pick up strdup() declaration
-                                                # in <string.h>
+  linux* ) CFLAGS="$CFLAGS -D_BSD_SOURCE"
   ;;
   solaris* ) CFLAGS="$CFLAGS -D__EXTENSIONS__"  # for strdup() from <string.h>
   ;;
diff --git a/src/convert.c b/src/convert.c
index 8fad6e10..97510cea 100644
--- a/src/convert.c
+++ b/src/convert.c
@@ -33,6 +33,7 @@
  */
 
 #include <stdio.h>
+#include <string.h>
 #include <arpa/inet.h>
 #include <locale.h>
 #include <stringprep.h>