Alien-cares

 view release on metacpan or  search on metacpan

libcares/.travis.yml  view on Meta::CPAN

        - os: osx
          compiler: clang
          language: objective-c
          env: BUILD_TYPE=ios
install:
    - if [ "$TRAVIS_OS_NAME" != "osx" ]; then pip install --user cpp-coveralls > /dev/null; fi
    - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew reinstall libtool > /dev/null; fi
before_script:
    - |
        if [ "$BUILD_TYPE" = "coverage" ]; then
             export CONFIG_OPTS="--enable-debug --disable-shared --enable-code-coverage"
        fi
    - |
         if [ "$BUILD_TYPE" = "asan" ]; then
             export CONFIG_OPTS=--enable-debug
             export CFLAGS=-fsanitize=address
             export CXXFLAGS=-fsanitize=address
             export LDFLAGS=-fsanitize=address
         fi
    - |
         if [ "$BUILD_TYPE" = "lsan" ]; then
             export CONFIG_OPTS=--enable-debug
             export CFLAGS=-fsanitize=leak
             export CXXFLAGS=-fsanitize=leak
             export LDFLAGS=-fsanitize=leak
         fi
    - |
         if [ "$BUILD_TYPE" = "ubsan" ]; then
             export CFLAGS="-fsanitize=undefined -fno-sanitize-recover"
             export LDFLAGS="-fsanitize=undefined"
         fi
    - |
         if [ "$BUILD_TYPE" = "analyse" ]; then
             export SCAN_WRAP="scan-build-5.0 --status-bugs"
             export CONFIG_OPTS="--enable-debug"
             export CXX="clang++-5.0"
             export CC="clang-5.0"
         fi
    - |
         if [ "$BUILD_TYPE" = "valgrind" ]; then
             export TEST_WRAP='libtool --mode=execute valgrind --leak-check=full'
             # Skip container tests as valgrind doesn't cope with clone()
             export TEST_FILTER="--gtest_filter=-*Container*"
         fi
    - |

libcares/CHANGES.0  view on Meta::CPAN

  with changes from Jakub Hrozek making these now return linked lists
  instead of arrays, and merging the ares_free_data() adjustments.

* November 10, 2009 (Yang Tse)
- Updated MSVC 6.0 project files to match settings from Makefile.msvc.

* November 9, 2009 (Yang Tse)
- Makefile.msvc is now the reference method to build c-ares and sample
  programs with any MSVC compiler or MS Visual Studio version.  If no
  option or target are specified it builds dynamic and static c-ares
  libraries in debug and release flavours and also builds all sample
  programs using each of the different c-ares libraries.

* November 2, 2009 (Yang Tse)
- Renamed c-ares setup.h to ares_setup.h

* October 31, 2009 (Yang Tse)
- Symbol hiding configure options are named now --enable-symbol-hiding
  and --disable-symbol-hiding in an attempt to make them less ambiguous.

* October 30, 2009 (Yang Tse)
- Many fixes for ares_parse_txt_reply()

* October 29, 2009 (Daniel Stenberg)
- Jakub Hrozek added ares_parse_txt_reply() for TXT parsing

* October 29, 2009 (Yang Tse)
- Updated MSVC 6.0 workspace and project files that allows building
  dynamic and static c-ares libraries in debug and release flavours.
  Additionally each of the three sample programs is built against
  each of the four possible c-ares libraries, generating all this
  a total number of 12 executables and 4 libraries.

* October 28, 2009 (Yang Tse)
- Initial step towards the ability to reduce c-ares exported symbols
  when built as a shared library based on the 'visibility' attribute
  for GNUC and Intel compilers and based on __global for Sun compilers,
  taking also in account __declspec function decoration for Win32 and
  Symbian DLL's.

libcares/CHANGES.0  view on Meta::CPAN


* June 11 2009 (Yang Tse)
- Modified buildconf so that when automake runs it copies missing files
  instead of symlinking them.

* June 8 2009 (Yang Tse)
- Removed buildconf.bat from release and daily snapshot archives. This
  file is only for CVS tree checkout builds.

* May 26 2009 (Yang Tse)
- Added --enable-curldebug configure option to enable and disable building
  with the low-level curl debug memory tracking 'feature' to allow decoupled
  setting from --enable-debug, allowing again to build c-ares independently
  out of the CVS tree.

  For the c-ares library option --enable-debug enables debug build features
  which are _not_ related with memory tracking. For the c-ares library when
  --enable-debug is given it does not enable the memory tracking feature. If
  you wish to enable the curl debug memory tracking you must use configure
  option --enable-curldebug explicitily to do so.

  Internally, definition of preprocessor symbol DEBUGBUILD restricts code
  which is only compiled for debug enabled builds. And symbol CURLDEBUG is
  used to differentiate code which is _only_ used for memory tracking.

  Make ares_init(), ares_dup() and ares_init_options() fail returning
  ARES_ENOTINITIALIZED if library initialization has not been performed
  calling ares_library_init().

* May 20 2009 (Yang Tse)
- Added ares_library_init() and ares_library_cleanup() man pages.

* May 19 2009 (Yang Tse)

libcares/CHANGES.0  view on Meta::CPAN


* Oct 21 2008 (Yang Tse)
  Charles Hardin added handling of EINPROGRESS for UDP connects.

* Oct 18 2008 (Daniel Stenberg)
  Charles Hardin made adig support a regular numerical dotted IP address for the
  -s option as well.

* Oct 7 2008 (Yang Tse)
- Added --enable-optimize configure option to enable and disable compiler
  optimizations to allow decoupled setting from --enable-debug.

* Oct 2 2008 (Yang Tse)
- Added --enable-warnings configure option to enable and disable strict
  compiler warnings to allow decoupled setting from --enable-debug.

* Sep 17 2008 (Yang Tse)
- Code reorganization to allow internal/private use of "nameser.h" to any
  system that lacks arpa/nameser.h or arpa/nameser_compat.h header files.

* Sep 16 2008 (Yang Tse)
- Code reorganization to allow internal/private use of ares_writev to any
  system that lacks the writev function.

* Sep 15 2008 (Yang Tse)

libcares/CHANGES.0  view on Meta::CPAN

  Detection is now based on compilation checks instead of linker ones.

- Configure process now checks availability of recvfrom() socket function and
  finds out its return type and the types of its arguments. Added definitions
  for non-configure systems config files, and introduced macro sreadfrom which
  will be used on udp sockets as a recvfrom() wrapper in the future.

* Jul 15 2008 (Yang Tse)
- Introduce definition of _REENTRANT symbol in setup.h to improve library
  usability.  Previously the configure process only used the AC_SYS_LARGEFILE
  macro for debug builds, now it is also used for non-debug ones enabling the
  use of configure options --enable-largefile and --disable-largefile which
  might be needed for library compatibility.  Remove checking the size of
  curl_off_t, it is no longer needed.

* Jul 3 2008 (Daniel Stenberg)
- Phil Blundell: If you ask ares_gethostbyname() to do an AF_INET6 lookup and
  the target host has only A records, it automatically falls back to an
  AF_INET lookup and gives you the A results.  However, if the target host has
  a CNAME record, this behaviour is defeated since the original query does
  return some data even though ares_parse_aaa_reply() doesn't consider it

libcares/CHANGES.0  view on Meta::CPAN


- Gisle Vanem made c-ares build and work with his Watt-32 TCP/IP stack.

* August 13

- Harshal Pradhan made a minor syntax change in ares_init.c to make it build
  fine with MSVC 7.1

* July 24

- Made the lib get built static only if --enable-debug is used.

- Gisle Vanem fixed:

  Basically in loops like handle_errors(), 'query->next' was assigned a local
  variable and then query was referenced after the memory was freed by
  next_server(). I've changed that so next_server() and end_query() returns
  the next query. So callers should use this ret-value.

  The next problem was that 'server->tcp_buffer_pos' had a random value at
  entry to 1st recv() (luckily causing Winsock to return ENOBUFS).

libcares/CHANGES.0  view on Meta::CPAN

  installation to improve overview and make it easier to add man pages.

Version 1.1.0 (March 11, 2004)

* March 9, 2004
- Gisle Vanem improved build on Windows.

* February 25, 2004
- Dan Fandrich found a flaw in the Feb 22 fix.

- Added better configure --enable-debug logic (taken from the curl configure
  script). Added acinclude.m4 to the tarball.

* February 23, 2004
- Removed ares_free_errmem(), the function, the file and the man page. It was
  not used and it did nothing.

- Fixed a lot of code that wasn't "64bit clean" and thus caused a lot of
  compiler warnings on picky compilers.

* February 22, 2004
- Dominick Meglio made ares init support multiple name servers in the
  NameServer key on Windows.

* February 16, 2004
- Modified ares_private.h to include libcurl's memory debug header if
  CURLDEBUG is set. This makes all the ares-functions supervised properly by
  the curl test suite. This also forced me to add inclusion of the
  ares_private.h header in a few more files that are using some kind of
  memory-related resources.

- Made the makefile only build ahost and adig if 'make demos' is used.

* February 10, 2004
- Dirk Manske made ares_version.h installed with 'make install'

* February 4, 2004
- ares_free_errmem() is subject for removal, it is simply present for future
  purposes, and since we removed the extra parameter in strerror() it won't
  be used by c-ares!
- configure --enable-debug now enables picky compiler options if gcc is used
- fixed several compiler warnings --enable-debug showed and Joerg Mueller-Tolk
  reported

Version 1.0.0 (February 3, 2004)

* February 3, 2004
- now we produce the libcares.a library instead of the previous libares.a
  since we are no longer compatible

* February 2, 2004

libcares/CONTRIBUTING.md  view on Meta::CPAN

Contributing to c-ares
======================

To contribute patches to c-ares, please generate a GitHub pull request
and follow these guidelines:

 - Check that the Travis builds are green for your pull request.
 - Please update the test suite to add a test case for any new functionality.
 - Build the library with `./configure --enable-debug --enable-maintainer-mode` and
   ensure there are no new warnings.

To improve the chances of the c-ares maintainers responding to your request:

 - Also send an email to the mailing list at `c-ares@cool.haxx.se` describing your change.
 - To follow any associated discussion, please subscribe to the [mailing list](http://cool.haxx.se/mailman/listinfo/c-ares).

libcares/INSTALL.md  view on Meta::CPAN

    CC=cc ./configure
    # or
    env CC=cc ./configure

To force a static library compile, disable the shared library creation
by running configure like:

    ./configure --disable-shared

If you're a c-ares developer and use gcc, you might want to enable more
debug options with the `--enable-debug` option.

### Special Cases

Some versions of uClibc require configuring with `CPPFLAGS=-D_GNU_SOURCE=1`
to get correct large file support.

The Open Watcom C compiler on Linux requires configuring with the variables:

    ./configure CC=owcc AR="$WATCOM/binl/wlib" AR_FLAGS=-q \
        RANLIB=/bin/true STRIP="$WATCOM/binl/wstrip" CFLAGS=-Wextra

libcares/INSTALL.md  view on Meta::CPAN


 - [KB94248](http://support.microsoft.com/kb/94248/en-us) - How To Use the C Run-Time

 - [KB140584](http://support.microsoft.com/kb/140584/en-us) - How to link with the correct C Run-Time (CRT) library

 - [KB190799](http://msdn.microsoft.com/en-us/library/ms235460) - Potential Errors Passing CRT Objects Across DLL Boundaries

If your app is misbehaving in some strange way, or it is suffering
from memory corruption, before asking for further help, please try
first to rebuild every single library your app uses as well as your
app using the debug multithreaded dynamic C runtime.


### MingW32

Make sure that MinGW32's bin dir is in the search path, for example:

    set PATH=c:\mingw32\bin;%PATH%

then run 'make -f Makefile.m32' in the root dir.

libcares/Makefile.Watcom  view on Meta::CPAN

MD = mkdir
RD = rmdir /q /s 2>NUL
CP = copy

CFLAGS = -3r -mf -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm &
         -wcd=201 -bt=nt -d+ -dWIN32 -dCARES_BUILDING_LIBRARY           &
         -dNTDDI_VERSION=0x05010000 -I. $(SYS_INCL)

LFLAGS = option quiet, map, caseexact, eliminate

!ifdef %debug
DEBUG  = -dDEBUG=1 -dDEBUGBUILD
CFLAGS += -d3 $(DEBUG)
LFLAGS += debug all
!else
CFLAGS += -d0
!endif

CFLAGS += -d_WIN32_WINNT=0x0600

#
# Change to suite.
#
!ifdef %use_watt32

libcares/Makefile.am  view on Meta::CPAN

ACLOCAL_AMFLAGS = -I m4

# Specify our include paths here, and do it relative to $(top_srcdir) and
# $(top_builddir), to ensure that these paths which belong to the library
# being currently built and tested are searched before the library which
# might possibly already be installed in the system.
#
# When using the low-level hard-hacking memory leak tracking code from
# libcurl the generated curl/curlbuild.h file must also be reachable.
# Using the libcurl lowlevel code from within c-ares library is ugly and
# only works when c-ares is built and linked with a similarly debug-build
# libcurl, but we do this anyway for convenience.
#
# $(top_builddir)/../include/curl for generated curlbuild.h included from curl.h
# $(top_builddir)/../include is for libcurl's generated curl/curlbuild.h file
# $(top_srcdir)/../include is for libcurl's external include files
# $(top_builddir)/../lib is for libcurl's generated lib/curl_config.h file
# $(top_srcdir)/../lib is for libcurl's lib/setup.h and other "private" files
# $(top_builddir) is for c-ares's generated ares_config.h file
# $(top_srcdir) is for c-ares's ares_setup.h and other "c-ares-private" files

libcares/Makefile.in  view on Meta::CPAN

@CURLDEBUG_FALSE@	$(am__append_4)

# Specify our include paths here, and do it relative to $(top_srcdir) and
# $(top_builddir), to ensure that these paths which belong to the library
# being currently built and tested are searched before the library which
# might possibly already be installed in the system.
#
# When using the low-level hard-hacking memory leak tracking code from
# libcurl the generated curl/curlbuild.h file must also be reachable.
# Using the libcurl lowlevel code from within c-ares library is ugly and
# only works when c-ares is built and linked with a similarly debug-build
# libcurl, but we do this anyway for convenience.
#
# $(top_builddir)/../include/curl for generated curlbuild.h included from curl.h
# $(top_builddir)/../include is for libcurl's generated curl/curlbuild.h file
# $(top_srcdir)/../include is for libcurl's external include files
# $(top_builddir)/../lib is for libcurl's generated lib/curl_config.h file
# $(top_srcdir)/../lib is for libcurl's lib/setup.h and other "private" files
# $(top_builddir) is for c-ares's generated ares_config.h file
# $(top_srcdir) is for c-ares's ares_setup.h and other "c-ares-private" files
@CURLDEBUG_TRUE@AM_CPPFLAGS = -I$(top_builddir)/../include/curl \

libcares/Makefile.msvc  view on Meta::CPAN

# M.I.T. makes no representations about the suitability of
# this software for any purpose.  It is provided "as is"
# without express or implied warranty.

# ------------------------------------------------------------------------------
#
# Makefile for building c-ares libraries and sample programs with MSVC.
#
# Usage: nmake /f makefile.msvc CFG=<config> <target>
#
# <config> must be one of: [ lib-release | lib-debug | dll-release | dll-debug }
# <target> must be one of: [ ALL | c-ares | acountry | adig | ahost | clean }
#
# If a <target> other than ALL or clean is given, <config> becomes mandatory.
#
# If neither <config> nor <target> are specified this results in
# all targets being built for all <config> c-ares library types.
#
# This makefile must be processed from the subdir where it is located.
#
# All results are generated below a subdirectory named msvcXXX.
#
# ------------------------------------------------------------------------------

NAME = cares

# ------------------------------------------------
# c-ares static and dynamic libraries common base
# file names for release and debug configurations
# ------------------------------------------------

STA_LIB_REL = lib$(NAME)
DYN_LIB_REL = $(NAME)
STA_LIB_DBG = $(STA_LIB_REL)d
DYN_LIB_DBG = $(DYN_LIB_REL)d

# -------------------------------------------
# Base names for c-ares DLL import libraries
# -------------------------------------------

libcares/Makefile.msvc  view on Meta::CPAN


!IFNDEF INSTALL_DIR_INC
INSTALL_DIR_INC = $(INSTALL_DIR)\include
!ENDIF

# -------------------------
# Configuration validation
# -------------------------

VALID_CFGSET = FALSE
!IF "$(CFG)" == "lib-release" || "$(CFG)" == "lib-debug" || \
    "$(CFG)" == "dll-release" || "$(CFG)" == "dll-debug"
VALID_CFGSET = TRUE
!ENDIF

!IF "$(VALID_CFGSET)" == "FALSE" && "$(CFG)" != ""
!  MESSAGE MSVC c-ares makefile
!  MESSAGE
!  MESSAGE Usage: nmake /f makefile.msvc CFG=<config> <target>
!  MESSAGE
!  MESSAGE <config> must be one of: [ lib-release | lib-debug | dll-release | dll-debug }
!  MESSAGE <target> must be one of: [ ALL | c-ares | acountry | adig | ahost | clean }
!  MESSAGE
!  MESSAGE If a <target> other than ALL or clean is given, <config> becomes mandatory.
!  MESSAGE
!  MESSAGE If neither <config> nor <target> are specified this results in
!  MESSAGE all targets being built for all <config> c-ares library types.
!  MESSAGE
!  ERROR Choose a valid configuration.
!ENDIF

libcares/Makefile.msvc  view on Meta::CPAN

CC_CFLAGS  = $(CFLAGS) /I. /W3 /EHsc /FD

RC_CMD_REL = rc.exe /l 0x409 /d "NDEBUG"
RC_CMD_DBG = rc.exe /l 0x409 /d "_DEBUG"

LINK_CMD_LIB = link.exe /lib /nologo
LINK_CMD_DLL = link.exe /dll /nologo /incremental:no /fixed:no
LINK_CMD_EXE = link.exe /nologo /incremental:no /fixed:no /subsystem:console

LINK_CMD_EXE_REL = $(LINK_CMD_EXE) /release $(PDB_NONE)
LINK_CMD_EXE_DBG = $(LINK_CMD_EXE) /debug $(PDBTYPE_CONSOLIDATE)

# ---------------------------------
# Configuration dependent settings
# ---------------------------------

!IF "$(CFG)" == "lib-release"
CARES_TARGET = $(STA_LIB_REL).lib
CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB
CARES_LFLAGS =
SPROG_CFLAGS = /DCARES_STATICLIB
SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_REL) $(STA_LIB_REL).lib
CARES_LINK   = $(LINK_CMD_LIB)
SPROG_LINK   = $(LINK_CMD_EXE_REL)
CC_CMD       = $(CC_CMD_REL)
!ENDIF

!IF "$(CFG)" == "lib-debug"
CARES_TARGET = $(STA_LIB_DBG).lib
CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB /DDEBUGBUILD
CARES_LFLAGS =
SPROG_CFLAGS = /DCARES_STATICLIB
SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_DBG) $(STA_LIB_DBG).lib
CARES_LINK   = $(LINK_CMD_LIB)
SPROG_LINK   = $(LINK_CMD_EXE_DBG)
CC_CMD       = $(CC_CMD_DBG)
!ENDIF

libcares/Makefile.msvc  view on Meta::CPAN

CARES_LFLAGS = /release $(EX_LIBS_REL) /implib:$(CARES_OUTDIR)\$(IMP_LIB_REL).lib $(PDB_NONE)
SPROG_CFLAGS =
SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_REL) $(IMP_LIB_REL).lib
CARES_LINK   = $(LINK_CMD_DLL)
SPROG_LINK   = $(LINK_CMD_EXE_REL)
CC_CMD       = $(CC_CMD_REL)
USE_RES_FILE = TRUE
RC_CMD       = $(RC_CMD_REL)
!ENDIF

!IF "$(CFG)" == "dll-debug"
CARES_TARGET = $(DYN_LIB_DBG).dll
CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DDEBUGBUILD
CARES_LFLAGS = /debug $(EX_LIBS_DBG) /implib:$(CARES_OUTDIR)\$(IMP_LIB_DBG).lib /pdb:$(CARES_OUTDIR)\$(DYN_LIB_DBG).pdb $(PDBTYPE_CONSOLIDATE)
SPROG_CFLAGS =
SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_DBG) $(IMP_LIB_DBG).lib
CARES_LINK   = $(LINK_CMD_DLL)
SPROG_LINK   = $(LINK_CMD_EXE_DBG)
CC_CMD       = $(CC_CMD_DBG)
USE_RES_FILE = TRUE
RC_CMD       = $(RC_CMD_DBG)
!ENDIF

# --------------------------------------------

libcares/Makefile.msvc  view on Meta::CPAN

# ------------------------------------------------------------- #
# Default target when no CFG library type has been specified,   #
# results in building target ALL for all c-ares library types.  #
# ------------------------------------------------------------- #
# ------------------------------------------------------------- #

!IF "$(VALID_CFGSET)" == "FALSE"

ALL:
    $(MAKE) /f .\Makefile.msvc  CFG=lib-release  ALL
    $(MAKE) /f .\Makefile.msvc  CFG=lib-debug    ALL
    $(MAKE) /f .\Makefile.msvc  CFG=dll-release  ALL
    $(MAKE) /f .\Makefile.msvc  CFG=dll-debug    ALL

clean:
    @-RMDIR /S /Q $(BASE_DIR) >NUL 2>&1

install:
    @$(MAKE) /nologo /f .\Makefile.msvc  CFG=lib-release  install
    @$(MAKE) /nologo /f .\Makefile.msvc  CFG=lib-debug    install
    @$(MAKE) /nologo /f .\Makefile.msvc  CFG=dll-release  install
    @$(MAKE) /nologo /f .\Makefile.msvc  CFG=dll-debug    install

!ENDIF

# ---------------------------------------------------------------------
# Targets only available when a proper CFG library type has been given
# ---------------------------------------------------------------------

!IF "$(VALID_CFGSET)" == "TRUE"

ALL: c-ares acountry adig ahost

libcares/Makefile.netware  view on Meta::CPAN


# Edit the var below to point to your lib architecture.
ifndef LIBARCH
LIBARCH = LIBC
endif

# must be equal to NDEBUG or DEBUG, CURLDEBUG
ifndef DB
DB	= NDEBUG
endif
# Optimization: -O<n> or debugging: -g
ifeq ($(DB),NDEBUG)
	OPT	= -O2
	OBJDIR	= release
else
	OPT	= -g
	OBJDIR	= debug
endif

# Include the version info retrieved from curlver.h
-include $(OBJDIR)/version.inc

# The following lines defines your compiler.
ifdef CWFolder
	METROWERKS = $(CWFolder)
endif
ifdef METROWERKS

libcares/Makefile.netware  view on Meta::CPAN

endif
ifdef STACK
	@echo $(DL)stack $(STACK)$(DL) >> $@
endif
ifdef SCREEN
	@echo $(DL)screenname "$(SCREEN)"$(DL) >> $@
else
	@echo $(DL)screenname "DEFAULT"$(DL) >> $@
endif
ifeq ($(DB),DEBUG)
	@echo $(DL)debug$(DL) >> $@
endif
	@echo $(DL)threadname "$^"$(DL) >> $@
ifdef XDCOPT
	@echo $(DL)xdcdata $(@:.def=.xdc)$(DL) >> $@
endif
ifeq ($(LDRING),0)
	@echo $(DL)flag_on 16$(DL) >> $@
endif
ifeq ($(LDRING),3)
	@echo $(DL)flag_on 512$(DL) >> $@

libcares/README.msvc  view on Meta::CPAN

  Once the above command has finished a new folder named MSVCXX will exist
  below the folder where makefile.msvc is found. The name of the folder
  depends on the MSVC compiler version being used to build c-ares.

  Below the MSVCXX folder there will exist four folders named 'cares',
  'ahost', 'acountry', and 'adig'. The 'cares' folder is the one that
  holds the c-ares libraries you have just generated, the other three
  hold sample programs that use the libraries.

  The above command builds four versions of the c-ares library, dynamic
  and static versions and each one in release and debug flavours. Each
  of these is found in folders named dll-release, dll-debug, lib-release,
  and lib-debug, which hang from the 'cares' folder mentioned above. Each
  sample program also has folders with the same names to reflect which
  library version it is using.


  How to install using MSVC from the command line
  -----------------------------------------------

  In order to allow easy usage of c-ares libraries it may be convenient to
  install c-ares libraries and header files to a common subdirectory tree.

libcares/README.msvc  view on Meta::CPAN

  A VC++ 6.0 reference workspace (vc6aws.dsw) is available within the 'vc'
  folder to allow proper building of the library and sample programs.

  1) Open the vc6aws.dsw workspace with MSVC6's IDE.
  2) Select 'Build' from top menu.
  3) Select 'Batch Build' from dropdown menu.
  4) Make sure that the sixteen project configurations are 'checked'.
  5) Click on the 'Build' button.
  6) Once the sixteen project configurations are built you are done.

  Dynamic and static c-ares libraries are built in debug and release flavours,
  and can be located each one in its own subdirectory, dll-debug, dll-release,
  lib-debug and lib-release, all of them below the 'vc\cares' subdirectory.

  In the same way four executable versions of each sample program are built,
  each using its respective library. The resulting sample executables are
  located in its own subdirectory, dll-debug, dll-release, lib-debug and
  lib-release, below the 'vc\acountry', 'vc\adig' and 'vc\ahost'folders.

  These reference VC++ 6.0 configurations are generated using the dynamic CRT.


  How to build using Visual Studio 2003 or newer IDE
  --------------------------------------------------

  First you have to convert the VC++ 6.0 reference workspace and project files
  to the Visual Studio IDE version you are using, following next steps:

libcares/README.msvc  view on Meta::CPAN

  Visual Studio 6 IDE apply here.


  Relationship between c-ares library file names and versions
  -----------------------------------------------------------

  c-ares static release library version files:

      libcares.lib -> static release library

  c-ares static debug library version files:

      libcaresd.lib -> static debug library

  c-ares dynamic release library version files:

      cares.dll -> dynamic release library
      cares.lib -> import library for the dynamic release library
      cares.exp -> export file for the dynamic release library

  c-ares dynamic debug library version files:

      caresd.dll -> dynamic debug library
      caresd.lib -> import library for the dynamic debug library
      caresd.exp -> export file for the dynamic debug library
      caresd.pdb -> debug symbol file for the dynamic debug library


  How to use c-ares static libraries
  ----------------------------------

  When using the c-ares static library in your program, you will have to
  define preprocessor symbol CARES_STATICLIB while building your program,
  otherwise you will get errors at linkage stage.


libcares/acountry.1  view on Meta::CPAN

.PP
.\" Add any additional description here
.PP
Print the country where HOST (an IPv4 address or hostname) is located,
using the countries.nerd.dk DNS domain to identify the country.
.PP
This utility comes with the \fBc\-ares\fR asynchronous resolver library.
.SH OPTIONS
.TP
\fB\-d\fR
Print some extra debugging output.
.TP
\fB\-h\fR, \fB\-\-help\fR
Display this help and exit.
.TP
\fB\-v\fR
Be more verbose. Print extra information.
.SH "REPORTING BUGS"
Report bugs to the c-ares mailing list:
\fBhttp://cool.haxx.se/mailman/listinfo/c-ares\fR
.SH "SEE ALSO"

libcares/adig.1  view on Meta::CPAN

.PP
This utility comes with the \fBc\-ares\fR asynchronous resolver library.
.SH OPTIONS
.TP
\fB\-c\fR class
Set the query class.
Possible values for class are
NY, CHAOS, HS, IN (default).
.TP
\fB\-d\fR
Print some extra debugging output.
.TP
\fB\-f\fR flag
Add a flag.
Possible values for flag are
igntc, noaliases, norecurse, primary, stayopen, usevc.
.TP
\fB\-h\fR, \fB\-\-help\fR
Display this help and exit.
.TP
\fB\-T\fR port

libcares/ahost.1  view on Meta::CPAN

.PP
.\" Add any additional description here
.PP
Look up the DNS A or AAAA record associated with HOST (a hostname or an
IP address).
.PP
This utility comes with the \fBc\-ares\fR asynchronous resolver library.
.SH OPTIONS
.TP
\fB\-d\fR
Print some extra debugging output.
.TP
\fB\-h\fR, \fB\-\-help\fR
Display this help and exit.
.TP
\fB\-t\fR type
If type is "a", print the A record (default).
If type is "aaaa", print the AAAA record.
If type is "u", look for either AAAA or A record (in that order).
.TP
\fB\-s\fR \fIdomain\fP

libcares/appveyor.yml  view on Meta::CPAN

build_script:
  - if "%platform%" == "x86" call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat"
  - if "%platform%" == "x64" "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64
  - if "%platform%" == "x64" call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
  - if "%platform%" == "mingw" set PATH=%PATH%;C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin
  - copy ares_build.h.dist ares_build.h
  - if "%platform%" == "mingw" ( mingw32-make.exe -f Makefile.m32 demos ) else ( nmake /f Makefile.msvc )
  - cd test
  - if "%platform%" == "mingw" ( mingw32-make.exe -f Makefile.m32 ) else ( nmake /f Makefile.msvc vtest )
  - if "%platform%" == "mingw" ( mingw32-make.exe -f Makefile.m32 aresfuzz.exe aresfuzzname.exe dnsdump.exe ) else ( nmake /f Makefile.msvc aresfuzz aresfuzzname dnsdump )
  - if "%platform%" == "mingw" ( .\dnsdump.exe fuzzinput\answer_a fuzzinput\answer_aaaa ) else ( .\msvc\arestest\lib-debug\dnsdump.exe fuzzinput\answer_a fuzzinput\answer_aaaa )

libcares/ares_expand_name.c  view on Meta::CPAN

#  include <arpa/nameser.h>
#else
#  include "nameser.h"
#endif
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
#  include <arpa/nameser_compat.h>
#endif

#include "ares.h"
#include "ares_nowarn.h"
#include "ares_private.h" /* for the memdebug */

/* Maximum number of indirections allowed for a name */
#define MAX_INDIRS 50

static int name_length(const unsigned char *encoded, const unsigned char *abuf,
                       int alen);

/* Expand an RFC1035-encoded domain name given by encoded.  The
 * containing message is given by abuf and alen.  The result given by
 * *s, which is set to a NUL-terminated allocated buffer.  *enclen is

libcares/ares_expand_string.c  view on Meta::CPAN

#ifdef HAVE_NETINET_IN_H
#  include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_NAMESER_H
#  include <arpa/nameser.h>
#else
#  include "nameser.h"
#endif

#include "ares.h"
#include "ares_private.h" /* for the memdebug */

/* Simply decodes a length-encoded character string. The first byte of the
 * input is the length of the string to be returned and the bytes thereafter
 * are the characters of the string. The returned result will be NULL
 * terminated.
 */
int ares_expand_string(const unsigned char *encoded,
                       const unsigned char *abuf,
                       int alen,
                       unsigned char **s,

libcares/ares_free_hostent.c  view on Meta::CPAN

 * without express or implied warranty.
 */

#include "ares_setup.h"

#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif

#include "ares.h"
#include "ares_private.h" /* for memdebug */

void ares_free_hostent(struct hostent *host)
{
  char **p;

  if (!host)
    return;

  ares_free((char *)(host->h_name));
  for (p = host->h_aliases; *p; p++)

libcares/ares_init.c  view on Meta::CPAN

{
  ares_channel channel;
  int i;
  int status = ARES_SUCCESS;
  struct timeval now;

#ifdef CURLDEBUG
  const char *env = getenv("CARES_MEMDEBUG");

  if (env)
    curl_memdebug(env);
  env = getenv("CARES_MEMLIMIT");
  if (env) {
    char *endptr;
    long num = strtol(env, &endptr, 10);
    if((endptr != env) && (endptr == env + strlen(env)) && (num > 0))
      curl_memlimit(num);
  }
#endif

  if (ares_library_initialized() != ARES_SUCCESS)

libcares/ares_init_options.3  view on Meta::CPAN

as aliases.
.TP 23
.B ARES_FLAG_NOALIASES
Do not honor the HOSTALIASES environment variable, which normally
specifies a file of hostname translations.
.TP 23
.B ARES_FLAG_NOCHECKRESP
Do not discard responses with the SERVFAIL, NOTIMP, or REFUSED
response code or responses whose questions don't match the questions
in the request.  Primarily useful for writing clients which might be
used to test or debug name servers.
.TP 23
.B ARES_FLAG_EDNS
Include an EDNS pseudo-resource record (RFC 2671) in generated requests.
.SH RETURN VALUES
\fBares_init_options(3)\fP can return any of the following values:
.TP 14
.B ARES_SUCCESS
Initialization succeeded.
.TP 14
.B ARES_EFILE

libcares/ares_platform.c  view on Meta::CPAN

{"ncld",               {NULL}, 405, "tcp"},
{"ncld",               {NULL}, 405, "udp"},
{"imsp",               {NULL}, 406, "tcp"},
{"imsp",               {NULL}, 406, "udp"},
{"timbuktu",           {NULL}, 407, "tcp"},
{"timbuktu",           {NULL}, 407, "udp"},
{"prm-sm",             {NULL}, 408, "tcp"},
{"prm-sm",             {NULL}, 408, "udp"},
{"prm-nm",             {NULL}, 409, "tcp"},
{"prm-nm",             {NULL}, 409, "udp"},
{"decladebug",         {NULL}, 410, "tcp"},
{"decladebug",         {NULL}, 410, "udp"},
{"rmt",                {NULL}, 411, "tcp"},
{"rmt",                {NULL}, 411, "udp"},
{"synoptics-trap",     {NULL}, 412, "tcp"},
{"synoptics-trap",     {NULL}, 412, "udp"},
{"smsp",               {NULL}, 413, "tcp"},
{"smsp",               {NULL}, 413, "udp"},
{"infoseek",           {NULL}, 414, "tcp"},
{"infoseek",           {NULL}, 414, "udp"},
{"bnet",               {NULL}, 415, "tcp"},
{"bnet",               {NULL}, 415, "udp"},

libcares/ares_platform.c  view on Meta::CPAN

{"cecsvc",             {NULL}, 2571, "tcp"},
{"cecsvc",             {NULL}, 2571, "udp"},
{"ibp",                {NULL}, 2572, "tcp"},
{"ibp",                {NULL}, 2572, "udp"},
{"trustestablish",     {NULL}, 2573, "tcp"},
{"trustestablish",     {NULL}, 2573, "udp"},
{"blockade-bpsp",      {NULL}, 2574, "tcp"},
{"blockade-bpsp",      {NULL}, 2574, "udp"},
{"hl7",                {NULL}, 2575, "tcp"},
{"hl7",                {NULL}, 2575, "udp"},
{"tclprodebugger",     {NULL}, 2576, "tcp"},
{"tclprodebugger",     {NULL}, 2576, "udp"},
{"scipticslsrvr",      {NULL}, 2577, "tcp"},
{"scipticslsrvr",      {NULL}, 2577, "udp"},
{"rvs-isdn-dcp",       {NULL}, 2578, "tcp"},
{"rvs-isdn-dcp",       {NULL}, 2578, "udp"},
{"mpfoncl",            {NULL}, 2579, "tcp"},
{"mpfoncl",            {NULL}, 2579, "udp"},
{"tributary",          {NULL}, 2580, "tcp"},
{"tributary",          {NULL}, 2580, "udp"},
{"argis-te",           {NULL}, 2581, "tcp"},
{"argis-te",           {NULL}, 2581, "udp"},

libcares/ares_platform.c  view on Meta::CPAN

{"mcp-port",           {NULL}, 3558, "tcp"},
{"mcp-port",           {NULL}, 3558, "udp"},
{"cctv-port",          {NULL}, 3559, "tcp"},
{"cctv-port",          {NULL}, 3559, "udp"},
{"iniserve-port",      {NULL}, 3560, "tcp"},
{"iniserve-port",      {NULL}, 3560, "udp"},
{"bmc-onekey",         {NULL}, 3561, "tcp"},
{"bmc-onekey",         {NULL}, 3561, "udp"},
{"sdbproxy",           {NULL}, 3562, "tcp"},
{"sdbproxy",           {NULL}, 3562, "udp"},
{"watcomdebug",        {NULL}, 3563, "tcp"},
{"watcomdebug",        {NULL}, 3563, "udp"},
{"esimport",           {NULL}, 3564, "tcp"},
{"esimport",           {NULL}, 3564, "udp"},
{"m2pa",               {NULL}, 3565, "tcp"},
{"m2pa",               {NULL}, 3565, "sctp"},
{"quest-data-hub",     {NULL}, 3566, "tcp"},
{"oap",                {NULL}, 3567, "tcp"},
{"oap",                {NULL}, 3567, "udp"},
{"oap-s",              {NULL}, 3568, "tcp"},
{"oap-s",              {NULL}, 3568, "udp"},
{"mbg-ctrl",           {NULL}, 3569, "tcp"},

libcares/ares_platform.c  view on Meta::CPAN

{"nexus-portal",       {NULL}, 4021, "tcp"},
{"nexus-portal",       {NULL}, 4021, "udp"},
{"dnox",               {NULL}, 4022, "tcp"},
{"dnox",               {NULL}, 4022, "udp"},
{"esnm-zoning",        {NULL}, 4023, "tcp"},
{"esnm-zoning",        {NULL}, 4023, "udp"},
{"tnp1-port",          {NULL}, 4024, "tcp"},
{"tnp1-port",          {NULL}, 4024, "udp"},
{"partimage",          {NULL}, 4025, "tcp"},
{"partimage",          {NULL}, 4025, "udp"},
{"as-debug",           {NULL}, 4026, "tcp"},
{"as-debug",           {NULL}, 4026, "udp"},
{"bxp",                {NULL}, 4027, "tcp"},
{"bxp",                {NULL}, 4027, "udp"},
{"dtserver-port",      {NULL}, 4028, "tcp"},
{"dtserver-port",      {NULL}, 4028, "udp"},
{"ip-qsig",            {NULL}, 4029, "tcp"},
{"ip-qsig",            {NULL}, 4029, "udp"},
{"jdmn-port",          {NULL}, 4030, "tcp"},
{"jdmn-port",          {NULL}, 4030, "udp"},
{"suucp",              {NULL}, 4031, "tcp"},
{"suucp",              {NULL}, 4031, "udp"},

libcares/ares_platform.c  view on Meta::CPAN

{"wfc",                {NULL}, 4847, "tcp"},
{"wfc",                {NULL}, 4847, "udp"},
{"appserv-http",       {NULL}, 4848, "tcp"},
{"appserv-http",       {NULL}, 4848, "udp"},
{"appserv-https",      {NULL}, 4849, "tcp"},
{"appserv-https",      {NULL}, 4849, "udp"},
{"sun-as-nodeagt",     {NULL}, 4850, "tcp"},
{"sun-as-nodeagt",     {NULL}, 4850, "udp"},
{"derby-repli",        {NULL}, 4851, "tcp"},
{"derby-repli",        {NULL}, 4851, "udp"},
{"unify-debug",        {NULL}, 4867, "tcp"},
{"unify-debug",        {NULL}, 4867, "udp"},
{"phrelay",            {NULL}, 4868, "tcp"},
{"phrelay",            {NULL}, 4868, "udp"},
{"phrelaydbg",         {NULL}, 4869, "tcp"},
{"phrelaydbg",         {NULL}, 4869, "udp"},
{"cc-tracking",        {NULL}, 4870, "tcp"},
{"cc-tracking",        {NULL}, 4870, "udp"},
{"wired",              {NULL}, 4871, "tcp"},
{"wired",              {NULL}, 4871, "udp"},
{"tritium-can",        {NULL}, 4876, "tcp"},
{"tritium-can",        {NULL}, 4876, "udp"},

libcares/ares_platform.c  view on Meta::CPAN

{"noit-transport",     {NULL}, 43191, "tcp"},
{"ew-mgmt",            {NULL}, 43440, "tcp"},
{"ew-disc-cmd",        {NULL}, 43440, "udp"},
{"ciscocsdb",          {NULL}, 43441, "tcp"},
{"ciscocsdb",          {NULL}, 43441, "udp"},
{"pmcd",               {NULL}, 44321, "tcp"},
{"pmcd",               {NULL}, 44321, "udp"},
{"pmcdproxy",          {NULL}, 44322, "tcp"},
{"pmcdproxy",          {NULL}, 44322, "udp"},
{"pcp",                {NULL}, 44323, "udp"},
{"rbr-debug",          {NULL}, 44553, "tcp"},
{"rbr-debug",          {NULL}, 44553, "udp"},
{"EtherNet/IP-2",      {NULL}, 44818, "tcp"},
{"EtherNet/IP-2",      {NULL}, 44818, "udp"},
{"invision-ag",        {NULL}, 45054, "tcp"},
{"invision-ag",        {NULL}, 45054, "udp"},
{"eba",                {NULL}, 45678, "tcp"},
{"eba",                {NULL}, 45678, "udp"},
{"qdb2service",        {NULL}, 45825, "tcp"},
{"qdb2service",        {NULL}, 45825, "udp"},
{"ssr-servermgr",      {NULL}, 45966, "tcp"},
{"ssr-servermgr",      {NULL}, 45966, "udp"},

libcares/ares_private.h  view on Meta::CPAN


#define SOCK_STATE_CALLBACK(c, s, r, w)                                 \
  do {                                                                  \
    if ((c)->sock_state_cb)                                             \
      (c)->sock_state_cb((c)->sock_state_cb_data, (s), (r), (w));       \
  } WHILE_FALSE

#ifdef CURLDEBUG
/* This is low-level hard-hacking memory leak tracking and similar. Using the
   libcurl lowlevel code from within library is ugly and only works when
   c-ares is built and linked with a similarly curldebug-enabled libcurl,
   but we do this anyway for convenience. */
#define HEADER_CURL_SETUP_ONCE_H
#include "../lib/memdebug.h"
#endif

#endif /* __ARES_PRIVATE_H */

libcares/ares_setup.h  view on Meta::CPAN

 * Android does have the arpa/nameser.h header which is detected by configure
 * but it appears to be empty with recent NDK r7b / r7c, so we undefine here.
 */
#if (defined(ANDROID) || defined(__ANDROID__)) && defined(HAVE_ARPA_NAMESER_H)
#  undef HAVE_ARPA_NAMESER_H
#endif

/*
 * Recent autoconf versions define these symbols in ares_config.h. We don't
 * want them (since they collide with the libcurl ones when we build
 *  --enable-debug) so we undef them again here.
 */

#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#undef PACKAGE_BUGREPORT
#undef PACKAGE_NAME
#undef VERSION
#undef PACKAGE

libcares/configure  view on Meta::CPAN

PACKAGE_VERSION
PACKAGE_TARNAME
PACKAGE_NAME
SHELL
PATH_SEPARATOR'
ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_maintainer_mode
enable_silent_rules
enable_debug
enable_optimize
enable_warnings
enable_werror
enable_curldebug
enable_symbol_hiding
enable_expose_statics
with_gcov
enable_code_coverage
enable_dependency_tracking
enable_largefile
enable_shared
enable_static
with_pic
enable_fast_install

libcares/configure  view on Meta::CPAN

fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
	pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
  srcdir=.
fi
# Remove unnecessary trailing slashes from srcdir.
# Double slashes in file names in object file debugging info
# mess up M-x gdb in Emacs.
case $srcdir in
*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
esac
for ac_var in $ac_precious_vars; do
  eval ac_env_${ac_var}_set=\${${ac_var}+set}
  eval ac_env_${ac_var}_value=\$${ac_var}
  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
  eval ac_cv_env_${ac_var}_value=\$${ac_var}
done

libcares/configure  view on Meta::CPAN


Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-maintainer-mode
                          enable make rules and dependencies not useful (and
                          sometimes confusing) to the casual installer
  --enable-silent-rules   less verbose build output (undo: "make V=1")
  --disable-silent-rules  verbose build output (undo: "make V=0")
  --enable-debug          Enable debug build options
  --disable-debug         Disable debug build options
  --enable-optimize(=OPT) Enable compiler optimizations (default=-O2)
  --disable-optimize      Disable compiler optimizations
  --enable-warnings       Enable strict compiler warnings
  --disable-warnings      Disable strict compiler warnings
  --enable-werror         Enable compiler warnings as errors
  --disable-werror        Disable compiler warnings as errors
  --enable-curldebug      Enable curl debug memory tracking
  --disable-curldebug     Disable curl debug memory tracking
  --enable-symbol-hiding  Enable hiding of library internal symbols
  --disable-symbol-hiding Disable hiding of library internal symbols
  --enable-expose-statics Enable exposure of internal static functions for
                          testing
  --disable-expose-statics
                          Disable exposure of internal static functions for
                          testing
  --enable-code-coverage  Whether to enable code coverage support
  --enable-dependency-tracking
                          do not reject slow dependency extractors

libcares/configure  view on Meta::CPAN

rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$4
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno

} # ac_fn_c_check_member
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by c-ares $as_me 1.15.0, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ $0 $@

_ACEOF
exec 5>>config.log
{
cat <<_ASUNAME

libcares/configure  view on Meta::CPAN

done
{ ac_configure_args0=; unset ac_configure_args0;}
{ ac_configure_args1=; unset ac_configure_args1;}

# When interrupted or exit'd, cleanup temporary files, and complete
# config.log.  We remove comments because anyway the quotes in there
# would cause problems or look ugly.
# WARNING: Use '\'' to represent an apostrophe within the trap.
# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
  # Save into config.log some information that might help in debugging.
  {
    echo

    $as_echo "## ---------------- ##
## Cache variables. ##
## ---------------- ##"
    echo
    # The following way of writing the cache mishandles newlines in values,
(
  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do

libcares/configure  view on Meta::CPAN

    AM_V='$(V)'
  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
else
  AM_V=$AM_DEFAULT_VERBOSITY
  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
fi
AM_BACKSLASH='\'



        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable debug build options" >&5
$as_echo_n "checking whether to enable debug build options... " >&6; }
  OPT_DEBUG_BUILD="default"
  # Check whether --enable-debug was given.
if test "${enable_debug+set}" = set; then :
  enableval=$enable_debug; OPT_DEBUG_BUILD=$enableval
fi

  case "$OPT_DEBUG_BUILD" in
    no)
            want_debug="no"
      ;;
    default)
            want_debug="no"
      ;;
    *)
            want_debug="yes"
      ;;
  esac
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $want_debug" >&5
$as_echo "$want_debug" >&6; }


      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable compiler optimizer" >&5
$as_echo_n "checking whether to enable compiler optimizer... " >&6; }
  OPT_COMPILER_OPTIMIZE="default"
  # Check whether --enable-optimize was given.
if test "${enable_optimize+set}" = set; then :
  enableval=$enable_optimize; OPT_COMPILER_OPTIMIZE=$enableval
fi

  case "$OPT_COMPILER_OPTIMIZE" in
    no)
                              want_optimize="no"
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
      ;;
    default)
                                                                        if test "$want_debug" = "yes"; then
        want_optimize="assume_no"
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not specified (assuming no)" >&5
$as_echo "not specified (assuming no)" >&6; }
      else
        want_optimize="assume_yes"
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not specified (assuming yes)" >&5
$as_echo "not specified (assuming yes)" >&6; }
      fi
      ;;
    *)

libcares/configure  view on Meta::CPAN

  # Check whether --enable-warnings was given.
if test "${enable_warnings+set}" = set; then :
  enableval=$enable_warnings; OPT_COMPILER_WARNINGS=$enableval
fi

  case "$OPT_COMPILER_WARNINGS" in
    no)
            want_warnings="no"
      ;;
    default)
                  want_warnings="$want_debug"
      ;;
    *)
            want_warnings="yes"
      ;;
  esac
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $want_warnings" >&5
$as_echo "$want_warnings" >&6; }


    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable compiler warnings as errors" >&5

libcares/configure  view on Meta::CPAN

            want_werror="no"
      ;;
    *)
            want_werror="yes"
      ;;
  esac
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $want_werror" >&5
$as_echo "$want_werror" >&6; }


    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable curl debug memory tracking" >&5
$as_echo_n "checking whether to enable curl debug memory tracking... " >&6; }
  OPT_CURLDEBUG_BUILD="default"
  # Check whether --enable-curldebug was given.
if test "${enable_curldebug+set}" = set; then :
  enableval=$enable_curldebug; OPT_CURLDEBUG_BUILD=$enableval
fi

  case "$OPT_CURLDEBUG_BUILD" in
    no)
            want_curldebug="no"
      ;;
    default)
            want_curldebug="no"
      ;;
    *)
                                                      want_curldebug="yes"
      ;;
  esac
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $want_curldebug" >&5
$as_echo "$want_curldebug" >&6; }


    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable hiding of library internal symbols" >&5
$as_echo_n "checking whether to enable hiding of library internal symbols... " >&6; }
  OPT_SYMBOL_HIDING="default"
  # Check whether --enable-symbol-hiding was given.
if test "${enable_symbol_hiding+set}" = set; then :
  enableval=$enable_symbol_hiding; OPT_SYMBOL_HIDING=$enableval
fi

libcares/configure  view on Meta::CPAN






striplib=
old_striplib=
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
$as_echo_n "checking whether stripping libraries is possible... " >&6; }
if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
# FIXME - insert some real tests, host_os isn't really good enough
  case $host_os in
  darwin*)
    if test -n "$STRIP"; then
      striplib="$STRIP -x"
      old_striplib="$STRIP -S"

libcares/configure  view on Meta::CPAN

      compiler_id="INTEL_UNIX_C"
      flags_dbg_all="-g -g0"
      flags_dbg_yes="-g"
      flags_dbg_off="-g0"
      flags_opt_all="-O -O0 -O1 -O2 -O3 -Os"
      flags_opt_yes="-O2"
      flags_opt_off="-O0"
    else
      compiler_id="INTEL_WINDOWS_C"
      flags_dbg_all="/ZI /Zi /zI /zi /ZD /Zd /zD /zd /Z7 /z7 /Oy /Oy-"
      flags_dbg_all="$flags_dbg_all /debug"
      flags_dbg_all="$flags_dbg_all /debug:none"
      flags_dbg_all="$flags_dbg_all /debug:minimal"
      flags_dbg_all="$flags_dbg_all /debug:partial"
      flags_dbg_all="$flags_dbg_all /debug:full"
      flags_dbg_all="$flags_dbg_all /debug:semantic_stepping"
      flags_dbg_all="$flags_dbg_all /debug:extended"
      flags_dbg_yes="/Zi /Oy-"
      flags_dbg_off="/debug:none /Oy-"
      flags_opt_all="/O /O0 /O1 /O2 /O3 /Od /Og /Og- /Oi /Oi-"
      flags_opt_yes="/O2"
      flags_opt_off="/Od"
    fi
  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
  fi


libcares/configure  view on Meta::CPAN

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
  fi

  #
  if test "$compiler_id" = "unknown"; then
  cat <<_EOF 1>&2
***
*** Warning: This configure script does not have information about the
*** compiler you are using, relative to the flags required to enable or
*** disable generation of debug info, optimization options or warnings.
***
*** Whatever settings are present in CFLAGS will be used for this run.
***
*** If you wish to help the c-ares project to better support your compiler
*** you can report this and the required info on the c-ares development
*** mailing list: http://cool.haxx.se/mailman/listinfo/c-ares/
***
_EOF
  fi

libcares/configure  view on Meta::CPAN

      fi
    done
    if test "$ac_var_strip_word" = "no"; then
      ac_var_stripped="$ac_var_stripped $word1"
    fi
  done
    tmp_CPPFLAGS="$ac_var_stripped"
  squeeze tmp_CPPFLAGS

    #
    if test "$want_debug" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts debug enabling options" >&5
$as_echo_n "checking if compiler accepts debug enabling options... " >&6; }
      tmp_options="$flags_dbg_yes"
    fi
    if test "$want_debug" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts debug disabling options" >&5
$as_echo_n "checking if compiler accepts debug disabling options... " >&6; }
      tmp_options="$flags_dbg_off"
    fi
    #
    if test "$flags_prefer_cppflags" = "yes"; then
      CPPFLAGS="$tmp_CPPFLAGS $tmp_options"
      CFLAGS="$tmp_CFLAGS"
    else
      CPPFLAGS="$tmp_CPPFLAGS"
      CFLAGS="$tmp_CFLAGS $tmp_options"
    fi

libcares/configure  view on Meta::CPAN

    symbol_hiding_CFLAGS="$tmp_CFLAGS"
    symbol_hiding_EXTERN="$tmp_EXTERN"
  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
  fi



      cares_builddir=`pwd`
  supports_curldebug="unknown"
  if test "$want_curldebug" = "yes"; then
    if test "x$enable_shared" != "xno" &&
      test "x$enable_shared" != "xyes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown enable_shared setting." >&5
$as_echo "$as_me: WARNING: unknown enable_shared setting." >&2;}
      supports_curldebug="no"
    fi
    if test "x$enable_static" != "xno" &&
      test "x$enable_static" != "xyes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown enable_static setting." >&5
$as_echo "$as_me: WARNING: unknown enable_static setting." >&2;}
      supports_curldebug="no"
    fi
    if test "$supports_curldebug" != "no"; then
      if test "$enable_shared" = "yes" &&
        test "x$xc_lt_shlib_use_no_undefined" = 'xyes'; then
        supports_curldebug="no"
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: shared library does not support undefined symbols." >&5
$as_echo "$as_me: WARNING: shared library does not support undefined symbols." >&2;}
      fi
      if test ! -f "$srcdir/../include/curl/curlbuild.h.dist"; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: c-ares source not embedded in curl's CVS tree." >&5
$as_echo "$as_me: WARNING: c-ares source not embedded in curl's CVS tree." >&2;}
        supports_curldebug="no"
      elif test ! -f "$srcdir/../include/curl/Makefile.in"; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: curl's buildconf has not been run." >&5
$as_echo "$as_me: WARNING: curl's buildconf has not been run." >&2;}
        supports_curldebug="no"
      elif test ! -f "$cares_builddir/../libcurl.pc" ||
        test ! -f "$cares_builddir/../include/curl/curlbuild.h"; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: curl's configure has not been run." >&5
$as_echo "$as_me: WARNING: curl's configure has not been run." >&2;}
        supports_curldebug="no"
      elif test ! -f "$cares_builddir/../lib/curl_config.h"; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcurl's curl_config.h is missing." >&5
$as_echo "$as_me: WARNING: libcurl's curl_config.h is missing." >&2;}
        supports_curldebug="no"
      elif test ! -f "$cares_builddir/../config.status"; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: curl's config.status is missing." >&5
$as_echo "$as_me: WARNING: curl's config.status is missing." >&2;}
        supports_curldebug="no"
      fi
      if test "$supports_curldebug" != "no"; then
        grep '^#define USE_ARES' "$cares_builddir/../lib/curl_config.h" >/dev/null
        if test "$?" -ne "0"; then
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcurl configured without c-ares support." >&5
$as_echo "$as_me: WARNING: libcurl configured without c-ares support." >&2;}
          supports_curldebug="no"
        fi
      fi
      if test "$supports_curldebug" != "no"; then
        grep 'CPPFLAGS.*CURLDEBUG' "$cares_builddir/../config.status" >/dev/null
        if test "$?" -ne "0"; then
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcurl configured without curldebug support." >&5
$as_echo "$as_me: WARNING: libcurl configured without curldebug support." >&2;}
          supports_curldebug="no"
        fi
      fi
    fi
  fi
  #
  if test "$want_curldebug" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if curl debug memory tracking can be enabled" >&5
$as_echo_n "checking if curl debug memory tracking can be enabled... " >&6; }
    test "$supports_curldebug" = "no" || supports_curldebug="yes"
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports_curldebug" >&5
$as_echo "$supports_curldebug" >&6; }
    if test "$supports_curldebug" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot enable curl debug memory tracking." >&5
$as_echo "$as_me: WARNING: cannot enable curl debug memory tracking." >&2;}
      want_curldebug="no"
    fi
  fi
  #
  if test "$want_curldebug" = "yes"; then

$as_echo "#define BUILDING_LIBCURL 1" >>confdefs.h

    CPPFLAGS="-DCURLDEBUG $CPPFLAGS"
    squeeze CPPFLAGS
  fi
  #
  if test "$want_debug" = "yes"; then
    CPPFLAGS="-DDEBUGBUILD $CPPFLAGS"
    squeeze CPPFLAGS
  fi

 if test x$want_curldebug = xyes; then
  CURLDEBUG_TRUE=
  CURLDEBUG_FALSE='#'
else
  CURLDEBUG_TRUE='#'
  CURLDEBUG_FALSE=
fi




libcares/configure  view on Meta::CPAN

ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
as_write_fail=0
cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.

debug=false
ac_cs_recheck=false
ac_cs_silent=false

SHELL=\${CONFIG_SHELL-$SHELL}
export SHELL
_ASEOF
cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##

libcares/configure  view on Meta::CPAN

from templates according to the current configuration.  Unless the files
and actions are specified as TAGs, all are instantiated by default.

Usage: $0 [OPTION]... [TAG]...

  -h, --help       print this help, then exit
  -V, --version    print version number and configuration settings, then exit
      --config     print configuration, then exit
  -q, --quiet, --silent
                   do not print progress messages
  -d, --debug      don't remove temporary files
      --recheck    update $as_me by reconfiguring in the same conditions
      --file=FILE[:TEMPLATE]
                   instantiate the configuration file FILE
      --header=FILE[:TEMPLATE]
                   instantiate the configuration header FILE

Configuration files:
$config_files

Configuration headers:

libcares/configure  view on Meta::CPAN

  esac

  case $ac_option in
  # Handling of the options.
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    ac_cs_recheck=: ;;
  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
    $as_echo "$ac_cs_version"; exit ;;
  --config | --confi | --conf | --con | --co | --c )
    $as_echo "$ac_cs_config"; exit ;;
  --debug | --debu | --deb | --de | --d | -d )
    debug=: ;;
  --file | --fil | --fi | --f )
    $ac_shift
    case $ac_optarg in
    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
    '') as_fn_error $? "missing file argument" ;;
    esac
    as_fn_append CONFIG_FILES " '$ac_optarg'"
    ac_need_defaults=false;;
  --header | --heade | --head | --hea )
    $ac_shift

libcares/configure  view on Meta::CPAN

# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
fi

# Have a temporary directory for convenience.  Make it in the build tree
# simply because there is no reason against having it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
# Hook for its removal unless debugging.
# Note that there is a small window in which the directory will not be cleaned:
# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
  tmp= ac_tmp=
  trap 'exit_status=$?
  : "${ac_tmp:=$tmp}"
  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
' 0
  trap 'as_fn_exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.

libcares/configure  view on Meta::CPAN


# Used to examine libraries when file_magic_cmd begins with "file".
MAGIC_CMD=$MAGIC_CMD

# Must we lock files when doing compilation?
need_locks=$lt_need_locks

# Manifest tool.
MANIFEST_TOOL=$lt_MANIFEST_TOOL

# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
DSYMUTIL=$lt_DSYMUTIL

# Tool to change global to local symbols on Mac OS X.
NMEDIT=$lt_NMEDIT

# Tool to manipulate fat objects and archives on Mac OS X.
LIPO=$lt_LIPO

# ldd/readelf like tool for Mach-O binaries on Mac OS X.
OTOOL=$lt_OTOOL

libcares/configure.ac  view on Meta::CPAN

  fi
  #
fi

CARES_CHECK_COMPILER_HALT_ON_ERROR
CARES_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
CARES_CHECK_COMPILER_PROTOTYPE_MISMATCH
CARES_CHECK_COMPILER_SYMBOL_HIDING

CARES_CHECK_CURLDEBUG
AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)

dnl **********************************************************************
dnl Compilation based checks should not be done before this point.
dnl **********************************************************************

dnl **********************************************************************
dnl Make sure that our checks for headers windows.h winsock.h winsock2.h 
dnl and ws2tcpip.h take precedence over any other further checks which 
dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
dnl this specific header files. And do them before its results are used.

libcares/ltmain.sh  view on Meta::CPAN

# should continue to work as you expect. And, of course, you can freely
# overwrite any of the functions or variables defined here before
# calling anything to customize them.

EXIT_SUCCESS=0
EXIT_FAILURE=1
EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.

# Allow overriding, eg assuming that you follow the convention of
# putting '$debug_cmd' at the start of all your functions, you can get
# bash to show function call trace with:
#
#    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
debug_cmd=${debug_cmd-":"}
exit_cmd=:

# By convention, finish your script with:
#
#    exit $exit_status
#
# so that you can set exit_status to non-zero if you want to indicate
# something went wrong during execution without actually bailing out at
# the point of failure.
exit_status=$EXIT_SUCCESS

libcares/ltmain.sh  view on Meta::CPAN

# of this file, in order that that they be as useful as possible to
# callers.


# require_term_colors
# -------------------
# Allow display of bold text on terminals that support it.
require_term_colors=func_require_term_colors
func_require_term_colors ()
{
    $debug_cmd

    test -t 1 && {
      # COLORTERM and USE_ANSI_COLORS environment variables take
      # precedence, because most terminfo databases neglect to describe
      # whether color sequences are supported.
      test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}

      if test 1 = "$USE_ANSI_COLORS"; then
        # Standard ANSI escape sequences
        tc_reset=''

libcares/ltmain.sh  view on Meta::CPAN

  # useable or anything else if it does not work.
  test -z "$_G_HAVE_PLUSEQ_OP" \
    && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
    && _G_HAVE_PLUSEQ_OP=yes

if test yes = "$_G_HAVE_PLUSEQ_OP"
then
  # This is an XSI compatible shell, allowing a faster implementation...
  eval 'func_append ()
  {
    $debug_cmd

    eval "$1+=\$2"
  }'
else
  # ...otherwise fall back to using expr, which is often a shell builtin.
  func_append ()
  {
    $debug_cmd

    eval "$1=\$$1\$2"
  }
fi


# func_append_quoted VAR VALUE
# ----------------------------
# Quote VALUE and append to the end of shell variable VAR, separated
# by a space.
if test yes = "$_G_HAVE_PLUSEQ_OP"; then
  eval 'func_append_quoted ()
  {
    $debug_cmd

    func_quote_for_eval "$2"
    eval "$1+=\\ \$func_quote_for_eval_result"
  }'
else
  func_append_quoted ()
  {
    $debug_cmd

    func_quote_for_eval "$2"
    eval "$1=\$$1\\ \$func_quote_for_eval_result"
  }
fi


# func_append_uniq VAR VALUE
# --------------------------
# Append unique VALUE onto the existing contents of VAR, assuming
# entries are delimited by the first character of VALUE.  For example:
#
#   func_append_uniq options " --another-option option-argument"
#
# will only append to $options if " --another-option option-argument "
# is not already present somewhere in $options already (note spaces at
# each end implied by leading space in second argument).
func_append_uniq ()
{
    $debug_cmd

    eval _G_current_value='`$ECHO $'$1'`'
    _G_delim=`expr "$2" : '\(.\)'`

    case $_G_delim$_G_current_value$_G_delim in
      *"$2$_G_delim"*) ;;
      *) func_append "$@" ;;
    esac
}

libcares/ltmain.sh  view on Meta::CPAN

# func_arith TERM...
# ------------------
# Set func_arith_result to the result of evaluating TERMs.
  test -z "$_G_HAVE_ARITH_OP" \
    && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
    && _G_HAVE_ARITH_OP=yes

if test yes = "$_G_HAVE_ARITH_OP"; then
  eval 'func_arith ()
  {
    $debug_cmd

    func_arith_result=$(( $* ))
  }'
else
  func_arith ()
  {
    $debug_cmd

    func_arith_result=`expr "$@"`
  }
fi


# func_basename FILE
# ------------------
# Set func_basename_result to FILE with everything up to and including
# the last / stripped.

libcares/ltmain.sh  view on Meta::CPAN

  _d='func_dirname_result=`$ECHO "$1"  |$SED "$sed_dirname"`
      if test "X$func_dirname_result" = "X$1"; then
        func_dirname_result=$3
      else
        func_append func_dirname_result "$2"
      fi'
fi

eval 'func_basename ()
{
    $debug_cmd

    '"$_b"'
}'


# func_dirname FILE APPEND NONDIR_REPLACEMENT
# -------------------------------------------
# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
# otherwise set result to NONDIR_REPLACEMENT.
eval 'func_dirname ()
{
    $debug_cmd

    '"$_d"'
}'


# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
# --------------------------------------------------------
# Perform func_basename and func_dirname in a single function
# call:
#   dirname:  Compute the dirname of FILE.  If nonempty,
#             add APPEND to the result, otherwise set result
#             to NONDIR_REPLACEMENT.
#             value returned in "$func_dirname_result"
#   basename: Compute filename of FILE.
#             value retuned in "$func_basename_result"
# For efficiency, we do not delegate to the functions above but instead
# duplicate the functionality here.
eval 'func_dirname_and_basename ()
{
    $debug_cmd

    '"$_b"'
    '"$_d"'
}'


# func_echo ARG...
# ----------------
# Echo program name prefixed message.
func_echo ()
{
    $debug_cmd

    _G_message=$*

    func_echo_IFS=$IFS
    IFS=$nl
    for _G_line in $_G_message; do
      IFS=$func_echo_IFS
      $ECHO "$progname: $_G_line"
    done
    IFS=$func_echo_IFS

libcares/ltmain.sh  view on Meta::CPAN

    $ECHO "$*"
}


# func_echo_infix_1 INFIX ARG...
# ------------------------------
# Echo program name, followed by INFIX on the first line, with any
# additional lines not showing INFIX.
func_echo_infix_1 ()
{
    $debug_cmd

    $require_term_colors

    _G_infix=$1; shift
    _G_indent=$_G_infix
    _G_prefix="$progname: $_G_infix: "
    _G_message=$*

    # Strip color escape sequences before counting printable length
    for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"

libcares/ltmain.sh  view on Meta::CPAN

    done
    IFS=$func_echo_infix_1_IFS
}


# func_error ARG...
# -----------------
# Echo program name prefixed message to standard error.
func_error ()
{
    $debug_cmd

    $require_term_colors

    func_echo_infix_1 "  $tc_standout${tc_red}error$tc_reset" "$*" >&2
}


# func_fatal_error ARG...
# -----------------------
# Echo program name prefixed message to standard error, and exit.
func_fatal_error ()
{
    $debug_cmd

    func_error "$*"
    exit $EXIT_FAILURE
}


# func_grep EXPRESSION FILENAME
# -----------------------------
# Check whether EXPRESSION matches any line of FILENAME, without output.
func_grep ()
{
    $debug_cmd

    $GREP "$1" "$2" >/dev/null 2>&1
}


# func_len STRING
# ---------------
# Set func_len_result to the length of STRING. STRING may not
# start with a hyphen.
  test -z "$_G_HAVE_XSI_OPS" \
    && (eval 'x=a/b/c;
      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
    && _G_HAVE_XSI_OPS=yes

if test yes = "$_G_HAVE_XSI_OPS"; then
  eval 'func_len ()
  {
    $debug_cmd

    func_len_result=${#1}
  }'
else
  func_len ()
  {
    $debug_cmd

    func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
  }
fi


# func_mkdir_p DIRECTORY-PATH
# ---------------------------
# Make sure the entire path to DIRECTORY-PATH is available.
func_mkdir_p ()
{
    $debug_cmd

    _G_directory_path=$1
    _G_dir_list=

    if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then

      # Protect directory names starting with '-'
      case $_G_directory_path in
        -*) _G_directory_path=./$_G_directory_path ;;
      esac

libcares/ltmain.sh  view on Meta::CPAN

}


# func_mktempdir [BASENAME]
# -------------------------
# Make a temporary directory that won't clash with other running
# libtool processes, and avoids race conditions if possible.  If
# given, BASENAME is the basename for that directory.
func_mktempdir ()
{
    $debug_cmd

    _G_template=${TMPDIR-/tmp}/${1-$progname}

    if test : = "$opt_dry_run"; then
      # Return a directory name, but don't create it in dry-run mode
      _G_tmpdir=$_G_template-$$
    else

      # If mktemp works, use that first and foremost
      _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`

libcares/ltmain.sh  view on Meta::CPAN

}


# func_normal_abspath PATH
# ------------------------
# Remove doubled-up and trailing slashes, "." path components,
# and cancel out any ".." path components in PATH after making
# it an absolute path.
func_normal_abspath ()
{
    $debug_cmd

    # These SED scripts presuppose an absolute path with a trailing slash.
    _G_pathcar='s|^/\([^/]*\).*$|\1|'
    _G_pathcdr='s|^/[^/]*||'
    _G_removedotparts=':dotsl
		s|/\./|/|g
		t dotsl
		s|/\.$|/|'
    _G_collapseslashes='s|/\{1,\}|/|g'
    _G_finalslash='s|/*$|/|'

libcares/ltmain.sh  view on Meta::CPAN

    # Restore leading double-slash if one was found on entry.
    func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
}


# func_notquiet ARG...
# --------------------
# Echo program name prefixed message only when not in quiet mode.
func_notquiet ()
{
    $debug_cmd

    $opt_quiet || func_echo ${1+"$@"}

    # A bug in bash halts the script if the last line of a function
    # fails when set -e is in force, so we need another command to
    # work around that:
    :
}


# func_relative_path SRCDIR DSTDIR
# --------------------------------
# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
func_relative_path ()
{
    $debug_cmd

    func_relative_path_result=
    func_normal_abspath "$1"
    func_relative_path_tlibdir=$func_normal_abspath_result
    func_normal_abspath "$2"
    func_relative_path_tbindir=$func_normal_abspath_result

    # Ascend the tree starting from libdir
    while :; do
      # check if we have found a prefix of bindir

libcares/ltmain.sh  view on Meta::CPAN

# --------------------------
# Aesthetically quote ARGs to be evaled later.
# This function returns two values:
#   i) func_quote_for_eval_result
#      double-quoted, suitable for a subsequent eval
#  ii) func_quote_for_eval_unquoted_result
#      has all characters that are still active within double
#      quotes backslashified.
func_quote_for_eval ()
{
    $debug_cmd

    func_quote_for_eval_unquoted_result=
    func_quote_for_eval_result=
    while test 0 -lt $#; do
      case $1 in
        *[\\\`\"\$]*)
	  _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
        *)
          _G_unquoted_arg=$1 ;;
      esac

libcares/ltmain.sh  view on Meta::CPAN

    done
}


# func_quote_for_expand ARG
# -------------------------
# Aesthetically quote ARG to be evaled later; same as above,
# but do not quote variable references.
func_quote_for_expand ()
{
    $debug_cmd

    case $1 in
      *[\\\`\"]*)
	_G_arg=`$ECHO "$1" | $SED \
	    -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
      *)
        _G_arg=$1 ;;
    esac

    case $_G_arg in

libcares/ltmain.sh  view on Meta::CPAN


# func_stripname PREFIX SUFFIX NAME
# ---------------------------------
# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
# PREFIX and SUFFIX must not contain globbing or regex special
# characters, hashes, percent signs, but SUFFIX may contain a leading
# dot (in which case that matches only a dot).
if test yes = "$_G_HAVE_XSI_OPS"; then
  eval 'func_stripname ()
  {
    $debug_cmd

    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
    # positional parameters, so assign one to ordinary variable first.
    func_stripname_result=$3
    func_stripname_result=${func_stripname_result#"$1"}
    func_stripname_result=${func_stripname_result%"$2"}
  }'
else
  func_stripname ()
  {
    $debug_cmd

    case $2 in
      .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
      *)  func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
    esac
  }
fi


# func_show_eval CMD [FAIL_EXP]
# -----------------------------
# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
# is given, then evaluate it.
func_show_eval ()
{
    $debug_cmd

    _G_cmd=$1
    _G_fail_exp=${2-':'}

    func_quote_for_expand "$_G_cmd"
    eval "func_notquiet $func_quote_for_expand_result"

    $opt_dry_run || {
      eval "$_G_cmd"
      _G_status=$?

libcares/ltmain.sh  view on Meta::CPAN

}


# func_show_eval_locale CMD [FAIL_EXP]
# ------------------------------------
# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
# is given, then evaluate it.  Use the saved locale for evaluation.
func_show_eval_locale ()
{
    $debug_cmd

    _G_cmd=$1
    _G_fail_exp=${2-':'}

    $opt_quiet || {
      func_quote_for_expand "$_G_cmd"
      eval "func_echo $func_quote_for_expand_result"
    }

    $opt_dry_run || {

libcares/ltmain.sh  view on Meta::CPAN



# func_tr_sh
# ----------
# Turn $1 into a string suitable for a shell variable name.
# Result is stored in $func_tr_sh_result.  All characters
# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
# if $1 begins with a digit, a '_' is prepended as well.
func_tr_sh ()
{
    $debug_cmd

    case $1 in
    [0-9]* | *[!a-zA-Z0-9_]*)
      func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
      ;;
    * )
      func_tr_sh_result=$1
      ;;
    esac
}


# func_verbose ARG...
# -------------------
# Echo program name prefixed message in verbose mode only.
func_verbose ()
{
    $debug_cmd

    $opt_verbose && func_echo "$*"

    :
}


# func_warn_and_continue ARG...
# -----------------------------
# Echo program name prefixed warning message to standard error.
func_warn_and_continue ()
{
    $debug_cmd

    $require_term_colors

    func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
}


# func_warning CATEGORY ARG...
# ----------------------------
# Echo program name prefixed warning message to standard error. Warning
# messages can be filtered according to CATEGORY, where this function
# elides messages where CATEGORY is not listed in the global variable
# 'opt_warning_types'.
func_warning ()
{
    $debug_cmd

    # CATEGORY must be in the warning_categories list!
    case " $warning_categories " in
      *" $1 "*) ;;
      *) func_internal_error "invalid warning category '$1'" ;;
    esac

    _G_category=$1
    shift

libcares/ltmain.sh  view on Meta::CPAN

# -----------------------
# 'sort -V' is not generally available.
# Note this deviates from the version comparison in automake
# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
# but this should suffice as we won't be specifying old
# version formats or redundant trailing .0 in bootstrap.conf.
# If we did want full compatibility then we should probably
# use m4_version_compare from autoconf.
func_sort_ver ()
{
    $debug_cmd

    printf '%s\n%s\n' "$1" "$2" \
      | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
}

# func_lt_ver PREV CURR
# ---------------------
# Return true if PREV and CURR are in the correct order according to
# func_sort_ver, otherwise false.  Use it like this:
#
#  func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
func_lt_ver ()
{
    $debug_cmd

    test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
}


# Local variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"

libcares/ltmain.sh  view on Meta::CPAN

#   ...rest of your script...
#
# In order for the '--version' option to work, you will need to have a
# suitably formatted comment like the one at the top of this file
# starting with '# Written by ' and ending with '# warranty; '.
#
# For '-h' and '--help' to work, you will also need a one line
# description of your script's purpose in a comment directly above the
# '# Written by ' line, like the one at the top of this file.
#
# The default options also support '--debug', which will turn on shell
# execution tracing (see the comment above debug_cmd below for another
# use), and '--verbose' and the func_verbose function to allow your script
# to display verbose messages only when your user has specified
# '--verbose'.
#
# After sourcing this file, you can plug processing for additional
# options by amending the variables from the 'Configuration' section
# below, and following the instructions in the 'Option parsing'
# section further down.

## -------------- ##

libcares/ltmain.sh  view on Meta::CPAN

# '--help' output messages. You can embed shell variables for delayed
# expansion at the time the message is displayed, but you will need to
# quote other shell meta-characters carefully to prevent them being
# expanded when the contents are evaled.
usage='$progpath [OPTION]...'

# Short help message in response to '-h' and '--help'.  Add to this or
# override it after sourcing this library to reflect the full set of
# options your script accepts.
usage_message="\
       --debug        enable verbose shell tracing
   -W, --warnings=CATEGORY
                      report the warnings falling in CATEGORY [all]
   -v, --verbose      verbosely report processing
       --version      print version information and exit
   -h, --help         print short or long help message and exit
"

# Additional text appended to 'usage_message' in response to '--help'.
long_help_message="
Warning categories include:

libcares/ltmain.sh  view on Meta::CPAN

# This section contains functions for adding, removing, and running hooks
# to the main code.  A hook is just a named list of of function, that can
# be run in order later on.

# func_hookable FUNC_NAME
# -----------------------
# Declare that FUNC_NAME will run hooks added with
# 'func_add_hook FUNC_NAME ...'.
func_hookable ()
{
    $debug_cmd

    func_append hookable_fns " $1"
}


# func_add_hook FUNC_NAME HOOK_FUNC
# ---------------------------------
# Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
# first have been declared "hookable" by a call to 'func_hookable'.
func_add_hook ()
{
    $debug_cmd

    case " $hookable_fns " in
      *" $1 "*) ;;
      *) func_fatal_error "'$1' does not accept hook functions." ;;
    esac

    eval func_append ${1}_hooks '" $2"'
}


# func_remove_hook FUNC_NAME HOOK_FUNC
# ------------------------------------
# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
func_remove_hook ()
{
    $debug_cmd

    eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
}


# func_run_hooks FUNC_NAME [ARG]...
# ---------------------------------
# Run all hook functions registered to FUNC_NAME.
# It is assumed that the list of hook functions contains nothing more
# than a whitespace-delimited list of legal shell function names, and
# no effort is wasted trying to catch shell meta-characters or preserve
# whitespace.
func_run_hooks ()
{
    $debug_cmd

    case " $hookable_fns " in
      *" $1 "*) ;;
      *) func_fatal_error "'$1' does not support hook funcions.n" ;;
    esac

    eval _G_hook_fns=\$$1_hooks; shift

    for _G_hook in $_G_hook_fns; do
      eval $_G_hook '"$@"'

libcares/ltmain.sh  view on Meta::CPAN

## --------------- ##

# In order to add your own option parsing hooks, you must accept the
# full positional parameter list in your hook function, remove any
# options that you action, and then pass back the remaining unprocessed
# options in '<hooked_function_name>_result', escaped suitably for
# 'eval'.  Like this:
#
#    my_options_prep ()
#    {
#        $debug_cmd
#
#        # Extend the existing usage message.
#        usage_message=$usage_message'
#      -s, --silent       don'\''t print informational messages
#    '
#
#        func_quote_for_eval ${1+"$@"}
#        my_options_prep_result=$func_quote_for_eval_result
#    }
#    func_add_hook func_options_prep my_options_prep
#
#
#    my_silent_option ()
#    {
#        $debug_cmd
#
#        # Note that for efficiency, we parse as many options as we can
#        # recognise in a loop before passing the remainder back to the
#        # caller on the first unrecognised argument we encounter.
#        while test $# -gt 0; do
#          opt=$1; shift
#          case $opt in
#            --silent|-s) opt_silent=: ;;
#            # Separate non-argument short options:
#            -s*)         func_split_short_opt "$_G_opt"

libcares/ltmain.sh  view on Meta::CPAN

#        done
#
#        func_quote_for_eval ${1+"$@"}
#        my_silent_option_result=$func_quote_for_eval_result
#    }
#    func_add_hook func_parse_options my_silent_option
#
#
#    my_option_validation ()
#    {
#        $debug_cmd
#
#        $opt_silent && $opt_verbose && func_fatal_help "\
#    '--silent' and '--verbose' options are mutually exclusive."
#
#        func_quote_for_eval ${1+"$@"}
#        my_option_validation_result=$func_quote_for_eval_result
#    }
#    func_add_hook func_validate_options my_option_validation
#
# You'll alse need to manually amend $usage_message to reflect the extra

libcares/ltmain.sh  view on Meta::CPAN

# multiple option parsing hooks can be added safely.


# func_options [ARG]...
# ---------------------
# All the functions called inside func_options are hookable. See the
# individual implementations for details.
func_hookable func_options
func_options ()
{
    $debug_cmd

    func_options_prep ${1+"$@"}
    eval func_parse_options \
        ${func_options_prep_result+"$func_options_prep_result"}
    eval func_validate_options \
        ${func_parse_options_result+"$func_parse_options_result"}

    eval func_run_hooks func_options \
        ${func_validate_options_result+"$func_validate_options_result"}

libcares/ltmain.sh  view on Meta::CPAN

# --------------------------
# All initialisations required before starting the option parse loop.
# Note that when calling hook functions, we pass through the list of
# positional parameters.  If a hook function modifies that list, and
# needs to propogate that back to rest of this script, then the complete
# modified list must be put in 'func_run_hooks_result' before
# returning.
func_hookable func_options_prep
func_options_prep ()
{
    $debug_cmd

    # Option defaults:
    opt_verbose=false
    opt_warning_types=

    func_run_hooks func_options_prep ${1+"$@"}

    # save modified positional parameters for caller
    func_options_prep_result=$func_run_hooks_result
}


# func_parse_options [ARG]...
# ---------------------------
# The main option parsing loop.
func_hookable func_parse_options
func_parse_options ()
{
    $debug_cmd

    func_parse_options_result=

    # this just eases exit handling
    while test $# -gt 0; do
      # Defer to hook functions for initial option parsing, so they
      # get priority in the event of reusing an option name.
      func_run_hooks func_parse_options ${1+"$@"}

      # Adjust func_parse_options positional parameters to match
      eval set dummy "$func_run_hooks_result"; shift

      # Break out of the loop if we already parsed every option.
      test $# -gt 0 || break

      _G_opt=$1
      shift
      case $_G_opt in
        --debug|-x)   debug_cmd='set -x'
                      func_echo "enabling shell trace mode"
                      $debug_cmd
                      ;;

        --no-warnings|--no-warning|--no-warn)
                      set dummy --warnings none ${1+"$@"}
                      shift
		      ;;

        --warnings|--warning|-W)
                      test $# = 0 && func_missing_arg $_G_opt && break
                      case " $warning_categories $1" in

libcares/ltmain.sh  view on Meta::CPAN

}


# func_validate_options [ARG]...
# ------------------------------
# Perform any sanity checks on option settings and/or unconsumed
# arguments.
func_hookable func_validate_options
func_validate_options ()
{
    $debug_cmd

    # Display all warnings if -W was not given.
    test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"

    func_run_hooks func_validate_options ${1+"$@"}

    # Bail if the options were screwed!
    $exit_cmd $EXIT_FAILURE

    # save modified positional parameters for caller

libcares/ltmain.sh  view on Meta::CPAN

# This section contains the helper functions used by the rest of the
# hookable option parser framework in ascii-betical order.


# func_fatal_help ARG...
# ----------------------
# Echo program name prefixed message to standard error, followed by
# a help hint, and exit.
func_fatal_help ()
{
    $debug_cmd

    eval \$ECHO \""Usage: $usage"\"
    eval \$ECHO \""$fatal_help"\"
    func_error ${1+"$@"}
    exit $EXIT_FAILURE
}


# func_help
# ---------
# Echo long help message to standard output and exit.
func_help ()
{
    $debug_cmd

    func_usage_message
    $ECHO "$long_help_message"
    exit 0
}


# func_missing_arg ARGNAME
# ------------------------
# Echo program name prefixed message to standard error and set global
# exit_cmd.
func_missing_arg ()
{
    $debug_cmd

    func_error "Missing argument for '$1'."
    exit_cmd=exit
}


# func_split_equals STRING
# ------------------------
# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
# splitting STRING at the '=' sign.
test -z "$_G_HAVE_XSI_OPS" \
    && (eval 'x=a/b/c;
      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
    && _G_HAVE_XSI_OPS=yes

if test yes = "$_G_HAVE_XSI_OPS"
then
  # This is an XSI compatible shell, allowing a faster implementation...
  eval 'func_split_equals ()
  {
      $debug_cmd

      func_split_equals_lhs=${1%%=*}
      func_split_equals_rhs=${1#*=}
      test "x$func_split_equals_lhs" = "x$1" \
        && func_split_equals_rhs=
  }'
else
  # ...otherwise fall back to using expr, which is often a shell builtin.
  func_split_equals ()
  {
      $debug_cmd

      func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
      func_split_equals_rhs=
      test "x$func_split_equals_lhs" = "x$1" \
        || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
  }
fi #func_split_equals


# func_split_short_opt SHORTOPT
# -----------------------------
# Set func_split_short_opt_name and func_split_short_opt_arg shell
# variables after splitting SHORTOPT after the 2nd character.
if test yes = "$_G_HAVE_XSI_OPS"
then
  # This is an XSI compatible shell, allowing a faster implementation...
  eval 'func_split_short_opt ()
  {
      $debug_cmd

      func_split_short_opt_arg=${1#??}
      func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
  }'
else
  # ...otherwise fall back to using expr, which is often a shell builtin.
  func_split_short_opt ()
  {
      $debug_cmd

      func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
      func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
  }
fi #func_split_short_opt


# func_usage
# ----------
# Echo short help message to standard output and exit.
func_usage ()
{
    $debug_cmd

    func_usage_message
    $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
    exit 0
}


# func_usage_message
# ------------------
# Echo short help message to standard output.
func_usage_message ()
{
    $debug_cmd

    eval \$ECHO \""Usage: $usage"\"
    echo
    $SED -n 's|^# ||
        /^Written by/{
          x;p;x
        }
	h
	/^Written by/q' < "$progpath"
    echo
    eval \$ECHO \""$usage_message"\"
}


# func_version
# ------------
# Echo version message to standard output and exit.
func_version ()
{
    $debug_cmd

    printf '%s\n' "$progname $scriptversion"
    $SED -n '
        /(C)/!b go
        :more
        /\./!{
          N
          s|\n# | |
          b more
        }

libcares/ltmain.sh  view on Meta::CPAN

# Set a version string.
scriptversion='(GNU libtool) 2.4.6'


# func_echo ARG...
# ----------------
# Libtool also displays the current mode in messages, so override
# funclib.sh func_echo with this custom definition.
func_echo ()
{
    $debug_cmd

    _G_message=$*

    func_echo_IFS=$IFS
    IFS=$nl
    for _G_line in $_G_message; do
      IFS=$func_echo_IFS
      $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
    done
    IFS=$func_echo_IFS
}


# func_warning ARG...
# -------------------
# Libtool warnings are not categorized, so override funclib.sh
# func_warning with this simpler definition.
func_warning ()
{
    $debug_cmd

    $warning_func ${1+"$@"}
}


## ---------------- ##
## Options parsing. ##
## ---------------- ##

# Hook in the functions to make sure our own options are parsed during
# the option parsing loop.

usage='$progpath [OPTION]... [MODE-ARG]...'

# Short help message in response to '-h'.
usage_message="Options:
       --config             show all configuration variables
       --debug              enable verbose shell tracing
   -n, --dry-run            display commands without modifying any files
       --features           display basic configuration information and exit
       --mode=MODE          use operation mode MODE
       --no-warnings        equivalent to '-Wnone'
       --preserve-dup-deps  don't remove duplicate dependency libraries
       --quiet, --silent    don't print informational messages
       --tag=TAG            use configuration variables from tag TAG
   -v, --verbose            print more informational messages than default
       --version            print version information
   -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]
   -h, --help, --help-all   print short, long, or detailed help message
"

# Additional text appended to 'usage_message' in response to '--help'.
func_help ()
{
    $debug_cmd

    func_usage_message
    $ECHO "$long_help_message

MODE must be one of the following:

       clean           remove files from the build directory
       compile         compile a source file into a libtool object
       execute         automatically set library path, then run a program
       finish          complete the installation of libtool libraries

libcares/ltmain.sh  view on Meta::CPAN

      exit $EXIT_MISMATCH
    fi
}


# libtool_options_prep [ARG]...
# -----------------------------
# Preparation for options parsed by libtool.
libtool_options_prep ()
{
    $debug_mode

    # Option defaults:
    opt_config=false
    opt_dlopen=
    opt_dry_run=false
    opt_help=false
    opt_mode=
    opt_preserve_dup_deps=false
    opt_quiet=false

libcares/ltmain.sh  view on Meta::CPAN

    libtool_options_prep_result=$func_quote_for_eval_result
}
func_add_hook func_options_prep libtool_options_prep


# libtool_parse_options [ARG]...
# ---------------------------------
# Provide handling for libtool specific options.
libtool_parse_options ()
{
    $debug_cmd

    # Perform our own loop to consume as many options as possible in
    # each iteration.
    while test $# -gt 0; do
      _G_opt=$1
      shift
      case $_G_opt in
        --dry-run|--dryrun|-n)
                        opt_dry_run=:
                        ;;

libcares/ltmain.sh  view on Meta::CPAN

# Perform any sanity checks on option settings and/or unconsumed
# arguments.
libtool_validate_options ()
{
    # save first non-option argument
    if test 0 -lt $#; then
      nonopt=$1
      shift
    fi

    # preserve --debug
    test : = "$debug_cmd" || func_append preserve_args " --debug"

    case $host in
      # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
      # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
      *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
        # don't eliminate duplications in $postdeps and $predeps
        opt_duplicate_compiler_generated_deps=:
        ;;
      *)
        opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps

libcares/ltmain.sh  view on Meta::CPAN

    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
}


# func_execute_cmds commands fail_cmd
# Execute tilde-delimited COMMANDS.
# If FAIL_CMD is given, eval that upon failure.
# FAIL_CMD may read-access the current command in variable CMD!
func_execute_cmds ()
{
    $debug_cmd

    save_ifs=$IFS; IFS='~'
    for cmd in $1; do
      IFS=$sp$nl
      eval cmd=\"$cmd\"
      IFS=$save_ifs
      func_show_eval "$cmd" "${2-:}"
    done
    IFS=$save_ifs
}


# func_source file
# Source FILE, adding directory component if necessary.
# Note that it is not necessary on cygwin/mingw to append a dot to
# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
# behavior happens only for exec(3), not for open(2)!  Also, sourcing
# 'FILE.' does not work on cygwin managed mounts.
func_source ()
{
    $debug_cmd

    case $1 in
    */* | *\\*)	. "$1" ;;
    *)		. "./$1" ;;
    esac
}


# func_resolve_sysroot PATH
# Replace a leading = in PATH with a sysroot.  Store the result into

libcares/ltmain.sh  view on Meta::CPAN

}

# func_infer_tag arg
# Infer tagged configuration to use if any are available and
# if one wasn't chosen via the "--tag" command line option.
# Only attempt this if the compiler in the base compile
# command doesn't match the default compiler.
# arg is usually of the form 'gcc ...'
func_infer_tag ()
{
    $debug_cmd

    if test -n "$available_tags" && test -z "$tagname"; then
      CC_quoted=
      for arg in $CC; do
	func_append_quoted CC_quoted "$arg"
      done
      CC_expanded=`func_echo_all $CC`
      CC_quoted_expanded=`func_echo_all $CC_quoted`
      case $@ in
      # Blanks in the command may have been stripped by the calling shell,

libcares/ltmain.sh  view on Meta::CPAN

# Helper function used by file name conversion functions when $build is *nix,
# and $host is mingw, cygwin, or some other w32 environment. Relies on a
# correctly configured wine environment available, with the winepath program
# in $build's $PATH.
#
# ARG is the $build file name to be converted to w32 format.
# Result is available in $func_convert_core_file_wine_to_w32_result, and will
# be empty on error (or when ARG is empty)
func_convert_core_file_wine_to_w32 ()
{
  $debug_cmd

  func_convert_core_file_wine_to_w32_result=$1
  if test -n "$1"; then
    # Unfortunately, winepath does not exit with a non-zero error code, so we
    # are forced to check the contents of stdout. On the other hand, if the
    # command is not found, the shell will set an exit code of 127 and print
    # *an error message* to stdout. So we must check for both error code of
    # zero AND non-empty stdout, which explains the odd construction:
    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
    if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then

libcares/ltmain.sh  view on Meta::CPAN

# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
# configured wine environment available, with the winepath program in $build's
# $PATH. Assumes ARG has no leading or trailing path separator characters.
#
# ARG is path to be converted from $build format to win32.
# Result is available in $func_convert_core_path_wine_to_w32_result.
# Unconvertible file (directory) names in ARG are skipped; if no directory names
# are convertible, then the result may be empty.
func_convert_core_path_wine_to_w32 ()
{
  $debug_cmd

  # unfortunately, winepath doesn't convert paths, only file names
  func_convert_core_path_wine_to_w32_result=
  if test -n "$1"; then
    oldIFS=$IFS
    IFS=:
    for func_convert_core_path_wine_to_w32_f in $1; do
      IFS=$oldIFS
      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
      if test -n "$func_convert_core_file_wine_to_w32_result"; then

libcares/ltmain.sh  view on Meta::CPAN

# or path in func_cygpath_result (input file name or path is assumed to be in
# Cygwin format). Returns an empty string on error.
#
# ARGS are passed to cygpath, with the last one being the file name or path to
# be converted.
#
# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
# environment variable; do not put it in $PATH.
func_cygpath ()
{
  $debug_cmd

  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
    if test "$?" -ne 0; then
      # on failure, ensure result is empty
      func_cygpath_result=
    fi
  else
    func_cygpath_result=
    func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
  fi
}
#end: func_cygpath


# func_convert_core_msys_to_w32 ARG
# Convert file name or path ARG from MSYS format to w32 format.  Return
# result in func_convert_core_msys_to_w32_result.
func_convert_core_msys_to_w32 ()
{
  $debug_cmd

  # awkward: cmd appends spaces to result
  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
    $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
}
#end: func_convert_core_msys_to_w32


# func_convert_file_check ARG1 ARG2
# Verify that ARG1 (a file name in $build format) was converted to $host
# format in ARG2. Otherwise, emit an error message, but continue (resetting
# func_to_host_file_result to ARG1).
func_convert_file_check ()
{
  $debug_cmd

  if test -z "$2" && test -n "$1"; then
    func_error "Could not determine host file name corresponding to"
    func_error "  '$1'"
    func_error "Continuing, but uninstalled executables may not work."
    # Fallback:
    func_to_host_file_result=$1
  fi
}
# end func_convert_file_check


# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
# Verify that FROM_PATH (a path in $build format) was converted to $host
# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
# func_to_host_file_result to a simplistic fallback value (see below).
func_convert_path_check ()
{
  $debug_cmd

  if test -z "$4" && test -n "$3"; then
    func_error "Could not determine the host path corresponding to"
    func_error "  '$3'"
    func_error "Continuing, but uninstalled executables may not work."
    # Fallback.  This is a deliberately simplistic "conversion" and
    # should not be "improved".  See libtool.info.
    if test "x$1" != "x$2"; then
      lt_replace_pathsep_chars="s|$1|$2|g"
      func_to_host_path_result=`echo "$3" |

libcares/ltmain.sh  view on Meta::CPAN

  fi
}
# end func_convert_path_check


# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
# and appending REPL if ORIG matches BACKPAT.
func_convert_path_front_back_pathsep ()
{
  $debug_cmd

  case $4 in
  $1 ) func_to_host_path_result=$3$func_to_host_path_result
    ;;
  esac
  case $4 in
  $2 ) func_append func_to_host_path_result "$3"
    ;;
  esac
}

libcares/ltmain.sh  view on Meta::CPAN

#
# In each case, ARG is the path to be converted from $build to $host format.
# Result will be available in $func_to_host_file_result.


# func_to_host_file ARG
# Converts the file name ARG from $build format to $host format. Return result
# in func_to_host_file_result.
func_to_host_file ()
{
  $debug_cmd

  $to_host_file_cmd "$1"
}
# end func_to_host_file


# func_to_tool_file ARG LAZY
# converts the file name ARG from $build format to toolchain format. Return
# result in func_to_tool_file_result.  If the conversion in use is listed
# in (the comma separated) LAZY, no conversion takes place.
func_to_tool_file ()
{
  $debug_cmd

  case ,$2, in
    *,"$to_tool_file_cmd",*)
      func_to_tool_file_result=$1
      ;;
    *)
      $to_tool_file_cmd "$1"
      func_to_tool_file_result=$func_to_host_file_result
      ;;
  esac

libcares/ltmain.sh  view on Meta::CPAN

}
# end func_convert_file_noop


# func_convert_file_msys_to_w32 ARG
# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
# conversion to w32 is not available inside the cwrapper.  Returns result in
# func_to_host_file_result.
func_convert_file_msys_to_w32 ()
{
  $debug_cmd

  func_to_host_file_result=$1
  if test -n "$1"; then
    func_convert_core_msys_to_w32 "$1"
    func_to_host_file_result=$func_convert_core_msys_to_w32_result
  fi
  func_convert_file_check "$1" "$func_to_host_file_result"
}
# end func_convert_file_msys_to_w32


# func_convert_file_cygwin_to_w32 ARG
# Convert file name ARG from Cygwin to w32 format.  Returns result in
# func_to_host_file_result.
func_convert_file_cygwin_to_w32 ()
{
  $debug_cmd

  func_to_host_file_result=$1
  if test -n "$1"; then
    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
    # LT_CYGPATH in this case.
    func_to_host_file_result=`cygpath -m "$1"`
  fi
  func_convert_file_check "$1" "$func_to_host_file_result"
}
# end func_convert_file_cygwin_to_w32


# func_convert_file_nix_to_w32 ARG
# Convert file name ARG from *nix to w32 format.  Requires a wine environment
# and a working winepath. Returns result in func_to_host_file_result.
func_convert_file_nix_to_w32 ()
{
  $debug_cmd

  func_to_host_file_result=$1
  if test -n "$1"; then
    func_convert_core_file_wine_to_w32 "$1"
    func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
  fi
  func_convert_file_check "$1" "$func_to_host_file_result"
}
# end func_convert_file_nix_to_w32


# func_convert_file_msys_to_cygwin ARG
# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
# Returns result in func_to_host_file_result.
func_convert_file_msys_to_cygwin ()
{
  $debug_cmd

  func_to_host_file_result=$1
  if test -n "$1"; then
    func_convert_core_msys_to_w32 "$1"
    func_cygpath -u "$func_convert_core_msys_to_w32_result"
    func_to_host_file_result=$func_cygpath_result
  fi
  func_convert_file_check "$1" "$func_to_host_file_result"
}
# end func_convert_file_msys_to_cygwin


# func_convert_file_nix_to_cygwin ARG
# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
# in func_to_host_file_result.
func_convert_file_nix_to_cygwin ()
{
  $debug_cmd

  func_to_host_file_result=$1
  if test -n "$1"; then
    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
    func_convert_core_file_wine_to_w32 "$1"
    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
    func_to_host_file_result=$func_cygpath_result
  fi
  func_convert_file_check "$1" "$func_to_host_file_result"
}

libcares/ltmain.sh  view on Meta::CPAN

# the two new functions must follow this pattern, or func_init_to_host_path_cmd
# will break.


# func_init_to_host_path_cmd
# Ensures that function "pointer" variable $to_host_path_cmd is set to the
# appropriate value, based on the value of $to_host_file_cmd.
to_host_path_cmd=
func_init_to_host_path_cmd ()
{
  $debug_cmd

  if test -z "$to_host_path_cmd"; then
    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
    to_host_path_cmd=func_convert_path_$func_stripname_result
  fi
}


# func_to_host_path ARG
# Converts the path ARG from $build format to $host format. Return result
# in func_to_host_path_result.
func_to_host_path ()
{
  $debug_cmd

  func_init_to_host_path_cmd
  $to_host_path_cmd "$1"
}
# end func_to_host_path


# func_convert_path_noop ARG
# Copy ARG to func_to_host_path_result.
func_convert_path_noop ()

libcares/ltmain.sh  view on Meta::CPAN

}
# end func_convert_path_noop


# func_convert_path_msys_to_w32 ARG
# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
# conversion to w32 is not available inside the cwrapper.  Returns result in
# func_to_host_path_result.
func_convert_path_msys_to_w32 ()
{
  $debug_cmd

  func_to_host_path_result=$1
  if test -n "$1"; then
    # Remove leading and trailing path separator characters from ARG.  MSYS
    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
    # and winepath ignores them completely.
    func_stripname : : "$1"
    func_to_host_path_tmp1=$func_stripname_result
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
    func_to_host_path_result=$func_convert_core_msys_to_w32_result

libcares/ltmain.sh  view on Meta::CPAN

  fi
}
# end func_convert_path_msys_to_w32


# func_convert_path_cygwin_to_w32 ARG
# Convert path ARG from Cygwin to w32 format.  Returns result in
# func_to_host_file_result.
func_convert_path_cygwin_to_w32 ()
{
  $debug_cmd

  func_to_host_path_result=$1
  if test -n "$1"; then
    # See func_convert_path_msys_to_w32:
    func_stripname : : "$1"
    func_to_host_path_tmp1=$func_stripname_result
    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
    func_convert_path_check : ";" \
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  fi
}
# end func_convert_path_cygwin_to_w32


# func_convert_path_nix_to_w32 ARG
# Convert path ARG from *nix to w32 format.  Requires a wine environment and
# a working winepath.  Returns result in func_to_host_file_result.
func_convert_path_nix_to_w32 ()
{
  $debug_cmd

  func_to_host_path_result=$1
  if test -n "$1"; then
    # See func_convert_path_msys_to_w32:
    func_stripname : : "$1"
    func_to_host_path_tmp1=$func_stripname_result
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
    func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
    func_convert_path_check : ";" \
      "$func_to_host_path_tmp1" "$func_to_host_path_result"

libcares/ltmain.sh  view on Meta::CPAN

  fi
}
# end func_convert_path_nix_to_w32


# func_convert_path_msys_to_cygwin ARG
# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
# Returns result in func_to_host_file_result.
func_convert_path_msys_to_cygwin ()
{
  $debug_cmd

  func_to_host_path_result=$1
  if test -n "$1"; then
    # See func_convert_path_msys_to_w32:
    func_stripname : : "$1"
    func_to_host_path_tmp1=$func_stripname_result
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
    func_to_host_path_result=$func_cygpath_result
    func_convert_path_check : : \

libcares/ltmain.sh  view on Meta::CPAN

}
# end func_convert_path_msys_to_cygwin


# func_convert_path_nix_to_cygwin ARG
# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
# func_to_host_file_result.
func_convert_path_nix_to_cygwin ()
{
  $debug_cmd

  func_to_host_path_result=$1
  if test -n "$1"; then
    # Remove leading and trailing path separator characters from
    # ARG. msys behavior is inconsistent here, cygpath turns them
    # into '.;' and ';.', and winepath ignores them completely.
    func_stripname : : "$1"
    func_to_host_path_tmp1=$func_stripname_result
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"

libcares/ltmain.sh  view on Meta::CPAN

  fi
}
# end func_convert_path_nix_to_cygwin


# func_dll_def_p FILE
# True iff FILE is a Windows DLL '.def' file.
# Keep in sync with _LT_DLL_DEF_P in libtool.m4
func_dll_def_p ()
{
  $debug_cmd

  func_dll_def_p_tmp=`$SED -n \
    -e 's/^[	 ]*//' \
    -e '/^\(;.*\)*$/d' \
    -e 's/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p' \
    -e q \
    "$1"`
  test DEF = "$func_dll_def_p_tmp"
}


# func_mode_compile arg...
func_mode_compile ()
{
    $debug_cmd

    # Get the compilation command and the source file.
    base_compile=
    srcfile=$nonopt  #  always keep a non-empty value in "srcfile"
    suppress_opt=yes
    suppress_output=
    arg_mode=normal
    libobj=
    later=
    pie_flag=

libcares/ltmain.sh  view on Meta::CPAN

      /more detailed .*MODE/d
      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
  fi
  exit $?
fi


# func_mode_execute arg...
func_mode_execute ()
{
    $debug_cmd

    # The first argument is the command name.
    cmd=$nonopt
    test -z "$cmd" && \
      func_fatal_help "you must specify a COMMAND"

    # Handle -dlopen flags immediately.
    for file in $opt_dlopen; do
      test -f "$file" \
	|| func_fatal_help "'$file' is not a file"

libcares/ltmain.sh  view on Meta::CPAN

      exec_cmd=\$cmd$args
    fi
}

test execute = "$opt_mode" && func_mode_execute ${1+"$@"}


# func_mode_finish arg...
func_mode_finish ()
{
    $debug_cmd

    libs=
    libdirs=
    admincmds=

    for opt in "$nonopt" ${1+"$@"}
    do
      if test -d "$opt"; then
	func_append libdirs " $opt"

libcares/ltmain.sh  view on Meta::CPAN

    fi
    exit $EXIT_SUCCESS
}

test finish = "$opt_mode" && func_mode_finish ${1+"$@"}


# func_mode_install arg...
func_mode_install ()
{
    $debug_cmd

    # There may be an optional sh(1) argument at the beginning of
    # install_prog (especially on Windows NT).
    if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
       # Allow the use of GNU shtool's install command.
       case $nonopt in *shtool*) :;; *) false;; esac
    then
      # Aesthetically quote it.
      func_quote_for_eval "$nonopt"
      install_prog="$func_quote_for_eval_result "

libcares/ltmain.sh  view on Meta::CPAN

}

test install = "$opt_mode" && func_mode_install ${1+"$@"}


# func_generate_dlsyms outputname originator pic_p
# Extract symbols from dlprefiles and create ${outputname}S.o with
# a dlpreopen symbol table.
func_generate_dlsyms ()
{
    $debug_cmd

    my_outputname=$1
    my_originator=$2
    my_pic_p=${3-false}
    my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
    my_dlsyms=

    if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
      if test -n "$NM" && test -n "$global_symbol_pipe"; then
	my_dlsyms=${my_outputname}S.c

libcares/ltmain.sh  view on Meta::CPAN

      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
    fi
}

# func_cygming_gnu_implib_p ARG
# This predicate returns with zero status (TRUE) if
# ARG is a GNU/binutils-style import library. Returns
# with nonzero status (FALSE) otherwise.
func_cygming_gnu_implib_p ()
{
  $debug_cmd

  func_to_tool_file "$1" func_convert_file_msys_to_w32
  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
  test -n "$func_cygming_gnu_implib_tmp"
}

# func_cygming_ms_implib_p ARG
# This predicate returns with zero status (TRUE) if
# ARG is an MS-style import library. Returns
# with nonzero status (FALSE) otherwise.
func_cygming_ms_implib_p ()
{
  $debug_cmd

  func_to_tool_file "$1" func_convert_file_msys_to_w32
  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
  test -n "$func_cygming_ms_implib_tmp"
}

# func_win32_libid arg
# return the library type of file 'arg'
#
# Need a lot of goo to handle *both* DLLs and import libs
# Has to be a shell function in order to 'eat' the argument
# that is supplied when $file_magic_command is called.
# Despite the name, also deal with 64 bit binaries.
func_win32_libid ()
{
  $debug_cmd

  win32_libid_type=unknown
  win32_fileres=`file -L $1 2>/dev/null`
  case $win32_fileres in
  *ar\ archive\ import\ library*) # definitely import
    win32_libid_type="x86 archive import"
    ;;
  *ar\ archive*) # could be an import, or static
    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |

libcares/ltmain.sh  view on Meta::CPAN

#
# Platform-specific function to extract the
# name of the DLL associated with the specified
# import library ARG.
# Invoked by eval'ing the libtool variable
#    $sharedlib_from_linklib_cmd
# Result is available in the variable
#    $sharedlib_from_linklib_result
func_cygming_dll_for_implib ()
{
  $debug_cmd

  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
}

# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
#
# The is the core of a fallback implementation of a
# platform-specific function to extract the name of the
# DLL associated with the specified import library LIBNAME.
#
# SECTION_NAME is either .idata$6 or .idata$7, depending
# on the platform and compiler that created the implib.
#
# Echos the name of the DLL associated with the
# specified import library.
func_cygming_dll_for_implib_fallback_core ()
{
  $debug_cmd

  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
    $SED '/^Contents of section '"$match_literal"':/{
      # Place marker at beginning of archive member dllname section
      s/.*/====MARK====/
      p
      d
    }
    # These lines can sometimes be longer than 43 characters, but

libcares/ltmain.sh  view on Meta::CPAN

# import library ARG.
#
# This fallback implementation is for use when $DLLTOOL
# does not support the --identify-strict option.
# Invoked by eval'ing the libtool variable
#    $sharedlib_from_linklib_cmd
# Result is available in the variable
#    $sharedlib_from_linklib_result
func_cygming_dll_for_implib_fallback ()
{
  $debug_cmd

  if func_cygming_gnu_implib_p "$1"; then
    # binutils import library
    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
  elif func_cygming_ms_implib_p "$1"; then
    # ms-generated import library
    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
  else
    # unknown
    sharedlib_from_linklib_result=
  fi
}


# func_extract_an_archive dir oldlib
func_extract_an_archive ()
{
    $debug_cmd

    f_ex_an_ar_dir=$1; shift
    f_ex_an_ar_oldlib=$1
    if test yes = "$lock_old_archive_extraction"; then
      lockfile=$f_ex_an_ar_oldlib.lock
      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
	func_echo "Waiting for $lockfile to be removed"
	sleep 2
      done
    fi

libcares/ltmain.sh  view on Meta::CPAN

     :
    else
      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
    fi
}


# func_extract_archives gentop oldlib ...
func_extract_archives ()
{
    $debug_cmd

    my_gentop=$1; shift
    my_oldlibs=${1+"$@"}
    my_oldobjs=
    my_xlib=
    my_xabs=
    my_xdir=

    for my_xlib in $my_oldlibs; do
      # Extract the objects.

libcares/ltmain.sh  view on Meta::CPAN

    ECHO=\"$qECHO\"
  fi

# Very basic option parsing. These options are (a) specific to
# the libtool wrapper, (b) are identical between the wrapper
# /script/ and the wrapper /executable/ that is used only on
# windows platforms, and (c) all begin with the string "--lt-"
# (application programs are unlikely to have options that match
# this pattern).
#
# There are only two supported options: --lt-debug and
# --lt-dump-script. There is, deliberately, no --lt-help.
#
# The first argument to this parsing function should be the
# script's $0 value, followed by "$@".
lt_option_debug=
func_parse_lt_options ()
{
  lt_script_arg0=\$0
  shift
  for lt_opt
  do
    case \"\$lt_opt\" in
    --lt-debug) lt_option_debug=1 ;;
    --lt-dump-script)
        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
        cat \"\$lt_dump_D/\$lt_dump_F\"
        exit 0
      ;;
    --lt-*)
        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
        exit 1
      ;;
    esac
  done

  # Print the debug banner immediately:
  if test -n \"\$lt_option_debug\"; then
    echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
  fi
}

# Used when --lt-debug. Prints its arguments to stdout
# (redirection is the responsibility of the caller)
func_lt_dump_args ()
{
  lt_dump_args_N=1;
  for lt_arg
  do
    \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
  done
}

# Core function for launching the target application
func_exec_program_core ()
{
"
  case $host in
  # Backslashes separate directories on plain windows
  *-*-mingw | *-*-os2* | *-cegcc*)
    $ECHO "\
      if test -n \"\$lt_option_debug\"; then
        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
        func_lt_dump_args \${1+\"\$@\"} 1>&2
      fi
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
"
    ;;

  *)
    $ECHO "\
      if test -n \"\$lt_option_debug\"; then
        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
        func_lt_dump_args \${1+\"\$@\"} 1>&2
      fi
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
"
    ;;
  esac
  $ECHO "\
      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
      exit 1

libcares/ltmain.sh  view on Meta::CPAN

#ifndef _O_BINARY
# define _O_BINARY 0
#endif

#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
#define XFREE(stale) do { \
  if (stale) { free (stale); stale = 0; } \
} while (0)

#if defined LT_DEBUGWRAPPER
static int lt_debug = 1;
#else
static int lt_debug = 0;
#endif

const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */

void *xmalloc (size_t num);
char *xstrdup (const char *string);
const char *base_name (const char *name);
char *find_executable (const char *wrapper);
char *chase_symlinks (const char *pathspec);
int make_executable (const char *path);
int check_executable (const char *path);
char *strendzap (char *str, const char *pat);
void lt_debugprintf (const char *file, int line, const char *fmt, ...);
void lt_fatal (const char *file, int line, const char *message, ...);
static const char *nonnull (const char *s);
static const char *nonempty (const char *s);
void lt_setenv (const char *name, const char *value);
char *lt_extend_str (const char *orig_value, const char *add, int to_end);
void lt_update_exe_path (const char *name, const char *value);
void lt_update_lib_path (const char *name, const char *value);
char **prepare_spawn (char **argv);
void lt_dump_script (FILE *f);
EOF

libcares/ltmain.sh  view on Meta::CPAN

EOF
	    fi


	    cat <<"EOF"

#define LTWRAPPER_OPTION_PREFIX         "--lt-"

static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";

int
main (int argc, char *argv[])
{
  char **newargz;
  int  newargc;
  char *tmp_pathspec;
  char *actual_cwrapper_path;
  char *actual_cwrapper_name;
  char *target_name;

libcares/ltmain.sh  view on Meta::CPAN

	      *mingw* | *cygwin* )
		# make stdout use "unix" line endings
		echo "          setmode(1,_O_BINARY);"
		;;
	      esac

	    cat <<"EOF"
	  lt_dump_script (stdout);
	  return 0;
	}
      if (STREQ (argv[i], debug_opt))
	{
          lt_debug = 1;
          continue;
	}
      if (STREQ (argv[i], ltwrapper_option_prefix))
        {
          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
             namespace, but it is not one of the ones we know about and
             have already dealt with, above (inluding dump-script), then
             report an error. Otherwise, targets might begin to believe
             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
             namespace. The first time any user complains about this, we'll

libcares/ltmain.sh  view on Meta::CPAN

		    "unrecognized %s option: '%s'",
                    ltwrapper_option_prefix, argv[i]);
        }
      /* otherwise ... */
      newargz[++newargc] = xstrdup (argv[i]);
    }
  newargz[++newargc] = NULL;

EOF
	    cat <<EOF
  /* The GNU banner must be the first non-error debug message */
  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
EOF
	    cat <<"EOF"
  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);

  tmp_pathspec = find_executable (argv[0]);
  if (tmp_pathspec == NULL)
    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
  lt_debugprintf (__FILE__, __LINE__,
                  "(main) found exe (before symlink chase) at: %s\n",
		  tmp_pathspec);

  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
  lt_debugprintf (__FILE__, __LINE__,
                  "(main) found exe (after symlink chase) at: %s\n",
		  actual_cwrapper_path);
  XFREE (tmp_pathspec);

  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
  strendzap (actual_cwrapper_path, actual_cwrapper_name);

  /* wrapper name transforms */
  strendzap (actual_cwrapper_name, ".exe");
  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);

libcares/ltmain.sh  view on Meta::CPAN

  tmp_pathspec = 0;

  /* target_name transforms -- use actual target program name; might have lt- prefix */
  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
  strendzap (target_name, ".exe");
  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
  XFREE (target_name);
  target_name = tmp_pathspec;
  tmp_pathspec = 0;

  lt_debugprintf (__FILE__, __LINE__,
		  "(main) libtool target name: %s\n",
		  target_name);
EOF

	    cat <<EOF
  newargz[0] =
    XMALLOC (char, (strlen (actual_cwrapper_path) +
		    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
  strcpy (newargz[0], actual_cwrapper_path);
  strcat (newargz[0], "$objdir");

libcares/ltmain.sh  view on Meta::CPAN


  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
     because on Windows, both *_VARNAMEs are PATH but uninstalled
     libraries must come first. */
  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);

  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
		  nonnull (lt_argv_zero));
  for (i = 0; i < newargc; i++)
    {
      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
		      i, nonnull (newargz[i]));
    }

EOF

	    case $host_os in
	      mingw*)
		cat <<"EOF"
  /* execv doesn't actually work on mingw as expected on unix */
  newargz = prepare_spawn (newargz);
  rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
  if (rval == -1)
    {
      /* failed to start process */
      lt_debugprintf (__FILE__, __LINE__,
		      "(main) failed to launch target \"%s\": %s\n",
		      lt_argv_zero, nonnull (strerror (errno)));
      return 127;
    }
  return rval;
EOF
		;;
	      *)
		cat <<"EOF"
  execv (lt_argv_zero, newargz);

libcares/ltmain.sh  view on Meta::CPAN

    if (IS_DIR_SEPARATOR (*name))
      base = name + 1;
  return base;
}

int
check_executable (const char *path)
{
  struct stat st;

  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
                  nonempty (path));
  if ((!path) || (!*path))
    return 0;

  if ((stat (path, &st) >= 0)
      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
    return 1;
  else
    return 0;
}

int
make_executable (const char *path)
{
  int rval = 0;
  struct stat st;

  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
                  nonempty (path));
  if ((!path) || (!*path))
    return 0;

  if (stat (path, &st) >= 0)
    {
      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
    }
  return rval;
}

libcares/ltmain.sh  view on Meta::CPAN

find_executable (const char *wrapper)
{
  int has_slash = 0;
  const char *p;
  const char *p_next;
  /* static buffer for getcwd */
  char tmp[LT_PATHMAX + 1];
  size_t tmp_len;
  char *concat_name;

  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
                  nonempty (wrapper));

  if ((wrapper == NULL) || (*wrapper == '\0'))
    return NULL;

  /* Absolute path? */
#if defined HAVE_DOS_BASED_FILE_SYSTEM
  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
    {
      concat_name = xstrdup (wrapper);

libcares/ltmain.sh  view on Meta::CPAN

#ifndef S_ISLNK
  return xstrdup (pathspec);
#else
  char buf[LT_PATHMAX];
  struct stat s;
  char *tmp_pathspec = xstrdup (pathspec);
  char *p;
  int has_symlinks = 0;
  while (strlen (tmp_pathspec) && !has_symlinks)
    {
      lt_debugprintf (__FILE__, __LINE__,
		      "checking path component for symlinks: %s\n",
		      tmp_pathspec);
      if (lstat (tmp_pathspec, &s) == 0)
	{
	  if (S_ISLNK (s.st_mode) != 0)
	    {
	      has_symlinks = 1;
	      break;
	    }

libcares/ltmain.sh  view on Meta::CPAN

  if (patlen <= len)
    {
      str += len - patlen;
      if (STREQ (str, pat))
	*str = '\0';
    }
  return str;
}

void
lt_debugprintf (const char *file, int line, const char *fmt, ...)
{
  va_list args;
  if (lt_debug)
    {
      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
      va_start (args, fmt);
      (void) vfprintf (stderr, fmt, args);
      va_end (args);
    }
}

static void
lt_error_core (int exit_status, const char *file,

libcares/ltmain.sh  view on Meta::CPAN


static const char *
nonempty (const char *s)
{
  return (s && !*s) ? "(empty)" : nonnull (s);
}

void
lt_setenv (const char *name, const char *value)
{
  lt_debugprintf (__FILE__, __LINE__,
		  "(lt_setenv) setting '%s' to '%s'\n",
                  nonnull (name), nonnull (value));
  {
#ifdef HAVE_SETENV
    /* always make a copy, for consistency with !HAVE_SETENV */
    char *str = xstrdup (value);
    setenv (name, str, 1);
#else
    size_t len = strlen (name) + 1 + strlen (value) + 1;
    char *str = XMALLOC (char, len);

libcares/ltmain.sh  view on Meta::CPAN

  else
    {
      new_value = xstrdup (add);
    }
  return new_value;
}

void
lt_update_exe_path (const char *name, const char *value)
{
  lt_debugprintf (__FILE__, __LINE__,
		  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
                  nonnull (name), nonnull (value));

  if (name && *name && value && *value)
    {
      char *new_value = lt_extend_str (getenv (name), value, 0);
      /* some systems can't cope with a ':'-terminated path #' */
      size_t len = strlen (new_value);
      while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
        {
          new_value[--len] = '\0';
        }
      lt_setenv (name, new_value);
      XFREE (new_value);
    }
}

void
lt_update_lib_path (const char *name, const char *value)
{
  lt_debugprintf (__FILE__, __LINE__,
		  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
                  nonnull (name), nonnull (value));

  if (name && *name && value && *value)
    {
      char *new_value = lt_extend_str (getenv (name), value, 0);
      lt_setenv (name, new_value);
      XFREE (new_value);
    }
}

libcares/ltmain.sh  view on Meta::CPAN

            cat <<"EOF"
}
EOF
}
# end: func_emit_cwrapperexe_src

# func_win32_import_lib_p ARG
# True if ARG is an import lib, as indicated by $file_magic_cmd
func_win32_import_lib_p ()
{
    $debug_cmd

    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
    *import*) : ;;
    *) false ;;
    esac
}

# func_suncc_cstd_abi
# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
# Several compiler flags select an ABI that is incompatible with the
# Cstd library. Avoid specifying it if any are in CXXFLAGS.
func_suncc_cstd_abi ()
{
    $debug_cmd

    case " $compile_command " in
    *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
      suncc_use_cstd_abi=no
      ;;
    *)
      suncc_use_cstd_abi=yes
      ;;
    esac
}

# func_mode_link arg...
func_mode_link ()
{
    $debug_cmd

    case $host in
    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
      # It is impossible to link a dll without this setting, and
      # we shouldn't force the makefile maintainer to figure out
      # what system we are compiling for in order to pass an extra
      # flag for every libtool invocation.
      # allow_undefined=no

      # FIXME: Unfortunately, there are problems with the above when trying

libcares/ltmain.sh  view on Meta::CPAN

}

if test link = "$opt_mode" || test relink = "$opt_mode"; then
  func_mode_link ${1+"$@"}
fi


# func_mode_uninstall arg...
func_mode_uninstall ()
{
    $debug_cmd

    RM=$nonopt
    files=
    rmforce=false
    exit_status=0

    # This variable tells wrapper scripts just to set variables rather
    # than running their programs.
    libtool_install_magic=$magic

libcares/m4/cares-compilers.m4  view on Meta::CPAN

  CARES_CHECK_COMPILER_SGI_MIPS_C
  CARES_CHECK_COMPILER_SUNPRO_C
  CARES_CHECK_COMPILER_TINY_C
  CARES_CHECK_COMPILER_WATCOM_C
  #
  if test "$compiler_id" = "unknown"; then
  cat <<_EOF 1>&2
***
*** Warning: This configure script does not have information about the
*** compiler you are using, relative to the flags required to enable or
*** disable generation of debug info, optimization options or warnings.
***
*** Whatever settings are present in CFLAGS will be used for this run.
***
*** If you wish to help the c-ares project to better support your compiler
*** you can report this and the required info on the c-ares development
*** mailing list: http://cool.haxx.se/mailman/listinfo/c-ares/
***
_EOF
  fi
])

libcares/m4/cares-compilers.m4  view on Meta::CPAN

      compiler_id="INTEL_UNIX_C"
      flags_dbg_all="-g -g0"
      flags_dbg_yes="-g"
      flags_dbg_off="-g0"
      flags_opt_all="-O -O0 -O1 -O2 -O3 -Os"
      flags_opt_yes="-O2"
      flags_opt_off="-O0"
    else
      compiler_id="INTEL_WINDOWS_C"
      flags_dbg_all="/ZI /Zi /zI /zi /ZD /Zd /zD /zd /Z7 /z7 /Oy /Oy-"
      flags_dbg_all="$flags_dbg_all /debug"
      flags_dbg_all="$flags_dbg_all /debug:none"
      flags_dbg_all="$flags_dbg_all /debug:minimal"
      flags_dbg_all="$flags_dbg_all /debug:partial"
      flags_dbg_all="$flags_dbg_all /debug:full"
      flags_dbg_all="$flags_dbg_all /debug:semantic_stepping"
      flags_dbg_all="$flags_dbg_all /debug:extended"
      flags_dbg_yes="/Zi /Oy-"
      flags_dbg_off="/debug:none /Oy-"
      flags_opt_all="/O /O0 /O1 /O2 /O3 /Od /Og /Og- /Oi /Oi-"
      flags_opt_yes="/O2"
      flags_opt_off="/Od"
    fi
  else
    AC_MSG_RESULT([no])
  fi
])


libcares/m4/cares-compilers.m4  view on Meta::CPAN

  ifelse($1,,:,[$1])
  ifelse($2,,,[else
    $2])
  fi
])


dnl CARES_SET_COMPILER_BASIC_OPTS
dnl -------------------------------------------------
dnl Sets compiler specific options/flags which do not
dnl depend on configure's debug, optimize or warnings
dnl options.

AC_DEFUN([CARES_SET_COMPILER_BASIC_OPTS], [
  AC_REQUIRE([CARES_CHECK_COMPILER])dnl
  AC_REQUIRE([CARES_SHFUNC_SQUEEZE])dnl
  #
  if test "$compiler_id" != "unknown"; then
    #
    if test "$compiler_id" = "GNU_C" ||
      test "$compiler_id" = "CLANG"; then

libcares/m4/cares-compilers.m4  view on Meta::CPAN

      ])
    fi
    #
  fi
])


dnl CARES_SET_COMPILER_DEBUG_OPTS
dnl -------------------------------------------------
dnl Sets compiler specific options/flags which depend
dnl on configure's debug option.

AC_DEFUN([CARES_SET_COMPILER_DEBUG_OPTS], [
  AC_REQUIRE([CARES_CHECK_OPTION_DEBUG])dnl
  AC_REQUIRE([CARES_CHECK_COMPILER])dnl
  AC_REQUIRE([CARES_SHFUNC_SQUEEZE])dnl
  #
  if test "$compiler_id" != "unknown"; then
    #
    tmp_save_CFLAGS="$CFLAGS"
    tmp_save_CPPFLAGS="$CPPFLAGS"
    #
    tmp_options=""
    tmp_CFLAGS="$CFLAGS"
    tmp_CPPFLAGS="$CPPFLAGS"
    CARES_VAR_STRIP([tmp_CFLAGS],[$flags_dbg_all])
    CARES_VAR_STRIP([tmp_CPPFLAGS],[$flags_dbg_all])
    #
    if test "$want_debug" = "yes"; then
      AC_MSG_CHECKING([if compiler accepts debug enabling options])
      tmp_options="$flags_dbg_yes"
    fi
    if test "$want_debug" = "no"; then
      AC_MSG_CHECKING([if compiler accepts debug disabling options])
      tmp_options="$flags_dbg_off"
    fi
    #
    if test "$flags_prefer_cppflags" = "yes"; then
      CPPFLAGS="$tmp_CPPFLAGS $tmp_options"
      CFLAGS="$tmp_CFLAGS"
    else
      CPPFLAGS="$tmp_CPPFLAGS"
      CFLAGS="$tmp_CFLAGS $tmp_options"
    fi

libcares/m4/cares-compilers.m4  view on Meta::CPAN

    #
    tmp_save_CFLAGS="$CFLAGS"
    tmp_save_CPPFLAGS="$CPPFLAGS"
    #
    tmp_options=""
    tmp_CFLAGS="$CFLAGS"
    tmp_CPPFLAGS="$CPPFLAGS"
    honor_optimize_option="yes"
    #
    dnl If optimization request setting has not been explicitly specified,
    dnl it has been derived from the debug setting and initially assumed.
    dnl This initially assumed optimizer setting will finally be ignored
    dnl if CFLAGS or CPPFLAGS already hold optimizer flags. This implies
    dnl that an initially assumed optimizer setting might not be honored.
    #
    if test "$want_optimize" = "assume_no" ||
       test "$want_optimize" = "assume_yes"; then
      AC_MSG_CHECKING([if compiler optimizer assumed setting might be used])
      CARES_VAR_MATCH_IFELSE([tmp_CFLAGS],[$flags_opt_all],[
        honor_optimize_option="no"
      ])

libcares/m4/cares-compilers.m4  view on Meta::CPAN

    fi
  done
  eval [$]1=\$_sqz_result
  return 0
}
])


dnl CARES_CHECK_CURLDEBUG
dnl -------------------------------------------------
dnl Settings which depend on configure's curldebug given
dnl option, and other additional configure pre-requisites.
dnl Using the curl debug memory tracking feature in c-ares
dnl is a hack that actually can only be used/enabled when
dnl c-ares is built directly in curl's CVS tree, as a static
dnl library or as a shared one on those systems on which
dnl shared libraries support undefined symbols, along with
dnl an equally configured libcurl.

AC_DEFUN([CARES_CHECK_CURLDEBUG], [
  AC_REQUIRE([XC_LIBTOOL])dnl
  AC_REQUIRE([CARES_SHFUNC_SQUEEZE])dnl
  cares_builddir=`pwd`
  supports_curldebug="unknown"
  if test "$want_curldebug" = "yes"; then
    if test "x$enable_shared" != "xno" &&
      test "x$enable_shared" != "xyes"; then
      AC_MSG_WARN([unknown enable_shared setting.])
      supports_curldebug="no"
    fi
    if test "x$enable_static" != "xno" &&
      test "x$enable_static" != "xyes"; then
      AC_MSG_WARN([unknown enable_static setting.])
      supports_curldebug="no"
    fi
    if test "$supports_curldebug" != "no"; then
      if test "$enable_shared" = "yes" &&
        test "x$xc_lt_shlib_use_no_undefined" = 'xyes'; then
        supports_curldebug="no"
        AC_MSG_WARN([shared library does not support undefined symbols.])
      fi
      if test ! -f "$srcdir/../include/curl/curlbuild.h.dist"; then
        AC_MSG_WARN([c-ares source not embedded in curl's CVS tree.])
        supports_curldebug="no"
      elif test ! -f "$srcdir/../include/curl/Makefile.in"; then
        AC_MSG_WARN([curl's buildconf has not been run.])
        supports_curldebug="no"
      elif test ! -f "$cares_builddir/../libcurl.pc" ||
        test ! -f "$cares_builddir/../include/curl/curlbuild.h"; then
        AC_MSG_WARN([curl's configure has not been run.])
        supports_curldebug="no"
      elif test ! -f "$cares_builddir/../lib/curl_config.h"; then
        AC_MSG_WARN([libcurl's curl_config.h is missing.])
        supports_curldebug="no"
      elif test ! -f "$cares_builddir/../config.status"; then
        AC_MSG_WARN([curl's config.status is missing.])
        supports_curldebug="no"
      fi
      if test "$supports_curldebug" != "no"; then
        grep '^#define USE_ARES' "$cares_builddir/../lib/curl_config.h" >/dev/null
        if test "$?" -ne "0"; then
          AC_MSG_WARN([libcurl configured without c-ares support.])
          supports_curldebug="no"
        fi
      fi
      if test "$supports_curldebug" != "no"; then
        grep 'CPPFLAGS.*CURLDEBUG' "$cares_builddir/../config.status" >/dev/null
        if test "$?" -ne "0"; then
          AC_MSG_WARN([libcurl configured without curldebug support.])
          supports_curldebug="no"
        fi
      fi
    fi
  fi
  #
  if test "$want_curldebug" = "yes"; then
    AC_MSG_CHECKING([if curl debug memory tracking can be enabled])
    test "$supports_curldebug" = "no" || supports_curldebug="yes"
    AC_MSG_RESULT([$supports_curldebug])
    if test "$supports_curldebug" = "no"; then
      AC_MSG_WARN([cannot enable curl debug memory tracking.])
      want_curldebug="no"
    fi
  fi
  #
  if test "$want_curldebug" = "yes"; then
    dnl TODO: Verify if the BUILDING_LIBCURL definition is still required.
    AC_DEFINE(BUILDING_LIBCURL, 1, [when building as static part of libcurl])
    CPPFLAGS="-DCURLDEBUG $CPPFLAGS"
    squeeze CPPFLAGS
  fi
  #
  if test "$want_debug" = "yes"; then
    CPPFLAGS="-DDEBUGBUILD $CPPFLAGS"
    squeeze CPPFLAGS
  fi
])


dnl CARES_CHECK_COMPILER_HALT_ON_ERROR
dnl -------------------------------------------------
dnl Verifies if the compiler actually halts after the
dnl compilation phase without generating any object

libcares/m4/cares-confopts.m4  view on Meta::CPAN

#
#***************************************************************************

# File version for 'aclocal' use. Keep it a single number.
# serial 11


dnl CARES_CHECK_OPTION_CURLDEBUG
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
dnl --enable-curldebug or --disable-curldebug, and set
dnl shell variable want_curldebug value as appropriate.

AC_DEFUN([CARES_CHECK_OPTION_CURLDEBUG], [
  AC_BEFORE([$0],[CARES_CHECK_CURLDEBUG])dnl
  AC_MSG_CHECKING([whether to enable curl debug memory tracking])
  OPT_CURLDEBUG_BUILD="default"
  AC_ARG_ENABLE(curldebug,
AC_HELP_STRING([--enable-curldebug],[Enable curl debug memory tracking])
AC_HELP_STRING([--disable-curldebug],[Disable curl debug memory tracking]),
  OPT_CURLDEBUG_BUILD=$enableval)
  case "$OPT_CURLDEBUG_BUILD" in
    no)
      dnl --disable-curldebug option used
      want_curldebug="no"
      ;;
    default)
      dnl configure option not specified
      want_curldebug="no"
      ;;
    *)
      dnl --enable-curldebug option used.
      dnl The use of this option value is a request to enable curl's
      dnl debug memory tracking for the c-ares library. This is a big
      dnl hack that can only be done when a whole bunch of requisites
      dnl are simultaneously satisfied. Later on, these requisites are
      dnl verified and if they are not fully satisfied the option will
      dnl be ignored and act as if --disable-curldebug had been given
      dnl setting shell variable want_curldebug to 'no'.
      want_curldebug="yes"
      ;;
  esac
  AC_MSG_RESULT([$want_curldebug])
])


dnl CARES_CHECK_OPTION_DEBUG
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
dnl --enable-debug or --disable-debug, and set shell
dnl variable want_debug value as appropriate.

AC_DEFUN([CARES_CHECK_OPTION_DEBUG], [
  AC_BEFORE([$0],[CARES_CHECK_OPTION_WARNINGS])dnl
  AC_BEFORE([$0],[CARES_CHECK_OPTION_CURLDEBUG])dnl
  AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl
  AC_MSG_CHECKING([whether to enable debug build options])
  OPT_DEBUG_BUILD="default"
  AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug],[Enable debug build options])
AC_HELP_STRING([--disable-debug],[Disable debug build options]),
  OPT_DEBUG_BUILD=$enableval)
  case "$OPT_DEBUG_BUILD" in
    no)
      dnl --disable-debug option used
      want_debug="no"
      ;;
    default)
      dnl configure option not specified
      want_debug="no"
      ;;
    *)
      dnl --enable-debug option used
      want_debug="yes"
      ;;
  esac
  AC_MSG_RESULT([$want_debug])
])


dnl CARES_CHECK_OPTION_NONBLOCKING
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
dnl --enable-nonblocking or --disable-nonblocking, and
dnl set shell variable want_nonblocking as appropriate.

AC_DEFUN([CARES_CHECK_OPTION_NONBLOCKING], [

libcares/m4/cares-confopts.m4  view on Meta::CPAN

      dnl --disable-optimize option used. We will handle this as
      dnl a request to disable compiler optimizations if possible.
      dnl If the compiler is known CFLAGS and CPPFLAGS will be
      dnl overridden, otherwise this can not be honored.
      want_optimize="no"
      AC_MSG_RESULT([no])
      ;;
    default)
      dnl configure's optimize option not specified. Initially we will
      dnl handle this as a a request contrary to configure's setting
      dnl for --enable-debug. IOW, initially, for debug-enabled builds
      dnl this will be handled as a request to disable optimizations if
      dnl possible, and for debug-disabled builds this will be handled
      dnl initially as a request to enable optimizations if possible.
      dnl Finally, if the compiler is known and CFLAGS and CPPFLAGS do
      dnl not have any optimizer flag the request will be honored, in
      dnl any other case the request can not be honored.
      dnl IOW, existing optimizer flags defined in CFLAGS or CPPFLAGS
      dnl will always take precedence over any initial assumption.
      if test "$want_debug" = "yes"; then
        want_optimize="assume_no"
        AC_MSG_RESULT([not specified (assuming no)])
      else
        want_optimize="assume_yes"
        AC_MSG_RESULT([not specified (assuming yes)])
      fi
      ;;
    *)
      dnl --enable-optimize option used. We will handle this as
      dnl a request to enable compiler optimizations if possible.

libcares/m4/cares-confopts.m4  view on Meta::CPAN

AC_HELP_STRING([--enable-warnings],[Enable strict compiler warnings])
AC_HELP_STRING([--disable-warnings],[Disable strict compiler warnings]),
  OPT_COMPILER_WARNINGS=$enableval)
  case "$OPT_COMPILER_WARNINGS" in
    no)
      dnl --disable-warnings option used
      want_warnings="no"
      ;;
    default)
      dnl configure option not specified, so
      dnl use same setting as --enable-debug
      want_warnings="$want_debug"
      ;;
    *)
      dnl --enable-warnings option used
      want_warnings="yes"
      ;;
  esac
  AC_MSG_RESULT([$want_warnings])
])

dnl CARES_CHECK_OPTION_WERROR

libcares/m4/libtool.m4  view on Meta::CPAN

lt_cl_help="\
'$as_me' creates a local libtool stub from the current configuration,
for use in further configure time tests before the real libtool is
generated.

Usage: $[0] [[OPTIONS]]

  -h, --help      print this help, then exit
  -V, --version   print version number, then exit
  -q, --quiet     do not print progress messages
  -d, --debug     don't remove temporary files

Report bugs to <bug-libtool@gnu.org>."

lt_cl_version="\
m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
configured by $[0], generated by m4_PACKAGE_STRING.

Copyright (C) 2011 Free Software Foundation, Inc.
This config.lt script is free software; the Free Software Foundation
gives unlimited permision to copy, distribute and modify it."

while test 0 != $[#]
do
  case $[1] in
    --version | --v* | -V )
      echo "$lt_cl_version"; exit 0 ;;
    --help | --h* | -h )
      echo "$lt_cl_help"; exit 0 ;;
    --debug | --d* | -d )
      debug=: ;;
    --quiet | --q* | --silent | --s* | -q )
      lt_cl_silent=: ;;

    -*) AC_MSG_ERROR([unrecognized option: $[1]
Try '$[0] --help' for more information.]) ;;

    *) AC_MSG_ERROR([unrecognized argument: $[1]
Try '$[0] --help' for more information.]) ;;
  esac
  shift

libcares/m4/libtool.m4  view on Meta::CPAN

# -------------------------
m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
  case $host_os in
    rhapsody* | darwin*)
    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
    AC_CHECK_TOOL([LIPO], [lipo], [:])
    AC_CHECK_TOOL([OTOOL], [otool], [:])
    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
    _LT_DECL([], [DSYMUTIL], [1],
      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
    _LT_DECL([], [NMEDIT], [1],
      [Tool to change global to local symbols on Mac OS X])
    _LT_DECL([], [LIPO], [1],
      [Tool to manipulate fat objects and archives on Mac OS X])
    _LT_DECL([], [OTOOL], [1],
      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
    _LT_DECL([], [OTOOL64], [1],
      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])

    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],

libcares/m4/libtool.m4  view on Meta::CPAN



# _LT_CMD_STRIPLIB
# ----------------
m4_defun([_LT_CMD_STRIPLIB],
[m4_require([_LT_DECL_EGREP])
striplib=
old_striplib=
AC_MSG_CHECKING([whether stripping libraries is possible])
if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
  AC_MSG_RESULT([yes])
else
# FIXME - insert some real tests, host_os isn't really good enough
  case $host_os in
  darwin*)
    if test -n "$STRIP"; then
      striplib="$STRIP -x"
      old_striplib="$STRIP -S"
      AC_MSG_RESULT([yes])

libcares/setup_once.h  view on Meta::CPAN

/*
 * Default return type for signal handlers.
 */

#ifndef RETSIGTYPE
#define RETSIGTYPE void
#endif


/*
 * Macro used to include code only in debug builds.
 */

#ifdef DEBUGBUILD
#define DEBUGF(x) x
#else
#define DEBUGF(x) do { } WHILE_FALSE
#endif


/*
 * Macro used to include assertion code only in debug builds.
 */

#if defined(DEBUGBUILD) && defined(HAVE_ASSERT_H)
#define DEBUGASSERT(x) assert(x)
#else
#define DEBUGASSERT(x) do { } WHILE_FALSE
#endif


/*

libcares/test/Makefile.msvc  view on Meta::CPAN

# M.I.T. makes no representations about the suitability of
# this software for any purpose.  It is provided "as is"
# without express or implied warranty.

# ------------------------------------------------------------------------------
#
# Makefile for building c-ares test suite with MSVC.
#
# Usage: nmake /f makefile.msvc CFG=<config> <target>
#
# <config> can be one of: [ lib-release | lib-debug | dll-release | dll-debug }
# <target> can be one of: [ all | arestest | clean }
#
# If <target> is not specified then all targets are built.
# If <config> is not specified then lib-debug will be assumed.
#
# This makefile must be processed from the subdir where it is located.
#
# All results are generated below a subdirectory named msvcXXX.
#
# ------------------------------------------------------------------------------


# ------------------------------------------------
# c-ares static and dynamic libraries common base
# file names for release and debug configurations
# ------------------------------------------------

LIBNAME = cares
STA_LIB_REL = lib$(LIBNAME)
DYN_LIB_REL = $(LIBNAME)
STA_LIB_DBG = $(STA_LIB_REL)d
DYN_LIB_DBG = $(DYN_LIB_REL)d

# -------------------------------------------
# Base names for c-ares DLL import libraries

libcares/test/Makefile.msvc  view on Meta::CPAN

# Subdir holding sources for all projects
# ----------------------------------------

SRCDIR = .

# -------------------------
# Configuration validation
# -------------------------

!IF "$(CFG)" == ""
CFG = lib-debug
!ENDIF

VALID_CFGSET = FALSE
!IF "$(CFG)" == "lib-release" || "$(CFG)" == "lib-debug" || \
    "$(CFG)" == "dll-release" || "$(CFG)" == "dll-debug"
VALID_CFGSET = TRUE
!ENDIF

!IF "$(VALID_CFGSET)" == "FALSE"
!  MESSAGE MSVC c-ares makefile
!  MESSAGE
!  MESSAGE Usage: nmake /f makefile.msvc CFG=<config> <target>
!  MESSAGE
!  MESSAGE <config> can be one of: [ lib-release | lib-debug | dll-release | dll-debug }
!  MESSAGE <target> can be one of: [ all | arestest | aresfuzz | aresfuzzname | dnsdump | clean }
!  MESSAGE
!  MESSAGE If <target> is not specified then all targets are built.
!  MESSAGE If <config> is not specified then lib-debug will be assumed.
!  MESSAGE
!  ERROR Choose a valid configuration.
!ENDIF

# --------------------------------------------------------
# Project subdirs independent of configuration being used
# --------------------------------------------------------

PROG_DIR = $(BASE_DIR)\arestest
LIB_DIR = $(LIB_BASE_DIR)\cares

libcares/test/Makefile.msvc  view on Meta::CPAN

CC_CFLAGS  = $(CFLAGS) /I. /I.. /I $(GMOCK_DIR) /W3 /EHsc /FD

RC_CMD_REL = rc.exe /l 0x409 /d "NDEBUG"
RC_CMD_DBG = rc.exe /l 0x409 /d "_DEBUG"

LINK_CMD_LIB = link.exe /lib /nologo
LINK_CMD_DLL = link.exe /dll /nologo /incremental:no /fixed:no
LINK_CMD_EXE = link.exe /nologo /incremental:no /fixed:no /subsystem:console

LINK_CMD_EXE_REL = $(LINK_CMD_EXE) /release $(PDB_NONE)
LINK_CMD_EXE_DBG = $(LINK_CMD_EXE) /debug $(PDBTYPE_CONSOLIDATE)

# ---------------------------------
# Configuration dependent settings
# ---------------------------------

!IF "$(CFG)" == "lib-release"
CARES_TARGET = $(STA_LIB_REL).lib
CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB
CARES_LFLAGS =
SPROG_CFLAGS = /DCARES_STATICLIB
SPROG_LFLAGS = /libpath:$(LIB_OUTDIR) $(EX_LIBS_REL) $(STA_LIB_REL).lib
CARES_LINK   = $(LINK_CMD_LIB)
SPROG_LINK   = $(LINK_CMD_EXE_REL)
CC_CMD       = $(CC_CMD_REL)
!ENDIF

!IF "$(CFG)" == "lib-debug"
CARES_TARGET = $(STA_LIB_DBG).lib
CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB /DDEBUGBUILD
CARES_LFLAGS =
SPROG_CFLAGS = /DCARES_STATICLIB
SPROG_LFLAGS = /libpath:$(LIB_OUTDIR) $(EX_LIBS_DBG) $(STA_LIB_DBG).lib
CARES_LINK   = $(LINK_CMD_LIB)
SPROG_LINK   = $(LINK_CMD_EXE_DBG)
CC_CMD       = $(CC_CMD_DBG)
!ENDIF

libcares/test/Makefile.msvc  view on Meta::CPAN

CARES_LFLAGS = /release $(EX_LIBS_REL) /implib:$(PROG_OUTDIR)\$(IMP_LIB_REL).lib $(PDB_NONE)
SPROG_CFLAGS =
SPROG_LFLAGS = /libpath:$(LIB_OUTDIR) $(EX_LIBS_REL) $(IMP_LIB_REL).lib
CARES_LINK   = $(LINK_CMD_DLL)
SPROG_LINK   = $(LINK_CMD_EXE_REL)
CC_CMD       = $(CC_CMD_REL)
USE_RES_FILE = TRUE
RC_CMD       = $(RC_CMD_REL)
!ENDIF

!IF "$(CFG)" == "dll-debug"
CARES_TARGET = $(DYN_LIB_DBG).dll
CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DDEBUGBUILD
CARES_LFLAGS = /debug $(EX_LIBS_DBG) /implib:$(PROG_OUTDIR)\$(IMP_LIB_DBG).lib /pdb:$(PROG_OUTDIR)\$(DYN_LIB_DBG).pdb $(PDBTYPE_CONSOLIDATE)
SPROG_CFLAGS =
SPROG_LFLAGS = /libpath:$(LIB_OUTDIR) $(EX_LIBS_DBG) $(IMP_LIB_DBG).lib
CARES_LINK   = $(LINK_CMD_DLL)
SPROG_LINK   = $(LINK_CMD_EXE_DBG)
CC_CMD       = $(CC_CMD_DBG)
USE_RES_FILE = TRUE
RC_CMD       = $(RC_CMD_DBG)
!ENDIF

# --------------------------------------------



( run in 1.717 second using v1.01-cache-2.11-cpan-49f99fa48dc )