Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 1 | Author: Luca Boccassi <luca.boccassi@microsoft.com> |
| 2 | Description: Automake: use EXTRA_LTLIBRARIES instead of noinst_LTLIBRARIES |
| 3 | noinst_LTLIBRARIES causes the libraries to be always built |
| 4 | unconditionally. EXTRA_LTLIBRARIES causes them to be built |
| 5 | only if other build target needs them. |
| 6 | In other words, avoid building libcommon.a and libtcolors.a |
| 7 | unless they are needed by another library/executable and |
| 8 | save some build time. |
| 9 | Upstream-Status: backport, commit:c65953d72bbc7412f32e566d9fa6e780d84f0696 |
| 10 | --- a/Makefile.am |
| 11 | +++ b/Makefile.am |
| 12 | @@ -39,7 +39,7 @@ bashcompletiondir = @bashcompletiondir@ |
| 13 | |
| 14 | dist_noinst_HEADERS = |
| 15 | noinst_PROGRAMS = |
| 16 | -noinst_LTLIBRARIES = |
| 17 | +EXTRA_LTLIBRARIES = |
| 18 | usrbin_exec_PROGRAMS = |
| 19 | usrsbin_exec_PROGRAMS = |
| 20 | dist_man_MANS = |
| 21 | @@ -169,7 +169,7 @@ else |
| 22 | edit_cmd += -e 's|@vendordir[@]||g' |
| 23 | endif |
| 24 | |
| 25 | -CLEANFILES += $(PATHFILES) |
| 26 | +CLEANFILES += $(PATHFILES) $(EXTRA_LTLIBRARIES) |
| 27 | EXTRA_DIST += $(PATHFILES:=.in) |
| 28 | |
| 29 | $(PATHFILES): Makefile |
| 30 | --- a/lib/Makemodule.am |
| 31 | +++ b/lib/Makemodule.am |
| 32 | @@ -9,7 +9,7 @@ |
| 33 | # Note that you need "make install-strip" (or proper rpm / Debian build) |
| 34 | # to generate binaries with only relevant stuff. |
| 35 | # |
| 36 | -noinst_LTLIBRARIES += libcommon.la |
| 37 | +EXTRA_LTLIBRARIES += libcommon.la |
| 38 | libcommon_la_CFLAGS = $(AM_CFLAGS) |
| 39 | libcommon_la_SOURCES = \ |
| 40 | lib/blkdev.c \ |
| 41 | @@ -59,7 +59,7 @@ libcommon_la_SOURCES += lib/sysfs.c |
| 42 | endif |
| 43 | endif |
| 44 | |
| 45 | -noinst_LTLIBRARIES += libtcolors.la |
| 46 | +EXTRA_LTLIBRARIES += libtcolors.la |
| 47 | libtcolors_la_CFLAGS = $(AM_CFLAGS) |
| 48 | libtcolors_la_SOURCES = lib/colors.c lib/color-names.c include/colors.h include/color-names.h |
| 49 | libtcolors_la_LIBADD = |