lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Best way to integrate PCRE


From: Greg Chicares
Subject: Re: [lmi] Best way to integrate PCRE
Date: Thu, 30 Sep 2021 01:38:12 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 9/28/21 8:09 PM, Greg Chicares wrote:
[...]
> The root cause seems to be here, in 'workhorse.make':
> 
>   # The link command promiscuously mentions libxml2 for all targets.
>   # Measurements show that this costs one-tenth of a second on
>   # reasonable hardware, and it saves the trouble of maintaining a list
>   # of which targets require which libraries.
>   #
>   # TODO ?? Consider refining it anyway, because it's unclean: libxml2
>   # isn't actually required for all targets.
>   
>   REQUIRED_LIBS := \
>     $(xml_libraries) \
> so maybe it's time to resolve that defect once and for all.

Below is a rough patch that I think will resolve this appropriately.

Obviously this part:
  -REQUIRED_LIBS := \
  +UN_REQUIRED_LIBS := \
     $(xml_libraries) \
should be removed, and the associated comments revised or removed.

In 'workhorse.make', the changes are mostly like this:
  +liblmi.a liblmi$(SHREXT): REQUIRED_LIBS := $(xml_libraries)
   liblmi.a liblmi$(SHREXT): EXTRA_LDFLAGS :=
where ":=" seems appropriate. In included file 'objects.make',
":=" won't do, and "+=" is needed, though I don't know why; maybe
tomorrow I'll try plain "=" in both files and see if that works.

Some disused targets (not exercised by 'nychthemeral_test.sh')
aren't modified in this patch; they could either be modified for
concinnity, or expunged for simplicity.

Any comments?

--8<----8<----8<----8<----8<----8<----8<----8<----8<--
diff --git a/objects.make b/objects.make
index 6f5bd85d9..1b4f0f8b4 100644
--- a/objects.make
+++ b/objects.make
@@ -487,6 +487,7 @@ account_value_test$(EXEEXT): \
   $(common_test_objects) \
   account_value_test.o \
 
+actuarial_table_test$(EXEEXT): REQUIRED_LIBS += $(xml_libraries)
 actuarial_table_test$(EXEEXT): \
   $(common_test_objects) \
   actuarial_table.o \
@@ -561,6 +562,7 @@ commutation_functions_test$(EXEEXT): \
   cso_table.o \
   timer.o \
 
+configurable_settings_test$(EXEEXT): REQUIRED_LIBS += $(xml_libraries)
 configurable_settings_test$(EXEEXT): \
   $(common_test_objects) \
   calendar_date.o \
@@ -691,6 +693,7 @@ input_sequence_test$(EXEEXT): \
   null_stream.o \
   path_utility.o \
 
+input_test$(EXEEXT): REQUIRED_LIBS += $(xml_libraries)
 input_test$(EXEEXT): \
   $(common_test_objects) \
   calendar_date.o \
@@ -751,6 +754,7 @@ irc7702_tables_test$(EXEEXT): \
   null_stream.o \
   path_utility.o \
 
+irc7702a_test$(EXEEXT): REQUIRED_LIBS += $(xml_libraries)
 irc7702a_test$(EXEEXT): \
   $(common_test_objects) \
   calendar_date.o \
@@ -769,6 +773,7 @@ istream_to_string_test$(EXEEXT): \
   istream_to_string_test.o \
   timer.o \
 
+ledger_test$(EXEEXT): REQUIRED_LIBS += $(xml_libraries)
 ledger_test$(EXEEXT): \
   $(common_test_objects) \
   calendar_date.o \
@@ -888,6 +893,7 @@ path_utility_test$(EXEEXT): \
   path_utility_test.o \
   wine_workarounds.o \
 
+premium_tax_test$(EXEEXT): REQUIRED_LIBS += $(xml_libraries)
 premium_tax_test$(EXEEXT): \
   $(common_test_objects) \
   calendar_date.o \
@@ -923,6 +929,7 @@ print_matrix_test$(EXEEXT): \
   path_utility.o \
   print_matrix_test.o \
 
+product_file_test$(EXEEXT): REQUIRED_LIBS += $(xml_libraries)
 product_file_test$(EXEEXT): \
   $(common_test_objects) \
   calendar_date.o \
@@ -1067,6 +1074,7 @@ wx_new_test$(EXEEXT): \
   $(common_test_objects) \
   wx_new_test.o \
 
+xml_serialize_test$(EXEEXT): REQUIRED_LIBS += $(xml_libraries)
 xml_serialize_test$(EXEEXT): \
   $(common_test_objects) \
   calendar_date.o \
@@ -1190,6 +1198,7 @@ bcc_rc$(EXEEXT): \
 # variable definitions here. If that works well, use the technique
 # elsewhere.
 
+product_files$(EXEEXT): REQUIRED_LIBS += $(xml_libraries)
 product_files$(EXEEXT): \
   alert_cli.o \
   generate_product_files.o \
diff --git a/workhorse.make b/workhorse.make
index 6df7c6ee6..31f481f02 100644
--- a/workhorse.make
+++ b/workhorse.make
@@ -764,7 +764,7 @@ $(product_file_sources): tutelary_flag += 
$(product_file_flags)
 # in this faq:
 #   http://boost.org/more/faq.htm
 
-REQUIRED_LIBS := \
+UN_REQUIRED_LIBS := \
   $(xml_libraries) \
 
 wx_ldflags = \
@@ -1001,8 +1001,11 @@ wx_new$(SHREXT)     : EXTRA_LDFLAGS :=
                       lmi_wx_new_so_attributes := -DLMI_WX_NEW_USE_SO
 wx_new$(SHREXT)     : lmi_wx_new_so_attributes := -DLMI_WX_NEW_BUILD_SO
 
+liblmi.a liblmi$(SHREXT): REQUIRED_LIBS := $(xml_libraries)
 liblmi.a liblmi$(SHREXT): EXTRA_LDFLAGS :=
 liblmi.a liblmi$(SHREXT): $(lmi_common_objects)
+
+libantediluvian.a libantediluvian$(SHREXT): REQUIRED_LIBS := $(xml_libraries)
 libantediluvian.a libantediluvian$(SHREXT): $(antediluvian_common_objects)
 
 # TODO ?? 'lmi*' targets can be built either with a shared or a static
@@ -1016,6 +1019,7 @@ lmi_wx_monolithic$(EXEEXT): $(lmi_wx_objects) 
$(lmi_common_objects) wx_new$(SHRE
 # source files that are unrelated to wx, and that are therefore not
 # part of $(skeleton_objects).
 skeleton$(SHREXT): lmi_so_attributes := -DLMI_USE_SO
+skeleton$(SHREXT): REQUIRED_LIBS := $(xml_libraries)
 skeleton$(SHREXT): EXTRA_LDFLAGS := $(wx_pdfdoc_ldflags) $(wx_ldflags)
 skeleton$(SHREXT): $(skeleton_objects) liblmi$(SHREXT) wx_new$(SHREXT)
 
@@ -1028,6 +1032,7 @@ lmi_wx_static$(EXEEXT): $(lmi_wx_objects) 
$(skeleton_objects) liblmi.a wx_new$(S
 
 lmi_cli_monolithic$(EXEEXT): $(cli_objects) $(lmi_common_objects)
 
+lmi_cli_shared$(EXEEXT): REQUIRED_LIBS := $(xml_libraries)
 lmi_cli_shared$(EXEEXT): lmi_so_attributes := -DLMI_USE_SO
 lmi_cli_shared$(EXEEXT): $(cli_objects) liblmi$(SHREXT)
 
@@ -1036,6 +1041,7 @@ lmi_cli_static$(EXEEXT): $(cli_objects) liblmi.a
 antediluvian_cgi$(EXEEXT): lmi_so_attributes := -DLMI_USE_SO
 antediluvian_cgi$(EXEEXT): $(cgi_objects) libantediluvian$(SHREXT)
 
+antediluvian_cli$(EXEEXT): REQUIRED_LIBS := $(xml_libraries)
 antediluvian_cli$(EXEEXT): lmi_so_attributes := -DLMI_USE_SO
 antediluvian_cli$(EXEEXT): $(cli_objects) libantediluvian$(SHREXT)
 
--8<----8<----8<----8<----8<----8<----8<----8<----8<--


reply via email to

[Prev in Thread] Current Thread [Next in Thread]