Hi Tim, > you could look at libidn2 as an example how to use system libunistring > if there (or if new enough) and fallback to gnulib unistring. > (BTW, libunistring is made of the gnulib unistring modules) > > It creates a separate dir / library for gnulib unistring functions, > *BUT* only uses it when a system libunistring can't be found. > > bootstrap.conf: Call gnulib-tool in bootstrap_post_import_hook() only > for the needed unistring modules. > > configure.ac: Check for system libunistring (set a conditional > HAVE_LIBUNISTRING > > Makefile.am: if !HAVE_LIBUNISTRING -> add unistring/ to SUBDIR > > */Makefile.am: if !HAVE_LIBUNISTRING -> add unistring/ to includes in > AM_CPPFLAGS
A simpler way to achieve the same thing is to include the gnulib module 'libunistring-optional'. It will use the system libunistring if it exists and is new enough, and otherwise compile the respective modules from source. Bruno