Provide pkg-config (.pc) scripts

This allows a project to use PKG_CHECK_MODULES() in its configure.ac
file to easily check for the presence of libjpeg-turbo and modify the
compiler/linker flags accordingly.  Note that if a project relies solely
on pkg-config to check for libjpeg-turbo, then it will not be possible
to build that project using libjpeg or an earlier version of
libjpeg-turbo.

Closes #53

Based on:
https://github.com/cberner/libjpeg-turbo/commit/496713871939b550d00005b4042420da41641a0a
diff --git a/ChangeLog.txt b/ChangeLog.txt
index cb59c2e..a0e39d1 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -79,6 +79,11 @@
 implementation.)  This speeds up the overall 64-bit compression performance by
 about 2x on ARMv8 processors.
 
+[15] pkg-config (.pc) scripts are now included for both the libjpeg and
+TurboJPEG API libraries on Un*x systems.  Note that if a project's build system
+relies on these scripts, then it will not be possible to build that project
+with libjpeg or with a prior version of libjpeg-turbo.
+
 
 1.4.2
 =====
diff --git a/Makefile.am b/Makefile.am
index e70ae69..16b8421 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,6 +10,8 @@
 
 nodist_include_HEADERS = jconfig.h
 
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = pkgscripts/libjpeg.pc pkgscripts/libturbojpeg.pc
 
 HDRS = jchuff.h jdct.h jdhuff.h jerror.h jinclude.h jmemsys.h jmorecfg.h \
 	jpegint.h jpeglib.h jversion.h jsimd.h jsimddct.h jpegcomp.h \
diff --git a/configure.ac b/configure.ac
index 97ed115..6be99fe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,6 +25,8 @@
   [BUILD="$with_build_date"],
   [BUILD=`date +%Y%m%d`])
 
+PKG_PROG_PKG_CONFIG
+
 # When the prefix is /opt/libjpeg-turbo, we assume that an "official" binary is
 # being created, and thus we install things into specific locations.
 
@@ -576,6 +578,8 @@
 AC_CONFIG_FILES([pkgscripts/makedpkg.tmpl:release/makedpkg.in])
 AC_CONFIG_FILES([pkgscripts/makemacpkg.tmpl:release/makemacpkg.in])
 AC_CONFIG_FILES([pkgscripts/uninstall.tmpl:release/uninstall.in])
+AC_CONFIG_FILES([pkgscripts/libjpeg.pc:release/libjpeg.pc.in])
+AC_CONFIG_FILES([pkgscripts/libturbojpeg.pc:release/libturbojpeg.pc.in])
 if test "x$with_turbojpeg" != "xno"; then
   AC_CONFIG_FILES([tjbenchtest])
 fi
diff --git a/release/libjpeg-turbo.spec.in b/release/libjpeg-turbo.spec.in
index 03d75d1..3e0dfa2 100644
--- a/release/libjpeg-turbo.spec.in
+++ b/release/libjpeg-turbo.spec.in
@@ -124,10 +124,12 @@
 %{_libdir}/libjpeg.so.@SO_MAJOR_VERSION@
 %{_libdir}/libjpeg.so
 %{_libdir}/libjpeg.a
+%{_libdir}/pkgconfig/libjpeg.pc
 %{_libdir}/libturbojpeg.so.0.1.0
 %{_libdir}/libturbojpeg.so.0
 %{_libdir}/libturbojpeg.so
 %{_libdir}/libturbojpeg.a
+%{_libdir}/pkgconfig/libturbojpeg.pc
 %dir %{_includedir}
 %{_includedir}/jconfig.h
 %{_includedir}/jerror.h
diff --git a/release/libjpeg.pc.in b/release/libjpeg.pc.in
new file mode 100644
index 0000000..40795f7
--- /dev/null
+++ b/release/libjpeg.pc.in
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libjpeg
+Description: A SIMD-accelerated JPEG codec that provides the libjpeg API
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -ljpeg
+Cflags: -I${includedir}
diff --git a/release/libturbojpeg.pc.in b/release/libturbojpeg.pc.in
new file mode 100644
index 0000000..7d4b656
--- /dev/null
+++ b/release/libturbojpeg.pc.in
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libturbojpeg
+Description: A SIMD-accelerated JPEG codec that provides the TurboJPEG API
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lturbojpeg
+Cflags: -I${includedir}