Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dnl
AC_DEFINE([_POSIX_C_SOURCE],[200809L],[Enable POSIX])
AC_SUBST([READLINE_LIBS])
AC_SUBST([YAZ_CONF_CFLAGS])
AC_SUBST([PKGCONFIG_XML])
dnl ------ Checking programs
AC_PROG_CC
AC_PROG_CPP
Expand Down Expand Up @@ -338,7 +339,7 @@ if test "$enable_threads" = "yes" -a "$HAVETHREADS" = "0"; then
LIBS="$lib $OLIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <pthread.h> ]],
[[ pthread_t id; pthread_join(id, 0); ]])],
[ PTHREAD_LIBS=$lib; break
[ PTHREAD_LIBS=$lib; break
],[])
done
LIBS=$OLIBS
Expand All @@ -357,16 +358,19 @@ YAZ_LIBXML2([
AC_DEFINE([YAZ_HAVE_XML2], [1], [Define to 1 if Libxml2 is present])
YAZ_CONFIG_CFLAGS="$YAZ_CONFIG_CFLAGS -DYAZ_HAVE_XML2=1"
xml_enabled=true
PKGCONFIG_XML=libxml-2.0
])

if test "$xml_enabled" = "true"; then
YAZ_LIBXSLT([
AC_DEFINE([YAZ_HAVE_XSLT], [1], [Define to 1 if Libxslt is present])
YAZ_CONFIG_CFLAGS="$YAZ_CONFIG_CFLAGS -DYAZ_HAVE_XSLT=1"
PKGCONFIG_XML=libxslt
])
YAZ_LIBEXSLT([
AC_DEFINE([YAZ_HAVE_EXSLT], [1], [Define to 1 if EXSLT is present])
YAZ_CONFIG_CFLAGS="$YAZ_CONFIG_CFLAGS -DYAZ_HAVE_EXSLT=1"
PKGCONFIG_XML=libexslt
])

fi
Expand Down
53 changes: 42 additions & 11 deletions doc/book.xml
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,17 @@
</para></listitem>
</varlistentry>
<varlistentry>
<term><filename>util/yaz-config</filename></term>
<term><filename>yaz.pc</filename>,
<filename>yaz-icu.pc</filename>,
<filename>yaz-server.pc</filename></term>
<listitem><para>Files generated by configure for
<command>pkg-config</command>, specifying compiler and linker flags
for the main &yaz; library, ICU wrapper library, and Generic Frontend
server library, respectively.
</para></listitem>
</varlistentry>
<varlistentry>
<term><filename>src/yaz-config</filename></term>
<listitem><para>A Bourne-shell script, generated by configure, that
specifies how external applications should compile - and link with
&yaz;.
Expand Down Expand Up @@ -822,6 +832,16 @@
<screen>
make install
</screen>
<para>
This also installs the <command>pkg-config</command> files
<filename>yaz.pc</filename>, <filename>yaz-icu.pc</filename>, and
<filename>yaz-server.pc</filename> in
<filename>${libdir}/pkgconfig</filename> (by default,
<filename>/usr/local/lib/pkgconfig</filename>), and the legacy
<filename>yaz-config</filename> script in
<filename>${bindir}</filename> (by default,
<filename>/usr/local/bin</filename>).
</para>
<para>
You probably need to have root access in order to perform this.
You must specify the <literal>--prefix</literal> option for configure if
Expand Down Expand Up @@ -936,16 +956,27 @@
<sect2 id="installation-linking-yaz-unix">
<title>How to make apps using YAZ on UNIX</title>
<para>
This section describes how to compile - and link your own
applications using the &yaz; toolkit.
If you're used to Makefiles this shouldn't be hard. As for
other libraries you have used before, you need to set a proper include
path for your C/C++ compiler and specify the location of
&yaz; libraries. You can do it by hand, but generally we suggest
you use the <filename>yaz-config</filename> that is generated
by <filename>configure</filename>. This is especially
important if you're using the threaded version of &yaz; which
require you to pass more options to your linker/compiler.
Use <command>pkg-config</command> to obtain the compiler and linker
flags for applications using &yaz;. The installed packages are
<literal>yaz</literal> for the main library,
<literal>yaz-icu</literal> for the ICU wrapper library, and
<literal>yaz-server</literal> for the Generic Frontend server library.
For example, <command>pkg-config --cflags yaz</command> prints the
compiler flags and <command>pkg-config --libs yaz</command> prints the
linker flags. Substitute <literal>yaz-icu</literal> or
<literal>yaz-server</literal> when using those libraries; their flags
include the main library dependency. The ICU wrapper requires &yaz;
to have been built with ICU support. If the installation directory
is outside the search path of <command>pkg-config</command>, add
<filename>${libdir}/pkgconfig</filename> to
<literal>PKG_CONFIG_PATH</literal>.
</para>
<para>
The legacy alternative is the <filename>yaz-config</filename> script
generated by <filename>configure</filename>. The following examples
describe how to use this script to set the include path for your
C/C++ compiler and specify the &yaz; libraries and other required
compiler and linker options.
</para>
<para>
The <filename>yaz-config</filename> script accepts command line
Expand Down
2 changes: 1 addition & 1 deletion yaz-icu.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ includedir=@includedir@
Name: YAZ ICU
Version: @VERSION@
Description: YAZ ICU library for building Z39.50 applications
Requires: yaz libexslt icu-i18n
Requires: yaz icu-i18n
Libs: -L${libdir} -lyaz_icu @PTHREAD_LIBS@
Cflags: @ICU_CPPFLAGS@
2 changes: 1 addition & 1 deletion yaz-server.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ includedir=@includedir@
Name: YAZ server
Version: @VERSION@
Description: YAZ server library for building Z39.50 applications
Requires: yaz libexslt
Requires: yaz
Libs: -L${libdir} -lyaz_server @PTHREAD_LIBS@
2 changes: 1 addition & 1 deletion yaz.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ includedir=@includedir@
Name: YAZ
Version: @VERSION@
Description: YAZ library for building Z39.50 applications
Requires: libexslt
Requires: @PKGCONFIG_XML@
Libs: -L${libdir} -lyaz
Libs.private: @LIBS@
Cflags: -I${includedir} @YAZ_CONFIG_CFLAGS@