forked from rttopo/librttopo
Switch to automake based builds
parent
c8f70b8860
commit
6bfbeea75e
|
@ -2,14 +2,22 @@
|
|||
*.lo
|
||||
*.la
|
||||
.libs/
|
||||
src/Makefile
|
||||
.deps/
|
||||
compile
|
||||
depcomp
|
||||
missing
|
||||
src/stamp-h1
|
||||
aclocal.m4
|
||||
rttopo.pc
|
||||
m4/
|
||||
Makefile
|
||||
Makefile.in
|
||||
autom4te.cache/
|
||||
config.guess
|
||||
config.log
|
||||
config.status
|
||||
config.sub
|
||||
configure
|
||||
cunit/Makefile
|
||||
install-sh
|
||||
librttopo_geom.h
|
||||
libtool
|
||||
|
@ -18,3 +26,4 @@ rtin_wkt_lex.c
|
|||
rtin_wkt_parse.c
|
||||
rtin_wkt_parse.h
|
||||
rttopo_config.h
|
||||
rttopo_config.h.in
|
||||
|
|
25
Makefile
25
Makefile
|
@ -1,25 +0,0 @@
|
|||
all install uninstall clean:
|
||||
$(MAKE) -C src $@
|
||||
|
||||
all install: config.status
|
||||
|
||||
maintainer-clean-local:
|
||||
rm -f configure
|
||||
rm -f config.guess config.rpath config.sub
|
||||
rm -f libtool install-sh ltmain.sh
|
||||
|
||||
maintainer-clean: distclean
|
||||
$(MAKE) maintainer-clean-local
|
||||
|
||||
distclean-local:
|
||||
rm -Rf autom4te.cache
|
||||
rm -f config.log config.cache config.status
|
||||
|
||||
distclean: clean
|
||||
$(MAKE) distclean-local
|
||||
|
||||
configure: configure.ac
|
||||
./autogen.sh
|
||||
|
||||
config.status: configure
|
||||
./configure
|
|
@ -0,0 +1,12 @@
|
|||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
SUBDIRS = src headers
|
||||
|
||||
EXTRA_DIST = makefile.vc nmake.opt \
|
||||
README.md README.topo g_serialized.txt
|
||||
|
||||
AUTOMAKE_OPTIONS = dist-zip foreign
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = rttopo.pc
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
|
||||
LIBRTGEOM_VERSION=0.0.0
|
||||
|
||||
# Librtgeom interface versioning
|
||||
|
||||
# Current interface, increments when adding an interface
|
||||
LIBRTGEOM_IFACE_CUR=0
|
||||
# Age of current interface, only changes when current interface
|
||||
# changes, either incrementing with it (compatible change) or
|
||||
# going back to zero (incompatible change).
|
||||
LIBRTGEOM_IFACE_AGE=0
|
||||
# Revision of current interface, set to 0 when adding an interface
|
||||
# or increment when just changing implementations.
|
||||
LIBRTGEOM_IFACE_REV=0
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
|
||||
m4_include([macros/libtool.m4])
|
||||
m4_include([macros/ltoptions.m4])
|
||||
m4_include([macros/ltsugar.m4])
|
||||
m4_include([macros/ltversion.m4])
|
||||
m4_include([macros/lt~obsolete.m4])
|
68
autogen.sh
68
autogen.sh
|
@ -1,7 +1,6 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
#
|
||||
# PostGIS Bootstrapping Script
|
||||
# rttopo bootstrapping script
|
||||
#
|
||||
giveup()
|
||||
{
|
||||
|
@ -13,32 +12,18 @@ giveup()
|
|||
|
||||
OSTYPE=`uname -s`
|
||||
|
||||
#
|
||||
# Solaris has GNU versions of utils with a g prefix
|
||||
#
|
||||
for grep in ggrep grep; do
|
||||
GREP=`which $grep 2>/dev/null`
|
||||
if test -x "${GREP}"; then
|
||||
break;
|
||||
fi
|
||||
done
|
||||
|
||||
for sed in gsed sed; do
|
||||
SED=`which $sed 2>/dev/null`
|
||||
if test -x "${SED}"; then
|
||||
break;
|
||||
fi
|
||||
done
|
||||
|
||||
#
|
||||
# Find and run Autoconf
|
||||
#
|
||||
AUTOCONF=`which autoconf 2>/dev/null`
|
||||
if [ ! ${AUTOCONF} ]; then
|
||||
echo "Missing autoconf!"
|
||||
exit
|
||||
fi
|
||||
AUTOCONF_VER=`${AUTOCONF} --version | ${GREP} -E "^.*[0-9]$" | ${SED} 's/^.* //'`
|
||||
AUTOCONF_VER=`${AUTOCONF} --version | grep -E "^.*[0-9]$" | sed 's/^.* //'`
|
||||
|
||||
AUTOHEADER=`which autoheader 2>/dev/null`
|
||||
if [ ! ${AUTOHEADER} ]; then
|
||||
echo "Missing autoheader!"
|
||||
exit
|
||||
fi
|
||||
|
||||
for aclocal in aclocal aclocal-1.10 aclocal-1.9; do
|
||||
ACLOCAL=`which $aclocal 2>/dev/null`
|
||||
|
@ -50,9 +35,21 @@ if [ ! ${ACLOCAL} ]; then
|
|||
echo "Missing aclocal!"
|
||||
exit
|
||||
fi
|
||||
ACLOCAL_VER=`${ACLOCAL} --version | ${GREP} -E "^.*[0-9]$" | ${SED} 's/^.* //'`
|
||||
ACLOCAL_VER=`${ACLOCAL} --version | grep -E "^.*[0-9]$" | sed 's/^.* //'`
|
||||
|
||||
for libtoolize in glibtoolize libtoolize; do
|
||||
for automake in automake automake-1.10 automake-1.9; do
|
||||
AUTOMAKE=`which $automake 2>/dev/null`
|
||||
if test -x "${AUTOMAKE}"; then
|
||||
break;
|
||||
fi
|
||||
done
|
||||
if [ ! ${AUTOMAKE} ]; then
|
||||
echo "Missing automake!"
|
||||
exit
|
||||
fi
|
||||
AUTOMAKE_VER=`${AUTOMAKE} --version | grep -E "^.*[0-9]$" | sed 's/^.* //'`
|
||||
|
||||
for libtoolize in libtoolize glibtoolize; do
|
||||
LIBTOOLIZE=`which $libtoolize 2>/dev/null`
|
||||
if test -x "${LIBTOOLIZE}"; then
|
||||
break;
|
||||
|
@ -62,21 +59,27 @@ if [ ! ${LIBTOOLIZE} ]; then
|
|||
echo "Missing libtoolize!"
|
||||
exit
|
||||
fi
|
||||
LIBTOOLIZE_VER=`${LIBTOOLIZE} --version | ${GREP} -E "^.*[0-9]\.[0-9]" | ${SED} 's/^.* //'`
|
||||
LIBTOOLIZE_MAJOR_VER=`echo ${LIBTOOLIZE_VER} | cut -f1 -d'.'`
|
||||
LIBTOOLIZE_VER=`${LIBTOOLIZE} --version | grep -E "^.*[0-9]\.[0-9]" | sed 's/^.* //'`
|
||||
|
||||
# TODO: Check libtool version and add --install option only for 1.9b+
|
||||
LTOPTS="--force --copy"
|
||||
if test ${LIBTOOLIZE_MAJOR_VER} -ge 2; then
|
||||
LTOPTS="${LTOPTS} --install"
|
||||
AMOPTS="--add-missing --copy -Woverride"
|
||||
if test "$OSTYPE" = "IRIX" -o "$OSTYPE" = "IRIX64"; then
|
||||
AMOPTS=$AMOPTS" --include-deps";
|
||||
fi
|
||||
|
||||
LTOPTS="--force --copy"
|
||||
echo "* Running ${LIBTOOLIZE} (${LIBTOOLIZE_VER})"
|
||||
echo " OPTIONS = ${LTOPTS}"
|
||||
${LIBTOOLIZE} ${LTOPTS} || giveup
|
||||
|
||||
echo "* Running $ACLOCAL (${ACLOCAL_VER})"
|
||||
${ACLOCAL} -I macros || giveup
|
||||
${ACLOCAL} -I m4 || giveup
|
||||
|
||||
echo "* Running ${AUTOHEADER} (${AUTOCONF_VER})"
|
||||
${AUTOHEADER} || giveup
|
||||
|
||||
echo "* Running ${AUTOMAKE} (${AUTOMAKE_VER})"
|
||||
echo " OPTIONS = ${AMOPTS}"
|
||||
${AUTOMAKE} ${AMOPTS} || giveup
|
||||
|
||||
echo "* Running ${AUTOCONF} (${AUTOCONF_VER})"
|
||||
${AUTOCONF} || giveup
|
||||
|
@ -89,3 +92,4 @@ else
|
|||
echo " Failed to generate ./configure script!"
|
||||
giveup
|
||||
fi
|
||||
|
||||
|
|
489
configure.ac
489
configure.ac
|
@ -1,417 +1,128 @@
|
|||
dnl **********************************************************************
|
||||
dnl *
|
||||
dnl * rttopo - topology library
|
||||
dnl * http://git.osgeo.org/gogs/rttopo/librttopo
|
||||
dnl * Copyright 2008 Mark Cave-Ayland
|
||||
dnl *
|
||||
dnl * This is free software; you can redistribute and/or modify it under
|
||||
dnl * the terms of the GNU General Public Licence. See the COPYING file.
|
||||
dnl *
|
||||
dnl **********************************************************************
|
||||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT()
|
||||
AC_CONFIG_HEADERS([src/rttopo_config.h])
|
||||
AC_CONFIG_MACRO_DIR([macros])
|
||||
AC_PREREQ(2.61)
|
||||
AC_INIT(librttopo, 1.0.0-RC0, strk@keybit.net)
|
||||
AC_LANG(C)
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
AM_INIT_AUTOMAKE([foreign])
|
||||
AM_MAINTAINER_MODE
|
||||
AM_CONFIG_HEADER(src/rttopo_config.h)
|
||||
|
||||
# disabling debug support
|
||||
AH_TEMPLATE([NDEBUG],
|
||||
[Must be defined in order to disable debug mode.])
|
||||
AC_DEFINE(NDEBUG)
|
||||
AH_TEMPLATE([LIBRTGEOM_VERSION],
|
||||
[RTTOPO library version.])
|
||||
AC_DEFINE_UNQUOTED([LIBRTGEOM_VERSION], ["$VERSION"], [rtgeom version])
|
||||
AC_SUBST([LIBRTGEOM_VERSION])
|
||||
AH_TEMPLATE([RTGEOM_GEOS_VERSION],
|
||||
[RTTOPO GEOS version.])
|
||||
AH_TEMPLATE([RTGEOM_DEBUG_LEVEL],
|
||||
[RTGEOM Debug Level.])
|
||||
AC_DEFINE(RTGEOM_DEBUG_LEVEL)
|
||||
AC_DEFINE_UNQUOTED([RTGEOM_DEBUG_LEVEL], [0], [debug level])
|
||||
|
||||
# Checks for header files.
|
||||
AC_CHECK_HEADERS(stdlib.h,, [AC_MSG_ERROR([cannot find stdlib.h, bailing out])])
|
||||
AC_CHECK_HEADERS(stdio.h,, [AC_MSG_ERROR([cannot find stdio.h, bailing out])])
|
||||
AC_CHECK_HEADERS(string.h,, [AC_MSG_ERROR([cannot find string.h, bailing out])])
|
||||
AC_CHECK_HEADERS(math.h,, [AC_MSG_ERROR([cannot find math.h, bailing out])])
|
||||
AC_CHECK_HEADERS(float.h,, [AC_MSG_ERROR([cannot find float.h, bailing out])])
|
||||
AC_CHECK_HEADERS(inttypes.h,, [AC_MSG_ERROR([cannot find inttypes.h, bailing out])])
|
||||
AC_CHECK_HEADERS(stdint.h,, [AC_MSG_ERROR([cannot find stdint.h, bailing out])])
|
||||
AC_CHECK_HEADERS(ctype.h,, [AC_MSG_ERROR([cannot find ctype.h, bailing out])])
|
||||
AC_CHECK_HEADERS(errno.h,, [AC_MSG_ERROR([cannot find errno.h, bailing out])])
|
||||
AC_CHECK_HEADERS(assert.h,, [AC_MSG_ERROR([cannot find assert.h, bailing out])])
|
||||
AC_CHECK_HEADERS(stdarg.h,, [AC_MSG_ERROR([cannot find stdarg.h, bailing out])])
|
||||
|
||||
|
||||
dnl Invoke libtool: we do this as it is the easiest way to find the PIC
|
||||
dnl flags required to build librttopo
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
dnl
|
||||
dnl Compilers
|
||||
dnl
|
||||
# Checks for programs.
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CC
|
||||
AC_PROG_CPP
|
||||
AC_PROG_GREP
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
dnl
|
||||
dnl Define PIC flags in PICFLAGS (note: this variable is set as part of libtool initialisation above)
|
||||
dnl
|
||||
PICFLAGS="$lt_prog_compiler_pic"
|
||||
AC_SUBST([PICFLAGS])
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_TYPE_OFF_T
|
||||
AC_TYPE_SIZE_T
|
||||
AC_HEADER_TIME
|
||||
AC_STRUCT_TM
|
||||
AC_C_VOLATILE
|
||||
|
||||
dnl
|
||||
dnl For GCC enable additional warning flags -Wall and -Wmissing-prototypes (using macro included with libtool)
|
||||
dnl
|
||||
WARNFLAGS=""
|
||||
AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -Wall], [_cv_wall], [-Wall], [], [WARNFLAGS="$WARNFLAGS -Wall"], [])
|
||||
AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -Wmissing-prototypes], [_cv_misprot], [-Wmissing-prototypes], [], [WARNFLAGS="$WARNFLAGS -Wmissing-prototypes"], [])
|
||||
AC_SUBST([WARNFLAGS])
|
||||
# Checks for library functions.
|
||||
AC_FUNC_LSTAT
|
||||
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
|
||||
AC_FUNC_MEMCMP
|
||||
AC_FUNC_STAT
|
||||
AC_FUNC_STRFTIME
|
||||
AC_CHECK_FUNCS([memset sqrt strcasecmp strerror strncasecmp strstr fdatasync ftruncate getcwd gettimeofday localtime_r memmove strerror])
|
||||
|
||||
dnl
|
||||
dnl For some GCC versions and platforms, floating point issues need to be
|
||||
dnl ironed out.
|
||||
NUMERICFLAGS=""
|
||||
AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -ffloat-store], [dummy_cv_ffloat_store], [-ffloat-store], [], [NUMERICFLAGS="$NUMERICFLAGS -ffloat-store"], [])
|
||||
AC_SUBST([NUMERICFLAGS])
|
||||
AC_CONFIG_FILES([Makefile \
|
||||
src/Makefile \
|
||||
headers/Makefile \
|
||||
headers/librttopo_geom.h \
|
||||
rttopo.pc])
|
||||
|
||||
dnl
|
||||
dnl Exporting used library symbols in the module is a source of issues,
|
||||
dnl see https://trac.osgeo.org/postgis/ticket/3281
|
||||
dnl
|
||||
EXCLUDELIBS_LDFLAGS=""
|
||||
AC_LIBTOOL_COMPILER_OPTION([if $compiler supports --exclude-libs], [_cv_exclude_libs], [[-Wl,--exclude-libs,ALL]], [], [EXCLUDELIBS_LDFLAGS="-Wl,--exclude-libs,ALL"], [])
|
||||
AC_SUBST([EXCLUDELIBS_LDFLAGS])
|
||||
|
||||
dnl
|
||||
dnl Define executable suffix for use with the loader Makefiles
|
||||
dnl
|
||||
EXESUFFIX="$ac_cv_exeext"
|
||||
AC_SUBST([EXESUFFIX])
|
||||
|
||||
dnl
|
||||
dnl Librttopo version information imported from Version.config
|
||||
dnl
|
||||
|
||||
LIBRTGEOM_CURRENT=`cat Version.config | grep ^LIBRTGEOM_IFACE_CUR | sed 's/[[^=]]*=\([[0-9]]\)/\1/g'`
|
||||
LIBRTGEOM_AGE=`cat Version.config | grep ^LIBRTGEOM_IFACE_AGE | sed 's/[[^=]]*=\([[0-9]]\)/\1/g'`
|
||||
LIBRTGEOM_REV=`cat Version.config | grep ^LIBRTGEOM_IFACE_REV | sed 's/[[^=]]*=\([[0-9]]\)/\1/g'`
|
||||
AC_SUBST([LIBRTGEOM_CURRENT])
|
||||
AC_SUBST([LIBRTGEOM_AGE])
|
||||
AC_SUBST([LIBRTGEOM_REV])
|
||||
|
||||
LIBRTGEOM_VERSION=`grep ^LIBRTGEOM_VERSION Version.config | sed 's/.*=//'`
|
||||
AC_DEFINE_UNQUOTED([LIBRTGEOM_VERSION], ["$LIBRTGEOM_VERSION"], [rtgeom version])
|
||||
AC_SUBST([LIBRTGEOM_VERSION])
|
||||
|
||||
|
||||
dnl
|
||||
dnl Search for flex/bison to build the parser
|
||||
dnl
|
||||
|
||||
AC_PROG_LEX
|
||||
AC_PROG_YACC
|
||||
AC_SUBST([LEX])
|
||||
AC_SUBST([YACC])
|
||||
|
||||
dnl
|
||||
dnl Search for OS-specific headers
|
||||
dnl
|
||||
AC_CHECK_HEADER([ieeefp.h], [HAVE_IEEEFP_H=1], [HAVE_IEEEFP_H=0])
|
||||
AC_DEFINE_UNQUOTED([HAVE_IEEEFP_H], [$HAVE_IEEEFP_H], [ieeefp.h header])
|
||||
AC_CHECK_HEADER([termios.h], [HAVE_TERMIOS_H=1], [HAVE_TERMIOS_H=0])
|
||||
AC_DEFINE_UNQUOTED([HAVE_TERMIOS_H], [$HAVE_TERMIOS_H], [termios.h header])
|
||||
|
||||
|
||||
dnl
|
||||
dnl Check for platform-specific functions
|
||||
dnl
|
||||
AC_CHECK_FUNC(vasprintf, AC_DEFINE([HAVE_VASPRINTF]))
|
||||
AC_CHECK_FUNC(asprintf, AC_DEFINE([HAVE_ASPRINTF]))
|
||||
AC_FUNC_FSEEKO()
|
||||
|
||||
dnl
|
||||
dnl First see if we have isfinite in basic header
|
||||
dnl then check to see if it's a GNU extension
|
||||
dnl
|
||||
AC_CHECK_DECL(isfinite,
|
||||
[AC_DEFINE([HAVE_ISFINITE])],
|
||||
[],
|
||||
[#include <math.h>])
|
||||
|
||||
dnl Clear the cache
|
||||
unset ac_cv_have_decl_isfinite
|
||||
|
||||
AC_CHECK_DECL(isfinite,
|
||||
AC_DEFINE([HAVE_GNU_ISFINITE]),
|
||||
[],
|
||||
[[
|
||||
#define _GNU_SOURCE
|
||||
#include <math.h>
|
||||
]])
|
||||
|
||||
dnl
|
||||
dnl MingW requires use of pwd -W to give proper Windows (not MingW) paths
|
||||
dnl for in-place regression tests
|
||||
dnl
|
||||
case $host_os in
|
||||
*mingw*)
|
||||
MINGWBUILD=1
|
||||
;;
|
||||
*)
|
||||
MINGWBUILD=0
|
||||
;;
|
||||
esac
|
||||
AC_SUBST([MINGWBUILD])
|
||||
|
||||
dnl
|
||||
dnl Allow the user to specify the location of the html/docbook.xsl stylesheet
|
||||
dnl
|
||||
|
||||
dnl ===========================================================================
|
||||
dnl Detect libxml2 if it is installed
|
||||
dnl (needed to GeomFromGML and GeomFromKML functions)
|
||||
dnl ===========================================================================
|
||||
|
||||
AC_ARG_WITH([xml2config],
|
||||
[AS_HELP_STRING([--with-xml2config=FILE], [specify an alternative xml2-config file])],
|
||||
[XML2CONFIG="$withval"], [XML2CONFIG=""])
|
||||
|
||||
if test "x$XML2CONFIG" = "x"; then
|
||||
dnl XML2CONFIG was not specified, so search within the current path
|
||||
AC_PATH_PROG([XML2CONFIG], [xml2-config])
|
||||
|
||||
dnl If we couldn't find xml2-config, display a warning
|
||||
if test "x$XML2CONFIG" = "x"; then
|
||||
AC_MSG_ERROR([could not find xml2-config from libxml2 within the current path. You may need to try re-running configure with a --with-xml2config parameter.])
|
||||
fi
|
||||
else
|
||||
dnl XML2CONFIG was specified; display a message to the user
|
||||
if test "x$XML2CONFIG" = "xyes"; then
|
||||
AC_MSG_ERROR([you must specify a parameter to --with-xml2config, e.g. --with-xml2config=/path/to/xml2-config])
|
||||
else
|
||||
if test -f $XML2CONFIG; then
|
||||
AC_MSG_RESULT([Using user-specified xml2-config file: $XML2CONFIG])
|
||||
else
|
||||
AC_MSG_ERROR([the user-specified xml2-config file $XML2CONFIG does not exist])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
dnl Extract the linker and include flags
|
||||
XML2_LDFLAGS=`$XML2CONFIG --libs`
|
||||
XML2_CPPFLAGS=`$XML2CONFIG --cflags`
|
||||
|
||||
dnl Extract the version
|
||||
RTGEOM_LIBXML2_VERSION=`$XML2CONFIG --version`
|
||||
|
||||
dnl Check headers file
|
||||
CPPFLAGS_SAVE="$CPPFLAGS"
|
||||
CPPFLAGS="$XML2_CPPFLAGS"
|
||||
AC_CHECK_HEADERS([libxml/tree.h libxml/parser.h libxml/xpath.h libxml/xpathInternals.h],
|
||||
[], [AC_MSG_ERROR([could not find headers include related to libxml2])])
|
||||
CPPFLAGS="$CPPFLAGS_SAVE"
|
||||
|
||||
dnl Ensure we can link against libxml2
|
||||
LIBS_SAVE="$LIBS"
|
||||
LIBS="$XML2_LDFLAGS"
|
||||
AC_CHECK_LIB([xml2], [xmlInitParser], [], [AC_MSG_ERROR([could not find libxml2])], [])
|
||||
LIBS="$LIBS_SAVE"
|
||||
|
||||
AC_DEFINE_UNQUOTED([RTGEOM_LIBXML2_VERSION], ["$RTGEOM_LIBXML2_VERSION"], [libxml2 version])
|
||||
AC_SUBST([RTGEOM_LIBXML2_VERSION])
|
||||
|
||||
|
||||
|
||||
dnl ===========================================================================
|
||||
dnl Detect the version of GEOS installed on the system
|
||||
dnl ===========================================================================
|
||||
|
||||
AC_ARG_WITH([geosconfig],
|
||||
[AS_HELP_STRING([--with-geosconfig=FILE], [specify an alternative geos-config file])],
|
||||
#-----------------------------------------------------------------------
|
||||
# --with-geosconfig
|
||||
#
|
||||
AC_ARG_WITH([geosconfig],
|
||||
[AS_HELP_STRING([--with-geosconfig=FILE], [specify an alternative geos-config file])],
|
||||
[GEOSCONFIG="$withval"], [GEOSCONFIG=""])
|
||||
|
||||
if test "x$GEOSCONFIG" = "x"; then
|
||||
dnl GEOSCONFIG was not specified, so search within the current path
|
||||
AC_PATH_PROG([GEOSCONFIG], [geos-config])
|
||||
|
||||
dnl If we couldn't find geos-config, display an error
|
||||
if test "x$GEOSCONFIG" = "x"; then
|
||||
AC_MSG_ERROR([could not find geos-config within the current path. You may need to try re-running configure with a --with-geosconfig parameter.])
|
||||
fi
|
||||
# GEOSCONFIG was not specified, so search within the current path
|
||||
AC_PATH_PROG([GEOSCONFIG], [geos-config])
|
||||
# If we couldn't find geos-config, display an error
|
||||
if test "x$GEOSCONFIG" = "x"; then
|
||||
AC_MSG_ERROR([could not find geos-config within the current path. You may need to try re-running configure with a --with-geosconfig parameter.])
|
||||
fi
|
||||
else
|
||||
dnl GEOSCONFIG was specified; display a message to the user
|
||||
if test "x$GEOSCONFIG" = "xyes"; then
|
||||
AC_MSG_ERROR([you must specify a parameter to --with-geosconfig, e.g. --with-geosconfig=/path/to/geos-config])
|
||||
else
|
||||
if test -f $GEOSCONFIG; then
|
||||
AC_MSG_RESULT([Using user-specified geos-config file: $GEOSCONFIG])
|
||||
else
|
||||
AC_MSG_ERROR([the user-specified geos-config file $GEOSCONFIG does not exist])
|
||||
fi
|
||||
fi
|
||||
# GEOSCONFIG was specified; display a message to the user
|
||||
if test "x$GEOSCONFIG" = "xyes"; then
|
||||
AC_MSG_ERROR([you must specify a parameter to --with-geosconfig, e.g. --with-geosconfig=/path/to/geos-config])
|
||||
else
|
||||
if test -f $GEOSCONFIG; then
|
||||
AC_MSG_RESULT([Using user-specified geos-config file: $GEOSCONFIG])
|
||||
else
|
||||
AC_MSG_ERROR([the user-specified geos-config file $GEOSCONFIG does not exist])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Extract the version information from geos_config
|
||||
dnl Note: we extract the major & minor separately, ensure they are numeric,
|
||||
dnl and then combine to give the final version.
|
||||
dnl This is to guard against user error...
|
||||
GEOS_MAJOR_VERSION=`$GEOSCONFIG --version | cut -d. -f1 | sed 's/[[^0-9]]//g'`
|
||||
GEOS_MINOR_VERSION=`$GEOSCONFIG --version | cut -d. -f2 | sed 's/[[^0-9]]//g'`
|
||||
GEOS_PATCH_VERSION=`$GEOSCONFIG --version | cut -d. -f3 | sed 's/[[^0-9]]//g'`
|
||||
if test "x$GEOS_PATCH_VERSION" = "x"; then
|
||||
GEOS_PATCH_VERSION="0";
|
||||
fi
|
||||
GEOS_FULL_VERSION=`$GEOSCONFIG --version`
|
||||
RTGEOM_GEOS_VERSION="$GEOS_MAJOR_VERSION$GEOS_MINOR_VERSION"
|
||||
GEOS_NUMERIC_PATCH_VERSION=`printf "%02d" $GEOS_PATCH_VERSION`
|
||||
GEOS_NUMERIC_MINOR_VERSION=`printf "%02d" $GEOS_MINOR_VERSION`
|
||||
GEOS_NUMERIC_VERSION="$GEOS_MAJOR_VERSION$GEOS_NUMERIC_MINOR_VERSION$GEOS_NUMERIC_PATCH_VERSION"
|
||||
|
||||
dnl Ensure that we are using GEOS >= 3.5.0
|
||||
AC_MSG_RESULT([checking GEOS version... $GEOS_FULL_VERSION])
|
||||
if test ! "$GEOS_NUMERIC_VERSION" -ge 30500; then
|
||||
AC_MSG_ERROR([librttopo requires GEOS >= 3.5.0])
|
||||
fi
|
||||
|
||||
dnl Extract the linker and include flags
|
||||
# Extract the linker and include flags
|
||||
GEOS_LDFLAGS=`$GEOSCONFIG --ldflags`
|
||||
GEOS_CPPFLAGS=-I`$GEOSCONFIG --includes`
|
||||
GEOS_CFLAGS=-I`$GEOSCONFIG --includes`
|
||||
AC_SUBST([GEOS_LDFLAGS])
|
||||
AC_SUBST([GEOS_CPPFLAGS])
|
||||
|
||||
dnl Ensure that we can parse geos_c.h
|
||||
AC_SUBST([GEOS_CFLAGS])
|
||||
# Ensure that we can parse geos_c.h
|
||||
CPPFLAGS_SAVE="$CPPFLAGS"
|
||||
CPPFLAGS="$GEOS_CPPFLAGS"
|
||||
AC_CHECK_HEADER([geos_c.h], [], [AC_MSG_ERROR([could not find geos_c.h - you may need to specify the directory of a geos-config file using --with-geosconfig])])
|
||||
CPPFLAGS="$CPPFLAGS_SAVE"
|
||||
|
||||
dnl Ensure we can link against libgeos_c
|
||||
CPPFLAGS="$GEOS_CFLAGS"
|
||||
AC_CHECK_HEADERS([geos_c.h],, [AC_MSG_ERROR([could not find geos_c.h - you may need to specify the directory of a geos-config file using --with-geosconfig])])
|
||||
CPPFLAGS="$CPPFLAGS_SAVE"
|
||||
# Ensure we can link against libgeos_c
|
||||
LIBS_SAVE="$LIBS"
|
||||
LIBS="$GEOS_LDFLAGS"
|
||||
AC_CHECK_LIB([geos_c], [initGEOS],
|
||||
[],
|
||||
[AC_MSG_ERROR([could not find libgeos_c - you may need to specify the directory of a geos-config file using --with-geosconfig])],
|
||||
[])
|
||||
AC_SEARCH_LIBS(GEOSContext_setErrorMessageHandler_r,geos_c,,AC_MSG_ERROR([could not find libgeos_c (or obsolete 'libgeos_c' < v.3.5.0 found) - you may need to specify the directory of a geos-config file using --with-geosconfig]))
|
||||
LIBS="$LIBS_SAVE"
|
||||
|
||||
LIBS="$LIBS $GEOS_LDFLAGS -lgeos_c"
|
||||
GEOS_MAJOR_VERSION=`$GEOSCONFIG --version | cut -d. -f1 | sed 's/[[^0-9]]//g'`
|
||||
GEOS_MINOR_VERSION=`$GEOSCONFIG --version | cut -d. -f2 | sed 's/[[^0-9]]//g'`
|
||||
RTGEOM_GEOS_VERSION="$GEOS_MAJOR_VERSION$GEOS_MINOR_VERSION"
|
||||
AC_DEFINE_UNQUOTED([RTGEOM_GEOS_VERSION], [$RTGEOM_GEOS_VERSION], [GEOS library version])
|
||||
AC_SUBST([RTGEOM_GEOS_VERSION])
|
||||
AC_SUBST([GEOS_NUMERIC_VERSION])
|
||||
|
||||
dnl ===========================================================================
|
||||
dnl Detect if json-c installed
|
||||
dnl ===========================================================================
|
||||
|
||||
CHECK_JSON=yes
|
||||
HAVE_JSON=no
|
||||
HAVE_JSON_C=no
|
||||
|
||||
AC_ARG_WITH([json],
|
||||
[AS_HELP_STRING([--without-json], [build without json-c support])],
|
||||
[CHECK_JSON="$withval"], [])
|
||||
|
||||
if test "$CHECK_JSON" != "no"; then dnl {
|
||||
|
||||
AC_ARG_WITH([jsondir],
|
||||
[AS_HELP_STRING([--with-jsondir=PATH], [specify the json-c installation directory])],
|
||||
[JSONDIR="$withval"], [JSONDIR=])
|
||||
|
||||
if test ! "x$JSONDIR" = "x"; then
|
||||
dnl Make sure that the directory exists
|
||||
if test "x$JSONDIR" = "xyes"; then
|
||||
AC_MSG_ERROR([you must specify a parameter to --with-jsondir, e.g. --with-jsondir=/path/to])
|
||||
else
|
||||
AC_MSG_RESULT([Using user-specified json-c directory: $JSONDIR])
|
||||
|
||||
dnl Add the include directory to JSON_CPPFLAGS
|
||||
JSON_CPPFLAGS="-I$JSONDIR/include"
|
||||
JSON_LDFLAGS="-L$JSONDIR/lib"
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Check that we can find the json/json.h header file
|
||||
CPPFLAGS_SAVE="$CPPFLAGS"
|
||||
CPPFLAGS="$JSON_CPPFLAGS"
|
||||
AC_CHECK_HEADER([json/json.h], [HAVE_JSON=yes], [
|
||||
AC_CHECK_HEADER([json-c/json.h], [HAVE_JSON=yes; HAVE_JSON_C=yes], [])
|
||||
])
|
||||
CPPFLAGS="$CPPFLAGS_SAVE"
|
||||
|
||||
dnl Ensure we can link against libjson
|
||||
LIBS_SAVE="$LIBS"
|
||||
LIBS="$JSON_LDFLAGS"
|
||||
AC_CHECK_LIB([json-c], [json_object_get], [HAVE_JSON=yes; JSON_LDFLAGS="${JSON_LDFLAGS} -ljson-c"], [
|
||||
AC_CHECK_LIB([json], [json_object_get], [HAVE_JSON=yes; JSON_LDFLAGS="${JSON_LDFLAGS} -ljson"], [], [])
|
||||
], [])
|
||||
LIBS="$LIBS_SAVE"
|
||||
|
||||
if test "$HAVE_JSON" = "yes"; then
|
||||
AC_DEFINE([HAVE_LIBJSON], 1, [Define to 1 if libjson is present])
|
||||
fi
|
||||
if test "$HAVE_JSON_C" = "yes"; then
|
||||
AC_DEFINE([HAVE_LIBJSON_C], 1, [Define to 1 if libjson resides in a json-c subdir])
|
||||
fi
|
||||
|
||||
AC_SUBST([JSON_CPPFLAGS])
|
||||
AC_SUBST([JSON_LDFLAGS])
|
||||
AC_SUBST([HAVE_JSON])
|
||||
|
||||
fi dnl }
|
||||
|
||||
|
||||
|
||||
|
||||
dnl ===========================================================================
|
||||
dnl Allow the user to enable debugging with --enable-debug
|
||||
dnl
|
||||
dnl Currently we default to debug level 4. See DEBUG for more information.
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE([debug], AC_HELP_STRING([--enable-debug], [Enable verbose debugging messages]),
|
||||
[RTGEOM_DEBUG_LEVEL=4], [RTGEOM_DEBUG_LEVEL=0])
|
||||
|
||||
AC_DEFINE_UNQUOTED([RTGEOM_DEBUG_LEVEL], [$RTGEOM_DEBUG_LEVEL], [library debug level (0=disabled)])
|
||||
|
||||
dnl ===========================================================================
|
||||
dnl Allow the user to enable GEOS profiling with --enable-profile
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE([profile], AC_HELP_STRING([--enable-profile], [Enable GEOS profiling messages]),
|
||||
[RTGEOM_PROFILE=1], [RTGEOM_PROFILE=0])
|
||||
|
||||
AC_DEFINE_UNQUOTED([RTGEOM_PROFILE], [$RTGEOM_PROFILE], [Enable GEOS profiling (0=disabled)])
|
||||
|
||||
dnl ===========================================================================
|
||||
dnl Define version macros
|
||||
dnl
|
||||
|
||||
|
||||
CPPFLAGS="$PGSQL_CPPFLAGS $GEOS_CPPFLAGS $XML2_CPPFLAGS $JSON_CPPFLAGS $PCRE_CPPFLAGS $CPPFLAGS"
|
||||
dnl AC_MSG_RESULT([CPPFLAGS: $CPPFLAGS])
|
||||
|
||||
SHLIB_LINK="$PGSQL_LDFLAGS $GEOS_LDFLAGS -lgeos_c -lproj $JSON_LDFLAGS $XML2_LDFLAGS $PCRE_LDFLAGS $EXCLUDELIBS_LDFLAGS"
|
||||
AC_SUBST([SHLIB_LINK])
|
||||
dnl AC_MSG_RESULT([SHLIB_LINK: $SHLIB_LINK])
|
||||
|
||||
dnl ====================================
|
||||
dnl interrupt tests
|
||||
dnl ====================================
|
||||
INTERRUPTTESTS="no"
|
||||
AC_ARG_WITH([interrupt-tests],
|
||||
[AS_HELP_STRING([--without-interrupt-tests],
|
||||
[Disable the interrupt tests (for CI servers)])],
|
||||
[], [])
|
||||
|
||||
if test "x$with_interrupt_tests" != "xno"; then
|
||||
INTERRUPTTESTS="yes"
|
||||
fi
|
||||
|
||||
AC_SUBST([INTERRUPTTESTS])
|
||||
|
||||
dnl ===========================================================================
|
||||
dnl SRID stuff
|
||||
dnl ===========================================================================
|
||||
|
||||
# SRID stuff
|
||||
SRID_MAX=999999
|
||||
SRID_USR_MAX=998999
|
||||
AC_SUBST([SRID_MAX])
|
||||
AC_SUBST([SRID_USR_MAX])
|
||||
|
||||
AC_OUTPUT([
|
||||
src/Makefile
|
||||
src/librttopo_geom.h
|
||||
])
|
||||
|
||||
dnl ===========================================================================
|
||||
dnl Display the configuration status information
|
||||
dnl ===========================================================================
|
||||
AC_OUTPUT
|
||||
|
||||
AC_MSG_RESULT()
|
||||
AC_MSG_RESULT([ rttopo is now configured for ${host}])
|
||||
AC_MSG_RESULT()
|
||||
AC_MSG_RESULT([ -------------- Compiler Info ------------- ])
|
||||
AC_MSG_RESULT([ C compiler: ${CC} ${CFLAGS}])
|
||||
AC_MSG_RESULT()
|
||||
AC_MSG_RESULT([ -------------- Dependencies -------------- ])
|
||||
AC_MSG_RESULT([ GEOS config: ${GEOSCONFIG}])
|
||||
AC_MSG_RESULT([ GEOS version: ${GEOS_FULL_VERSION}])
|
||||
AC_MSG_RESULT([ Libxml2 config: ${XML2CONFIG}])
|
||||
AC_MSG_RESULT([ Libxml2 version: ${RTGEOM_LIBXML2_VERSION}])
|
||||
AC_MSG_RESULT([ JSON-C support: ${HAVE_JSON}])
|
||||
AC_MSG_RESULT([ PCRE support: ${HAVE_PCRE}])
|
||||
AC_MSG_RESULT([ Debug level: ${RTGEOM_DEBUG_LEVEL}])
|
||||
AC_MSG_RESULT([ Perl: ${PERL}])
|
||||
AC_MSG_RESULT()
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
nobase_include_HEADERS = librttopo_geom.h librttopo.h
|
|
@ -1,216 +0,0 @@
|
|||
## intltool.m4 - Configure intltool for the target system. -*-Shell-script-*-
|
||||
## Copyright (C) 2001 Eazel, Inc.
|
||||
## Author: Maciej Stachowiak <mjs@noisehavoc.org>
|
||||
## Kenneth Christiansen <kenneth@gnu.org>
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful, but
|
||||
## WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
## General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
##
|
||||
## As a special exception to the GNU General Public License, if you
|
||||
## distribute this file as part of a program that contains a
|
||||
## configuration script generated by Autoconf, you may include it under
|
||||
## the same distribution terms that you use for the rest of that program.
|
||||
|
||||
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
|
||||
# serial 40 IT_PROG_INTLTOOL
|
||||
AC_DEFUN([IT_PROG_INTLTOOL], [
|
||||
AC_PREREQ([2.50])dnl
|
||||
AC_REQUIRE([AM_NLS])dnl
|
||||
|
||||
case "$am__api_version" in
|
||||
1.[01234])
|
||||
AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -n "$1"; then
|
||||
AC_MSG_CHECKING([for intltool >= $1])
|
||||
|
||||
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
|
||||
INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
|
||||
[INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
|
||||
]
|
||||
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
|
||||
test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
|
||||
AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
|
||||
fi
|
||||
|
||||
AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
|
||||
AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
|
||||
AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
|
||||
if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
|
||||
AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.])
|
||||
fi
|
||||
|
||||
INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@'
|
||||
INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
|
||||
_IT_SUBST(INTLTOOL_DESKTOP_RULE)
|
||||
_IT_SUBST(INTLTOOL_DIRECTORY_RULE)
|
||||
_IT_SUBST(INTLTOOL_KEYS_RULE)
|
||||
_IT_SUBST(INTLTOOL_PROP_RULE)
|
||||
_IT_SUBST(INTLTOOL_OAF_RULE)
|
||||
_IT_SUBST(INTLTOOL_PONG_RULE)
|
||||
_IT_SUBST(INTLTOOL_SERVER_RULE)
|
||||
_IT_SUBST(INTLTOOL_SHEET_RULE)
|
||||
_IT_SUBST(INTLTOOL_SOUNDLIST_RULE)
|
||||
_IT_SUBST(INTLTOOL_UI_RULE)
|
||||
_IT_SUBST(INTLTOOL_XAM_RULE)
|
||||
_IT_SUBST(INTLTOOL_KBD_RULE)
|
||||
_IT_SUBST(INTLTOOL_XML_RULE)
|
||||
_IT_SUBST(INTLTOOL_XML_NOMERGE_RULE)
|
||||
_IT_SUBST(INTLTOOL_CAVES_RULE)
|
||||
_IT_SUBST(INTLTOOL_SCHEMAS_RULE)
|
||||
_IT_SUBST(INTLTOOL_THEME_RULE)
|
||||
_IT_SUBST(INTLTOOL_SERVICE_RULE)
|
||||
_IT_SUBST(INTLTOOL_POLICY_RULE)
|
||||
|
||||
# Check the gettext tools to make sure they are GNU
|
||||
AC_PATH_PROG(XGETTEXT, xgettext)
|
||||
AC_PATH_PROG(MSGMERGE, msgmerge)
|
||||
AC_PATH_PROG(MSGFMT, msgfmt)
|
||||
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
|
||||
if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
|
||||
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
|
||||
fi
|
||||
xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
|
||||
mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
|
||||
mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`"
|
||||
if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then
|
||||
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
|
||||
fi
|
||||
|
||||
AC_PATH_PROG(INTLTOOL_PERL, perl)
|
||||
if test -z "$INTLTOOL_PERL"; then
|
||||
AC_MSG_ERROR([perl not found])
|
||||
fi
|
||||
AC_MSG_CHECKING([for perl >= 5.8.1])
|
||||
$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1
|
||||
if test $? -ne 0; then
|
||||
AC_MSG_ERROR([perl 5.8.1 is required for intltool])
|
||||
else
|
||||
IT_PERL_VERSION="`$INTLTOOL_PERL -e \"printf '%vd', $^V\"`"
|
||||
AC_MSG_RESULT([$IT_PERL_VERSION])
|
||||
fi
|
||||
if test "x$2" != "xno-xml"; then
|
||||
AC_MSG_CHECKING([for XML::Parser])
|
||||
if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
|
||||
AC_MSG_RESULT([ok])
|
||||
else
|
||||
AC_MSG_ERROR([XML::Parser perl module is required for intltool])
|
||||
fi
|
||||
fi
|
||||
|
||||
# Substitute ALL_LINGUAS so we can use it in po/Makefile
|
||||
AC_SUBST(ALL_LINGUAS)
|
||||
|
||||
# Set DATADIRNAME correctly if it is not set yet
|
||||
# (copied from glib-gettext.m4)
|
||||
if test -z "$DATADIRNAME"; then
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([[]],
|
||||
[[extern int _nl_msg_cat_cntr;
|
||||
return _nl_msg_cat_cntr]])],
|
||||
[DATADIRNAME=share],
|
||||
[case $host in
|
||||
*-*-solaris*)
|
||||
dnl On Solaris, if bind_textdomain_codeset is in libc,
|
||||
dnl GNU format message catalog is always supported,
|
||||
dnl since both are added to the libc all together.
|
||||
dnl Hence, we'd like to go with DATADIRNAME=share
|
||||
dnl in this case.
|
||||
AC_CHECK_FUNC(bind_textdomain_codeset,
|
||||
[DATADIRNAME=share], [DATADIRNAME=lib])
|
||||
;;
|
||||
*)
|
||||
[DATADIRNAME=lib]
|
||||
;;
|
||||
esac])
|
||||
fi
|
||||
AC_SUBST(DATADIRNAME)
|
||||
|
||||
IT_PO_SUBDIR([po])
|
||||
|
||||
])
|
||||
|
||||
|
||||
# IT_PO_SUBDIR(DIRNAME)
|
||||
# ---------------------
|
||||
# All po subdirs have to be declared with this macro; the subdir "po" is
|
||||
# declared by IT_PROG_INTLTOOL.
|
||||
#
|
||||
AC_DEFUN([IT_PO_SUBDIR],
|
||||
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
|
||||
dnl
|
||||
dnl The following CONFIG_COMMANDS should be exetuted at the very end
|
||||
dnl of config.status.
|
||||
AC_CONFIG_COMMANDS_PRE([
|
||||
AC_CONFIG_COMMANDS([$1/stamp-it], [
|
||||
if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then
|
||||
AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.])
|
||||
fi
|
||||
rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
|
||||
>"$1/stamp-it.tmp"
|
||||
[sed '/^#/d
|
||||
s/^[[].*] *//
|
||||
/^[ ]*$/d
|
||||
'"s|^| $ac_top_srcdir/|" \
|
||||
"$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
|
||||
]
|
||||
[sed '/^POTFILES =/,/[^\\]$/ {
|
||||
/^POTFILES =/!d
|
||||
r $1/POTFILES
|
||||
}
|
||||
' "$1/Makefile.in" >"$1/Makefile"]
|
||||
rm -f "$1/Makefile.tmp"
|
||||
mv "$1/stamp-it.tmp" "$1/stamp-it"
|
||||
])
|
||||
])dnl
|
||||
])
|
||||
|
||||
# _IT_SUBST(VARIABLE)
|
||||
# -------------------
|
||||
# Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
|
||||
#
|
||||
AC_DEFUN([_IT_SUBST],
|
||||
[
|
||||
AC_SUBST([$1])
|
||||
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
|
||||
]
|
||||
)
|
||||
|
||||
# deprecated macros
|
||||
AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
|
||||
# A hint is needed for aclocal from Automake <= 1.9.4:
|
||||
# AC_DEFUN([AC_PROG_INTLTOOL], ...)
|
||||
|
110
macros/lib-ld.m4
110
macros/lib-ld.m4
|
@ -1,110 +0,0 @@
|
|||
# lib-ld.m4 serial 3 (gettext-0.13)
|
||||
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl Subroutines of libtool.m4,
|
||||
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
|
||||
dnl with libtool.m4.
|
||||
|
||||
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
|
||||
AC_DEFUN([AC_LIB_PROG_LD_GNU],
|
||||
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
|
||||
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
|
||||
case `$LD -v 2>&1 </dev/null` in
|
||||
*GNU* | *'with BFD'*)
|
||||
acl_cv_prog_gnu_ld=yes ;;
|
||||
*)
|
||||
acl_cv_prog_gnu_ld=no ;;
|
||||
esac])
|
||||
with_gnu_ld=$acl_cv_prog_gnu_ld
|
||||
])
|
||||
|
||||
dnl From libtool-1.4. Sets the variable LD.
|
||||
AC_DEFUN([AC_LIB_PROG_LD],
|
||||
[AC_ARG_WITH(gnu-ld,
|
||||
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
|
||||
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
# Prepare PATH_SEPARATOR.
|
||||
# The user is always right.
|
||||
if test "${PATH_SEPARATOR+set}" != set; then
|
||||
echo "#! /bin/sh" >conf$$.sh
|
||||
echo "exit 0" >>conf$$.sh
|
||||
chmod +x conf$$.sh
|
||||
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
|
||||
PATH_SEPARATOR=';'
|
||||
else
|
||||
PATH_SEPARATOR=:
|
||||
fi
|
||||
rm -f conf$$.sh
|
||||
fi
|
||||
ac_prog=ld
|
||||
if test "$GCC" = yes; then
|
||||
# Check if gcc -print-prog-name=ld gives a path.
|
||||
AC_MSG_CHECKING([for ld used by GCC])
|
||||
case $host in
|
||||
*-*-mingw*)
|
||||
# gcc leaves a trailing carriage return which upsets mingw
|
||||
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
|
||||
*)
|
||||
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
|
||||
esac
|
||||
case $ac_prog in
|
||||
# Accept absolute paths.
|
||||
[[\\/]* | [A-Za-z]:[\\/]*)]
|
||||
[re_direlt='/[^/][^/]*/\.\./']
|
||||
# Canonicalize the path of ld
|
||||
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
|
||||
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
|
||||
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
|
||||
done
|
||||
test -z "$LD" && LD="$ac_prog"
|
||||
;;
|
||||
"")
|
||||
# If it fails, then pretend we aren't using GCC.
|
||||
ac_prog=ld
|
||||
;;
|
||||
*)
|
||||
# If it is relative, then search for the first ld in PATH.
|
||||
with_gnu_ld=unknown
|
||||
;;
|
||||
esac
|
||||
elif test "$with_gnu_ld" = yes; then
|
||||
AC_MSG_CHECKING([for GNU ld])
|
||||
else
|
||||
AC_MSG_CHECKING([for non-GNU ld])
|
||||
fi
|
||||
AC_CACHE_VAL(acl_cv_path_LD,
|
||||
[if test -z "$LD"; then
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
||||
for ac_dir in $PATH; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
|
||||
acl_cv_path_LD="$ac_dir/$ac_prog"
|
||||
# Check to see if the program is GNU ld. I'd rather use --version,
|
||||
# but apparently some GNU ld's only accept -v.
|
||||
# Break only if it was the GNU/non-GNU ld that we prefer.
|
||||
case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
|
||||
*GNU* | *'with BFD'*)
|
||||
test "$with_gnu_ld" != no && break ;;
|
||||
*)
|
||||
test "$with_gnu_ld" != yes && break ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
else
|
||||
acl_cv_path_LD="$LD" # Let the user override the test with a path.
|
||||
fi])
|
||||
LD="$acl_cv_path_LD"
|
||||
if test -n "$LD"; then
|
||||
AC_MSG_RESULT($LD)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
|
||||
AC_LIB_PROG_LD_GNU
|
||||
])
|
|
@ -1,709 +0,0 @@
|
|||
# lib-link.m4 serial 13 (gettext-0.17)
|
||||
dnl Copyright (C) 2001-2007 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl From Bruno Haible.
|
||||
|
||||
AC_PREREQ(2.54)
|
||||
|
||||
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
|
||||
dnl the libraries corresponding to explicit and implicit dependencies.
|
||||
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
|
||||
dnl augments the CPPFLAGS variable.
|
||||
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
|
||||
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
|
||||
AC_DEFUN([AC_LIB_LINKFLAGS],
|
||||
[
|
||||
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
|
||||
AC_REQUIRE([AC_LIB_RPATH])
|
||||
define([Name],[translit([$1],[./-], [___])])
|
||||
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
|
||||
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
|
||||
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
|
||||
AC_LIB_LINKFLAGS_BODY([$1], [$2])
|
||||
ac_cv_lib[]Name[]_libs="$LIB[]NAME"
|
||||
ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
|
||||
ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
|
||||
ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
|
||||
])
|
||||
LIB[]NAME="$ac_cv_lib[]Name[]_libs"
|
||||
LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
|
||||
INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
|
||||
LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
|
||||
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
|
||||
AC_SUBST([LIB]NAME)
|
||||
AC_SUBST([LTLIB]NAME)
|
||||
AC_SUBST([LIB]NAME[_PREFIX])
|
||||
dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
|
||||
dnl results of this search when this library appears as a dependency.
|
||||
HAVE_LIB[]NAME=yes
|
||||
undefine([Name])
|
||||
undefine([NAME])
|
||||
])
|
||||
|
||||
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
|
||||
dnl searches for libname and the libraries corresponding to explicit and
|
||||
dnl implicit dependencies, together with the specified include files and
|
||||
dnl the ability to compile and link the specified testcode. If found, it
|
||||
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
|
||||
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
|
||||
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
|
||||
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
|
||||
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
|
||||
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
|
||||
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
|
||||
[
|
||||
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
|
||||
AC_REQUIRE([AC_LIB_RPATH])
|
||||
define([Name],[translit([$1],[./-], [___])])
|
||||
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
|
||||
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
|
||||
|
||||
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
|
||||
dnl accordingly.
|
||||
AC_LIB_LINKFLAGS_BODY([$1], [$2])
|
||||
|
||||
dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
|
||||
dnl because if the user has installed lib[]Name and not disabled its use
|
||||
dnl via --without-lib[]Name-prefix, he wants to use it.
|
||||
ac_save_CPPFLAGS="$CPPFLAGS"
|
||||
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
|
||||
|
||||
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $LIB[]NAME"
|
||||
AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
|
||||
LIBS="$ac_save_LIBS"
|
||||
])
|
||||
if test "$ac_cv_lib[]Name" = yes; then
|
||||
HAVE_LIB[]NAME=yes
|
||||
AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
|
||||
AC_MSG_CHECKING([how to link with lib[]$1])
|
||||
AC_MSG_RESULT([$LIB[]NAME])
|
||||
else
|
||||
HAVE_LIB[]NAME=no
|
||||
dnl If $LIB[]NAME didn't lead to a usable library, we don't need
|
||||
dnl $INC[]NAME either.
|
||||
CPPFLAGS="$ac_save_CPPFLAGS"
|
||||
LIB[]NAME=
|
||||
LTLIB[]NAME=
|
||||
LIB[]NAME[]_PREFIX=
|
||||
fi
|
||||
AC_SUBST([HAVE_LIB]NAME)
|
||||
AC_SUBST([LIB]NAME)
|
||||
AC_SUBST([LTLIB]NAME)
|
||||
AC_SUBST([LIB]NAME[_PREFIX])
|
||||
undefine([Name])
|
||||
undefine([NAME])
|
||||
])
|
||||
|
||||
dnl Determine the platform dependent parameters needed to use rpath:
|
||||
dnl acl_libext,
|
||||
dnl acl_shlibext,
|
||||
dnl acl_hardcode_libdir_flag_spec,
|
||||
dnl acl_hardcode_libdir_separator,
|
||||
dnl acl_hardcode_direct,
|
||||
dnl acl_hardcode_minus_L.
|
||||
AC_DEFUN([AC_LIB_RPATH],
|
||||
[
|
||||
dnl Tell automake >= 1.10 to complain if config.rpath is missing.
|
||||
m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
|
||||
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
|
||||
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
|
||||
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
|
||||
AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
|
||||
CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
|
||||
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
|
||||
. ./conftest.sh
|
||||
rm -f ./conftest.sh
|
||||
acl_cv_rpath=done
|
||||
])
|
||||
wl="$acl_cv_wl"
|
||||
acl_libext="$acl_cv_libext"
|
||||
acl_shlibext="$acl_cv_shlibext"
|
||||
acl_libname_spec="$acl_cv_libname_spec"
|
||||
acl_library_names_spec="$acl_cv_library_names_spec"
|
||||
acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
|
||||
acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
|
||||
acl_hardcode_direct="$acl_cv_hardcode_direct"
|
||||
acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
|
||||
dnl Determine whether the user wants rpath handling at all.
|
||||
AC_ARG_ENABLE(rpath,
|
||||
[ --disable-rpath do not hardcode runtime library paths],
|
||||
:, enable_rpath=yes)
|
||||
])
|
||||
|
||||
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
|
||||
dnl the libraries corresponding to explicit and implicit dependencies.
|
||||
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
|
||||
dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
|
||||
dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
|
||||
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
||||
[
|
||||
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
|
||||
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
|
||||
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
|
||||
dnl Autoconf >= 2.61 supports dots in --with options.
|
||||
define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
|
||||
dnl By default, look in $includedir and $libdir.
|
||||
use_additional=yes
|
||||
AC_LIB_WITH_FINAL_PREFIX([
|
||||
eval additional_includedir=\"$includedir\"
|
||||
eval additional_libdir=\"$libdir\"
|
||||
])
|
||||
AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix],
|
||||
[ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
|
||||
--without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir],
|
||||
[
|
||||
if test "X$withval" = "Xno"; then
|
||||
use_additional=no
|
||||
else
|
||||
if test "X$withval" = "X"; then
|
||||
AC_LIB_WITH_FINAL_PREFIX([
|
||||
eval additional_includedir=\"$includedir\"
|
||||
eval additional_libdir=\"$libdir\"
|
||||
])
|
||||
else
|
||||
additional_includedir="$withval/include"
|
||||
additional_libdir="$withval/$acl_libdirstem"
|
||||
fi
|
||||
fi
|
||||
])
|
||||
dnl Search the library and its dependencies in $additional_libdir and
|
||||
dnl $LDFLAGS. Using breadth-first-seach.
|
||||
LIB[]NAME=
|
||||
LTLIB[]NAME=
|
||||
INC[]NAME=
|
||||
LIB[]NAME[]_PREFIX=
|
||||
rpathdirs=
|
||||
ltrpathdirs=
|
||||
names_already_handled=
|
||||
names_next_round='$1 $2'
|
||||
while test -n "$names_next_round"; do
|
||||
names_this_round="$names_next_round"
|
||||
names_next_round=
|
||||
for name in $names_this_round; do
|
||||
already_handled=
|
||||
for n in $names_already_handled; do
|
||||
if test "$n" = "$name"; then
|
||||
already_handled=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$already_handled"; then
|
||||
names_already_handled="$names_already_handled $name"
|
||||
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
|
||||
dnl or AC_LIB_HAVE_LINKFLAGS call.
|
||||
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
|
||||
eval value=\"\$HAVE_LIB$uppername\"
|
||||
if test -n "$value"; then
|
||||
if test "$value" = yes; then
|
||||
eval value=\"\$LIB$uppername\"
|
||||
test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
|
||||
eval value=\"\$LTLIB$uppername\"
|
||||
test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
|
||||
else
|
||||
dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
|
||||
dnl that this library doesn't exist. So just drop it.
|
||||
:
|
||||
fi
|
||||
else
|
||||
dnl Search the library lib$name in $additional_libdir and $LDFLAGS
|
||||
dnl and the already constructed $LIBNAME/$LTLIBNAME.
|
||||
found_dir=
|
||||
found_la=
|
||||
found_so=
|
||||
found_a=
|
||||
eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
|
||||
if test -n "$acl_shlibext"; then
|
||||
shrext=".$acl_shlibext" # typically: shrext=.so
|
||||
else
|
||||
shrext=
|
||||
fi
|
||||
if test $use_additional = yes; then
|
||||
dir="$additional_libdir"
|
||||
dnl The same code as in the loop below:
|
||||
dnl First look for a shared library.
|
||||
if test -n "$acl_shlibext"; then
|
||||
if test -f "$dir/$libname$shrext"; then
|
||||
found_dir="$dir"
|
||||
found_so="$dir/$libname$shrext"
|
||||
else
|
||||
if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
|
||||
ver=`(cd "$dir" && \
|
||||
for f in "$libname$shrext".*; do echo "$f"; done \
|
||||
| sed -e "s,^$libname$shrext\\\\.,," \
|
||||
| sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
|
||||
| sed 1q ) 2>/dev/null`
|
||||
if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
|
||||
found_dir="$dir"
|
||||
found_so="$dir/$libname$shrext.$ver"
|
||||
fi
|
||||
else
|
||||
eval library_names=\"$acl_library_names_spec\"
|
||||
for f in $library_names; do
|
||||
if test -f "$dir/$f"; then
|
||||
found_dir="$dir"
|
||||
found_so="$dir/$f"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
dnl Then look for a static library.
|
||||
if test "X$found_dir" = "X"; then
|
||||
if test -f "$dir/$libname.$acl_libext"; then
|
||||
found_dir="$dir"
|
||||
found_a="$dir/$libname.$acl_libext"
|
||||
fi
|
||||
fi
|
||||
if test "X$found_dir" != "X"; then
|
||||
if test -f "$dir/$libname.la"; then
|
||||
found_la="$dir/$libname.la"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "X$found_dir" = "X"; then
|
||||
for x in $LDFLAGS $LTLIB[]NAME; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
case "$x" in
|
||||
-L*)
|
||||
dir=`echo "X$x" | sed -e 's/^X-L//'`
|
||||
dnl First look for a shared library.
|
||||
if test -n "$acl_shlibext"; then
|
||||
if test -f "$dir/$libname$shrext"; then
|
||||
found_dir="$dir"
|
||||
found_so="$dir/$libname$shrext"
|
||||
else
|
||||
if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
|
||||
ver=`(cd "$dir" && \
|
||||
for f in "$libname$shrext".*; do echo "$f"; done \
|
||||
| sed -e "s,^$libname$shrext\\\\.,," \
|
||||
| sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
|
||||
| sed 1q ) 2>/dev/null`
|
||||
if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
|
||||
found_dir="$dir"
|
||||
found_so="$dir/$libname$shrext.$ver"
|
||||
fi
|
||||
else
|
||||
eval library_names=\"$acl_library_names_spec\"
|
||||
for f in $library_names; do
|
||||
if test -f "$dir/$f"; then
|
||||
found_dir="$dir"
|
||||
found_so="$dir/$f"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
dnl Then look for a static library.
|
||||
if test "X$found_dir" = "X"; then
|
||||
if test -f "$dir/$libname.$acl_libext"; then
|
||||
found_dir="$dir"
|
||||
found_a="$dir/$libname.$acl_libext"
|
||||
fi
|
||||
fi
|
||||
if test "X$found_dir" != "X"; then
|
||||
if test -f "$dir/$libname.la"; then
|
||||
found_la="$dir/$libname.la"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if test "X$found_dir" != "X"; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if test "X$found_dir" != "X"; then
|
||||
dnl Found the library.
|
||||
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
|
||||
if test "X$found_so" != "X"; then
|
||||
dnl Linking with a shared library. We attempt to hardcode its
|
||||
dnl directory into the executable's runpath, unless it's the
|
||||
dnl standard /usr/lib.
|
||||
if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
|
||||
dnl No hardcoding is needed.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
|
||||
else
|
||||
dnl Use an explicit option to hardcode DIR into the resulting
|
||||
dnl binary.
|
||||
dnl Potentially add DIR to ltrpathdirs.
|
||||
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
|
||||
haveit=
|
||||
for x in $ltrpathdirs; do
|
||||
if test "X$x" = "X$found_dir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
ltrpathdirs="$ltrpathdirs $found_dir"
|
||||
fi
|
||||
dnl The hardcoding into $LIBNAME is system dependent.
|
||||
if test "$acl_hardcode_direct" = yes; then
|
||||
dnl Using DIR/libNAME.so during linking hardcodes DIR into the
|
||||
dnl resulting binary.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
|
||||
else
|
||||
if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
|
||||
dnl Use an explicit option to hardcode DIR into the resulting
|
||||
dnl binary.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
|
||||
dnl Potentially add DIR to rpathdirs.
|
||||
dnl The rpathdirs will be appended to $LIBNAME at the end.
|
||||
haveit=
|
||||
for x in $rpathdirs; do
|
||||
if test "X$x" = "X$found_dir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
rpathdirs="$rpathdirs $found_dir"
|
||||
fi
|
||||
else
|
||||
dnl Rely on "-L$found_dir".
|
||||
dnl But don't add it if it's already contained in the LDFLAGS
|
||||
dnl or the already constructed $LIBNAME
|
||||
haveit=
|
||||
for x in $LDFLAGS $LIB[]NAME; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
if test "X$x" = "X-L$found_dir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
|
||||
fi
|
||||
if test "$acl_hardcode_minus_L" != no; then
|
||||
dnl FIXME: Not sure whether we should use
|
||||
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
|
||||
dnl here.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
|
||||
else
|
||||
dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
|
||||
dnl here, because this doesn't fit in flags passed to the
|
||||
dnl compiler. So give up. No hardcoding. This affects only
|
||||
dnl very old systems.
|
||||
dnl FIXME: Not sure whether we should use
|
||||
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
|
||||
dnl here.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if test "X$found_a" != "X"; then
|
||||
dnl Linking with a static library.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
|
||||
else
|
||||
dnl We shouldn't come here, but anyway it's good to have a
|
||||
dnl fallback.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
|
||||
fi
|
||||
fi
|
||||
dnl Assume the include files are nearby.
|
||||
additional_includedir=
|
||||
case "$found_dir" in
|
||||
*/$acl_libdirstem | */$acl_libdirstem/)
|
||||
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
|
||||
LIB[]NAME[]_PREFIX="$basedir"
|
||||
additional_includedir="$basedir/include"
|
||||
;;
|
||||
esac
|
||||
if test "X$additional_includedir" != "X"; then
|
||||
dnl Potentially add $additional_includedir to $INCNAME.
|
||||
dnl But don't add it
|
||||
dnl 1. if it's the standard /usr/include,
|
||||
dnl 2. if it's /usr/local/include and we are using GCC on Linux,
|
||||
dnl 3. if it's already present in $CPPFLAGS or the already
|
||||
dnl constructed $INCNAME,
|
||||
dnl 4. if it doesn't exist as a directory.
|
||||
if test "X$additional_includedir" != "X/usr/include"; then
|
||||
haveit=
|
||||
if test "X$additional_includedir" = "X/usr/local/include"; then
|
||||
if test -n "$GCC"; then
|
||||
case $host_os in
|
||||
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
if test -z "$haveit"; then
|
||||
for x in $CPPFLAGS $INC[]NAME; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
if test "X$x" = "X-I$additional_includedir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
if test -d "$additional_includedir"; then
|
||||
dnl Really add $additional_includedir to $INCNAME.
|
||||
INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
dnl Look for dependencies.
|
||||
if test -n "$found_la"; then
|
||||
dnl Read the .la file. It defines the variables
|
||||
dnl dlname, library_names, old_library, dependency_libs, current,
|
||||
dnl age, revision, installed, dlopen, dlpreopen, libdir.
|
||||
save_libdir="$libdir"
|
||||
case "$found_la" in
|
||||
*/* | *\\*) . "$found_la" ;;
|
||||
*) . "./$found_la" ;;
|
||||
esac
|
||||
libdir="$save_libdir"
|
||||
dnl We use only dependency_libs.
|
||||
for dep in $dependency_libs; do
|
||||
case "$dep" in
|
||||
-L*)
|
||||
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
|
||||
dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
|
||||
dnl But don't add it
|
||||
dnl 1. if it's the standard /usr/lib,
|
||||
dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
|
||||
dnl 3. if it's already present in $LDFLAGS or the already
|
||||
dnl constructed $LIBNAME,
|
||||
dnl 4. if it doesn't exist as a directory.
|
||||
if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
|
||||
haveit=
|
||||
if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
|
||||
if test -n "$GCC"; then
|
||||
case $host_os in
|
||||
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
if test -z "$haveit"; then
|
||||
haveit=
|
||||
for x in $LDFLAGS $LIB[]NAME; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
if test "X$x" = "X-L$additional_libdir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
if test -d "$additional_libdir"; then
|
||||
dnl Really add $additional_libdir to $LIBNAME.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
|
||||
fi
|
||||
fi
|
||||
haveit=
|
||||
for x in $LDFLAGS $LTLIB[]NAME; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
if test "X$x" = "X-L$additional_libdir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
if test -d "$additional_libdir"; then
|
||||
dnl Really add $additional_libdir to $LTLIBNAME.
|
||||
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
-R*)
|
||||
dir=`echo "X$dep" | sed -e 's/^X-R//'`
|
||||
if test "$enable_rpath" != no; then
|
||||
dnl Potentially add DIR to rpathdirs.
|
||||
dnl The rpathdirs will be appended to $LIBNAME at the end.
|
||||
haveit=
|
||||
for x in $rpathdirs; do
|
||||
if test "X$x" = "X$dir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
rpathdirs="$rpathdirs $dir"
|
||||
fi
|
||||
dnl Potentially add DIR to ltrpathdirs.
|
||||
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
|
||||
haveit=
|
||||
for x in $ltrpathdirs; do
|
||||
if test "X$x" = "X$dir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
ltrpathdirs="$ltrpathdirs $dir"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
-l*)
|
||||
dnl Handle this in the next round.
|
||||
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
|
||||
;;
|
||||
*.la)
|
||||
dnl Handle this in the next round. Throw away the .la's
|
||||
dnl directory; it is already contained in a preceding -L
|
||||
dnl option.
|
||||
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
|
||||
;;
|
||||
*)
|
||||
dnl Most likely an immediate library name.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
|
||||
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
else
|
||||
dnl Didn't find the library; assume it is in the system directories
|
||||
dnl known to the linker and runtime loader. (All the system
|
||||
dnl directories known to the linker should also be known to the
|
||||
dnl runtime loader, otherwise the system is severely misconfigured.)
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
|
||||
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
if test "X$rpathdirs" != "X"; then
|
||||
if test -n "$acl_hardcode_libdir_separator"; then
|
||||
dnl Weird platform: only the last -rpath option counts, the user must
|
||||
dnl pass all path elements in one option. We can arrange that for a
|
||||
dnl single library, but not when more than one $LIBNAMEs are used.
|
||||
alldirs=
|
||||
for found_dir in $rpathdirs; do
|
||||
alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
|
||||
done
|
||||
dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
|
||||
acl_save_libdir="$libdir"
|
||||
libdir="$alldirs"
|
||||
eval flag=\"$acl_hardcode_libdir_flag_spec\"
|
||||
libdir="$acl_save_libdir"
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
|
||||
else
|
||||
dnl The -rpath options are cumulative.
|
||||
for found_dir in $rpathdirs; do
|
||||
acl_save_libdir="$libdir"
|
||||
libdir="$found_dir"
|
||||
eval flag=\"$acl_hardcode_libdir_flag_spec\"
|
||||
libdir="$acl_save_libdir"
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
if test "X$ltrpathdirs" != "X"; then
|
||||
dnl When using libtool, the option that works for both libraries and
|
||||
dnl executables is -R. The -R options are cumulative.
|
||||
for found_dir in $ltrpathdirs; do
|
||||
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
|
||||
done
|
||||
fi
|
||||
])
|
||||
|
||||
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
|
||||
dnl unless already present in VAR.
|
||||
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
|
||||
dnl contains two or three consecutive elements that belong together.
|
||||
AC_DEFUN([AC_LIB_APPENDTOVAR],
|
||||
[
|
||||
for element in [$2]; do
|
||||
haveit=
|
||||
for x in $[$1]; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
if test "X$x" = "X$element"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
[$1]="${[$1]}${[$1]:+ }$element"
|
||||
fi
|
||||
done
|
||||
])
|
||||
|
||||
dnl For those cases where a variable contains several -L and -l options
|
||||
dnl referring to unknown libraries and directories, this macro determines the
|
||||
dnl necessary additional linker options for the runtime path.
|
||||
dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
|
||||
dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
|
||||
dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
|
||||
dnl otherwise linking without libtool is assumed.
|
||||
AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
|
||||
[
|
||||
AC_REQUIRE([AC_LIB_RPATH])
|
||||
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
|
||||
$1=
|
||||
if test "$enable_rpath" != no; then
|
||||
if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
|
||||
dnl Use an explicit option to hardcode directories into the resulting
|
||||
dnl binary.
|
||||
rpathdirs=
|
||||
next=
|
||||
for opt in $2; do
|
||||
if test -n "$next"; then
|
||||
dir="$next"
|
||||
dnl No need to hardcode the standard /usr/lib.
|
||||
if test "X$dir" != "X/usr/$acl_libdirstem"; then
|
||||
rpathdirs="$rpathdirs $dir"
|
||||
fi
|
||||
next=
|
||||
else
|
||||
case $opt in
|
||||
-L) next=yes ;;
|
||||
-L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
|
||||
dnl No need to hardcode the standard /usr/lib.
|
||||
if test "X$dir" != "X/usr/$acl_libdirstem"; then
|
||||
rpathdirs="$rpathdirs $dir"
|
||||
fi
|
||||
next= ;;
|
||||
|