diff --git a/common.mk b/common.mk
index c1a5e6c66e45ab8e67aedd9b01c350bca55704db..20b96bd4a1fb3e2ce4fd06eab69cb75470d13649 100644
--- a/common.mk
+++ b/common.mk
@@ -2,7 +2,8 @@
 # common flags used in openocd build
 AM_CPPFLAGS = -I$(top_srcdir)/src \
 			  -I$(top_builddir)/src \
-			  -DPKGDATADIR=\"$(pkgdatadir)\"
+			  -DPKGDATADIR=\"$(pkgdatadir)\" \
+			  -DPKGLIBDIR=\"$(pkglibdir)\"
 
 if INTERNAL_JIMTCL
 AM_CPPFLAGS += -I$(top_srcdir)/jimtcl \