Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | Upstream-Status: Pending |
| 2 | |
| 3 | Add pkgconfig support to pth. |
| 4 | |
| 5 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> |
| 6 | |
| 7 | Index: Makefile.in |
| 8 | =========================================================== |
| 9 | --- a/Makefile.in |
| 10 | +++ b/Makefile.in |
| 11 | @@ -47,6 +47,9 @@ datadir = @datadir@ |
| 12 | |
| 13 | DESTDIR = |
| 14 | |
| 15 | +pkgconfigdir = ${libdir}/pkgconfig |
| 16 | +pkgconfig_DATA = pth.pc |
| 17 | + |
| 18 | ## |
| 19 | ## ____ TOOL DEFINITIONS ___________________________________________ |
| 20 | ## |
| 21 | @@ -216,7 +219,7 @@ test_pthread: test_pthread.o test_common.o libpthread.la |
| 22 | |
| 23 | # install the package |
| 24 | install: all-for-install |
| 25 | - @$(MAKE) $(MKFLAGS) install-dirs install-pth @INSTALL_PTHREAD@ |
| 26 | + @$(MAKE) $(MKFLAGS) install-dirs install-pth @INSTALL_PTHREAD@ install-pkgconfigDATA |
| 27 | @touch .done-install >/dev/null 2>&1 || $(TRUE) |
| 28 | @$(MAKE) $(MKFLAGS) what-next |
| 29 | install-dirs: |
| 30 | @@ -227,6 +230,7 @@ install-dirs: |
| 31 | $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man1 |
| 32 | $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man3 |
| 33 | $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(datadir)/aclocal |
| 34 | + $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(pkgconfigdir) |
| 35 | install-pth: |
| 36 | $(SHTOOL) install -c -m 755 pth-config $(DESTDIR)$(bindir)/pth-config |
| 37 | $(SHTOOL) install -c -m 644 $(S)pth-config.1 $(DESTDIR)$(mandir)/man1/pth-config.1 |
| 38 | @@ -242,12 +246,16 @@ install-pthread: |
| 39 | $(SHTOOL) install -c -m 644 $(S)pthread.3 $(DESTDIR)$(mandir)/man3/pthread.3 |
| 40 | @umask 022; $(LIBTOOL) --mode=install \ |
| 41 | $(SHTOOL) install -c libpthread.la $(DESTDIR)$(libdir)/libpthread.la |
| 42 | +install-pkgconfigDATA: $(pkgconfig_DATA) |
| 43 | + $(SHTOOL) install -c -m 644 $(pkgconfig_DATA) $(DESTDIR)$(pkgconfigdir)/$(pkgconfig_DATA) |
| 44 | |
| 45 | # uninstall the package |
| 46 | uninstall: |
| 47 | - @$(MAKE) $(MKFLAGS) @UNINSTALL_PTHREAD@ uninstall-pth uninstall-dirs |
| 48 | + @$(MAKE) $(MKFLAGS) uninstall-pkgconfigDATA @UNINSTALL_PTHREAD@ uninstall-pth uninstall-dirs |
| 49 | @touch .done-uninstall >/dev/null 2>&1 || $(TRUE) |
| 50 | @$(MAKE) $(MKFLAGS) what-next |
| 51 | +uninstall-pkgconfigDATA: |
| 52 | + $(RM) $(DESTDIR)$(pkgconfigdir)/$(pkgconfig_DATA) |
| 53 | uninstall-pthread: |
| 54 | $(RM) $(DESTDIR)$(bindir)/pthread-config |
| 55 | $(RM) $(DESTDIR)$(mandir)/man1/pthread-config.1 |
| 56 | @@ -271,6 +279,7 @@ uninstall-dirs: |
| 57 | -$(RMDIR) $(DESTDIR)$(includedir) >/dev/null 2>&1 || $(TRUE) |
| 58 | -$(RMDIR) $(DESTDIR)$(bindir) >/dev/null 2>&1 || $(TRUE) |
| 59 | -$(RMDIR) $(DESTDIR)$(prefix) >/dev/null 2>&1 || $(TRUE) |
| 60 | + -$(RMDIR) $(DESTDIR)$(pkgconfigdir) > /dev/null 2>&1 ||$(TRUE) |
| 61 | |
| 62 | # strip down the source tree to its minimum |
| 63 | striptease: |
| 64 | Index: configure.ac |
| 65 | =========================================================== |
| 66 | --- a/configure.ac |
| 67 | +++ b/configure.ac |
| 68 | @@ -656,6 +656,13 @@ pth_acmac.h dnl |
| 69 | chmod +rx pthread-config |
| 70 | chmod +rx pth-config |
| 71 | )dnl |
| 72 | + |
| 73 | +PTH_VERSION=`echo $PTH_VERSION_STR | cut -d' ' -f1` |
| 74 | +AC_SUBST(PTH_VERSION) |
| 75 | + |
| 76 | +AC_CONFIG_FILES([pth.pc]) |
| 77 | +AC_OUTPUT |
| 78 | + |
| 79 | if test ".$enable_pthread" = .no; then |
| 80 | rm -f pthread-config |
| 81 | rm -f pthread.h |
| 82 | Index: pth.pc.in |
| 83 | =========================================================== |
| 84 | --- /dev/null |
| 85 | +++ b/pth.pc.in |
| 86 | @@ -0,0 +1,16 @@ |
| 87 | +prefix=@prefix@ |
| 88 | +exec_prefix=@exec_prefix@ |
| 89 | +libdir=@libdir@ |
| 90 | +includedir=@includedir@ |
| 91 | +bindir=@bindir@ |
| 92 | +mandir=@mandir@ |
| 93 | +datadir=@datadir@ |
| 94 | +acdir=@datadir@/aclocal |
| 95 | + |
| 96 | +Name: pth |
| 97 | +Description: GNU Portable Threads |
| 98 | +Requires: |
| 99 | +Version: @PTH_VERSION@ |
| 100 | +Libs: -L${libdir} -lpth |
| 101 | +Libs.private: |
| 102 | +Cflags: -I${includedir} |
| 103 | -- |
| 104 | 1.7.5.4 |
| 105 | |