|
From: <ai...@us...> - 2019-07-10 00:28:25
|
Revision: 233
http://sourceforge.net/p/lasi/code/233
Author: airwin
Date: 2019-07-10 00:28:23 +0000 (Wed, 10 Jul 2019)
Log Message:
-----------
Omnibus commit concerning linking-related issues
The previous r230 commit entitled "Fix underlinking issue discovered
by Luigi Baldoni" was somewhat bogus because it solved that issue
(missing direct dependencies of libLASI on libgobject-2.0 and
glib-2.0) in an old-fashioned transitive linking way. Furthermore
that was only done for external executables and shared objects that
were linked to libLASi while Luigi's underlinking issue was quite
different (for the CMake-based build of libLASi itself). This commit
is a substantial update of that previous fix which includes the following changes:
* Add PREFER_EXTERNAL_STATIC option (see Section 2.2 in README.release for further details).
* Add NON_TRANSITIVE option (See Section 2.3 in README.release for further details).
* Implement the configured test_tarball.sh(.in) bash script (See Section 2.4 in README.release for further details).
* Really solve ALL cases of the underlinking issue (see README.release section 2.5 for further
details).
* Make the libLASi CMake-based build system pkg-config processing consistent with similar processing done for PLplot.
This change was implemented by making the pkg_check_pkgconfig macro
be consistent with the PLplot version of that macro and by replacing
the pkg_config_link_flags macro with the PLplot function of the same
name.
Modified Paths:
--------------
trunk/CMakeLists.txt
trunk/README.Release_Manager_Cookbook
trunk/README.release
trunk/cmake/modules/lasi.cmake
trunk/cmake/modules/pkg-config.cmake
trunk/examples/CMakeLists.txt
trunk/lasi.pc.in
trunk/src/CMakeLists.txt
Added Paths:
-----------
trunk/test_tarball.sh.in
Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt 2019-07-10 00:03:58 UTC (rev 232)
+++ trunk/CMakeLists.txt 2019-07-10 00:28:23 UTC (rev 233)
@@ -63,11 +63,24 @@
${CMAKE_CURRENT_BINARY_DIR}/config.h
)
+if(NON_TRANSITIVE)
+ set(PC_REQUIRES_LINE "Requires.private: pangoft2,pango,freetype2,gobject-2.0,glib-2.0")
+else(NON_TRANSITIVE)
+ set(PC_REQUIRES_LINE "Requires: pangoft2,pango,freetype2,gobject-2.0,glib-2.0")
+endif(NON_TRANSITIVE)
+
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/lasi.pc.in
${CMAKE_CURRENT_BINARY_DIR}/lasi.pc
+@ONLY
)
+configure_file(
+${CMAKE_CURRENT_SOURCE_DIR}/test_tarball.sh.in
+${CMAKE_CURRENT_BINARY_DIR}/test_tarball.sh
+@ONLY
+)
+
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/lasi.pc
DESTINATION ${PKG_CONFIG_DIR}
Modified: trunk/README.Release_Manager_Cookbook
===================================================================
--- trunk/README.Release_Manager_Cookbook 2019-07-10 00:03:58 UTC (rev 232)
+++ trunk/README.Release_Manager_Cookbook 2019-07-10 00:28:23 UTC (rev 233)
@@ -19,50 +19,28 @@
(1) Create and test a preliminary tarball from trunk
- This (extensive testing) is just to make sure that the trunk version
+ This (extensive sets of tests) is just to make sure that the trunk version
is in good shape before you do the following final stages of the
release process.
- Do the test in (3) below. Also, build and install a shared version of LibLASi
- and a static version of LIBLASi and test each of those
- with the following PLplot comprehensive test:
+ Do the tests in (3) below using the old lasi version (since that version
+ has not been updated yet).
-time (nice -19 env CMAKE_PREFIX_PATH=/home/software/lua/install-5.3.5:/home/software/lasi_svn/install PATH="/home/software/cmake/install-3.12.4/bin:$PATH" LD_LIBRARY_PATH=/home/software/lasi_svn/install/lib "$SOURCE_PREFIX"/scripts/comprehensive_test.sh --prefix "$COMPREHENSIVE_TEST_PREFIX" --cmake_added_options "-DUSE_INCRTCL_VERSION_4=ON -DDEFAULT_NO_DEVICES=ON -DPLD_psttfc=ON -DPLPLOT_TEST_DEVICE=psttfc" --build_command "make -j16" --ctest_command "ctest -j16" --do_test_interactive no)
+export LASI_VERSION=1.1.3
- where
+Also to save a factor of two in time just execute 4 tests (with the minimum cmake version choice)
+rather than all 8 versions of the test since this is just a preliminary test to give
+us some confidence that all is well at this stage.
-SOURCE_PREFIX="/home/software/plplot/HEAD/plplot blank .git"
-COMPREHENSIVE_TEST_PREFIX="/home/software/plplot/HEAD/comprehensive_test_disposeable blank"
-
- Furthermore, the CMAKE_PREFIX_PATH components are to help cmake
- find a local version of lua and to find the local installed
- version of libLASi (since the Debian versions of lua and libLASi
- have showstopping bugs); the PATH update is to use cmake and
- ctest version 3.12.4 (the minimum version of cmake accepted by
- PLplot); LD_LIBRARY_PATH must be set (for now) because PLplot
- rpath processing is currently not correct for a version of
- libLASi installed in a non-standard location;
- -DUSE_INCRTCL_VERSION_4=ON is to work around Tcl find issues,
- -DDEFAULT_NO_DEVICES=ON -DPLD_psttfc=ON is to limit all device
- testing to just -dev psttfc, and -DPLPLOT_TEST_DEVICE=psttfc is
- to use that device for difference testing.
-
- Evaluation of those comprehensives tests done as per
- doc/wiki_source/Testing_PLplot in the PLplot source tree should
- show perfect results. But if not (i.e., there is a regression in
- this regard), make the appropriate libLASi changes to fix the
- libLASi bugs causing those issues, and commit those bug fixes to
- the trunk version.
-
(2) Finish release-related trunk changes so they will be in the release
* set environment variable for version to make directions below
more generic.
-export LASI_VERSION=1.1.3
+export LASI_VERSION=1.1.4
# Should refer to first release in this release cycle, i.e., one after
# last release for the last release.
-export FIRST_REVISION_IN_CYCLE=r200
+export FIRST_REVISION_IN_CYCLE=r223
* Prepare a preliminary version of the ChangeLog file to see what
has been accomplished since the last release.
@@ -115,8 +93,10 @@
cd /home/software/lasi_svn/HEAD/build_dir
# In case this not set.
-LASI_VERSION= 1.1.3
-time (rm -rf /home/software/lasi_svn/HEAD/build_dir/* ~/lasi_svn/install; env PATH="/usr/bin:$PATH" cmake -DCMAKE_INSTALL_PREFIX=/home/software/lasi_svn/install -DBUILD_SHARED_LIBS=ON ../lasi_2019 >& cmake.out)
+LASI_VERSION=1.1.4
+# N.B. using the minimum version of cmake allowed by our build system.
+time (rm -rf /home/software/lasi_svn/HEAD/build_dir/* ~/lasi_svn/install; env PATH="/home/software/cmake/install-3.13.2/bin:$PATH" cmake -DCMAKE_INSTALL_PREFIX=/home/software/lasi_svn/install -DBUILD_SHARED_LIBS=ON -DNON_TRANSITIVE=ON ../lasi_2019 >& cmake.out)
+# BUILD to assure documentation is built with results copied to source tree.
make -j16 all >& all.out
Then build a preliminary version of the release tarball
@@ -127,82 +107,41 @@
tar ztvf libLASi-$LASI_VERSION.tar.gz |sed "s? *? ?g" |cut --delimiter=" " --fields="6-" |less
-* Unpack that tarball:
+* Test that tarball
-tar zxf libLASi-$LASI_VERSION.tar.gz
+# Setup the test by creating the following environment variables:
-* Test that tarball with shared build, install, and shared examples build
+export LASI_VERSION
+export PARALLEL_OPTION=-j16
-mkdir tarball_build_dir
-cd tarball_build_dir
-build_tree_dir=$(pwd)
-/usr/bin/cmake -DCMAKE_INSTALL_PREFIX=../tarball_install -DBUILD_SHARED_LIBS=ON ../libLASi-$LASI_VERSION >& cmake.out
-make -j16 >& make.out
-# Inspect EPS results. Note a white background has to be imposed because
-# these results have no background. So by default the background would be a checkerboard
-# imposed by pqiv if this --background-pattern option was not used.
+# PLplot-related environment variables:
+# N.B. if any one of these are not set, the script skips the special PLplot comprehensive test
+# that is designed to thoroughly test the PLplot psttf and psttfc devices and therefore libLASi
+# (since those devices depend on that library).
-# Inspect same results converted (with opaque white background added) to PNG format
-# by inkscape.
+# Use minimum allowed version of CMake for PLplot during special comprehensive test
+# of PLplot that externally tests libLASi.
+export PLPLOT_CMAKE_PATH=/home/software/cmake/install-3.13.2/bin
-for CORE_NAME in MissingGlyphExample SimpleLASiExample ComplexTextLayoutExample ; do
- pqiv -i --background-pattern=white examples/$CORE_NAME.eps
- pqiv -i examples/$CORE_NAME.png
-done
+# Choose this prefix to assure that the PLplot source tree has
+# a blank in its pathname. This combined with choosing a comprehensive test prefix
+# inside the script with a blank in the pathname assures that the case where there
+# are blanks in the source, build, and install tree prefixes is tested by this
+# comprehensive test.
+export PLPLOT_SOURCE_PREFIX="/home/software/plplot/HEAD/plplot blank .git"
-# ldd and valgrind tests of the examples including comparisons of the
-# results generated with the previous results. Note, that 2>&1
-# redirects stderr to *current" stdout (which defaults to pipe),
-# test.eps afterwards means PostScript output goes directly to that
-# file rather than stdout (so nothing more is emitted to stdout), and
-# >| test.eps afterwards means PostScript output goes to stdout (but
-# not stderr) and stdout then overwrites whatever was in test.eps
-# before.
+./test_tarball.sh /home/software/cmake/install-3.13.2/bin -DBUILD_SHARED_LIBS=ON -DNON_TRANSITIVE=ON
+./test_tarball.sh /home/software/cmake/install-3.13.2/bin -DBUILD_SHARED_LIBS=ON -DNON_TRANSITIVE=OFF
+./test_tarball.sh /home/software/cmake/install-3.13.2/bin -DBUILD_SHARED_LIBS=OFF -DPREFER_EXTERNAL_STATIC=OFF
+./test_tarball.sh /home/software/cmake/install-3.13.2/bin -DBUILD_SHARED_LIBS=OFF -DPREFER_EXTERNAL_STATIC=ON
+./test_tarball.sh /home/software/cmake/install-3.14.5/bin -DBUILD_SHARED_LIBS=ON -DNON_TRANSITIVE=ON
+./test_tarball.sh /home/software/cmake/install-3.14.5/bin -DBUILD_SHARED_LIBS=ON -DNON_TRANSITIVE=OFF
+./test_tarball.sh /home/software/cmake/install-3.14.5/bin -DBUILD_SHARED_LIBS=OFF -DPREFER_EXTERNAL_STATIC=OFF
+./test_tarball.sh /home/software/cmake/install-3.14.5/bin -DBUILD_SHARED_LIBS=OFF -DPREFER_EXTERNAL_STATIC=ON
-for CORE_NAME in MissingGlyphExample SimpleLASiExample ComplexTextLayoutExample ; do
- ldd -r examples/$CORE_NAME 2>&1 | less
- valgrind examples/$CORE_NAME 2>&1 test.eps | less
- cmp test.eps examples/$CORE_NAME.eps
- valgrind examples/$CORE_NAME 2>&1 >| test.eps | less
- cmp test.eps examples/$CORE_NAME.eps
-done
+# If any of these 8 tests reveal that trunk changes are necessary, do
+# those, retest, and iterate until perfect results are obtained.
-# Run ctest
-/usr/bin/ctest -j16 --output-log >| ctest.out
-# Compare ctest results with above make results.
-for CORE_NAME in MissingGlyphExample SimpleLASiExample ComplexTextLayoutExample ; do
- cmp examples/ctest_examples_output_dir/$CORE_NAME.eps examples/$CORE_NAME.eps
-done
-
-make -j16 install >& make_install.out
-cd ../tarball_install/share/lasi$LASI_VERSION/examples
-make -j16 >& make.out
-
-for CORE_NAME in MissingGlyphExample SimpleLASiExample ComplexTextLayoutExample ; do
- ldd -r $CORE_NAME 2>&1 | less
- cmp $CORE_NAME.eps $build_tree_dir/examples/$CORE_NAME.eps
- valgrind ./$CORE_NAME 2>&1 test.eps | less
- cmp test.eps $CORE_NAME.eps
- valgrind ./$CORE_NAME 2>&1 >| test.eps | less
- cmp test.eps $CORE_NAME.eps
-done
-
-# Return to core build tree and get rid of test results.
-cd $build_tree_dir/..
-rm -rf tarball_*
-
-* Test that tarball with static build, install, and static examples build
-
-# Repeat all the prior test steps (except for the cmake option
-# -DBUILD_SHARED_LIBS=ON replaced by -DBUILD_SHARED_LIBS=OFF) starting
-# with
-
-mkdir tarball_build_dir
-[...]
-
- If these shared and static tests reveal that trunk changes are
- necessary, do those, commit them, and retest them.
-
(4) Update ChangeLog and README.Release_Manager_Cookbook
* Update this file (README.Release_Manager_Cookbook) as much as
Modified: trunk/README.release
===================================================================
--- trunk/README.release 2019-07-10 00:03:58 UTC (rev 232)
+++ trunk/README.release 2019-07-10 00:28:23 UTC (rev 233)
@@ -1,4 +1,4 @@
-libLASi Release 1.1.3
+libLASi Release 1.1.4
~~~~~~~~~~~~~~~~~~~~~
This is a maintenance release of libLASi that reflect the ongoing
efforts of the libLASi developers to respond to bug reports for this
@@ -18,21 +18,15 @@
1. OFFICIAL NOTICES FOR USERS
1.1 CMake version compatibility
-1.2 Backwards-incompatible libLASi API changes
-1.3 Need help getting rid of deprecation build warnings
+1.2 Need help getting rid of deprecation build warnings
-2. Changes relative to our previous release (version 1.1.2) in decreasing order of importance
+2. Changes relative to our previous release
-2.1 Improve libLASi's response when pango/fontconfig chooses pure bitmapped fonts
-2.2 Make glyph names have a one-to-one relationship with glyphs
-2.3 Set target property POSITION_INDEPENDENT_CODE ON for the libLASi library
-2.4 Make "MissingGlyphExample" a more stringent test of font or glyph issues for libLASi
-2.5 Replace deprecated lower-case variants of Freetype macro constants with preferred upper-case form
-2.6 Add bounding boxes to the "MissingGlyphExample" and "ComplexTextLayoutExample" examples
-2.7 Rename example applications and results using consistent and descriptive core names
-2.8 Fix low-resolution boundary box issue
-2.9 Update doxygen configuration files from doxygen version 1.8.1.2 to 1.8.13
-2.10 Change the minimum version of CMake from 2.8.9 to 3.13.2
+2.1 Improve libLASi's find capability for pkg-config
+2.2 Add PREFER_EXTERNAL_STATIC option
+2.3 Add NON_TRANSITIVE option
+2.4 Implement the configured test_tarball.sh(.in) bash script
+2.5 Fix libLASi underlinking issues
3. Testing of this release.
@@ -40,31 +34,30 @@
1. OFFICIAL NOTICES FOR USERS
-1.1 CMake version compatibility
+Our build system is implemented using CMake. The minimum version of
+CMake we currently allow is 3.13.2 on all platforms, and currently the
+latest version of CMake that has been officially released is 3.14.5.
- Our build system is implemented using CMake. The minimum version
- of CMake we allow is 3.13.2 on all platforms. That version is the
- one we have used to test this release of libLASi (see Section 3
- below). However, if you try later CMake versions as they are
- released during the life of this libLASi release, our build system
- will likely continue to work well because CMake has an excellent
- reputation for preserving backwards compatibility.
+Note, that as of the time of this release we have the following
+free distribution packaging support for modern CMake versions:
-1.2 Backwards-incompatible libLASi API changes
+* Cygwin: 3.13.1 from <https://cygwin.com/cgi-bin2/package-grep.cgi>
+* MinGW-w64/MSYS2: 3.14.5 from <http://repo.msys2.org/mingw/x86_64/>
+* Fink: 3.11.0 from <http://pdb.finkproject.org/pdb/browse.php?name=cmake>
+* MacPorts: 3.14.5 from <https://www.macports.org/ports.php?by=name&substr=cmake>
+* Homebrew: 3.14.5 from <https://formulae.brew.sh/formula/cmake>
+* Debian Testing: 3.13.4 (from <https://packages.debian.org/buster/cmake> where Testing = Buster is scheduled to become the official Debian Stable release of Debian as of 2019-07-06, see <https://en.wikipedia.org/wiki/Debian_version_history>).
+* Other modern Linux distributions: likely 3.13.4 or greater since they typically package later versions of CMake than are available for Debian Stable.
- The bug fixes in this release required backwards-incompatible
- changes to the libLASi API (a change in the argument list of the
- PostscriptDocument::GlyphId::GlyphId protected method that is
- designed for internal use only and the addition of the
- PostscriptDocument::PangoItem_do protected method that is also
- designed for internal use only). Therefore, the SOVERSION for
- libLASi has been bumped from 1 to 2 to force source code that
- depends on this library (e.g., the PLplot psttf device driver) to
- be recompiled. However, such source code will not require changes
- to adjust to this backwards-incompatible change in the libLASi
- API.
+It appears from the above table that binary packages for CMake for our
+minimum allowed version (3.13.2) or later should be available soon or
+immediately on most modern free software distributions. However,
+libLASi users of distributions that do not package 3.13.2 or later
+(e.g., the current dated status of CMake packaging on Cygwin and Fink)
+will need to build CMake 3.13.2 or later for themselves before they
+build libLASi-1.1.4.
-1.3 Need help getting rid of deprecation build warnings
+1.2 Need help getting rid of deprecation build warnings
This release has deprecation warning build issues which are
@@ -78,183 +71,187 @@
help with cleaning up any of these deprecation build warnings messages
would be much appreciated!
-2. Changes relative to our previous release (version 1.1.2) in decreasing order of importance
+2. Changes relative to our previous release
-2.1 Improve libLASi's response when pango/fontconfig chooses pure bitmapped fonts
+2.1 Improve libLASi's find capability for pkg-config
- This change was the primary motivation for this release.
+I have dropped our dated and buggy cmake/modules/FindPkgConfig.cmake
+find capability for pkg-config in favour of the well-maintained CMake
+upstream version of FindPkgConfig.cmake. At least one positive result
+of this change is that the CMake-wrapped pkg-config results match
+those of the equivalent pkg-config command rather than incorrectly
+mixing static and shared library results together (as I observed in
+one particular test case before I dropped
+cmake/modules/FindPkgConfig.cmake).
- Previous to this change when pango chose the popular Noto Color
- Emoji font to help render the Aries glyph, libLASi threw an error
- and aborted since such pure bitmap fonts are not suitable for
- libLASi's outline font needs. Such a response completely stops
- PLplot tests when PLplot standard example 7 attempts to render an
- Aries glyph with either the psttf or psttfc devices. So this
- previous response was completely unacceptable, and the fix for it
- is important.
+2.2 Add PREFER_EXTERNAL_STATIC option
- This change fixes that previous response by replacing all glyphs
- for a PangoItem where pango chooses a non-outline font with the
- default glyph used to represent missing glyphs. Of course, a
- much better procedure would be to request pango to limit its
- choices to outline fonts, but as far as I know there is no method
- for doing that (outside of having one fontconfig configuration
- for libLASi use and another for all other situations), and, in
- any case, the present workaround is "good enough for now" because
- pure bitmap fonts are rare (for example, it is possible that Noto
- Color Emoji in the future may become available in the outline
- form generally preferred for modern fonts), and Pango/fontconfig
- chooses such pure bitmap fonts for relatively few glyphs.
+This option is only allowed to be ON for the case where static internal libraries
+are being built. The motivation for this option is to reduce external library
+dependencies to just the run time libraries. However, this option is
+set to OFF by default. The reason for this is
-2.2 Make glyph names have a one-to-one relationship with glyphs
+readelf -d tarball_build_dir/examples/MissingGlyphExample |grep NEEDED
- This change is an important motivation for this release.
+(and similarly for the other examples) shows that some
+shared libraries from the pango/cairo subset of the GTK+ stack of
+libraries are not eliminated by this option on the Debian Buster platform, namely
- This change is confined to the case when fonts don't follow
- standards so that they cannot be interrogated for the glyph name,
- i.e., FT_HAS_GLYPH_NAMES(face) is false. Before this change,
- libLASi computed its own unique glyph name using the template
+ 0x0000000000000001 (NEEDED) Shared library: [libpangoft2-1.0.so.0]
+ 0x0000000000000001 (NEEDED) Shared library: [libgraphite2.so.3]
+ 0x0000000000000001 (NEEDED) Shared library: [libpango-1.0.so.0]
-LASi_glyph_<unique number>
+The fundamental reason for this issue is the pangoft2-1.0, graphite2,
+and pango libraries are not available in static form for the Debian Buster
+platform. As a result of this platform deficiency
- where <unique number> was incremented whenever the code decided a
- new glyph had been encountered. This scheme had the following
- disadvantages:
+ldd -r tarball_build_dir/examples/MissingGlyphExample
-* The logic for deciding when new glyphs were encountered was
- faulty with the result that the same glyph would have multiple
- glyph names and therefore redundant glyph information stored in
- the PostScript header whenever, for example, both
+(and similarly for the other examples) shows that the run-time linker
+links to a very large list of shared libraries which are dependencies
+of the above list which completely subverts the motivation for turning
+this option ON!
-doc.osBody() << show(string)
-
- and
+Despite this Debian Buster platform issue, we have implemented this
+option since it should still be useful for those platforms that supply
+static versions of *all* the pango/cairo subset of libraries linked
+directly or indirectly by libLASi.
-doc.get_dimensions(string,&lineSpacing,&xAdvance,&yMinimum,&yMaximum);
+2.3 Add NON_TRANSITIVE option
- (a common combination when bounding boxes are being determined)
- were called for the same string.
+This option is only allowed to be ON for the case where shared
+internal libraries are being built. It specifies whether linking
+should just be to the libraries which are direct dependencies of the
+object being linked (ON) or libraries which are both direct and
+indirect dependencies of the object being linked (OFF). Setting this
+option to ON avoids overlinking, but this is a "would be nice" rather
+than essential. Therefore if ON is not working correctly for any
+platform try specifying OFF.
-* The glyph name depended on the order with which strings were
- processed with the result that PLplot octave results (where all
- standard octave examples were run from one instance of octave)
- had different glyph names than PLplot C results (where all
- standard C examples were run using separate executables for each
- example).
+The NON_TRANSITIVE option essentially affects just how external
+objects (including the installed libLASi examples and the PLplot psttf
+device driver) link to libLASi using lasi.pc and pkg-config (directly
+or indirectly via CMake). (The option also affects how the link
+interfaces of the test_executables is configured by the CMake-based
+build system, but that is essentially just a matter of style since
+those interfaces are unused, i.e., no object links to those
+executables.) In particular, the NON_TRANSITIVE option does not
+affect how libLASi itself is linked to external libraries using
+pkg-config since it is assumed the *.pc files associated with those
+external libraries are configured properly for whatever transitive or
+non-transitive linking model is appropriate for the platform.
-* The glyph names were completely meaningless to humans reading
- through the PostScript code in the results.
+2.4 Implement the configured test_tarball.sh(.in) bash script
- All these issues were addressed by borrowing a static function
- from PLplot (whose LGPL'd code allows us to do that) to calculate
- the UCS4 (32-bit unsigned) encoding of unicode for each glyph
- encountered in the UTF-8 encoded input string. With the result
- that the glyph names now have the template
+This script tests a source tarball (created with "make all" and "make package_source")
+for a given configuration of libLASi. See README.Release_Manager_Cookbook
+for directions concerning how to run this script. The tests included in this
+script are the following:
-LASi_glyph_U+<UCS4 hexadecimal code for the glyph>
+* Configure, build, and install libLASi.
- where by definition the UCS4 hexadecimal code completely
- identifies the glyph in a unique way which is easy to look up,
- e.g., with the gucharmap application.
+ This build includes building all the examples, running those
+ examples, and converting the resulting *.eps form of results to the
+ *.png results using inkscape.
- The net result of this change is the PLplot test_diff_device
- target for the case when -DPLPLOT_TEST_DEVICE=psttfc now gives a
- clean report for the first time ever. So this change is an
- important one.
+* Display the example results (in both the *.eps and *.png forms)
+ using pqiv to confirm there are no obvious rendering issues in these
+ results.
-2.3 Set target property POSITION_INDEPENDENT_CODE ON for the libLASi library
+* Run ldd -r for all built examples
- This change is an important motivation for this release.
+* Run all built examples in two different ways with valgrind and
+ compare the *.eps results with the equivalent results created by the
+ above original build.
- This bug fix allows the static version of libLASi to be used with
- shared builds of external software that depend on libLASi such as
- the PLplot psttf device driver.
+* Run ctest and compare its *.eps results with the equivalent results
+ created by the above original build.
-2.4 Make "MissingGlyphExample" a more stringent test of font or glyph issues for libLASi
+* Build the installed examples.
- The most important change here was to add
+* Run ldd -r for those examples.
-"Unicode U+2648 ARIES (twice): ♈♈"
-"Embedded newlines a\\nb\\nc: a\nb\nc"
+* Run those examples in two different ways with valgrind and compare
+ the *.eps results with the equivalent results created by theabove
+ original build.
- to the strings that are rendered to PostScript by this example.
+* Evaluate all these "internal" test results to make sure they worked properly.
- For the first of these, the Debian Buster version of pango
- (likely due to the default fontconfig configuration) decides to
- use the popular Noto Color Emoji font to render the Aries glyphs,
- but the problem for that font is it is a pure bitmap font with no
- outline information that is required by libLASi. So this line
- tests the response of libLASi to this situation.
+* If environment variables are set up properly to allow a special
+ comprehensive test of PLplot with the psttf and psttfc devices do
+ that comprehensive test and evaluate those results. This is an
+ important external test of libLASi since the psttf and psttf PLplot
+ devices depend strongly on that library, and this comprehensive test
+ evaluates those devices in a very large number of ways.
- For the second of these the linefeed "\n" glyph is a non-printing
- glyph. It appears for all such glyphs there is a "missing glyph"
- issue so regardless of future font improvements this line seems
- to be a reliable way to trigger missing-glyph issues to test the
- response of libLASi to this situation.
+2.5 Fix libLASi underlinking issues
-2.5 Replace deprecated lower-case variants of Freetype macro constants with preferred upper-case form
+The issue (discovered by Luigi Baldoni on the "Tumbleweed" openSUSE platform)
+is that libLASi depends directly on symbols in the gobject-2.0 and glib-2.0
+libraries, but libLASi was not directly linked with those libraries before this fix. For
+most platforms (so far the only exception I know is the Baldoni platform) this
+direct underlinking issue was covered up by transitive linking of those
+libraries via the direct library dependencies of the pango library. That is, libLASi has
+always been linked directly to the pango library, and, for example, on
+Debian Buster we have
-2.6 Add bounding boxes to the "MissingGlyphExample" and "ComplexTextLayoutExample" examples
+software@merlin> pkg-config --libs pango
+-lpango-1.0 -lgobject-2.0 -lglib-2.0
- The resulting MissingGlyphExample.eps and
- ComplexTextLayoutExample.eps files join SimpleLASiExample.eps as
- being properly formatted EPS (Encapsulated PostScript) files.
+That is, on this platform libpango depends directly on the gobject-2.0
+and glib-2.0 libraries and this covers up the libLASi underlinking
+issue that has just been fixed. However, this pkg-config result which
+includes -lgobject-2.0 -lglib-2.0 apparently does not occur on
+Tumbleweed which exposes the libLASi underlinking bug that has just
+been fixed.
- Note also that for the "Complex Text Layout" case, I implemented
- some generally useful C++ code macros (called
- LASI_SHOW_AND_UPDATE_BB, LASI_SCALED_SHOW_AND_UPDATE_BB, and
- LASI_ROTATED_SHOW_AND_UPDATE_BB), which made it straightforward
- to handle even complex cases such as determining the bounding box
- of text that has undergone anamorphic scaling or rotation. For
- example, the LASI_ROTATED_SHOW_AND_UPDATE_BB macro includes C++
- code to apply the rotation matrix to determine the x,y
- coordinates of the corners of the rotated text box and use those
- corner coordinates to help determine the overall bounding box.
+The fix for this libLASi underlinking issue was necessarily made in
+two places. One place was to directly link libLASi with gobject-2.0
+and glib-2.0 when using our CMake-based build system to build libLASi.
+The other place was to modify the configured lasi.pc(.in) file (which
+controls builds of executables and shared objects that are linked to
+libLASi such as the traditional build of the installed libLASi
+examples and the CMake-based build of the PLplot psttf device) so the
+previous
-2.7 Rename example applications and results using consistent and descriptive core names
+Requires: pangoft2,pango,freetype2
- Those core names are " MissingGlyphExample", "SimpleLASiExample",
- and "ComplexTextLayoutExample". As a result the example source
- code name is <core name>.cpp, the example application name is
- <core name> (or <core name>.exe on Windows platforms), the EPS
- (Encapsulated PostScript) results are named <core name>.eps, and
- the PNG results (generated from the EPS results using inkscape)
- are named <core name>.png.
+line in that pkg-config file was replaced by either
-2.8 Fix low-resolution boundary box issue
+Requires.private: pangoft2,pango,freetype2,gobject-2.0,glib-2.0
- As a result of this change the low-res (int) BB (bounding box)
- limits are calculated from the high-res (double) BB limits with
- the appropriate combinations of floor and ceil so the low-res
- limits always lie on or outside (by up to but not including 1
- point) the high-res limits. Previously this calculation was done
- incorrectly with floor for all limits.
+or
-2.9 Update doxygen configuration files from doxygen version 1.8.1.2 to 1.8.13
+Requires: pangoft2,pango,freetype2,gobject-2.0,glib-2.0
- These changes were done in the usual way by running the following
- commands:
+depending respectively on whether NON_TRANSITIVE was true or not.
-doxygen -u Doxyfile.developer
-doxygen -u Doxyfile.user
+3. Testing of this release.
-2.10 Change the minimum version of CMake from 2.8.9 to 3.13.2
+This release has been successfully built and run-tested (following the
+prescription in README.Release_Manager_Cookbook) for the following
+major configurations
- This change was motivated by the bug fixes in later CMake
- versions and also the much better checking of the build system
- that occurs for the policies automatically used for 3.13.2.
+* -DBUILD_SHARED_LIBS=ON -DNON_TRANSITIVE=ON (build shared internal libraries with non-transitive linking)
-3. Testing of this release.
+* -DBUILD_SHARED_LIBS=ON -DNON_TRANSITIVE=OFF (build shared internal libraries with transitive linking)
-This release has been successfully built and run-tested (following the
-prescription in README.Release_Manager_Cookbook) for both the shared
-and static library case on Linux (Debian Buster) using CMake-3.13.2
-(the minimum allowed version of CMake for libLASi), libpango-1.42.4,
-libcairo-1.16.0, libfreetype-2.9.1, and libfontconfig-2.13.1.
+* -DBUILD_SHARED_LIBS=OFF -DPREFER_EXTERNAL_STATIC=OFF (build static internal libraries with shared external libraries preferred)
+* -DBUILD_SHARED_LIBS=OFF -DPREFER_EXTERNAL_STATIC=ON (build static internal libraries with static external libraries preferred)
+
+on Linux (Debian Buster) using CMake-3.13.2 (the minimum allowed
+version of CMake for libLASi) and 3.14.5 (the latest released
+version of CMake at this time). For these 8 tests, the Debian Buster
+packages containing the direct library dependencies of libLASi were
+libpango1.0-dev-1.42.4, libfreetype6-dev-2.9.1, and
+libglib2.0-dev-2.58.3.
+
This release has not been tested (yet) on Mac OS X or Windows
-platforms, but we anticipate no difficulties on those platforms since
-previous versions of libLASi have worked well on those platforms. In
-other words, the cross-platform nature of libLASi appears to have been
-well supported by CMake in the past, and we feel that happy state will
-continue with this release as well.
+platforms because of my lack of access to those platforms. However, I
+anticipate no difficulties on those platforms since previous versions
+of libLASi have worked well on those platforms. In other words, the
+cross-platform nature of libLASi appears to have been well supported
+by CMake in the past, and should likely continue with this release as
+well. But if that view turns out to be too optimistic let me know
+(e.g., with a bug report)!
Modified: trunk/cmake/modules/lasi.cmake
===================================================================
--- trunk/cmake/modules/lasi.cmake 2019-07-10 00:03:58 UTC (rev 232)
+++ trunk/cmake/modules/lasi.cmake 2019-07-10 00:28:23 UTC (rev 233)
@@ -4,6 +4,18 @@
# libraries are all shared by default
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
+if(BUILD_SHARED_LIBS)
+ # OFF means shared libraries (but never static libraries) are
+ # transitively linked by default by CMake
+ if(WIN32 OR CYGWIN)
+ option(NON_TRANSITIVE "Option to use non-transitive linking" OFF)
+ else(WIN32 OR CYGWIN)
+ option(NON_TRANSITIVE "Option to use non-transitive linking" ON)
+ endif(WIN32 OR CYGWIN)
+else(BUILD_SHARED_LIBS)
+ set(NON_TRANSITIVE OFF CACHE BOOL "Option to use non-transitive linking" FORCE)
+endif(BUILD_SHARED_LIBS)
+
# for win32 we set the DLLFLAG (used in lasi.pc)
# to import the functions correctly from the dll
if(WIN32 AND BUILD_SHARED_LIBS)
@@ -50,7 +62,7 @@
include(pkg-config)
-pkg_check_pkgconfig("pangoft2;pango;freetype2" PANGOFT2_includedir PANGOFT2_libdir PANGOFT2_libraries PANGOFT2_cflags PANGOFT2_version PANGOFT2)
+pkg_check_pkgconfig("pangoft2;pango;freetype2;glib-2.0;gobject-2.0" PANGOFT2_includedir PANGOFT2_libdir PANGOFT2_libraries PANGOFT2_cflags PANGOFT2_version PANGOFT2)
#message(STATUS "DEBUG:PANGOFT2_includedir = ${PANGOFT2_includedir}")
#message(STATUS "DEBUG:PANGOFT2_libdir = ${PANGOFT2_libdir}")
#message(STATUS "DEBUG:PANGOFT2_libraries = ${PANGOFT2_libraries}")
@@ -58,7 +70,7 @@
#message(STATUS "DEBUG:PANGOFT2_version = ${PANGOFT2_version}")
if(NOT PANGOFT2_libraries)
- message(FATAL_ERROR "pangoft2, pango, and freetype2 pkg-config module required to build libLASi.")
+ message(FATAL_ERROR "pangoft2, pango, freetype2, glib-2.0, and gobject-2.0 pkg-config modules are all required to build libLASi.")
endif(NOT PANGOFT2_libraries)
# Only required to determine FT2_VERSION. The rest is ignored.
Modified: trunk/cmake/modules/pkg-config.cmake
===================================================================
--- trunk/cmake/modules/pkg-config.cmake 2019-07-10 00:03:58 UTC (rev 232)
+++ trunk/cmake/modules/pkg-config.cmake 2019-07-10 00:28:23 UTC (rev 233)
@@ -13,11 +13,27 @@
message(FATAL_ERROR "Build of libLASi requires pkg-config.")
endif(PKG_CONFIG_EXECUTABLE)
+# CYGWIN eliminated here because .a suffix is not sufficient to guarantee a
+# static library on that platform.
+if(UNIX AND NOT CYGWIN AND NOT BUILD_SHARED_LIBS)
+ option(PREFER_EXTERNAL_STATIC "Prefer external UNIX libraries to be static" OFF)
+else(UNIX AND NOT CYGWIN AND NOT BUILD_SHARED_LIBS)
+ set(PREFER_EXTERNAL_STATIC OFF CACHE BOOL "Prefer external UNIX libraries to be static" FORCE)
+endif(UNIX AND NOT CYGWIN AND NOT BUILD_SHARED_LIBS)
+
+if(PREFER_EXTERNAL_STATIC)
+ # All find_library commands append these suffixes to the searched name so
+ # this combination on Unix platforms means find_library will preferentially find the
+ # Unix static library if it exists, but otherwise find the shared library.
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so")
+endif(PREFER_EXTERNAL_STATIC)
+
macro(pkg_check_pkgconfig _package _include_DIR _link_DIR _link_FLAGS _cflags _version)
- # Similar to legacy pkgconfig only these results are derived
- # from pkg_check_modules and therefore are returned as lists rather than
+ # Similar to legacy pkgconfig only these results are derived from
+ # pkg_check_modules and therefore are returned as lists rather than
# blank-delimited strings. Also, the _link_FLAGS value is converted
- # to the preferred CMake form via the cmake_link_flags macro.
+ # to the list of full library paths preferred by CMake via the
+ # cmake_link_flags macro.
# N.B. if using this macro in more than one context, cache clashes will
# occur unless optional trailing prefix argument is specified to distinguish
@@ -26,13 +42,30 @@
if(NOT _prefix)
set(_prefix "_PKGCONFIG_TMP")
endif(NOT _prefix)
-
- _pkg_check_modules_internal(0 0 ${_prefix} "${_package}")
- if (${_prefix}_FOUND)
- set(${_include_DIR} ${${_prefix}_INCLUDE_DIRS})
- set(${_link_DIR} ${${_prefix}_LIBRARY_DIRS})
- cmake_link_flags(${_link_FLAGS} "${${_prefix}_LDFLAGS}")
- set(${_cflags} ${${_prefix}_CFLAGS})
+
+ if(PREFER_EXTERNAL_STATIC)
+ set(_xprefix ${_prefix}_STATIC)
+ else(PREFER_EXTERNAL_STATIC)
+ set(_xprefix ${_prefix})
+ endif(PREFER_EXTERNAL_STATIC)
+
+ pkg_check_modules(${_prefix} "${_package}")
+
+ if(${_prefix}_FOUND)
+ cmake_link_flags(${_link_FLAGS} "${${_xprefix}_LDFLAGS}")
+ # If libraries cannot be not found, then that is equivalent to whole
+ # pkg-config module not being found.
+ if(NOT ${_link_FLAGS})
+ set(${_prefix}_FOUND)
+ endif(NOT ${_link_FLAGS})
+ endif(${_prefix}_FOUND)
+
+ if(${_prefix}_FOUND)
+ set(${_include_DIR} ${${_xprefix}_INCLUDE_DIRS})
+ set(${_link_DIR} ${${_xprefix}_LIBRARY_DIRS})
+ set(${_cflags} ${${_xprefix}_CFLAGS})
+ # N.B. must use ${_prefix}_VERSION} rather than ${_xprefix}_VERSION}
+ # because the latter is not defined.
set(${_version} ${${_prefix}_VERSION})
set(_return_VALUE 0)
else(${_prefix}_FOUND)
@@ -43,76 +76,94 @@
set(${_version})
set(_return_VALUE 1)
endif(${_prefix}_FOUND)
- #message("${_prefix}_FOUND = ${${_prefix}_FOUND}")
- #message("${_include_DIR} = ${${_include_DIR}}")
- #message("${_link_DIR} = ${${_link_DIR}}")
- #message("${_link_FLAGS} = ${${_link_FLAGS}}")
- #message("${_cflags} = ${${_cflags}}")
+ #message("DEBUG: ${_prefix}_FOUND = ${${_prefix}_FOUND}")
+ #message("DEBUG: ${_include_DIR} = ${${_include_DIR}}")
+ #message("DEBUG: ${_link_DIR} = ${${_link_DIR}}")
+ #message("DEBUG: ${_link_FLAGS} = ${${_link_FLAGS}}")
+ #message("DEBUG: ${_cflags} = ${${_cflags}}")
+ #message("DEBUG: ${_version} = ${${_version}}")
endmacro(pkg_check_pkgconfig)
-macro(pkg_config_link_flags _link_flags_out _link_flags_in)
+function(pkg_config_link_flags link_flags_out link_flags_in)
# Transform link flags into a form that is suitable to be used for
# output pkg-config (*.pc) files.
- # N.B. ${_link_flags_in} must be a string and not a list.
+ # N.B. ${link_flags_in} must be in quoted "${list_variable}" form
+ # where list_variable is a CMake list.
+ #message("(original link flags) = ${link_flags_in}")
# First strip out optimized / debug options which are not needed
# Currently only FindQt4 seems to need this.
if(CMAKE_BUILD_TYPE MATCHES "Debug")
# Get rid of the optimized keyword and immediately following library as
# well as the debug keyword anywhere such patterns occur in the list.
- string(REGEX REPLACE "(^|;)optimized;[^;]*;" "\\1" ${_link_flags_out} "${_link_flags_in}")
- string(REGEX REPLACE "(^|;)debug;" "\\1" ${_link_flags_out} "${${_link_flags_out}}")
+ string(REGEX REPLACE "(^|;)optimized;[^;]*;" "\\1" link_flags "${link_flags_in}")
+ string(REGEX REPLACE "(^|;)debug;" "\\1" link_flags "${link_flags}")
else(CMAKE_BUILD_TYPE MATCHES "Debug")
# Get rid of the debug keyword and immediately following library as
# well as the optimized keyword anywhere such patterns occur in the list.
- string(REGEX REPLACE "(^|;)debug;[^;]*;" "\\1" ${_link_flags_out} "${_link_flags_in}")
- string(REGEX REPLACE "(^|;)optimized;" "\\1" ${_link_flags_out} "${${_link_flags_out}}")
+ string(REGEX REPLACE "(^|;)debug;[^;]*;" "\\1" link_flags "${link_flags_in}")
+ string(REGEX REPLACE "(^|;)optimized;" "\\1" link_flags "${link_flags}")
endif(CMAKE_BUILD_TYPE MATCHES "Debug")
- #message("(original link flags) = ${_link_flags_in}")
- # Convert link flags to a blank-delimited string.
- string(REGEX REPLACE ";" " " ${_link_flags_out} "${${_link_flags_out}}")
- #message("(blanks) ${_link_flags_out} = ${${_link_flags_out}}")
+ #message("(stripped link flags) = ${link_flags}")
# Replace actual library names with the -LPATHNAME and -lLIBRARYNAME form
# since it appears pkg-config handles that latter form much better (with
# regard to keeping the correct order and eliminating duplicates).
- # These REGEX REPLACE's won't actually replace anything on bare windows since
- # library names are not of this form on that platform. Something to be
- # considered later if we decide to use pkg-config on bare windows.
+ # These suffix patterns for library pathnames appear to work fine on
+ # Linux, Mac OS X, and MinGW/MSYS but it may need some
+ # generalization on other platforms such as Cygwin.
- # This logic will need to be expanded for Unix platforms other than
- # Mac OS X and Linux.
- if(APPLE)
- set(suffix_list ".so" ".a" ".dylib")
- else(APPLE)
- set(suffix_list ".so" ".a")
- endif(APPLE)
+ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ set(suffix_pattern "(\\.so.*|\\.a)")
+ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+ set(suffix_pattern "(\\.so.*|\\.a|\\.dylib)")
+ elseif(WIN32_OR_CYGWIN)
+ # Order is important here.
+ set(suffix_pattern "(\\.dll\\.a|\\.a)")
+ else(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ # Probably a non-Linux, non-Mac OS X, Unix platform
+ # For this case we assume the same as Linux.
+ set(suffix_pattern "(\\.so.*|\\.a)")
+ endif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
- foreach(suffix ${suffix_list})
- string(
- REGEX REPLACE "(/[^ ]*)/lib([^ ]*)\\${suffix}" "-L\\1 -l\\2"
- ${_link_flags_out}
- "${${_link_flags_out}}"
- )
- #message("(${suffix}) ${_link_flags_out} = ${${_link_flags_out}}")
- endforeach(suffix ${suffix_list})
+ set(_link_flags)
+ foreach(link_flag IN LISTS link_flags)
+ #message(STATUS "link_flag = ${link_flag}")
+ if(WIN32_OR_CYGWIN)
+ # Look for colon-delimited drive-letter form on these platforms.
+ string(REGEX REPLACE "^([a-zA-Z]:/.*)/lib(.*)${suffix_pattern}$" "-L\"\\1\" -l\\2" link_flag "${link_flag}")
+ endif(WIN32_OR_CYGWIN)
+ # Look for form starting with "/" on all platforms.
+ string(REGEX REPLACE "^(/.*)/lib(.*)${suffix_pattern}$" "-L\"\\1\" -l\\2" link_flag "${link_flag}")
+ #message(STATUS "(-L form of link_flag = ${link_flag}")
+ list(APPEND _link_flags ${link_flag})
+ endforeach(link_flag IN LISTS link_flags)
+ set(link_flags ${_link_flags})
+ set(_link_flags)
+ #message("(-L form of link_flags) = ${link_flags}")
- if(APPLE)
+ # Convert link flags to a blank-delimited string.
+ string(REGEX REPLACE ";" " " link_flags "${link_flags}")
+ #message("(blank-delimited) link_flags = ${link_flags}")
+
+ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# For Mac OS X transform frameworks information into correct form.
string(
REGEX REPLACE
"/System/Library/Frameworks/([^ ]*)\\.framework"
"-framework \\1"
- ${_link_flags_out}
- ${${_link_flags_out}}
+ link_flags
+ "${link_flags}"
)
- #message("(frameworks) ${_link_flags_out} = ${${_link_flags_out}}")
- endif(APPLE)
+ #message("(frameworks) link_flags = ${link_flags}")
+ endif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-endmacro(pkg_config_link_flags)
+ set(${link_flags_out} ${link_flags} PARENT_SCOPE)
+endfunction(pkg_config_link_flags)
+
macro(cmake_link_flags _link_flags_out _link_flags_in)
# Transform link flags delivered by pkg-config into the best form
# for CMake.
@@ -120,6 +171,8 @@
# is pkg-config delivers link flags using the -L and -l options which
# may not be the case for windows.
# N.B. ${_link_flags_in} must be a string and not a list.
+ # N.B. We deliberately do not remove duplicates in case those
+ # are required.
if("${_link_flags_in}" STREQUAL "")
set(${_link_flags_out})
@@ -129,6 +182,16 @@
# (such as "-framework whatever") so preserve those by splitting into
# separate list elements only if the next element starts with a hyphen.
string(REGEX REPLACE " -" ";-" _link_flags_list "${_link_flags_in}")
+ if(NOT MATH_LIB)
+ # On systems (normally Windows) where MATH_LIB is not defined
+ # filter out -lm from link flags. This works around a pkg-config
+ # configuration bug on Windows for the GTK+ stack of libraries where
+ # -lm is supplied as a required library flag when that library does
+ # not exist on Windows platforms.
+ list(REMOVE_ITEM _link_flags_list "-lm")
+ endif(NOT MATH_LIB)
+ #message("_link_flags_list = ${_link_flags_list}")
+
# Extract list of directories from -L options.
list(LENGTH _link_flags_list _link_flags_length)
math(EXPR _link_flags_length "${_link_flags_length} - 1")
@@ -143,26 +206,37 @@
endif(_list_element STREQUAL "-L${_list_element1}")
endforeach(_list_index RANGE ${_link_flags_length})
#message("_index_list = ${_index_list}")
- if("${_index_list}" STREQUAL "")
- else("${_index_list}" STREQUAL "")
+ if(NOT "${_index_list}" STREQUAL "")
# Remove -L options from list.
list(REMOVE_AT _link_flags_list ${_index_list})
- endif("${_index_list}" STREQUAL "")
+ endif(NOT "${_index_list}" STREQUAL "")
#message("_link_directory_list = ${_link_directory_list}")
#message("_link_flags_list (without -L options) = ${_link_flags_list}")
-
- # Derive ${_link_flags_out} from _link_flags_list with -l options
+
+ # Derive ${_link_flags_out} from _link_flags_list with -l options
# replaced by complete pathname of library.
list(LENGTH _link_flags_list _link_flags_length)
math(EXPR _link_flags_length "${_link_flags_length} - 1")
set(${_link_flags_out})
+ set(_success ON)
+ set(_not_found_list)
+ if(PREFER_EXTERNAL_STATIC)
+ # For PREFER_EXTERNAL_STATIC true need to keep certain system
+ # libraries in -l form to avoid an issue with mixing static
+ # versions of those libraries with a runtime with shared components.
+ set(_pass_through_libraries "-lm")
+ else(PREFER_EXTERNAL_STATIC)
+ set(_pass_through_libraries "")
+ endif(PREFER_EXTERNAL_STATIC)
foreach(_list_index RANGE ${_link_flags_length})
list(GET _link_flags_list ${_list_index} _list_element)
+ list(FIND _pass_through_libraries ${_list_element} _index_pass_through)
+ #message(STATUS "DEBUG: _index_pass_through = ${_index_pass_through} for _list_element = ${_list_element}")
string(REGEX REPLACE "^-l" "" _list_element1 "${_list_element}")
- if(_list_element STREQUAL "-l${_list_element1}")
+ if(_list_element STREQUAL "-l${_list_element1}" AND _index_pass_through EQUAL "-1")
set(_library_pathname "_library_pathname-NOTFOUND")
find_library(
- _library_pathname
+ _library_pathname
${_list_element1}
PATHS ${_link_directory_list}
NO_DEFAULT_PATH
@@ -170,26 +244,37 @@
# Try second time (without NO_DEFAULT_PATH) just in case pkg-config
# specified some system libraries without corresponding -L options.
find_library(
- _library_pathname
+ _library_pathname
${_list_element1}
PATHS ${_link_directory_list}
)
if(NOT _library_pathname)
- message(
- "Cannot find library corresponding to linker option ${_list_element}"
- )
- message(
- "original link flags delivered by pkg-config = ${_link_flags_in}"
- )
- message(FATAL_ERROR "FATAL ERROR in cmake_link_flags macro")
+ set(_success OFF)
+ list(APPEND _not_found_list ${_list_element1})
endif(NOT _library_pathname)
list(APPEND ${_link_flags_out} ${_library_pathname})
- else(_list_element STREQUAL "-L${_list_element1}")
- # link options that are not -L or -l passed through in correct order
- # in ${_link_flags_out}.
+ else(_list_element STREQUAL "-l${_list_element1}" AND _index_pass_through EQUAL "-1")
+ # link options that are not -L or -l or which are an -l option
+ # in _passed_through_libraries are _passed through in correct
+ # order in ${_link_flags_out}.
list(APPEND ${_link_flags_out} ${_list_element})
- endif(_list_element STREQUAL "-l${_list_element1}")
+ endif(_list_element STREQUAL "-l${_list_element1}" AND _index_pass_through EQUAL "-1")
endforeach(_list_index RANGE ${_link_flags_length})
- #message("${_link_flags_out} = ${${_link_flags_out}}")
+ #message(STATUS "DEBUG: ${_link_flags_out} = ${${_link_flags_out}}")
+
+ # If one or more of the libraries cannot be found, then return an
+ # empty ${_link_flags_out} as a sign of that failure.
+ if(NOT _success)
+ message(STATUS "WARNING: Library inconsistency detected. Your pkg-config files claim certain libraries are present, but CMake cannot find them.")
+ message(STATUS "The unfound library basenames are as follows:")
+ foreach(_not_found IN LISTS _not_found_list)
+ message(STATUS "${_not_found}")
+ endforeach(_not_found IN LISTS _not_found_list)
+ message(STATUS "Some library installation and/or adjustment of find-related environment variables or corresponding CMake variables will be required before CMake will be able to find these libraries.")
+ message(STATUS "cmake_link_flags WARNING: (original link flags) = ${_link_flags_in}")
+ message(STATUS "cmake_link_flags WARNING: (corresponding link flags with found libraries = ${_link_flags_out}) = ${${_link_flags_out}}")
+ message(STATUS "cmake_link_flags WARNING: ${_link_flags_out} is invalid so it is set to nothing to signal the failure of cmake_link_flags for the original link flags printed out above.")
+ set(${_link_flags_out})
+ endif(NOT _success)
endif("${_link_flags_in}" STREQUAL "")
endmacro(cmake_link_flags)
Modified: trunk/examples/CMakeLists.txt
===================================================================
--- trunk/examples/CMakeLists.txt 2019-07-10 00:03:58 UTC (rev 232)
+++ trunk/examples/CMakeLists.txt 2019-07-10 00:28:23 UTC (rev 233)
@@ -44,8 +44,20 @@
list(APPEND INSTALL_LIST ${SRC_ROOT_NAME}.cpp)
add_executable(${SRC_ROOT_NAME} ${SRC_ROOT_NAME}.cpp)
- target_link_libraries(${SRC_ROOT_NAME} LASi)
+ if(SRC_ROOT_NAME STREQUAL "ComplexTextLayoutExample")
+ # This example depends directly on the math library.
+ set(DEPENDENT_LIBRARIES LASi ${MATH_LIB})
+ else(SRC_ROOT_NAME STREQUAL "ComplexTextLayoutExample")
+ set(DEPENDENT_LIBRARIES LASi)
+ endif(SRC_ROOT_NAME STREQUAL "ComplexTextLayoutExample")
+
+ if(NON_TRANSITIVE)
+ target_link_libraries(${SRC_ROOT_NAME} PRIVATE ${DEPENDENT_LIBRARIES})
+ else(NON_TRANSITIVE)
+ target_link_libraries(${SRC_ROOT_NAME} PUBLIC ${DEPENDENT_LIBRARIES})
+ endif(NON_TRANSITIVE)
+
add_test(${SRC_ROOT_NAME}
${CMAKE_CURRENT_BINARY_DIR}/${SRC_ROOT_NAME} ${CTEST_EXAMPLES_OUTPUT_DIR}/${SRC_ROOT_NAME}.eps
)
Modified: trunk/lasi.pc.in
===================================================================
--- trunk/lasi.pc.in 2019-07-10 00:03:58 UTC (rev 232)
+++ trunk/lasi.pc.in 2019-07-10 00:28:23 UTC (rev 233)
@@ -6,7 +6,7 @@
Name: LASi
Description: Library to write UTF-8 strings to Postscript stream.
Version: @VERSION@
-Requires: pangoft2,pango,freetype2, gobject-2.0, glib-2.0
+@PC_REQUIRES_LINE@
Libs: -L${libdir} -lLASi
Cflags: -I${includedir} @DLLFLAG@
Modified: trunk/src/CMakeLists.txt
===================================================================
--- trunk/src/CMakeLists.txt 2019-07-10 00:03:58 UTC (rev 232)
+++ trunk/src/CMakeLists.txt 2019-07-10 00:28:23 UTC (rev 233)
@@ -47,6 +47,7 @@
set(libLASi_LINK_LIBRARIES ${PANGOFT2_libraries})
if(MATH_LIB)
+ # libLASi depends directly on the math library.
list(APPEND libLASi_LINK_LIBRARIES ${MATH_LIB})
endif(MATH_LIB)
Added: trunk/test_tarball.sh.in
===================================================================
--- trunk/test_tarball.sh.in (rev 0)
+++ trunk/test_tarball.sh.in 2019-07-10 00:28:23 UTC (rev 233)
@@ -0,0 +1,189 @@
+#!/bin/bash
+
+# Bash script to test an existing libLASi tarball.
+
+# List of environment variables that always need to be defined to
+# taylor this script for a particular platform.
+
+for variable in LASI_VERSION PARALLEL_OPTION ; do
+ if [ -z "${!variable}" ] ; then
+ echo "Environment variable $variable should be set to a non-empty string before invoking this script"
+ exit 1
+ fi
+done
+
+# Optional environment variables which affect whether special PLplot comprehensive test
+# is performed as part of this test.
+if [ -z "$PLPLOT_CMAKE_PATH" -o -z "$PLPLOT_SOURCE_PREFIX" ] ; then
+ echo "One or both of PLPLOT_CMAKE_PATH or PLPLOT_SOURCE_PREFIX environment variables not"
+ echo "set. Therefore, will NOT do special PLplot comprehensive test of the psttf and"
+ echo "psttfc devices that depend on libLASi."
+ do_plplot_test="no"
+else
+ do_plplot_test="yes"
+fi
+
+# Command-line options (typically changed much more often than the above set of environment variables).
+CMAKE_PATH=$1
+CMAKE_OPTION_1=$2
+CMAKE_OPTION_2=$3
+
+SOURCE_TREE=@CMAKE_CURRENT_BINARY_DIR@/libLASi-$LASI_VERSION
+BUILD_TREE=@CMAKE_CURRENT_BINARY_DIR@/tarball_build_dir
+INSTALL_TREE=@CMAKE_CURRENT_BINARY_DIR@/tarball_install_dir
+
+TARBALL=@CMAKE_CURRENT_BINARY_DIR@/libLASi-$LASI_VERSION.tar.gz
+if [ ! -f $TARBALL ] ; then
+ echo "Could not find tarball = $TARBALL to be tested by this script"
+ exit 1
+fi
+
+# Unpack the tarball into a fresh source tree.
+rm -rf $SOURCE_TREE
+tar zxf $TARBALL
+
+# Start tarball test fresh with no build or install tree.
+rm -rf $BUILD_TREE
+rm -rf $INSTALL_TREE
+
+mkdir -p $BUILD_TREE
+cd $BUILD_TREE
+
+env PATH="$CMAKE_PATH:$PATH" cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_TREE $CMAKE_OPTION_1 $CMAKE_OPTION_2 $SOURCE_TREE >& cmake.out
+make $PARALLEL_OPTION >& make.out
+
+for CORE_NAME in MissingGlyphExample SimpleLASiExample ComplexTextLayoutExample ; do
+ # Inspect EPS results. Note a white background has to be imposed
+ # because these results have no background. So by default the
+ # background would be a checkerboard imposed by pqiv if this
+ # --background-pattern option was not used.
+ pqiv -i --background-pattern=white examples/$CORE_NAME.eps
+
+ # Inspect same results converted (with opaque white background
+ # added) to PNG format by inkscape.
+ pqiv -i examples/$CORE_NAME.png
+done
+
+# ldd and valgrind tests of the examples including comparisons of the
+# results generated with the previous results. Note, that 2>&1
+# redirects stderr to *current" stdout (which defaults to pipe),
+# test.eps afterwards means PostScript output goes directly to that
+# file rather than stdout (so nothing more is emitted to stdout), and
+# >| test.eps afterwards means PostScript output goes to stdout (but
+# not stderr) and stdout then overwrites whatever was in test.eps
+# before.
+
+for CORE_NAME in MissingGlyphExample SimpleLASiExample ComplexTextLayoutExample ; do
+ ldd -r examples/$CORE_NAME 2>&1 | less
+ valgrind examples/$CORE_NAME 2>&1 test.eps | less
+ cmp test.eps examples/$CORE_NAME.eps
+ valgrind examples/$CORE_NAME 2>&1 >| test.eps | less
+ cmp test.eps examples/$CORE_NAME.eps
+done
+
+# Run ctest
+env PATH="$CMAKE_PATH:$PATH" ctest $PARALLEL_OPTION --output-log >| ctest.out
+# Compare ctest results with above make results.
+for CORE_NAME in MissingGlyphExample SimpleLASiExample ComplexTextLayoutExample ; do
+ cmp examples/ctest_examples_output_dir/$CORE_NAME.eps examples/$CORE_NAME.eps
+done
+
+# Was ctest a complete success?
+grep -l "100% tests passed" ctest.out
+
+ctest_rc=$?
+
+if [ "$ctest_rc" -ne 0 ] ; then
+ echo "ERROR: ctest failed with the following complete output"
+ cat ctest.out
+ exit 1
+fi
+
+make $PARALLEL_OPTION install >& make_install.out
+cd $INSTALL_TREE/share/lasi$LASI_VERSION/examples
+make $PARALLEL_OPTION >& $BUILD_TREE/installed_traditional_make.out
+
+for CORE_NAME in MissingGlyphExample SimpleLASiExample ComplexTextLayoutExample ; do
+ ldd -r $CORE_NAME 2>&1 | less
+ cmp $CORE_NAME.eps $BUILD_TREE/examples/$CORE_NAME.eps
+ valgrind ./$CORE_NAME 2>&1 test.eps | less
+ cmp test.eps $CORE_NAME.eps
+ valgrind ./$CORE_NAME 2>&1 >| test.eps | less
+ cmp test.eps $CORE_NAME.eps
+done
+
+echo "Check for warnings/errors in all the *.out files generated prior to the comprehensive test"
+
+cd $BUILD_TREE
+# Fix me once deprecated warnings on gone.
+# Trailing grep stanzas are to drop false alarms due to deprecated warnings.
+grep -i warning *.out | grep -v deprecated
+grep -i error *.out | grep -vE 'FT_Error|throw'
+
+if [ "$do_plplot_test" = "yes" ] ; then
+ # Test the above installed version of libLASi with a specific PLplot comprehensive test.
+
+ # I deliberately place a blank in this pathname. Assuming that $PLPLOT_SOURCE_PREFIX" also has
+ # a blank, then this combination tests the case where the source, build, and install trees for the
+ # PLplot comprehensive test have blanks in their prefixes.
+ COMPREHENSIVE_TEST_PREFIX="@CMAKE_CURRENT_BINARY_DIR@/tarball_comprehensive_test_disposeable blank"
+
+
+ # Set CMAKE_PREFIX_PATH to access local versions of lua and libLASi
+ # to avoid important bugs in the Debian Testing versions of those
+ # packages and also to test the local version of libLASi installed above.
+ # Also access a local version of libqhull to test that additional
+ # rpath possibility.
+
+ # Put $PLPLOT_CMAKE_PATH first on the path to use that version of CMake and CTest for
+ # this PLplot test.
+
+ # Use the -DUSE_INCRTCL_VERSION_4=ON option to help CMake find Tcl/Tk
+ # components. (This step will not be necessary as soon as the PLplot
+ # build system is modified to make Tcl/Tk/Itcl/Itk/Iwidgets finding
+ # more robust.)
+
+ # The psttfc and psttf devices are the only ones that depend on
+ # libLASi. Therefore, use -DDEFAULT_NO_DEVICES=ON -DPLD_psttfc=ON
+ # -DPLD_psttf=ON -DPLPLOT_TEST_DEVICE=psttfc to drop all device
+ # testing other than psttfc and psttf and to use psttfc for the
+ # difference report.
+
+ # Use -DSWIG_EXECUTABLE=/home/software/swig/install/bin/swig to test a pre-release version
+ # o...
[truncated message content] |