[tex-live] location of t1* binaries

Olaf Weber olaf at infovore.xs4all.nl
Thu Oct 7 09:30:19 CEST 2004


Thomas Esser writes:

> The patch that I have send you does not try to find the header file or
> the libraray if configuring together with a texk source tree. You might
> try to check for the header file, but you have to take care of the right
> relative path. configure runs at your top-level and the paths that I
> have suggested work inside otftotfm where they are needed.

> Don't you have a teTeX-beta? You can try to use that for these tests.
> Just put your sources into utils/lcdf-typetools and try to build using
>   mkdir -p /some/where/build
>   cd /some/where/build
>   with_kpathsea=texk-local /some/where/tetex-beta/configure
> You might need to remove installed kpathsea headers and the installed
> library from your system for a real test, though.

FWIW, I've been playing around with some m4 stuff to handle similar
situations.  The idea would be that you can do something like this to
test for libz and libcurl, respectively.  The examples below are from
a makefile and configuration I've been playing with.  I haven't much
experience yet with putting this stuff in a Makefile.am though.

---- from autoconfig.ac ----
KPSE_WITH_LIB(z, zlib.h, ../zlib)
KPSE_WITH_LIB(curl, curl/curl.h, ../curl/lib, ../curl/include, libcurl.la)
---- fragments from Makefile.in ----
libz_CPPFLAGS = @libz_CPPFLAGS@
libz_LDFLAGS = @libz_LDFLAGS@
libz_LDLIBS = @libz_LDLIBS@
libz_DIR = @libz_DIR@
libz_DEP = @libz_DEP@
libz_LIB = @libz_LIB@

$(libz_LIB):
	(cd $(libz_DIR) && make)


libcurl_CPPFLAGS = @libcurl_CPPFLAGS@
libcurl_LDFLAGS = @libcurl_LDFLAGS@
libcurl_LDLIBS = @libcurl_LDLIBS@
libcurl_DIR = @libcurl_DIR@
libcurl_DEP = @libcurl_DEP@
libcurl_LIB = @libcurl_LIB@

$(libcurl_LIB):
	(cd $(libcurl_DIR) && make)

# DEFS and LIBS are set by configure; meddle at your own risk.
# If you just want to add something, use CPPFLAGS and LDLIBS.
DEFS = @DEFS@
LIBS = @LIBS@

INCLUDES = -I. -I$(srcdir) $(libz_CPPFLAGS) $(libcurl_CPPFLAGS)

## Compilation without libtool
CCcompile = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
CXXcompile = $(CXX) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS)


---- from acinclude.m4 ----

# Determine whether to use a library, and if so, whether to use an
# installed version or compile one ourself, in which case the source
# must be available.  You can specify the libdir and include even if
# you're not using a system library.  The assumption is then that the
# source is not in the default location.
#
# $1 = the library's base name (e.g, 'z' for 'libz')
# $2 = one or more headers to check for
# $3 = relative path to the source of the library
# $4 = default path for includes (optional, default is $3)
# $5 = name of library in the source tree (optional, default is lib$1.a)
#
# We set a number of variables, depending on what options were given:
#   lib$1_CPPFLAGS - Additional CPPFLAGS needed to use lib$1 (e.g, -I)
#   lib$1_LDFLAGS  - Additional LDFLAGS needed to use lib$1 (e.g, -L)
#   lib$1_LDLIBS   - Additional LDLIBS needed to use lib$1 (e.g, -l)
#   lib$1_DIR      - Directory where lib$1 can be built.
#   lib$1_DEP      - Variable to use to depend on lib$1.
#   lib$1_LIB      - Name of the library.
#
# It is an error if --without-lib$1 is not given, but we cannot find
# any trace of the library.
#
AC_DEFUN([KPSE_WITH_LIB],
  [AC_ARG_WITH(lib$1,
    [  --without-lib$1
                          do not use lib$1 library])
  AC_ARG_WITH(system_lib$1,
    [  --with-system-lib$1
                          use installed lib$1 library])
  AC_ARG_WITH(lib$1_libdir,
    [  --with-lib$1-libdir=DIR
                          where to look for lib$1])
  AC_ARG_WITH(lib$1_include,
    [  --with-lib$1-include=DIR
                          where to look for lib$1 headers])
  if test "x$with_lib$1" = "xno"; then
    # --without-LIB was given
    lib$1_CPPFLAGS=
    lib$1_LDFLAGS=
    lib$1_LDLIBS=
    lib$1_DIR=
    lib$1_DEP=
    lib$1_LIB=dummy-lib$1
  else
    # Where to get the lib$1 headers from.
    kpse_with_lib_user_cppflags="$CPPFLAGS"
    if test "x$with_lib$1_include" != x; then
      # Always use a path that was given on command line.
      lib$1_CPPFLAGS="-I$with_lib$1_include"
    elif test "x$with_system_lib$1" = "xyes"; then
      # --with-system-lib$1 was given, assume we know what to do.
      lib$1_CPPFLAGS=
    else
      # Look in default locations first.
      if test "x$4" = x; then
        # Only use inferred default path for includes if it exists.
        if test -d "$ac_srcdir/$3" || test -d "$3"; then
          lib$1_CPPFLAGS='-I$3 -I$(srcdir)/$3'
        fi
      else
        # Only use default path for includes if it exists.
        if test -d "$ac_srcdir/$4" || test -d "$4"; then
          lib$1_CPPFLAGS='-I$4 -I$(srcdir)/$4'
        fi
      fi
      # If lib$1_CPPFLAGS is still empty, we don't have the source
      # where we expect it.  The library wasn't disabled, so pretend
      # --with-system-lib$1 was given.
      if test "x$lib$1_CPPFLAGS" = x; then
        with_system_lib$1=yes
      fi
    fi
    CPPFLAGS="$CPPFLAGS $lib$1_CPPFLAGS"
    AC_CHECK_HEADERS([$2],,AC_MSG_ERROR($2 not found))
    CPPFLAGS="$kpse_with_lib_user_cppflags"

    kpse_with_lib_user_ldflags="$LDFLAGS"
    if test "x$with_lib$1_libdir" != x; then
      # Always use a path that was given on command line.
      lib$1_DIR="$with_lib$1_libdir"
      lib$1_LDFLAGS='-L$(lib$1_DIR)'
    elif test "x$with_system_lib$1" = "xyes"; then
      # --with-system-lib$1 was given, assume we know what to do.
      lib$1_DIR=
      lib$1_LDFLAGS=
    else
      # Fall back on default.  (FIXME: should we check for existence?)
      lib$1_DIR="$3"
      lib$1_LDFLAGS='-L$(lib$1_DIR)'
    fi
    LDFLAGS="$lib$1_LDFLAGS $kpse_with_lib_ldflags"
    if test "$with_system_lib$1" = yes; then
      kpse_with_lib_user_libs="$LIBS"
      AC_CHECK_LIB($1,main,,AC_MSG_ERROR(lib$1 not found))
      LIBS="$kpse_with_lib_user_libs"
      lib$1_LDLIBS="-l$1"
      lib$1_DEP=
      lib$1_LIB=dummy-lib$1
      kpse_with_lib_ldflags="$LDFLAGS"
    elif test "x$5" = x; then
      lib$1_LDLIBS="-l$1"
      lib$1_DEP='$(lib$1_DIR)/lib$1.a'
      lib$1_LIB='$(lib$1_DIR)/lib$1.a'
    else
      lib$1_LDLIBS="-l$1"
      lib$1_DEP='$(lib$1_DIR)/$5'
      lib$1_LIB='$(lib$1_DIR)/$5'
    fi
    LDFLAGS="$kpse_with_lib_user_ldflags"
  fi
  AC_SUBST(lib$1_CPPFLAGS)
  AC_SUBST(lib$1_LDFLAGS)
  AC_SUBST(lib$1_LDLIBS)
  AC_SUBST(lib$1_DIR)
  AC_SUBST(lib$1_DEP)
  AC_SUBST(lib$1_LIB)
])# KPSE_WITH_LIB

-- 
Olaf Weber

               (This space left blank for technical reasons.)



More information about the tex-live mailing list