--- configure
+++ configure
@@ -3093,6 +3093,24 @@
 
 
 
+cppflags_to_add="-D_REENTRANT -D_GNU_SOURCE"
+if test "x$CPPFLAGS" = "x"; then
+	CPPFLAGS="$cppflags_to_add"
+else
+	for i in $cppflags_to_add; do
+		flag_found="0"
+		for j in $CPPFLAGS; do
+			if test "x$i" = "x$j"; then
+				flag_found="1"
+				break
+			fi
+		done
+		if test "$flag_found" = "0"; then
+			CPPFLAGS="$CPPFLAGS $i"
+		fi
+	done
+fi
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
--- sqlite3.pc.in
+++ sqlite3.pc.in
@@ -8,6 +8,5 @@
 Name: SQLite
 Description: SQL database engine
 Version: @PACKAGE_VERSION@
-Libs: -L${libdir} -lsqlite3
-Libs.private: @LIBS@
-Cflags: -I${includedir}
+Libs: -L${libdir} @LIBS@ -lsqlite3
+Cflags: -I${includedir} -D_REENTRANT -D_GNU_SOURCE
