mirror of https://github.com/c-ares/c-ares.git
Autotools: rework to simplify and fix recent issues (#674)
Completely rework the autotools build system, issues have cropped up due to the complexity and could cause issues on even semi-modern Linux systems (Ubuntu 20.04 for example). Changes include: Remove all curl/xc/cares m4 helper files, they go overboard on detections of functions and datatypes. Go back to more plain autoconf macros as they've come a long way over the years. Use known systems and heuristics to determine datatypes for functions like send() and recv(), rather than the error prone detection which required thousands of permutations and might still get it wrong. Remove unneeded configure arguments like --enable-debug or --enable-optimize, its more common for people to simply pass their own CFLAGS on the command line. Only require CARES_STATICLIB definition on Windows static builds, its not necessary ever for other systems, even when hiding non-public symbols. Remove some function and definition detections that were never used in c-ares The test framework is now embedded into the toplevel configure system, there was no need to chain build the test system as it is never built externally to c-ares. As a side-effect of the changes, a configure run completes in about 25% of the original time. This has been tested on various Linux distributions (of varying age), FreeBSD, MacOS, Windows (via MSYS2 with Mingw), and Solaris10/11 (by @dfandrich), AIX 7.3 (by @dfandrich). It is not unlikely that this may have broken more esoteric or legacy systems, and we'll likely need to be ready to accept bug reports and patches, but it has removed over 10k lines of build system code. It is very likely any issues that crop up will add far fewer lines of code to fix such systems. Fixes Bug: #670 Fix By: Brad House (@bradh352)pull/676/head
parent
87eb22ef26
commit
4f490b40df
41 changed files with 927 additions and 11571 deletions
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,114 +1,52 @@ |
||||
/* MIT License
|
||||
* |
||||
* Copyright (c) 2009 Daniel Stenberg |
||||
* |
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
* of this software and associated documentation files (the "Software"), to deal |
||||
* in the Software without restriction, including without limitation the rights |
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
* copies of the Software, and to permit persons to whom the Software is |
||||
* furnished to do so, subject to the following conditions: |
||||
* |
||||
* The above copyright notice and this permission notice (including the next |
||||
* paragraph) shall be included in all copies or substantial portions of the |
||||
* Software. |
||||
* |
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
||||
* SOFTWARE. |
||||
* |
||||
* SPDX-License-Identifier: MIT |
||||
*/ |
||||
#ifndef __CARES_BUILD_H |
||||
#define __CARES_BUILD_H |
||||
|
||||
/* ================================================================ */ |
||||
/* NOTES FOR CONFIGURE CAPABLE SYSTEMS */ |
||||
/* ================================================================ */ |
||||
|
||||
/*
|
||||
* NOTE 1: |
||||
* ------- |
||||
* |
||||
* Nothing in this file is intended to be modified or adjusted by the |
||||
* c-ares library user nor by the c-ares library builder. |
||||
* |
||||
* If you think that something actually needs to be changed, adjusted |
||||
* or fixed in this file, then, report it on the c-ares development |
||||
* mailing list: http://lists.haxx.se/listinfo/c-ares/
|
||||
* |
||||
* This header file shall only export symbols which are 'cares' or 'CARES' |
||||
* prefixed, otherwise public name space would be polluted. |
||||
* |
||||
* NOTE 2: |
||||
* ------- |
||||
* |
||||
* Right now you might be staring at file ares_build.h.in or ares_build.h, |
||||
* this is due to the following reason: |
||||
* |
||||
* On systems capable of running the configure script, the configure process |
||||
* will overwrite the distributed ares_build.h file with one that is suitable |
||||
* and specific to the library being configured and built, which is generated |
||||
* from the ares_build.h.in template file. |
||||
* |
||||
* Copyright (C) The c-ares project and its contributors |
||||
* SPDX-License-Identifier: MIT |
||||
*/ |
||||
|
||||
/* ================================================================ */ |
||||
/* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */ |
||||
/* ================================================================ */ |
||||
|
||||
#ifdef CARES_TYPEOF_ARES_SOCKLEN_T |
||||
# error "CARES_TYPEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h" |
||||
Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_already_defined |
||||
#endif |
||||
|
||||
#define CARES_TYPEOF_ARES_SOCKLEN_T @CARES_TYPEOF_ARES_SOCKLEN_T@ |
||||
#define CARES_TYPEOF_ARES_SSIZE_T @CARES_TYPEOF_ARES_SSIZE_T@ |
||||
|
||||
/* Prefix names with CARES_ to make sure they don't conflict with other config.h
|
||||
* files. We need to include some dependent headers that may be system specific |
||||
* for C-Ares */ |
||||
#undef CARES_HAVE_SYS_TYPES_H |
||||
#undef CARES_HAVE_SYS_RANDOM_H |
||||
#undef CARES_HAVE_SYS_SOCKET_H |
||||
#undef CARES_HAVE_WINDOWS_H |
||||
#undef CARES_HAVE_WS2TCPIP_H |
||||
#undef CARES_HAVE_WINSOCK2_H |
||||
#undef CARES_HAVE_WINDOWS_H |
||||
#undef CARES_HAVE_ARPA_NAMESER_H |
||||
#undef CARES_HAVE_ARPA_NAMESER_COMPAT_H |
||||
|
||||
/* ================================================================ */ |
||||
/* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */ |
||||
/* ================================================================ */ |
||||
#ifdef CARES_HAVE_SYS_TYPES_H |
||||
# include <sys/types.h> |
||||
#endif |
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */ |
||||
/* header file ws2tcpip.h must be included by the external interface. */ |
||||
#undef CARES_PULL_WS2TCPIP_H |
||||
#ifdef CARES_PULL_WS2TCPIP_H |
||||
# ifndef WIN32_LEAN_AND_MEAN |
||||
# define WIN32_LEAN_AND_MEAN |
||||
#ifdef CARES_HAVE_SYS_RANDOM_H |
||||
# include <sys/random.h> |
||||
#endif |
||||
# include <windows.h> |
||||
|
||||
#ifdef CARES_HAVE_SYS_SOCKET_H |
||||
# include <sys/socket.h> |
||||
#endif |
||||
|
||||
#ifdef CARES_HAVE_WINSOCK2_H |
||||
# include <winsock2.h> |
||||
# include <ws2tcpip.h> |
||||
#endif |
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */ |
||||
/* header file sys/types.h must be included by the external interface. */ |
||||
#undef CARES_PULL_SYS_TYPES_H |
||||
#ifdef CARES_PULL_SYS_TYPES_H |
||||
# include <sys/types.h> |
||||
#ifdef CARES_HAVE_WS2TCPIP_H |
||||
# include <ws2tcpip.h> |
||||
#endif |
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */ |
||||
/* header file sys/socket.h must be included by the external interface. */ |
||||
#undef CARES_PULL_SYS_SOCKET_H |
||||
#ifdef CARES_PULL_SYS_SOCKET_H |
||||
# include <sys/socket.h> |
||||
#ifdef CARES_HAVE_WINDOWS_H |
||||
# include <windows.h> |
||||
#endif |
||||
|
||||
/* Integral data type used for ares_socklen_t. */ |
||||
#undef CARES_TYPEOF_ARES_SOCKLEN_T |
||||
|
||||
/* Data type definition of ares_socklen_t. */ |
||||
typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t; |
||||
|
||||
/* Integral data type used for ares_ssize_t. */ |
||||
#undef CARES_TYPEOF_ARES_SSIZE_T |
||||
|
||||
/* Data type definition of ares_ssize_t. */ |
||||
typedef CARES_TYPEOF_ARES_SSIZE_T ares_ssize_t; |
||||
|
||||
#endif /* __CARES_BUILD_H */ |
||||
|
@ -0,0 +1,44 @@ |
||||
# =========================================================================== |
||||
# https://www.gnu.org/software/autoconf-archive/ax_append_link_flags.html |
||||
# =========================================================================== |
||||
# |
||||
# SYNOPSIS |
||||
# |
||||
# AX_APPEND_LINK_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT]) |
||||
# |
||||
# DESCRIPTION |
||||
# |
||||
# For every FLAG1, FLAG2 it is checked whether the linker works with the |
||||
# flag. If it does, the flag is added FLAGS-VARIABLE |
||||
# |
||||
# If FLAGS-VARIABLE is not specified, the linker's flags (LDFLAGS) is |
||||
# used. During the check the flag is always added to the linker's flags. |
||||
# |
||||
# If EXTRA-FLAGS is defined, it is added to the linker's default flags |
||||
# when the check is done. The check is thus made with the flags: "LDFLAGS |
||||
# EXTRA-FLAGS FLAG". This can for example be used to force the linker to |
||||
# issue an error when a bad flag is given. |
||||
# |
||||
# INPUT gives an alternative input source to AC_COMPILE_IFELSE. |
||||
# |
||||
# NOTE: This macro depends on the AX_APPEND_FLAG and AX_CHECK_LINK_FLAG. |
||||
# Please keep this macro in sync with AX_APPEND_COMPILE_FLAGS. |
||||
# |
||||
# LICENSE |
||||
# |
||||
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com> |
||||
# |
||||
# Copying and distribution of this file, with or without modification, are |
||||
# permitted in any medium without royalty provided the copyright notice |
||||
# and this notice are preserved. This file is offered as-is, without any |
||||
# warranty. |
||||
|
||||
#serial 7 |
||||
|
||||
AC_DEFUN([AX_APPEND_LINK_FLAGS], |
||||
[AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) |
||||
AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) |
||||
for flag in $1; do |
||||
AX_CHECK_LINK_FLAG([$flag], [AX_APPEND_FLAG([$flag], [m4_default([$2], [LDFLAGS])])], [], [$3], [$4]) |
||||
done |
||||
])dnl AX_APPEND_LINK_FLAGS |
@ -0,0 +1,53 @@ |
||||
# =========================================================================== |
||||
# https://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html |
||||
# =========================================================================== |
||||
# |
||||
# SYNOPSIS |
||||
# |
||||
# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) |
||||
# |
||||
# DESCRIPTION |
||||
# |
||||
# Check whether the given FLAG works with the linker or gives an error. |
||||
# (Warnings, however, are ignored) |
||||
# |
||||
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on |
||||
# success/failure. |
||||
# |
||||
# If EXTRA-FLAGS is defined, it is added to the linker's default flags |
||||
# when the check is done. The check is thus made with the flags: "LDFLAGS |
||||
# EXTRA-FLAGS FLAG". This can for example be used to force the linker to |
||||
# issue an error when a bad flag is given. |
||||
# |
||||
# INPUT gives an alternative input source to AC_LINK_IFELSE. |
||||
# |
||||
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this |
||||
# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG. |
||||
# |
||||
# LICENSE |
||||
# |
||||
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> |
||||
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com> |
||||
# |
||||
# Copying and distribution of this file, with or without modification, are |
||||
# permitted in any medium without royalty provided the copyright notice |
||||
# and this notice are preserved. This file is offered as-is, without any |
||||
# warranty. |
||||
|
||||
#serial 6 |
||||
|
||||
AC_DEFUN([AX_CHECK_LINK_FLAG], |
||||
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF |
||||
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl |
||||
AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [ |
||||
ax_check_save_flags=$LDFLAGS |
||||
LDFLAGS="$LDFLAGS $4 $1" |
||||
AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], |
||||
[AS_VAR_SET(CACHEVAR,[yes])], |
||||
[AS_VAR_SET(CACHEVAR,[no])]) |
||||
LDFLAGS=$ax_check_save_flags]) |
||||
AS_VAR_IF(CACHEVAR,yes, |
||||
[m4_default([$2], :)], |
||||
[m4_default([$3], :)]) |
||||
AS_VAR_POPDEF([CACHEVAR])dnl |
||||
])dnl AX_CHECK_LINK_FLAGS |
@ -0,0 +1,119 @@ |
||||
# =========================================================================== |
||||
# https://www.gnu.org/software/autoconf-archive/ax_compiler_vendor.html |
||||
# =========================================================================== |
||||
# |
||||
# SYNOPSIS |
||||
# |
||||
# AX_COMPILER_VENDOR |
||||
# |
||||
# DESCRIPTION |
||||
# |
||||
# Determine the vendor of the C, C++ or Fortran compiler. The vendor is |
||||
# returned in the cache variable $ax_cv_c_compiler_vendor for C, |
||||
# $ax_cv_cxx_compiler_vendor for C++ or $ax_cv_fc_compiler_vendor for |
||||
# (modern) Fortran. The value is one of "intel", "ibm", "pathscale", |
||||
# "clang" (LLVM), "cray", "fujitsu", "sdcc", "sx", "nvhpc" (NVIDIA HPC |
||||
# Compiler), "portland" (PGI), "gnu" (GCC), "sun" (Oracle Developer |
||||
# Studio), "hp", "dec", "borland", "comeau", "kai", "lcc", "sgi", |
||||
# "microsoft", "metrowerks", "watcom", "tcc" (Tiny CC) or "unknown" (if |
||||
# the compiler cannot be determined). |
||||
# |
||||
# To check for a Fortran compiler, you must first call AC_FC_PP_SRCEXT |
||||
# with an appropriate preprocessor-enabled extension. For example: |
||||
# |
||||
# AC_LANG_PUSH([Fortran]) |
||||
# AC_PROG_FC |
||||
# AC_FC_PP_SRCEXT([F]) |
||||
# AX_COMPILER_VENDOR |
||||
# AC_LANG_POP([Fortran]) |
||||
# |
||||
# LICENSE |
||||
# |
||||
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> |
||||
# Copyright (c) 2008 Matteo Frigo |
||||
# Copyright (c) 2018-19 John Zaitseff <J.Zaitseff@zap.org.au> |
||||
# |
||||
# This program is free software: you can redistribute it and/or modify it |
||||
# under the terms of the GNU General Public License as published by the |
||||
# Free Software Foundation, either version 3 of the License, or (at your |
||||
# option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, but |
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
||||
# Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License along |
||||
# with this program. If not, see <https://www.gnu.org/licenses/>. |
||||
# |
||||
# As a special exception, the respective Autoconf Macro's copyright owner |
||||
# gives unlimited permission to copy, distribute and modify the configure |
||||
# scripts that are the output of Autoconf when processing the Macro. You |
||||
# need not follow the terms of the GNU General Public License when using |
||||
# or distributing such scripts, even though portions of the text of the |
||||
# Macro appear in them. The GNU General Public License (GPL) does govern |
||||
# all other use of the material that constitutes the Autoconf Macro. |
||||
# |
||||
# This special exception to the GPL applies to versions of the Autoconf |
||||
# Macro released by the Autoconf Archive. When you make and distribute a |
||||
# modified version of the Autoconf Macro, you may extend this special |
||||
# exception to the GPL to apply to your modified version as well. |
||||
|
||||
#serial 32 |
||||
|
||||
AC_DEFUN([AX_COMPILER_VENDOR], [dnl |
||||
AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, [dnl |
||||
dnl If you modify this list of vendors, please add similar support |
||||
dnl to ax_compiler_version.m4 if at all possible. |
||||
dnl |
||||
dnl Note: Do NOT check for GCC first since some other compilers |
||||
dnl define __GNUC__ to remain compatible with it. Compilers that |
||||
dnl are very slow to start (such as Intel) are listed first. |
||||
|
||||
vendors=" |
||||
intel: __ICC,__ECC,__INTEL_COMPILER |
||||
ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__,__ibmxl__ |
||||
pathscale: __PATHCC__,__PATHSCALE__ |
||||
clang: __clang__ |
||||
cray: _CRAYC |
||||
fujitsu: __FUJITSU |
||||
sdcc: SDCC,__SDCC |
||||
sx: _SX |
||||
nvhpc: __NVCOMPILER |
||||
portland: __PGI |
||||
gnu: __GNUC__ |
||||
sun: __SUNPRO_C,__SUNPRO_CC,__SUNPRO_F90,__SUNPRO_F95 |
||||
hp: __HP_cc,__HP_aCC |
||||
dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER |
||||
borland: __BORLANDC__,__CODEGEARC__,__TURBOC__ |
||||
comeau: __COMO__ |
||||
kai: __KCC |
||||
lcc: __LCC__ |
||||
sgi: __sgi,sgi |
||||
microsoft: _MSC_VER |
||||
metrowerks: __MWERKS__ |
||||
watcom: __WATCOMC__ |
||||
tcc: __TINYC__ |
||||
unknown: UNKNOWN |
||||
" |
||||
for ventest in $vendors; do |
||||
case $ventest in |
||||
*:) |
||||
vendor=$ventest |
||||
continue |
||||
;; |
||||
*) |
||||
vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" |
||||
;; |
||||
esac |
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ |
||||
#if !($vencpp) |
||||
thisisanerror; |
||||
#endif |
||||
]])], [break]) |
||||
done |
||||
|
||||
ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1` |
||||
]) |
||||
])dnl |
File diff suppressed because it is too large
Load Diff
@ -1,352 +0,0 @@ |
||||
#*************************************************************************** |
||||
# |
||||
# Copyright (C) Daniel Stenberg et al |
||||
# |
||||
# Permission to use, copy, modify, and distribute this software and its |
||||
# documentation for any purpose and without fee is hereby granted, provided |
||||
# that the above copyright notice appear in all copies and that both that |
||||
# copyright notice and this permission notice appear in supporting |
||||
# documentation, and that the name of M.I.T. not be used in advertising or |
||||
# publicity pertaining to distribution of the software without specific, |
||||
# written prior permission. 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. |
||||
# |
||||
# SPDX-License-Identifier: MIT |
||||
#*************************************************************************** |
||||
|
||||
# File version for 'aclocal' use. Keep it a single number. |
||||
# serial 11 |
||||
|
||||
|
||||
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],[XC_CHECK_PROG_CC])dnl |
||||
AC_MSG_CHECKING([whether to enable debug build options]) |
||||
OPT_DEBUG_BUILD="default" |
||||
AC_ARG_ENABLE(debug, |
||||
AS_HELP_STRING([--enable-debug],[Enable debug build options]) |
||||
AS_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], [ |
||||
AC_BEFORE([$0],[CARES_CHECK_NONBLOCKING_SOCKET])dnl |
||||
AC_MSG_CHECKING([whether to enable non-blocking communications]) |
||||
OPT_NONBLOCKING="default" |
||||
AC_ARG_ENABLE(nonblocking, |
||||
AS_HELP_STRING([--enable-nonblocking],[Enable non-blocking communications]) |
||||
AS_HELP_STRING([--disable-nonblocking],[Disable non-blocking communications]), |
||||
OPT_NONBLOCKING=$enableval) |
||||
case "$OPT_NONBLOCKING" in |
||||
no) |
||||
dnl --disable-nonblocking option used |
||||
want_nonblocking="no" |
||||
;; |
||||
default) |
||||
dnl configure option not specified |
||||
want_nonblocking="yes" |
||||
;; |
||||
*) |
||||
dnl --enable-nonblocking option used |
||||
want_nonblocking="yes" |
||||
;; |
||||
esac |
||||
AC_MSG_RESULT([$want_nonblocking]) |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CHECK_OPTION_OPTIMIZE |
||||
dnl ------------------------------------------------- |
||||
dnl Verify if configure has been invoked with option |
||||
dnl --enable-optimize or --disable-optimize, and set |
||||
dnl shell variable want_optimize value as appropriate. |
||||
|
||||
AC_DEFUN([CARES_CHECK_OPTION_OPTIMIZE], [ |
||||
AC_REQUIRE([CARES_CHECK_OPTION_DEBUG])dnl |
||||
AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl |
||||
AC_MSG_CHECKING([whether to enable compiler optimizer]) |
||||
OPT_COMPILER_OPTIMIZE="default" |
||||
AC_ARG_ENABLE(optimize, |
||||
AS_HELP_STRING([--enable-optimize(=OPT)],[Enable compiler optimizations (default=-O2)]) |
||||
AS_HELP_STRING([--disable-optimize],[Disable compiler optimizations]), |
||||
OPT_COMPILER_OPTIMIZE=$enableval) |
||||
case "$OPT_COMPILER_OPTIMIZE" in |
||||
no) |
||||
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. |
||||
dnl If the compiler is known CFLAGS and CPPFLAGS will be |
||||
dnl overridden, otherwise this can not be honored. |
||||
want_optimize="yes" |
||||
AC_MSG_RESULT([yes]) |
||||
;; |
||||
esac |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CHECK_OPTION_SYMBOL_HIDING |
||||
dnl ------------------------------------------------- |
||||
dnl Verify if configure has been invoked with option |
||||
dnl --enable-symbol-hiding or --disable-symbol-hiding, |
||||
dnl setting shell variable want_symbol_hiding value. |
||||
|
||||
AC_DEFUN([CARES_CHECK_OPTION_SYMBOL_HIDING], [ |
||||
AC_BEFORE([$0],[CARES_CHECK_COMPILER_SYMBOL_HIDING])dnl |
||||
AC_MSG_CHECKING([whether to enable hiding of library internal symbols]) |
||||
OPT_SYMBOL_HIDING="default" |
||||
AC_ARG_ENABLE(symbol-hiding, |
||||
AS_HELP_STRING([--enable-symbol-hiding],[Enable hiding of library internal symbols]) |
||||
AS_HELP_STRING([--disable-symbol-hiding],[Disable hiding of library internal symbols]), |
||||
OPT_SYMBOL_HIDING=$enableval) |
||||
case "$OPT_SYMBOL_HIDING" in |
||||
no) |
||||
dnl --disable-symbol-hiding option used. |
||||
dnl This is an indication to not attempt hiding of library internal |
||||
dnl symbols. Default symbol visibility will be used, which normally |
||||
dnl exposes all library internal symbols. |
||||
want_symbol_hiding="no" |
||||
AC_MSG_RESULT([no]) |
||||
;; |
||||
default) |
||||
dnl configure's symbol-hiding option not specified. |
||||
dnl Handle this as if --enable-symbol-hiding option was given. |
||||
want_symbol_hiding="yes" |
||||
AC_MSG_RESULT([yes]) |
||||
;; |
||||
*) |
||||
dnl --enable-symbol-hiding option used. |
||||
dnl This is an indication to attempt hiding of library internal |
||||
dnl symbols. This is only supported on some compilers/linkers. |
||||
want_symbol_hiding="yes" |
||||
AC_MSG_RESULT([yes]) |
||||
;; |
||||
esac |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CHECK_OPTION_EXPOSE_STATICS |
||||
dnl ------------------------------------------------- |
||||
dnl Verify if configure has been invoked with option |
||||
dnl --enable-expose-statics or --disable-expose-statics, |
||||
dnl setting shell variable want_expose_statics value. |
||||
|
||||
AC_DEFUN([CARES_CHECK_OPTION_EXPOSE_STATICS], [ |
||||
AC_MSG_CHECKING([whether to expose internal static functions for testing]) |
||||
OPT_EXPOSE_STATICS="default" |
||||
AC_ARG_ENABLE(expose-statics, |
||||
AS_HELP_STRING([--enable-expose-statics],[Enable exposure of internal static functions for testing]) |
||||
AS_HELP_STRING([--disable-expose-statics],[Disable exposure of internal static functions for testing]), |
||||
OPT_EXPOSE_STATICS=$enableval) |
||||
case "$OPT_EXPOSE_STATICS" in |
||||
no) |
||||
dnl --disable-expose-statics option used. |
||||
want_expose_statics="no" |
||||
AC_MSG_RESULT([no]) |
||||
;; |
||||
default) |
||||
dnl configure's expose-statics option not specified. |
||||
dnl Handle this as if --disable-expose-statics option was given. |
||||
want_expose_statics="no" |
||||
AC_MSG_RESULT([no]) |
||||
;; |
||||
*) |
||||
dnl --enable-expose-statics option used. |
||||
want_expose_statics="yes" |
||||
AC_MSG_RESULT([yes]) |
||||
;; |
||||
esac |
||||
if test "$want_expose_statics" = "yes"; then |
||||
AC_DEFINE_UNQUOTED(CARES_EXPOSE_STATICS, 1, |
||||
[Defined for build that exposes internal static functions for testing.]) |
||||
fi |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CHECK_OPTION_WARNINGS |
||||
dnl ------------------------------------------------- |
||||
dnl Verify if configure has been invoked with option |
||||
dnl --enable-warnings or --disable-warnings, and set |
||||
dnl shell variable want_warnings as appropriate. |
||||
|
||||
AC_DEFUN([CARES_CHECK_OPTION_WARNINGS], [ |
||||
AC_REQUIRE([CARES_CHECK_OPTION_DEBUG])dnl |
||||
AC_BEFORE([$0],[CARES_CHECK_OPTION_WERROR])dnl |
||||
AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl |
||||
AC_MSG_CHECKING([whether to enable strict compiler warnings]) |
||||
OPT_COMPILER_WARNINGS="yes" |
||||
AC_ARG_ENABLE(warnings, |
||||
AS_HELP_STRING([--enable-warnings],[Enable strict compiler warnings]) |
||||
AS_HELP_STRING([--disable-warnings],[Disable strict compiler warnings]), |
||||
OPT_COMPILER_WARNINGS=yes) |
||||
case "$OPT_COMPILER_WARNINGS" in |
||||
no) |
||||
dnl --disable-warnings option used |
||||
want_warnings="no" |
||||
;; |
||||
*) |
||||
dnl --enable-warnings option used |
||||
want_warnings="yes" |
||||
;; |
||||
esac |
||||
AC_MSG_RESULT([$want_warnings]) |
||||
]) |
||||
|
||||
dnl CARES_CHECK_OPTION_WERROR |
||||
dnl ------------------------------------------------- |
||||
dnl Verify if configure has been invoked with option |
||||
dnl --enable-werror or --disable-werror, and set |
||||
dnl shell variable want_werror as appropriate. |
||||
|
||||
AC_DEFUN([CARES_CHECK_OPTION_WERROR], [ |
||||
AC_BEFORE([$0],[CARES_CHECK_COMPILER])dnl |
||||
AC_MSG_CHECKING([whether to enable compiler warnings as errors]) |
||||
OPT_COMPILER_WERROR="default" |
||||
AC_ARG_ENABLE(werror, |
||||
AS_HELP_STRING([--enable-werror],[Enable compiler warnings as errors]) |
||||
AS_HELP_STRING([--disable-werror],[Disable compiler warnings as errors]), |
||||
OPT_COMPILER_WERROR=$enableval) |
||||
case "$OPT_COMPILER_WERROR" in |
||||
no) |
||||
dnl --disable-werror option used |
||||
want_werror="no" |
||||
;; |
||||
default) |
||||
dnl configure option not specified |
||||
want_werror="no" |
||||
;; |
||||
*) |
||||
dnl --enable-werror option used |
||||
want_werror="yes" |
||||
;; |
||||
esac |
||||
AC_MSG_RESULT([$want_werror]) |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CHECK_NONBLOCKING_SOCKET |
||||
dnl ------------------------------------------------- |
||||
dnl Check for how to set a socket into non-blocking state. |
||||
|
||||
AC_DEFUN([CARES_CHECK_NONBLOCKING_SOCKET], [ |
||||
AC_REQUIRE([CARES_CHECK_OPTION_NONBLOCKING])dnl |
||||
AC_REQUIRE([CARES_CHECK_FUNC_FCNTL])dnl |
||||
AC_REQUIRE([CARES_CHECK_FUNC_IOCTL])dnl |
||||
AC_REQUIRE([CARES_CHECK_FUNC_IOCTLSOCKET])dnl |
||||
AC_REQUIRE([CARES_CHECK_FUNC_IOCTLSOCKET_CAMEL])dnl |
||||
AC_REQUIRE([CARES_CHECK_FUNC_SETSOCKOPT])dnl |
||||
# |
||||
tst_method="unknown" |
||||
if test "$want_nonblocking" = "yes"; then |
||||
AC_MSG_CHECKING([how to set a socket into non-blocking mode]) |
||||
if test "x$ac_cv_func_fcntl_o_nonblock" = "xyes"; then |
||||
tst_method="fcntl O_NONBLOCK" |
||||
elif test "x$ac_cv_func_ioctl_fionbio" = "xyes"; then |
||||
tst_method="ioctl FIONBIO" |
||||
elif test "x$ac_cv_func_ioctlsocket_fionbio" = "xyes"; then |
||||
tst_method="ioctlsocket FIONBIO" |
||||
elif test "x$ac_cv_func_ioctlsocket_camel_fionbio" = "xyes"; then |
||||
tst_method="IoctlSocket FIONBIO" |
||||
elif test "x$ac_cv_func_setsockopt_so_nonblock" = "xyes"; then |
||||
tst_method="setsockopt SO_NONBLOCK" |
||||
fi |
||||
AC_MSG_RESULT([$tst_method]) |
||||
if test "$tst_method" = "unknown"; then |
||||
AC_MSG_WARN([cannot determine non-blocking socket method.]) |
||||
fi |
||||
fi |
||||
if test "$tst_method" = "unknown"; then |
||||
AC_DEFINE_UNQUOTED(USE_BLOCKING_SOCKETS, 1, |
||||
[Define to disable non-blocking sockets.]) |
||||
AC_MSG_WARN([non-blocking sockets disabled.]) |
||||
fi |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CONFIGURE_SYMBOL_HIDING |
||||
dnl ------------------------------------------------- |
||||
dnl Depending on --enable-symbol-hiding or --disable-symbol-hiding |
||||
dnl configure option, and compiler capability to actually honor such |
||||
dnl option, this will modify compiler flags as appropriate and also |
||||
dnl provide needed definitions for configuration and Makefile.am files. |
||||
dnl This macro should not be used until all compilation tests have |
||||
dnl been done to prevent interferences on other tests. |
||||
|
||||
AC_DEFUN([CARES_CONFIGURE_SYMBOL_HIDING], [ |
||||
AC_MSG_CHECKING([whether hiding of library internal symbols will actually happen]) |
||||
CFLAG_CARES_SYMBOL_HIDING="" |
||||
doing_symbol_hiding="no" |
||||
if test x"$ac_cv_native_windows" != "xyes" && |
||||
test "$want_symbol_hiding" = "yes" && |
||||
test "$supports_symbol_hiding" = "yes"; then |
||||
doing_symbol_hiding="yes" |
||||
CFLAG_CARES_SYMBOL_HIDING="$symbol_hiding_CFLAGS" |
||||
AC_DEFINE_UNQUOTED(CARES_SYMBOL_SCOPE_EXTERN, $symbol_hiding_EXTERN, |
||||
[Definition to make a library symbol externally visible.]) |
||||
AC_MSG_RESULT([yes]) |
||||
else |
||||
AC_MSG_RESULT([no]) |
||||
fi |
||||
AM_CONDITIONAL(DOING_CARES_SYMBOL_HIDING, test x$doing_symbol_hiding = xyes) |
||||
AC_SUBST(CFLAG_CARES_SYMBOL_HIDING) |
||||
if test "$doing_symbol_hiding" = "yes"; then |
||||
AC_DEFINE_UNQUOTED(CARES_SYMBOL_HIDING, 1, |
||||
[Defined for build with symbol hiding.]) |
||||
fi |
||||
]) |
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,610 +0,0 @@ |
||||
#*************************************************************************** |
||||
# Copyright (C) Daniel Stenberg et al |
||||
# |
||||
# Permission to use, copy, modify, and distribute this software and its |
||||
# documentation for any purpose and without fee is hereby granted, provided |
||||
# that the above copyright notice appear in all copies and that both that |
||||
# copyright notice and this permission notice appear in supporting |
||||
# documentation, and that the name of M.I.T. not be used in advertising or |
||||
# publicity pertaining to distribution of the software without specific, |
||||
# written prior permission. 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. |
||||
# |
||||
# SPDX-License-Identifier: MIT |
||||
#*************************************************************************** |
||||
|
||||
# File version for 'aclocal' use. Keep it a single number. |
||||
# serial 6 |
||||
|
||||
dnl Note 1 |
||||
dnl ------ |
||||
dnl None of the CARES_CHECK_NEED_REENTRANT_* macros shall use HAVE_FOO_H to |
||||
dnl conditionally include header files. These macros are used early in the |
||||
dnl configure process much before header file availability is known. |
||||
|
||||
|
||||
dnl CARES_CHECK_NEED_REENTRANT_ERRNO |
||||
dnl ------------------------------------------------- |
||||
dnl Checks if the preprocessor _REENTRANT definition |
||||
dnl makes errno available as a preprocessor macro. |
||||
|
||||
AC_DEFUN([CARES_CHECK_NEED_REENTRANT_ERRNO], [ |
||||
AC_COMPILE_IFELSE([ |
||||
AC_LANG_PROGRAM([[ |
||||
#include <errno.h> |
||||
]],[[ |
||||
if(0 != errno) |
||||
return 1; |
||||
]]) |
||||
],[ |
||||
tmp_errno="yes" |
||||
],[ |
||||
tmp_errno="no" |
||||
]) |
||||
if test "$tmp_errno" = "yes"; then |
||||
AC_COMPILE_IFELSE([ |
||||
AC_LANG_PROGRAM([[ |
||||
#include <errno.h> |
||||
]],[[ |
||||
#ifdef errno |
||||
int dummy=1; |
||||
#else |
||||
force compilation error |
||||
#endif |
||||
]]) |
||||
],[ |
||||
tmp_errno="errno_macro_defined" |
||||
],[ |
||||
AC_COMPILE_IFELSE([ |
||||
AC_LANG_PROGRAM([[ |
||||
#define _REENTRANT |
||||
#include <errno.h> |
||||
]],[[ |
||||
#ifdef errno |
||||
int dummy=1; |
||||
#else |
||||
force compilation error |
||||
#endif |
||||
]]) |
||||
],[ |
||||
tmp_errno="errno_macro_needs_reentrant" |
||||
tmp_need_reentrant="yes" |
||||
]) |
||||
]) |
||||
fi |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CHECK_NEED_REENTRANT_GMTIME_R |
||||
dnl ------------------------------------------------- |
||||
dnl Checks if the preprocessor _REENTRANT definition |
||||
dnl makes function gmtime_r compiler visible. |
||||
|
||||
AC_DEFUN([CARES_CHECK_NEED_REENTRANT_GMTIME_R], [ |
||||
AC_LINK_IFELSE([ |
||||
AC_LANG_FUNC_LINK_TRY([gmtime_r]) |
||||
],[ |
||||
tmp_gmtime_r="yes" |
||||
],[ |
||||
tmp_gmtime_r="no" |
||||
]) |
||||
if test "$tmp_gmtime_r" = "yes"; then |
||||
AC_EGREP_CPP([gmtime_r],[ |
||||
#include <sys/types.h> |
||||
#include <time.h> |
||||
],[ |
||||
tmp_gmtime_r="proto_declared" |
||||
],[ |
||||
AC_EGREP_CPP([gmtime_r],[ |
||||
#define _REENTRANT |
||||
#include <sys/types.h> |
||||
#include <time.h> |
||||
],[ |
||||
tmp_gmtime_r="proto_needs_reentrant" |
||||
tmp_need_reentrant="yes" |
||||
]) |
||||
]) |
||||
fi |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CHECK_NEED_REENTRANT_LOCALTIME_R |
||||
dnl ------------------------------------------------- |
||||
dnl Checks if the preprocessor _REENTRANT definition |
||||
dnl makes function localtime_r compiler visible. |
||||
|
||||
AC_DEFUN([CARES_CHECK_NEED_REENTRANT_LOCALTIME_R], [ |
||||
AC_LINK_IFELSE([ |
||||
AC_LANG_FUNC_LINK_TRY([localtime_r]) |
||||
],[ |
||||
tmp_localtime_r="yes" |
||||
],[ |
||||
tmp_localtime_r="no" |
||||
]) |
||||
if test "$tmp_localtime_r" = "yes"; then |
||||
AC_EGREP_CPP([localtime_r],[ |
||||
#include <sys/types.h> |
||||
#include <time.h> |
||||
],[ |
||||
tmp_localtime_r="proto_declared" |
||||
],[ |
||||
AC_EGREP_CPP([localtime_r],[ |
||||
#define _REENTRANT |
||||
#include <sys/types.h> |
||||
#include <time.h> |
||||
],[ |
||||
tmp_localtime_r="proto_needs_reentrant" |
||||
tmp_need_reentrant="yes" |
||||
]) |
||||
]) |
||||
fi |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CHECK_NEED_REENTRANT_STRERROR_R |
||||
dnl ------------------------------------------------- |
||||
dnl Checks if the preprocessor _REENTRANT definition |
||||
dnl makes function strerror_r compiler visible. |
||||
|
||||
AC_DEFUN([CARES_CHECK_NEED_REENTRANT_STRERROR_R], [ |
||||
AC_LINK_IFELSE([ |
||||
AC_LANG_FUNC_LINK_TRY([strerror_r]) |
||||
],[ |
||||
tmp_strerror_r="yes" |
||||
],[ |
||||
tmp_strerror_r="no" |
||||
]) |
||||
if test "$tmp_strerror_r" = "yes"; then |
||||
AC_EGREP_CPP([strerror_r],[ |
||||
#include <sys/types.h> |
||||
#include <string.h> |
||||
],[ |
||||
tmp_strerror_r="proto_declared" |
||||
],[ |
||||
AC_EGREP_CPP([strerror_r],[ |
||||
#define _REENTRANT |
||||
#include <sys/types.h> |
||||
#include <string.h> |
||||
],[ |
||||
tmp_strerror_r="proto_needs_reentrant" |
||||
tmp_need_reentrant="yes" |
||||
]) |
||||
]) |
||||
fi |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CHECK_NEED_REENTRANT_STRTOK_R |
||||
dnl ------------------------------------------------- |
||||
dnl Checks if the preprocessor _REENTRANT definition |
||||
dnl makes function strtok_r compiler visible. |
||||
|
||||
AC_DEFUN([CARES_CHECK_NEED_REENTRANT_STRTOK_R], [ |
||||
AC_LINK_IFELSE([ |
||||
AC_LANG_FUNC_LINK_TRY([strtok_r]) |
||||
],[ |
||||
tmp_strtok_r="yes" |
||||
],[ |
||||
tmp_strtok_r="no" |
||||
]) |
||||
if test "$tmp_strtok_r" = "yes"; then |
||||
AC_EGREP_CPP([strtok_r],[ |
||||
#include <sys/types.h> |
||||
#include <string.h> |
||||
],[ |
||||
tmp_strtok_r="proto_declared" |
||||
],[ |
||||
AC_EGREP_CPP([strtok_r],[ |
||||
#define _REENTRANT |
||||
#include <sys/types.h> |
||||
#include <string.h> |
||||
],[ |
||||
tmp_strtok_r="proto_needs_reentrant" |
||||
tmp_need_reentrant="yes" |
||||
]) |
||||
]) |
||||
fi |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CHECK_NEED_REENTRANT_INET_NTOA_R |
||||
dnl ------------------------------------------------- |
||||
dnl Checks if the preprocessor _REENTRANT definition |
||||
dnl makes function inet_ntoa_r compiler visible. |
||||
|
||||
AC_DEFUN([CARES_CHECK_NEED_REENTRANT_INET_NTOA_R], [ |
||||
AC_LINK_IFELSE([ |
||||
AC_LANG_FUNC_LINK_TRY([inet_ntoa_r]) |
||||
],[ |
||||
tmp_inet_ntoa_r="yes" |
||||
],[ |
||||
tmp_inet_ntoa_r="no" |
||||
]) |
||||
if test "$tmp_inet_ntoa_r" = "yes"; then |
||||
AC_EGREP_CPP([inet_ntoa_r],[ |
||||
#include <sys/types.h> |
||||
#include <sys/socket.h> |
||||
#include <netinet/in.h> |
||||
#include <arpa/inet.h> |
||||
],[ |
||||
tmp_inet_ntoa_r="proto_declared" |
||||
],[ |
||||
AC_EGREP_CPP([inet_ntoa_r],[ |
||||
#define _REENTRANT |
||||
#include <sys/types.h> |
||||
#include <sys/socket.h> |
||||
#include <netinet/in.h> |
||||
#include <arpa/inet.h> |
||||
],[ |
||||
tmp_inet_ntoa_r="proto_needs_reentrant" |
||||
tmp_need_reentrant="yes" |
||||
]) |
||||
]) |
||||
fi |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CHECK_NEED_REENTRANT_GETHOSTBYADDR_R |
||||
dnl ------------------------------------------------- |
||||
dnl Checks if the preprocessor _REENTRANT definition |
||||
dnl makes function gethostbyaddr_r compiler visible. |
||||
|
||||
AC_DEFUN([CARES_CHECK_NEED_REENTRANT_GETHOSTBYADDR_R], [ |
||||
AC_LINK_IFELSE([ |
||||
AC_LANG_FUNC_LINK_TRY([gethostbyaddr_r]) |
||||
],[ |
||||
tmp_gethostbyaddr_r="yes" |
||||
],[ |
||||
tmp_gethostbyaddr_r="no" |
||||
]) |
||||
if test "$tmp_gethostbyaddr_r" = "yes"; then |
||||
AC_EGREP_CPP([gethostbyaddr_r],[ |
||||
#include <sys/types.h> |
||||
#include <netdb.h> |
||||
],[ |
||||
tmp_gethostbyaddr_r="proto_declared" |
||||
],[ |
||||
AC_EGREP_CPP([gethostbyaddr_r],[ |
||||
#define _REENTRANT |
||||
#include <sys/types.h> |
||||
#include <netdb.h> |
||||
],[ |
||||
tmp_gethostbyaddr_r="proto_needs_reentrant" |
||||
tmp_need_reentrant="yes" |
||||
]) |
||||
]) |
||||
fi |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R |
||||
dnl ------------------------------------------------- |
||||
dnl Checks if the preprocessor _REENTRANT definition |
||||
dnl makes function gethostbyname_r compiler visible. |
||||
|
||||
AC_DEFUN([CARES_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R], [ |
||||
AC_LINK_IFELSE([ |
||||
AC_LANG_FUNC_LINK_TRY([gethostbyname_r]) |
||||
],[ |
||||
tmp_gethostbyname_r="yes" |
||||
],[ |
||||
tmp_gethostbyname_r="no" |
||||
]) |
||||
if test "$tmp_gethostbyname_r" = "yes"; then |
||||
AC_EGREP_CPP([gethostbyname_r],[ |
||||
#include <sys/types.h> |
||||
#include <netdb.h> |
||||
],[ |
||||
tmp_gethostbyname_r="proto_declared" |
||||
],[ |
||||
AC_EGREP_CPP([gethostbyname_r],[ |
||||
#define _REENTRANT |
||||
#include <sys/types.h> |
||||
#include <netdb.h> |
||||
],[ |
||||
tmp_gethostbyname_r="proto_needs_reentrant" |
||||
tmp_need_reentrant="yes" |
||||
]) |
||||
]) |
||||
fi |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CHECK_NEED_REENTRANT_GETPROTOBYNAME_R |
||||
dnl ------------------------------------------------- |
||||
dnl Checks if the preprocessor _REENTRANT definition |
||||
dnl makes function getprotobyname_r compiler visible. |
||||
|
||||
AC_DEFUN([CARES_CHECK_NEED_REENTRANT_GETPROTOBYNAME_R], [ |
||||
AC_LINK_IFELSE([ |
||||
AC_LANG_FUNC_LINK_TRY([getprotobyname_r]) |
||||
],[ |
||||
tmp_getprotobyname_r="yes" |
||||
],[ |
||||
tmp_getprotobyname_r="no" |
||||
]) |
||||
if test "$tmp_getprotobyname_r" = "yes"; then |
||||
AC_EGREP_CPP([getprotobyname_r],[ |
||||
#include <sys/types.h> |
||||
#include <netdb.h> |
||||
],[ |
||||
tmp_getprotobyname_r="proto_declared" |
||||
],[ |
||||
AC_EGREP_CPP([getprotobyname_r],[ |
||||
#define _REENTRANT |
||||
#include <sys/types.h> |
||||
#include <netdb.h> |
||||
],[ |
||||
tmp_getprotobyname_r="proto_needs_reentrant" |
||||
tmp_need_reentrant="yes" |
||||
]) |
||||
]) |
||||
fi |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CHECK_NEED_REENTRANT_GETSERVBYPORT_R |
||||
dnl ------------------------------------------------- |
||||
dnl Checks if the preprocessor _REENTRANT definition |
||||
dnl makes function getservbyport_r compiler visible. |
||||
|
||||
AC_DEFUN([CARES_CHECK_NEED_REENTRANT_GETSERVBYPORT_R], [ |
||||
AC_LINK_IFELSE([ |
||||
AC_LANG_FUNC_LINK_TRY([getservbyport_r]) |
||||
],[ |
||||
tmp_getservbyport_r="yes" |
||||
],[ |
||||
tmp_getservbyport_r="no" |
||||
]) |
||||
if test "$tmp_getservbyport_r" = "yes"; then |
||||
AC_EGREP_CPP([getservbyport_r],[ |
||||
#include <sys/types.h> |
||||
#include <netdb.h> |
||||
],[ |
||||
tmp_getservbyport_r="proto_declared" |
||||
],[ |
||||
AC_EGREP_CPP([getservbyport_r],[ |
||||
#define _REENTRANT |
||||
#include <sys/types.h> |
||||
#include <netdb.h> |
||||
],[ |
||||
tmp_getservbyport_r="proto_needs_reentrant" |
||||
tmp_need_reentrant="yes" |
||||
]) |
||||
]) |
||||
fi |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CHECK_NEED_REENTRANT_FUNCTIONS_R |
||||
dnl ------------------------------------------------- |
||||
dnl Checks if the preprocessor _REENTRANT definition |
||||
dnl makes several _r functions compiler visible. |
||||
dnl Internal macro for CARES_CONFIGURE_REENTRANT. |
||||
|
||||
AC_DEFUN([CARES_CHECK_NEED_REENTRANT_FUNCTIONS_R], [ |
||||
if test "$tmp_need_reentrant" = "no"; then |
||||
CARES_CHECK_NEED_REENTRANT_GMTIME_R |
||||
fi |
||||
if test "$tmp_need_reentrant" = "no"; then |
||||
CARES_CHECK_NEED_REENTRANT_LOCALTIME_R |
||||
fi |
||||
if test "$tmp_need_reentrant" = "no"; then |
||||
CARES_CHECK_NEED_REENTRANT_STRERROR_R |
||||
fi |
||||
if test "$tmp_need_reentrant" = "no"; then |
||||
CARES_CHECK_NEED_REENTRANT_STRTOK_R |
||||
fi |
||||
if test "$tmp_need_reentrant" = "no"; then |
||||
CARES_CHECK_NEED_REENTRANT_INET_NTOA_R |
||||
fi |
||||
if test "$tmp_need_reentrant" = "no"; then |
||||
CARES_CHECK_NEED_REENTRANT_GETHOSTBYADDR_R |
||||
fi |
||||
if test "$tmp_need_reentrant" = "no"; then |
||||
CARES_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R |
||||
fi |
||||
if test "$tmp_need_reentrant" = "no"; then |
||||
CARES_CHECK_NEED_REENTRANT_GETPROTOBYNAME_R |
||||
fi |
||||
if test "$tmp_need_reentrant" = "no"; then |
||||
CARES_CHECK_NEED_REENTRANT_GETSERVBYPORT_R |
||||
fi |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CHECK_NEED_REENTRANT_SYSTEM |
||||
dnl ------------------------------------------------- |
||||
dnl Checks if the preprocessor _REENTRANT definition |
||||
dnl must be unconditionally done for this platform. |
||||
dnl Internal macro for CARES_CONFIGURE_REENTRANT. |
||||
|
||||
AC_DEFUN([CARES_CHECK_NEED_REENTRANT_SYSTEM], [ |
||||
case $host_os in |
||||
solaris*) |
||||
tmp_need_reentrant="yes" |
||||
;; |
||||
*) |
||||
tmp_need_reentrant="no" |
||||
;; |
||||
esac |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CHECK_NEED_THREAD_SAFE_SYSTEM |
||||
dnl ------------------------------------------------- |
||||
dnl Checks if the preprocessor _THREAD_SAFE definition |
||||
dnl must be unconditionally done for this platform. |
||||
dnl Internal macro for CARES_CONFIGURE_THREAD_SAFE. |
||||
|
||||
AC_DEFUN([CARES_CHECK_NEED_THREAD_SAFE_SYSTEM], [ |
||||
case $host_os in |
||||
aix[[123]].* | aix4.[[012]].*) |
||||
dnl aix 4.2 and older |
||||
tmp_need_thread_safe="no" |
||||
;; |
||||
aix*) |
||||
dnl AIX 4.3 and newer |
||||
tmp_need_thread_safe="yes" |
||||
;; |
||||
*) |
||||
tmp_need_thread_safe="no" |
||||
;; |
||||
esac |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT |
||||
dnl ------------------------------------------------- |
||||
dnl This macro ensures that configuration tests done |
||||
dnl after this will execute with preprocessor symbol |
||||
dnl _REENTRANT defined. This macro also ensures that |
||||
dnl the generated config file defines NEED_REENTRANT |
||||
dnl and that in turn setup.h will define _REENTRANT. |
||||
dnl Internal macro for CARES_CONFIGURE_REENTRANT. |
||||
|
||||
AC_DEFUN([CARES_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT], [ |
||||
AC_DEFINE(NEED_REENTRANT, 1, |
||||
[Define to 1 if _REENTRANT preprocessor symbol must be defined.]) |
||||
cat >>confdefs.h <<_EOF |
||||
#ifndef _REENTRANT |
||||
# define _REENTRANT |
||||
#endif |
||||
_EOF |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CONFIGURE_FROM_NOW_ON_WITH_THREAD_SAFE |
||||
dnl ------------------------------------------------- |
||||
dnl This macro ensures that configuration tests done |
||||
dnl after this will execute with preprocessor symbol |
||||
dnl _THREAD_SAFE defined. This macro also ensures that |
||||
dnl the generated config file defines NEED_THREAD_SAFE |
||||
dnl and that in turn setup.h will define _THREAD_SAFE. |
||||
dnl Internal macro for CARES_CONFIGURE_THREAD_SAFE. |
||||
|
||||
AC_DEFUN([CARES_CONFIGURE_FROM_NOW_ON_WITH_THREAD_SAFE], [ |
||||
AC_DEFINE(NEED_THREAD_SAFE, 1, |
||||
[Define to 1 if _THREAD_SAFE preprocessor symbol must be defined.]) |
||||
cat >>confdefs.h <<_EOF |
||||
#ifndef _THREAD_SAFE |
||||
# define _THREAD_SAFE |
||||
#endif |
||||
_EOF |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CONFIGURE_REENTRANT |
||||
dnl ------------------------------------------------- |
||||
dnl This first checks if the preprocessor _REENTRANT |
||||
dnl symbol is already defined. If it isn't currently |
||||
dnl defined a set of checks are performed to verify |
||||
dnl if its definition is required to make visible to |
||||
dnl the compiler a set of *_r functions. Finally, if |
||||
dnl _REENTRANT is already defined or needed it takes |
||||
dnl care of making adjustments necessary to ensure |
||||
dnl that it is defined equally for further configure |
||||
dnl tests and generated config file. |
||||
|
||||
AC_DEFUN([CARES_CONFIGURE_REENTRANT], [ |
||||
AC_PREREQ([2.50])dnl |
||||
# |
||||
AC_MSG_CHECKING([if _REENTRANT is already defined]) |
||||
AC_COMPILE_IFELSE([ |
||||
AC_LANG_PROGRAM([[ |
||||
]],[[ |
||||
#ifdef _REENTRANT |
||||
int dummy=1; |
||||
#else |
||||
force compilation error |
||||
#endif |
||||
]]) |
||||
],[ |
||||
AC_MSG_RESULT([yes]) |
||||
tmp_reentrant_initially_defined="yes" |
||||
],[ |
||||
AC_MSG_RESULT([no]) |
||||
tmp_reentrant_initially_defined="no" |
||||
]) |
||||
# |
||||
if test "$tmp_reentrant_initially_defined" = "no"; then |
||||
AC_MSG_CHECKING([if _REENTRANT is actually needed]) |
||||
CARES_CHECK_NEED_REENTRANT_SYSTEM |
||||
if test "$tmp_need_reentrant" = "no"; then |
||||
CARES_CHECK_NEED_REENTRANT_ERRNO |
||||
fi |
||||
if test "$tmp_need_reentrant" = "no"; then |
||||
CARES_CHECK_NEED_REENTRANT_FUNCTIONS_R |
||||
fi |
||||
if test "$tmp_need_reentrant" = "yes"; then |
||||
AC_MSG_RESULT([yes]) |
||||
else |
||||
AC_MSG_RESULT([no]) |
||||
fi |
||||
fi |
||||
# |
||||
AC_MSG_CHECKING([if _REENTRANT is onwards defined]) |
||||
if test "$tmp_reentrant_initially_defined" = "yes" || |
||||
test "$tmp_need_reentrant" = "yes"; then |
||||
CARES_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT |
||||
AC_MSG_RESULT([yes]) |
||||
else |
||||
AC_MSG_RESULT([no]) |
||||
fi |
||||
# |
||||
]) |
||||
|
||||
|
||||
dnl CARES_CONFIGURE_THREAD_SAFE |
||||
dnl ------------------------------------------------- |
||||
dnl This first checks if the preprocessor _THREAD_SAFE |
||||
dnl symbol is already defined. If it isn't currently |
||||
dnl defined a set of checks are performed to verify |
||||
dnl if its definition is required. Finally, if |
||||
dnl _THREAD_SAFE is already defined or needed it takes |
||||
dnl care of making adjustments necessary to ensure |
||||
dnl that it is defined equally for further configure |
||||
dnl tests and generated config file. |
||||
|
||||
AC_DEFUN([CARES_CONFIGURE_THREAD_SAFE], [ |
||||
AC_PREREQ([2.50])dnl |
||||
# |
||||
AC_MSG_CHECKING([if _THREAD_SAFE is already defined]) |
||||
AC_COMPILE_IFELSE([ |
||||
AC_LANG_PROGRAM([[ |
||||
]],[[ |
||||
#ifdef _THREAD_SAFE |
||||
int dummy=1; |
||||
#else |
||||
force compilation error |
||||
#endif |
||||
]]) |
||||
],[ |
||||
AC_MSG_RESULT([yes]) |
||||
tmp_thread_safe_initially_defined="yes" |
||||
],[ |
||||
AC_MSG_RESULT([no]) |
||||
tmp_thread_safe_initially_defined="no" |
||||
]) |
||||
# |
||||
if test "$tmp_thread_safe_initially_defined" = "no"; then |
||||
AC_MSG_CHECKING([if _THREAD_SAFE is actually needed]) |
||||
CARES_CHECK_NEED_THREAD_SAFE_SYSTEM |
||||
if test "$tmp_need_thread_safe" = "yes"; then |
||||
AC_MSG_RESULT([yes]) |
||||
else |
||||
AC_MSG_RESULT([no]) |
||||
fi |
||||
fi |
||||
# |
||||
AC_MSG_CHECKING([if _THREAD_SAFE is onwards defined]) |
||||
if test "$tmp_thread_safe_initially_defined" = "yes" || |
||||
test "$tmp_need_thread_safe" = "yes"; then |
||||
CARES_CONFIGURE_FROM_NOW_ON_WITH_THREAD_SAFE |
||||
AC_MSG_RESULT([yes]) |
||||
else |
||||
AC_MSG_RESULT([no]) |
||||
fi |
||||
# |
||||
]) |
@ -1,254 +0,0 @@ |
||||
#--------------------------------------------------------------------------- |
||||
# |
||||
# xc-am-iface.m4 |
||||
# |
||||
# Copyright (c) Daniel Stenberg <daniel@haxx.se> |
||||
# |
||||
# Permission to use, copy, modify, and distribute this software for any |
||||
# purpose with or without fee is hereby granted, provided that the above |
||||
# copyright notice and this permission notice appear in all copies. |
||||
# |
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
||||
# |
||||
# SPDX-License-Identifier: MIT |
||||
#--------------------------------------------------------------------------- |
||||
|
||||
# serial 1 |
||||
|
||||
|
||||
dnl _XC_AUTOMAKE_BODY |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
dnl |
||||
dnl This macro performs embedding of automake initialization |
||||
dnl code into configure script. When automake version 1.14 or |
||||
dnl newer is used at configure script generation time, this |
||||
dnl results in 'subdir-objects' automake option being used. |
||||
dnl When using automake versions older than 1.14 this option |
||||
dnl is not used when generating configure script. |
||||
dnl |
||||
dnl Existence of automake _AM_PROG_CC_C_O m4 private macro |
||||
dnl is used to differentiate automake version 1.14 from older |
||||
dnl ones which lack this macro. |
||||
|
||||
m4_define([_XC_AUTOMAKE_BODY], |
||||
[dnl |
||||
## --------------------------------------- ## |
||||
## Start of automake initialization code ## |
||||
## --------------------------------------- ## |
||||
m4_ifdef([_AM_PROG_CC_C_O], |
||||
[ |
||||
AM_INIT_AUTOMAKE([subdir-objects]) |
||||
],[ |
||||
AM_INIT_AUTOMAKE |
||||
])dnl |
||||
## ------------------------------------- ## |
||||
## End of automake initialization code ## |
||||
## ------------------------------------- ## |
||||
dnl |
||||
m4_define([$0], [])[]dnl |
||||
]) |
||||
|
||||
|
||||
dnl XC_AUTOMAKE |
||||
dnl ------------------------------------------------- |
||||
dnl Public macro. |
||||
dnl |
||||
dnl This macro embeds automake machinery into configure |
||||
dnl script regardless of automake version used in order |
||||
dnl to generate configure script. |
||||
dnl |
||||
dnl When using automake version 1.14 or newer, automake |
||||
dnl initialization option 'subdir-objects' is used to |
||||
dnl generate the configure script, otherwise this option |
||||
dnl is not used. |
||||
|
||||
AC_DEFUN([XC_AUTOMAKE], |
||||
[dnl |
||||
AC_PREREQ([2.50])dnl |
||||
dnl |
||||
AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl |
||||
dnl |
||||
_XC_AUTOMAKE_BODY |
||||
dnl |
||||
m4_ifdef([AM_INIT_AUTOMAKE], |
||||
[m4_undefine([AM_INIT_AUTOMAKE])])dnl |
||||
dnl |
||||
m4_define([$0], [])[]dnl |
||||
]) |
||||
|
||||
|
||||
dnl _XC_AMEND_DISTCLEAN_BODY ([LIST-OF-SUBDIRS]) |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
dnl |
||||
dnl This macro performs shell code embedding into |
||||
dnl configure script in order to modify distclean |
||||
dnl and maintainer-clean targets of makefiles which |
||||
dnl are located in given list of subdirs. |
||||
dnl |
||||
dnl See XC_AMEND_DISTCLEAN comments for details. |
||||
|
||||
m4_define([_XC_AMEND_DISTCLEAN_BODY], |
||||
[dnl |
||||
## ---------------------------------- ## |
||||
## Start of distclean amending code ## |
||||
## ---------------------------------- ## |
||||
|
||||
for xc_subdir in [$1] |
||||
do |
||||
|
||||
if test ! -f "$xc_subdir/Makefile"; then |
||||
echo "$xc_msg_err $xc_subdir/Makefile file not found. $xc_msg_abrt" >&2 |
||||
exit 1 |
||||
fi |
||||
|
||||
# Fetch dependency tracking file list from Makefile include lines. |
||||
|
||||
xc_inc_lines=`grep '^include .*(DEPDIR)' "$xc_subdir/Makefile" 2>/dev/null` |
||||
xc_cnt_words=`echo "$xc_inc_lines" | wc -w | tr -d "$xc_space$xc_tab"` |
||||
|
||||
# --disable-dependency-tracking might have been used, consequently |
||||
# there is nothing to amend without a dependency tracking file list. |
||||
|
||||
if test $xc_cnt_words -gt 0; then |
||||
|
||||
AC_MSG_NOTICE([amending $xc_subdir/Makefile]) |
||||
|
||||
# Build Makefile specific patch hunk. |
||||
|
||||
xc_p="$xc_subdir/xc_patch.tmp" |
||||
|
||||
xc_rm_depfiles=`echo "$xc_inc_lines" \ |
||||
| $SED 's%include% -rm -f%' 2>/dev/null` |
||||
|
||||
xc_dep_subdirs=`echo "$xc_inc_lines" \ |
||||
| $SED 's%include[[ ]][[ ]]*%%' 2>/dev/null \ |
||||
| $SED 's%(DEPDIR)/.*%(DEPDIR)%' 2>/dev/null \ |
||||
| sort | uniq` |
||||
|
||||
echo "$xc_rm_depfiles" >$xc_p |
||||
|
||||
for xc_dep_dir in $xc_dep_subdirs; do |
||||
echo "${xc_tab}@xm_dep_cnt=\`ls $xc_dep_dir | wc -l 2>/dev/null\`; \\" >>$xc_p |
||||
echo "${xc_tab}if test \$\$xm_dep_cnt -eq 0 && test -d $xc_dep_dir; then \\" >>$xc_p |
||||
echo "${xc_tab} rm -rf $xc_dep_dir; \\" >>$xc_p |
||||
echo "${xc_tab}fi" >>$xc_p |
||||
done |
||||
|
||||
# Build Makefile patching sed scripts. |
||||
|
||||
xc_s1="$xc_subdir/xc_script_1.tmp" |
||||
xc_s2="$xc_subdir/xc_script_2.tmp" |
||||
xc_s3="$xc_subdir/xc_script_3.tmp" |
||||
|
||||
cat >$xc_s1 <<\_EOT |
||||
/^distclean[[ ]]*:/,/^[[^ ]][[^ ]]*:/{ |
||||
s/^.*(DEPDIR)/___xc_depdir_line___/ |
||||
} |
||||
/^maintainer-clean[[ ]]*:/,/^[[^ ]][[^ ]]*:/{ |
||||
s/^.*(DEPDIR)/___xc_depdir_line___/ |
||||
} |
||||
_EOT |
||||
|
||||
cat >$xc_s2 <<\_EOT |
||||
/___xc_depdir_line___$/{ |
||||
N |
||||
/___xc_depdir_line___$/D |
||||
} |
||||
_EOT |
||||
|
||||
cat >$xc_s3 <<_EOT |
||||
/^___xc_depdir_line___/{ |
||||
r $xc_p |
||||
d |
||||
} |
||||
_EOT |
||||
|
||||
# Apply patch to Makefile and cleanup. |
||||
|
||||
$SED -f "$xc_s1" "$xc_subdir/Makefile" >"$xc_subdir/Makefile.tmp1" |
||||
$SED -f "$xc_s2" "$xc_subdir/Makefile.tmp1" >"$xc_subdir/Makefile.tmp2" |
||||
$SED -f "$xc_s3" "$xc_subdir/Makefile.tmp2" >"$xc_subdir/Makefile.tmp3" |
||||
|
||||
if test -f "$xc_subdir/Makefile.tmp3"; then |
||||
mv -f "$xc_subdir/Makefile.tmp3" "$xc_subdir/Makefile" |
||||
fi |
||||
|
||||
test -f "$xc_subdir/Makefile.tmp1" && rm -f "$xc_subdir/Makefile.tmp1" |
||||
test -f "$xc_subdir/Makefile.tmp2" && rm -f "$xc_subdir/Makefile.tmp2" |
||||
test -f "$xc_subdir/Makefile.tmp3" && rm -f "$xc_subdir/Makefile.tmp3" |
||||
|
||||
test -f "$xc_p" && rm -f "$xc_p" |
||||
test -f "$xc_s1" && rm -f "$xc_s1" |
||||
test -f "$xc_s2" && rm -f "$xc_s2" |
||||
test -f "$xc_s3" && rm -f "$xc_s3" |
||||
|
||||
fi |
||||
|
||||
done |
||||
|
||||
## -------------------------------- ## |
||||
## End of distclean amending code ## |
||||
## -------------------------------- ## |
||||
dnl |
||||
m4_define([$0], [])[]dnl |
||||
]) |
||||
|
||||
|
||||
dnl XC_AMEND_DISTCLEAN ([LIST-OF-SUBDIRS]) |
||||
dnl ------------------------------------------------- |
||||
dnl Public macro. |
||||
dnl |
||||
dnl This macro embeds shell code into configure script |
||||
dnl that amends, at configure runtime, the distclean |
||||
dnl and maintainer-clean targets of Makefiles located |
||||
dnl in all subdirs given in the mandatory white-space |
||||
dnl separated list argument. |
||||
dnl |
||||
dnl Embedding only takes place when using automake 1.14 |
||||
dnl or newer, otherwise amending code is not included |
||||
dnl in generated configure script. |
||||
dnl |
||||
dnl distclean and maintainer-clean targets are modified |
||||
dnl to avoid unconditional removal of dependency subdirs |
||||
dnl which triggers distclean and maintainer-clean errors |
||||
dnl when using automake 'subdir-objects' option along |
||||
dnl with per-target objects and source files existing in |
||||
dnl multiple subdirs used for different build targets. |
||||
dnl |
||||
dnl New behavior first removes each dependency tracking |
||||
dnl file independently, and only removes each dependency |
||||
dnl subdir when it finds out that it no longer holds any |
||||
dnl dependency tracking file. |
||||
dnl |
||||
dnl When configure option --disable-dependency-tracking |
||||
dnl is used no amending takes place given that there are |
||||
dnl no dependency tracking files. |
||||
|
||||
AC_DEFUN([XC_AMEND_DISTCLEAN], |
||||
[dnl |
||||
AC_PREREQ([2.50])dnl |
||||
dnl |
||||
m4_ifdef([_AC_OUTPUT_MAIN_LOOP], |
||||
[m4_provide_if([_AC_OUTPUT_MAIN_LOOP], [], |
||||
[m4_fatal([call to AC_OUTPUT needed before $0])])])dnl |
||||
dnl |
||||
m4_if([$#], [1], [], [m4_fatal([$0: wrong number of arguments])])dnl |
||||
m4_if([$1], [], [m4_fatal([$0: missing argument])])dnl |
||||
dnl |
||||
AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl |
||||
dnl |
||||
m4_ifdef([_AM_PROG_CC_C_O], |
||||
[ |
||||
_XC_AMEND_DISTCLEAN_BODY([$1]) |
||||
])dnl |
||||
m4_define([$0], [])[]dnl |
||||
]) |
||||
|
@ -1,97 +0,0 @@ |
||||
#--------------------------------------------------------------------------- |
||||
# |
||||
# xc-cc-check.m4 |
||||
# |
||||
# Copyright (c) Daniel Stenberg <daniel@haxx.se> |
||||
# |
||||
# Permission to use, copy, modify, and distribute this software for any |
||||
# purpose with or without fee is hereby granted, provided that the above |
||||
# copyright notice and this permission notice appear in all copies. |
||||
# |
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
||||
# |
||||
# SPDX-License-Identifier: MIT |
||||
#--------------------------------------------------------------------------- |
||||
|
||||
# serial 1 |
||||
|
||||
|
||||
dnl _XC_PROG_CC_PREAMBLE |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
|
||||
AC_DEFUN([_XC_PROG_CC_PREAMBLE], [ |
||||
xc_prog_cc_prev_IFS=$IFS |
||||
xc_prog_cc_prev_LIBS=$LIBS |
||||
xc_prog_cc_prev_CFLAGS=$CFLAGS |
||||
xc_prog_cc_prev_LDFLAGS=$LDFLAGS |
||||
xc_prog_cc_prev_CPPFLAGS=$CPPFLAGS |
||||
]) |
||||
|
||||
|
||||
dnl _XC_PROG_CC_POSTLUDE |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
|
||||
AC_DEFUN([_XC_PROG_CC_POSTLUDE], [ |
||||
IFS=$xc_prog_cc_prev_IFS |
||||
LIBS=$xc_prog_cc_prev_LIBS |
||||
CFLAGS=$xc_prog_cc_prev_CFLAGS |
||||
LDFLAGS=$xc_prog_cc_prev_LDFLAGS |
||||
CPPFLAGS=$xc_prog_cc_prev_CPPFLAGS |
||||
AC_SUBST([CC])dnl |
||||
AC_SUBST([CPP])dnl |
||||
AC_SUBST([LIBS])dnl |
||||
AC_SUBST([CFLAGS])dnl |
||||
AC_SUBST([LDFLAGS])dnl |
||||
AC_SUBST([CPPFLAGS])dnl |
||||
]) |
||||
|
||||
|
||||
dnl _XC_PROG_CC |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
|
||||
AC_DEFUN([_XC_PROG_CC], [ |
||||
AC_REQUIRE([_XC_PROG_CC_PREAMBLE])dnl |
||||
AC_REQUIRE([XC_CHECK_BUILD_FLAGS])dnl |
||||
AC_REQUIRE([AC_PROG_INSTALL])dnl |
||||
AC_REQUIRE([AC_PROG_CC])dnl |
||||
AC_REQUIRE([AM_PROG_CC_C_O])dnl |
||||
AC_REQUIRE([AC_PROG_CPP])dnl |
||||
AC_REQUIRE([_XC_PROG_CC_POSTLUDE])dnl |
||||
]) |
||||
|
||||
|
||||
dnl XC_CHECK_PROG_CC |
||||
dnl ------------------------------------------------- |
||||
dnl Public macro. |
||||
dnl |
||||
dnl Checks for C compiler and C preprocessor programs, |
||||
dnl while doing some previous sanity validation on user |
||||
dnl provided LIBS, LDFLAGS, CPPFLAGS and CFLAGS values |
||||
dnl that must succeed in order to continue execution. |
||||
dnl |
||||
dnl This sets variables CC and CPP, while preventing |
||||
dnl LIBS, LDFLAGS, CFLAGS, CPPFLAGS and IFS from being |
||||
dnl unexpectedly changed by underlying macros. |
||||
|
||||
AC_DEFUN([XC_CHECK_PROG_CC], [ |
||||
AC_PREREQ([2.50])dnl |
||||
AC_BEFORE([$0],[_XC_PROG_CC_PREAMBLE])dnl |
||||
AC_BEFORE([$0],[AC_PROG_INSTALL])dnl |
||||
AC_BEFORE([$0],[AC_PROG_CC])dnl |
||||
AC_BEFORE([$0],[AM_PROG_CC_C_O])dnl |
||||
AC_BEFORE([$0],[AC_PROG_CPP])dnl |
||||
AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl |
||||
AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl |
||||
AC_BEFORE([$0],[_XC_PROG_CC_POSTLUDE])dnl |
||||
AC_REQUIRE([_XC_PROG_CC])dnl |
||||
]) |
||||
|
@ -1,467 +0,0 @@ |
||||
#--------------------------------------------------------------------------- |
||||
# |
||||
# xc-lt-iface.m4 |
||||
# |
||||
# Copyright (c) Daniel Stenberg <daniel@haxx.se> |
||||
# |
||||
# Permission to use, copy, modify, and distribute this software for any |
||||
# purpose with or without fee is hereby granted, provided that the above |
||||
# copyright notice and this permission notice appear in all copies. |
||||
# |
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
||||
# |
||||
# |
||||
# SPDX-License-Identifier: MIT |
||||
#--------------------------------------------------------------------------- |
||||
|
||||
# serial 1 |
||||
|
||||
|
||||
dnl _XC_LIBTOOL_PREAMBLE |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
dnl |
||||
dnl Checks some configure script options related with |
||||
dnl libtool and customizes its default behavior before |
||||
dnl libtool code is actually used in script. |
||||
|
||||
m4_define([_XC_LIBTOOL_PREAMBLE], |
||||
[dnl |
||||
# ------------------------------------ # |
||||
# Determine libtool default behavior # |
||||
# ------------------------------------ # |
||||
|
||||
# |
||||
# Default behavior is to enable shared and static libraries on systems |
||||
# where libtool knows how to build both library versions, and does not |
||||
# require separate configuration and build runs for each flavor. |
||||
# |
||||
|
||||
xc_lt_want_enable_shared='yes' |
||||
xc_lt_want_enable_static='yes' |
||||
|
||||
# |
||||
# User may have disabled shared or static libraries. |
||||
# |
||||
case "x$enable_shared" in @%:@ ( |
||||
xno) |
||||
xc_lt_want_enable_shared='no' |
||||
;; |
||||
esac |
||||
case "x$enable_static" in @%:@ ( |
||||
xno) |
||||
xc_lt_want_enable_static='no' |
||||
;; |
||||
esac |
||||
if test "x$xc_lt_want_enable_shared" = 'xno' && |
||||
test "x$xc_lt_want_enable_static" = 'xno'; then |
||||
AC_MSG_ERROR([can not disable shared and static libraries simultaneously]) |
||||
fi |
||||
|
||||
# |
||||
# Default behavior on systems that require independent configuration |
||||
# and build runs for shared and static is to enable shared libraries |
||||
# and disable static ones. On these systems option '--disable-shared' |
||||
# must be used in order to build a proper static library. |
||||
# |
||||
|
||||
if test "x$xc_lt_want_enable_shared" = 'xyes' && |
||||
test "x$xc_lt_want_enable_static" = 'xyes'; then |
||||
case $host_os in @%:@ ( |
||||
mingw* | pw32* | cegcc* | os2* | aix*) |
||||
xc_lt_want_enable_static='no' |
||||
;; |
||||
esac |
||||
fi |
||||
|
||||
# |
||||
# Make libtool aware of current shared and static library preferences |
||||
# taking in account that, depending on host characteristics, libtool |
||||
# may modify these option preferences later in this configure script. |
||||
# |
||||
|
||||
enable_shared=$xc_lt_want_enable_shared |
||||
enable_static=$xc_lt_want_enable_static |
||||
|
||||
# |
||||
# Default behavior is to build PIC objects for shared libraries and |
||||
# non-PIC objects for static libraries. |
||||
# |
||||
|
||||
xc_lt_want_with_pic='default' |
||||
|
||||
# |
||||
# User may have specified PIC preference. |
||||
# |
||||
|
||||
case "x$with_pic" in @%:@ (( |
||||
xno) |
||||
xc_lt_want_with_pic='no' |
||||
;; |
||||
xyes) |
||||
xc_lt_want_with_pic='yes' |
||||
;; |
||||
esac |
||||
|
||||
# |
||||
# Default behavior on some systems where building a shared library out |
||||
# of non-PIC compiled objects will fail with following linker error |
||||
# "relocation R_X86_64_32 can not be used when making a shared object" |
||||
# is to build PIC objects even for static libraries. This behavior may |
||||
# be overriden using 'configure --disable-shared --without-pic'. |
||||
# |
||||
|
||||
if test "x$xc_lt_want_with_pic" = 'xdefault'; then |
||||
case $host_cpu in @%:@ ( |
||||
x86_64 | amd64 | ia64) |
||||
case $host_os in @%:@ ( |
||||
linux* | freebsd*) |
||||
xc_lt_want_with_pic='yes' |
||||
;; |
||||
esac |
||||
;; |
||||
esac |
||||
fi |
||||
|
||||
# |
||||
# Make libtool aware of current PIC preference taking in account that, |
||||
# depending on host characteristics, libtool may modify PIC default |
||||
# behavior to fit host system idiosyncrasies later in this script. |
||||
# |
||||
|
||||
with_pic=$xc_lt_want_with_pic |
||||
dnl |
||||
m4_define([$0],[])dnl |
||||
]) |
||||
|
||||
|
||||
dnl _XC_LIBTOOL_BODY |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
dnl |
||||
dnl This macro performs embedding of libtool code into |
||||
dnl configure script, regardless of libtool version in |
||||
dnl use when generating configure script. |
||||
|
||||
m4_define([_XC_LIBTOOL_BODY], |
||||
[dnl |
||||
## ----------------------- ## |
||||
## Start of libtool code ## |
||||
## ----------------------- ## |
||||
m4_ifdef([LT_INIT], |
||||
[dnl |
||||
LT_INIT([win32-dll]) |
||||
],[dnl |
||||
AC_LIBTOOL_WIN32_DLL |
||||
AC_PROG_LIBTOOL |
||||
])dnl |
||||
## --------------------- ## |
||||
## End of libtool code ## |
||||
## --------------------- ## |
||||
dnl |
||||
m4_define([$0], [])[]dnl |
||||
]) |
||||
|
||||
|
||||
dnl _XC_CHECK_LT_BUILD_LIBRARIES |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
dnl |
||||
dnl Checks wether libtool shared and static libraries |
||||
dnl are finally built depending on user input, default |
||||
dnl behavior and knowledge that libtool has about host |
||||
dnl characteristics. |
||||
dnl Results stored in following shell variables: |
||||
dnl xc_lt_build_shared |
||||
dnl xc_lt_build_static |
||||
|
||||
m4_define([_XC_CHECK_LT_BUILD_LIBRARIES], |
||||
[dnl |
||||
# |
||||
# Verify if finally libtool shared libraries will be built |
||||
# |
||||
|
||||
case "x$enable_shared" in @%:@ (( |
||||
xyes | xno) |
||||
xc_lt_build_shared=$enable_shared |
||||
;; |
||||
*) |
||||
AC_MSG_ERROR([unexpected libtool enable_shared value: $enable_shared]) |
||||
;; |
||||
esac |
||||
|
||||
# |
||||
# Verify if finally libtool static libraries will be built |
||||
# |
||||
|
||||
case "x$enable_static" in @%:@ (( |
||||
xyes | xno) |
||||
xc_lt_build_static=$enable_static |
||||
;; |
||||
*) |
||||
AC_MSG_ERROR([unexpected libtool enable_static value: $enable_static]) |
||||
;; |
||||
esac |
||||
dnl |
||||
m4_define([$0],[])dnl |
||||
]) |
||||
|
||||
|
||||
dnl _XC_CHECK_LT_SHLIB_USE_VERSION_INFO |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
dnl |
||||
dnl Checks if the -version-info linker flag must be |
||||
dnl provided when building libtool shared libraries. |
||||
dnl Result stored in xc_lt_shlib_use_version_info. |
||||
|
||||
m4_define([_XC_CHECK_LT_SHLIB_USE_VERSION_INFO], |
||||
[dnl |
||||
# |
||||
# Verify if libtool shared libraries should be linked using flag -version-info |
||||
# |
||||
|
||||
AC_MSG_CHECKING([whether to build shared libraries with -version-info]) |
||||
xc_lt_shlib_use_version_info='yes' |
||||
if test "x$version_type" = 'xnone'; then |
||||
xc_lt_shlib_use_version_info='no' |
||||
fi |
||||
case $host_os in @%:@ ( |
||||
amigaos*) |
||||
xc_lt_shlib_use_version_info='yes' |
||||
;; |
||||
esac |
||||
AC_MSG_RESULT([$xc_lt_shlib_use_version_info]) |
||||
dnl |
||||
m4_define([$0], [])[]dnl |
||||
]) |
||||
|
||||
|
||||
dnl _XC_CHECK_LT_SHLIB_USE_NO_UNDEFINED |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
dnl |
||||
dnl Checks if the -no-undefined linker flag must be |
||||
dnl provided when building libtool shared libraries. |
||||
dnl Result stored in xc_lt_shlib_use_no_undefined. |
||||
|
||||
m4_define([_XC_CHECK_LT_SHLIB_USE_NO_UNDEFINED], |
||||
[dnl |
||||
# |
||||
# Verify if libtool shared libraries should be linked using flag -no-undefined |
||||
# |
||||
|
||||
AC_MSG_CHECKING([whether to build shared libraries with -no-undefined]) |
||||
xc_lt_shlib_use_no_undefined='no' |
||||
if test "x$allow_undefined" = 'xno'; then |
||||
xc_lt_shlib_use_no_undefined='yes' |
||||
elif test "x$allow_undefined_flag" = 'xunsupported'; then |
||||
xc_lt_shlib_use_no_undefined='yes' |
||||
fi |
||||
case $host_os in @%:@ ( |
||||
cygwin* | mingw* | pw32* | cegcc* | os2* | aix*) |
||||
xc_lt_shlib_use_no_undefined='yes' |
||||
;; |
||||
esac |
||||
AC_MSG_RESULT([$xc_lt_shlib_use_no_undefined]) |
||||
dnl |
||||
m4_define([$0], [])[]dnl |
||||
]) |
||||
|
||||
|
||||
dnl _XC_CHECK_LT_SHLIB_USE_MIMPURE_TEXT |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
dnl |
||||
dnl Checks if the -mimpure-text linker flag must be |
||||
dnl provided when building libtool shared libraries. |
||||
dnl Result stored in xc_lt_shlib_use_mimpure_text. |
||||
|
||||
m4_define([_XC_CHECK_LT_SHLIB_USE_MIMPURE_TEXT], |
||||
[dnl |
||||
# |
||||
# Verify if libtool shared libraries should be linked using flag -mimpure-text |
||||
# |
||||
|
||||
AC_MSG_CHECKING([whether to build shared libraries with -mimpure-text]) |
||||
xc_lt_shlib_use_mimpure_text='no' |
||||
case $host_os in @%:@ ( |
||||
solaris2*) |
||||
if test "x$GCC" = 'xyes'; then |
||||
xc_lt_shlib_use_mimpure_text='yes' |
||||
fi |
||||
;; |
||||
esac |
||||
AC_MSG_RESULT([$xc_lt_shlib_use_mimpure_text]) |
||||
dnl |
||||
m4_define([$0], [])[]dnl |
||||
]) |
||||
|
||||
|
||||
dnl _XC_CHECK_LT_BUILD_WITH_PIC |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
dnl |
||||
dnl Checks wether libtool shared and static libraries |
||||
dnl would be built with PIC depending on user input, |
||||
dnl default behavior and knowledge that libtool has |
||||
dnl about host characteristics. |
||||
dnl Results stored in following shell variables: |
||||
dnl xc_lt_build_shared_with_pic |
||||
dnl xc_lt_build_static_with_pic |
||||
|
||||
m4_define([_XC_CHECK_LT_BUILD_WITH_PIC], |
||||
[dnl |
||||
# |
||||
# Find out wether libtool libraries would be built wit PIC |
||||
# |
||||
|
||||
case "x$pic_mode" in @%:@ (((( |
||||
xdefault) |
||||
xc_lt_build_shared_with_pic='yes' |
||||
xc_lt_build_static_with_pic='no' |
||||
;; |
||||
xyes) |
||||
xc_lt_build_shared_with_pic='yes' |
||||
xc_lt_build_static_with_pic='yes' |
||||
;; |
||||
xno) |
||||
xc_lt_build_shared_with_pic='no' |
||||
xc_lt_build_static_with_pic='no' |
||||
;; |
||||
*) |
||||
xc_lt_build_shared_with_pic='unknown' |
||||
xc_lt_build_static_with_pic='unknown' |
||||
AC_MSG_WARN([unexpected libtool pic_mode value: $pic_mode]) |
||||
;; |
||||
esac |
||||
AC_MSG_CHECKING([whether to build shared libraries with PIC]) |
||||
AC_MSG_RESULT([$xc_lt_build_shared_with_pic]) |
||||
AC_MSG_CHECKING([whether to build static libraries with PIC]) |
||||
AC_MSG_RESULT([$xc_lt_build_static_with_pic]) |
||||
dnl |
||||
m4_define([$0],[])dnl |
||||
]) |
||||
|
||||
|
||||
dnl _XC_CHECK_LT_BUILD_SINGLE_VERSION |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
dnl |
||||
dnl Checks wether a libtool shared or static library |
||||
dnl is finally built exclusively without the other. |
||||
dnl Results stored in following shell variables: |
||||
dnl xc_lt_build_shared_only |
||||
dnl xc_lt_build_static_only |
||||
|
||||
m4_define([_XC_CHECK_LT_BUILD_SINGLE_VERSION], |
||||
[dnl |
||||
# |
||||
# Verify if libtool shared libraries will be built while static not built |
||||
# |
||||
|
||||
AC_MSG_CHECKING([whether to build shared libraries only]) |
||||
if test "$xc_lt_build_shared" = 'yes' && |
||||
test "$xc_lt_build_static" = 'no'; then |
||||
xc_lt_build_shared_only='yes' |
||||
else |
||||
xc_lt_build_shared_only='no' |
||||
fi |
||||
AC_MSG_RESULT([$xc_lt_build_shared_only]) |
||||
|
||||
# |
||||
# Verify if libtool static libraries will be built while shared not built |
||||
# |
||||
|
||||
AC_MSG_CHECKING([whether to build static libraries only]) |
||||
if test "$xc_lt_build_static" = 'yes' && |
||||
test "$xc_lt_build_shared" = 'no'; then |
||||
xc_lt_build_static_only='yes' |
||||
else |
||||
xc_lt_build_static_only='no' |
||||
fi |
||||
AC_MSG_RESULT([$xc_lt_build_static_only]) |
||||
dnl |
||||
m4_define([$0],[])dnl |
||||
]) |
||||
|
||||
|
||||
dnl _XC_LIBTOOL_POSTLUDE |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
dnl |
||||
dnl Performs several checks related with libtool that |
||||
dnl can not be done unless libtool code has already |
||||
dnl been executed. See individual check descriptions |
||||
dnl for further info. |
||||
|
||||
m4_define([_XC_LIBTOOL_POSTLUDE], |
||||
[dnl |
||||
_XC_CHECK_LT_BUILD_LIBRARIES |
||||
_XC_CHECK_LT_SHLIB_USE_VERSION_INFO |
||||
_XC_CHECK_LT_SHLIB_USE_NO_UNDEFINED |
||||
_XC_CHECK_LT_SHLIB_USE_MIMPURE_TEXT |
||||
_XC_CHECK_LT_BUILD_WITH_PIC |
||||
_XC_CHECK_LT_BUILD_SINGLE_VERSION |
||||
dnl |
||||
m4_define([$0],[])dnl |
||||
]) |
||||
|
||||
|
||||
dnl XC_LIBTOOL |
||||
dnl ------------------------------------------------- |
||||
dnl Public macro. |
||||
dnl |
||||
dnl This macro embeds libtool machinery into configure |
||||
dnl script, regardless of libtool version, and performs |
||||
dnl several additional checks whose results can be used |
||||
dnl later on. |
||||
dnl |
||||
dnl Usage of this macro ensures that generated configure |
||||
dnl script uses equivalent logic irrespective of autoconf |
||||
dnl or libtool version being used to generate configure |
||||
dnl script. |
||||
dnl |
||||
dnl Results stored in following shell variables: |
||||
dnl xc_lt_build_shared |
||||
dnl xc_lt_build_static |
||||
dnl xc_lt_shlib_use_version_info |
||||
dnl xc_lt_shlib_use_no_undefined |
||||
dnl xc_lt_shlib_use_mimpure_text |
||||
dnl xc_lt_build_shared_with_pic |
||||
dnl xc_lt_build_static_with_pic |
||||
dnl xc_lt_build_shared_only |
||||
dnl xc_lt_build_static_only |
||||
|
||||
AC_DEFUN([XC_LIBTOOL], |
||||
[dnl |
||||
AC_PREREQ([2.50])dnl |
||||
dnl |
||||
AC_BEFORE([$0],[LT_INIT])dnl |
||||
AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl |
||||
AC_BEFORE([$0],[AC_LIBTOOL_WIN32_DLL])dnl |
||||
dnl |
||||
AC_REQUIRE([XC_CHECK_PATH_SEPARATOR])dnl |
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl |
||||
AC_REQUIRE([AC_PROG_CC])dnl |
||||
dnl |
||||
_XC_LIBTOOL_PREAMBLE |
||||
_XC_LIBTOOL_BODY |
||||
_XC_LIBTOOL_POSTLUDE |
||||
dnl |
||||
m4_ifdef([AC_LIBTOOL_WIN32_DLL], |
||||
[m4_undefine([AC_LIBTOOL_WIN32_DLL])])dnl |
||||
m4_ifdef([AC_PROG_LIBTOOL], |
||||
[m4_undefine([AC_PROG_LIBTOOL])])dnl |
||||
m4_ifdef([LT_INIT], |
||||
[m4_undefine([LT_INIT])])dnl |
||||
dnl |
||||
m4_define([$0],[])dnl |
||||
]) |
||||
|
@ -1,166 +0,0 @@ |
||||
#--------------------------------------------------------------------------- |
||||
# |
||||
# xc-translit.m4 |
||||
# |
||||
# Copyright (c) Daniel Stenberg <daniel@haxx.se> |
||||
# |
||||
# Permission to use, copy, modify, and distribute this software for any |
||||
# purpose with or without fee is hereby granted, provided that the above |
||||
# copyright notice and this permission notice appear in all copies. |
||||
# |
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
||||
# |
||||
# |
||||
# SPDX-License-Identifier: MIT |
||||
#--------------------------------------------------------------------------- |
||||
|
||||
# File version for 'aclocal' use. Keep it a single number. |
||||
# serial 2 |
||||
|
||||
|
||||
dnl XC_SH_TR_SH (expression) |
||||
dnl ------------------------------------------------- |
||||
dnl Shell execution time transliteration of 'expression' |
||||
dnl argument, where all non-alfanumeric characters are |
||||
dnl converted to the underscore '_' character. |
||||
dnl Normal shell expansion and substitution takes place |
||||
dnl for given 'expression' at shell execution time before |
||||
dnl transliteration is applied to it. |
||||
|
||||
AC_DEFUN([XC_SH_TR_SH], |
||||
[`echo "$1" | sed 's/[[^a-zA-Z0-9_]]/_/g'`]) |
||||
|
||||
|
||||
dnl XC_SH_TR_SH_EX (expression, [extra]) |
||||
dnl ------------------------------------------------- |
||||
dnl Like XC_SH_TR_SH but transliterating characters |
||||
dnl given in 'extra' argument to lowercase 'p'. For |
||||
dnl example [*+], [*], and [+] are valid 'extra' args. |
||||
|
||||
AC_DEFUN([XC_SH_TR_SH_EX], |
||||
[ifelse([$2], [], |
||||
[XC_SH_TR_SH([$1])], |
||||
[`echo "$1" | sed 's/[[$2]]/p/g' | sed 's/[[^a-zA-Z0-9_]]/_/g'`])]) |
||||
|
||||
|
||||
dnl XC_M4_TR_SH (expression) |
||||
dnl ------------------------------------------------- |
||||
dnl m4 execution time transliteration of 'expression' |
||||
dnl argument, where all non-alfanumeric characters are |
||||
dnl converted to the underscore '_' character. |
||||
|
||||
AC_DEFUN([XC_M4_TR_SH], |
||||
[patsubst(XC_QPATSUBST(XC_QUOTE($1), |
||||
[[^a-zA-Z0-9_]], [_]), |
||||
[\(_\(.*\)_\)], [\2])]) |
||||
|
||||
|
||||
dnl XC_M4_TR_SH_EX (expression, [extra]) |
||||
dnl ------------------------------------------------- |
||||
dnl Like XC_M4_TR_SH but transliterating characters |
||||
dnl given in 'extra' argument to lowercase 'p'. For |
||||
dnl example [*+], [*], and [+] are valid 'extra' args. |
||||
|
||||
AC_DEFUN([XC_M4_TR_SH_EX], |
||||
[ifelse([$2], [], |
||||
[XC_M4_TR_SH([$1])], |
||||
[patsubst(XC_QPATSUBST(XC_QPATSUBST(XC_QUOTE($1), |
||||
[[$2]], |
||||
[p]), |
||||
[[^a-zA-Z0-9_]], [_]), |
||||
[\(_\(.*\)_\)], [\2])])]) |
||||
|
||||
|
||||
dnl XC_SH_TR_CPP (expression) |
||||
dnl ------------------------------------------------- |
||||
dnl Shell execution time transliteration of 'expression' |
||||
dnl argument, where all non-alfanumeric characters are |
||||
dnl converted to the underscore '_' character and alnum |
||||
dnl characters are converted to uppercase. |
||||
dnl Normal shell expansion and substitution takes place |
||||
dnl for given 'expression' at shell execution time before |
||||
dnl transliteration is applied to it. |
||||
|
||||
AC_DEFUN([XC_SH_TR_CPP], |
||||
[`echo "$1" | dnl |
||||
sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' | dnl |
||||
sed 's/[[^A-Z0-9_]]/_/g'`]) |
||||
|
||||
|
||||
dnl XC_SH_TR_CPP_EX (expression, [extra]) |
||||
dnl ------------------------------------------------- |
||||
dnl Like XC_SH_TR_CPP but transliterating characters |
||||
dnl given in 'extra' argument to uppercase 'P'. For |
||||
dnl example [*+], [*], and [+] are valid 'extra' args. |
||||
|
||||
AC_DEFUN([XC_SH_TR_CPP_EX], |
||||
[ifelse([$2], [], |
||||
[XC_SH_TR_CPP([$1])], |
||||
[`echo "$1" | dnl |
||||
sed 's/[[$2]]/P/g' | dnl |
||||
sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' | dnl |
||||
sed 's/[[^A-Z0-9_]]/_/g'`])]) |
||||
|
||||
|
||||
dnl XC_M4_TR_CPP (expression) |
||||
dnl ------------------------------------------------- |
||||
dnl m4 execution time transliteration of 'expression' |
||||
dnl argument, where all non-alfanumeric characters are |
||||
dnl converted to the underscore '_' character and alnum |
||||
dnl characters are converted to uppercase. |
||||
|
||||
AC_DEFUN([XC_M4_TR_CPP], |
||||
[patsubst(XC_QPATSUBST(XC_QTRANSLIT(XC_QUOTE($1), |
||||
[abcdefghijklmnopqrstuvwxyz], |
||||
[ABCDEFGHIJKLMNOPQRSTUVWXYZ]), |
||||
[[^A-Z0-9_]], [_]), |
||||
[\(_\(.*\)_\)], [\2])]) |
||||
|
||||
|
||||
dnl XC_M4_TR_CPP_EX (expression, [extra]) |
||||
dnl ------------------------------------------------- |
||||
dnl Like XC_M4_TR_CPP but transliterating characters |
||||
dnl given in 'extra' argument to uppercase 'P'. For |
||||
dnl example [*+], [*], and [+] are valid 'extra' args. |
||||
|
||||
AC_DEFUN([XC_M4_TR_CPP_EX], |
||||
[ifelse([$2], [], |
||||
[XC_M4_TR_CPP([$1])], |
||||
[patsubst(XC_QPATSUBST(XC_QTRANSLIT(XC_QPATSUBST(XC_QUOTE($1), |
||||
[[$2]], |
||||
[P]), |
||||
[abcdefghijklmnopqrstuvwxyz], |
||||
[ABCDEFGHIJKLMNOPQRSTUVWXYZ]), |
||||
[[^A-Z0-9_]], [_]), |
||||
[\(_\(.*\)_\)], [\2])])]) |
||||
|
||||
|
||||
dnl XC_QUOTE (expression) |
||||
dnl ------------------------------------------------- |
||||
dnl Expands to quoted result of 'expression' expansion. |
||||
|
||||
AC_DEFUN([XC_QUOTE], |
||||
[[$@]]) |
||||
|
||||
|
||||
dnl XC_QPATSUBST (string, regexp[, repl]) |
||||
dnl ------------------------------------------------- |
||||
dnl Expands to quoted result of 'patsubst' expansion. |
||||
|
||||
AC_DEFUN([XC_QPATSUBST], |
||||
[XC_QUOTE(patsubst([$1], [$2], [$3]))]) |
||||
|
||||
|
||||
dnl XC_QTRANSLIT (string, chars, repl) |
||||
dnl ------------------------------------------------- |
||||
dnl Expands to quoted result of 'translit' expansion. |
||||
|
||||
AC_DEFUN([XC_QTRANSLIT], |
||||
[XC_QUOTE(translit([$1], [$2], [$3]))]) |
||||
|
@ -1,245 +0,0 @@ |
||||
#--------------------------------------------------------------------------- |
||||
# |
||||
# xc-val-flgs.m4 |
||||
# |
||||
# Copyright (c) Daniel Stenberg <daniel@haxx.se> |
||||
# |
||||
# Permission to use, copy, modify, and distribute this software for any |
||||
# purpose with or without fee is hereby granted, provided that the above |
||||
# copyright notice and this permission notice appear in all copies. |
||||
# |
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
||||
# |
||||
# |
||||
# SPDX-License-Identifier: MIT |
||||
#--------------------------------------------------------------------------- |
||||
|
||||
# serial 1 |
||||
|
||||
|
||||
dnl _XC_CHECK_VAR_LIBS |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
|
||||
AC_DEFUN([_XC_CHECK_VAR_LIBS], [ |
||||
xc_bad_var_libs=no |
||||
for xc_word in $LIBS; do |
||||
case "$xc_word" in |
||||
-l* | --library=*) |
||||
: |
||||
;; |
||||
*) |
||||
xc_bad_var_libs=yes |
||||
;; |
||||
esac |
||||
done |
||||
if test $xc_bad_var_libs = yes; then |
||||
AC_MSG_NOTICE([using LIBS: $LIBS]) |
||||
AC_MSG_NOTICE([LIBS error: LIBS may only be used to specify libraries (-lname).]) |
||||
fi |
||||
]) |
||||
|
||||
|
||||
dnl _XC_CHECK_VAR_LDFLAGS |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
|
||||
AC_DEFUN([_XC_CHECK_VAR_LDFLAGS], [ |
||||
xc_bad_var_ldflags=no |
||||
for xc_word in $LDFLAGS; do |
||||
case "$xc_word" in |
||||
-D*) |
||||
xc_bad_var_ldflags=yes |
||||
;; |
||||
-U*) |
||||
xc_bad_var_ldflags=yes |
||||
;; |
||||
-I*) |
||||
xc_bad_var_ldflags=yes |
||||
;; |
||||
-l* | --library=*) |
||||
xc_bad_var_ldflags=yes |
||||
;; |
||||
esac |
||||
done |
||||
if test $xc_bad_var_ldflags = yes; then |
||||
AC_MSG_NOTICE([using LDFLAGS: $LDFLAGS]) |
||||
xc_bad_var_msg="LDFLAGS error: LDFLAGS may only be used to specify linker flags, not" |
||||
for xc_word in $LDFLAGS; do |
||||
case "$xc_word" in |
||||
-D*) |
||||
AC_MSG_NOTICE([$xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word]) |
||||
;; |
||||
-U*) |
||||
AC_MSG_NOTICE([$xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word]) |
||||
;; |
||||
-I*) |
||||
AC_MSG_NOTICE([$xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word]) |
||||
;; |
||||
-l* | --library=*) |
||||
AC_MSG_NOTICE([$xc_bad_var_msg libraries. Use LIBS for: $xc_word]) |
||||
;; |
||||
esac |
||||
done |
||||
fi |
||||
]) |
||||
|
||||
|
||||
dnl _XC_CHECK_VAR_CPPFLAGS |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
|
||||
AC_DEFUN([_XC_CHECK_VAR_CPPFLAGS], [ |
||||
xc_bad_var_cppflags=no |
||||
for xc_word in $CPPFLAGS; do |
||||
case "$xc_word" in |
||||
-rpath*) |
||||
xc_bad_var_cppflags=yes |
||||
;; |
||||
-L* | --library-path=*) |
||||
xc_bad_var_cppflags=yes |
||||
;; |
||||
-l* | --library=*) |
||||
xc_bad_var_cppflags=yes |
||||
;; |
||||
esac |
||||
done |
||||
if test $xc_bad_var_cppflags = yes; then |
||||
AC_MSG_NOTICE([using CPPFLAGS: $CPPFLAGS]) |
||||
xc_bad_var_msg="CPPFLAGS error: CPPFLAGS may only be used to specify C preprocessor flags, not" |
||||
for xc_word in $CPPFLAGS; do |
||||
case "$xc_word" in |
||||
-rpath*) |
||||
AC_MSG_NOTICE([$xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word]) |
||||
;; |
||||
-L* | --library-path=*) |
||||
AC_MSG_NOTICE([$xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word]) |
||||
;; |
||||
-l* | --library=*) |
||||
AC_MSG_NOTICE([$xc_bad_var_msg libraries. Use LIBS for: $xc_word]) |
||||
;; |
||||
esac |
||||
done |
||||
fi |
||||
]) |
||||
|
||||
|
||||
dnl _XC_CHECK_VAR_CFLAGS |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
|
||||
AC_DEFUN([_XC_CHECK_VAR_CFLAGS], [ |
||||
xc_bad_var_cflags=no |
||||
for xc_word in $CFLAGS; do |
||||
case "$xc_word" in |
||||
-D*) |
||||
xc_bad_var_cflags=yes |
||||
;; |
||||
-U*) |
||||
xc_bad_var_cflags=yes |
||||
;; |
||||
-I*) |
||||
xc_bad_var_cflags=yes |
||||
;; |
||||
-rpath*) |
||||
xc_bad_var_cflags=yes |
||||
;; |
||||
-L* | --library-path=*) |
||||
xc_bad_var_cflags=yes |
||||
;; |
||||
-l* | --library=*) |
||||
xc_bad_var_cflags=yes |
||||
;; |
||||
esac |
||||
done |
||||
if test $xc_bad_var_cflags = yes; then |
||||
AC_MSG_NOTICE([using CFLAGS: $CFLAGS]) |
||||
xc_bad_var_msg="CFLAGS error: CFLAGS may only be used to specify C compiler flags, not" |
||||
for xc_word in $CFLAGS; do |
||||
case "$xc_word" in |
||||
-D*) |
||||
AC_MSG_NOTICE([$xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word]) |
||||
;; |
||||
-U*) |
||||
AC_MSG_NOTICE([$xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word]) |
||||
;; |
||||
-I*) |
||||
AC_MSG_NOTICE([$xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word]) |
||||
;; |
||||
-rpath*) |
||||
AC_MSG_NOTICE([$xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word]) |
||||
;; |
||||
-L* | --library-path=*) |
||||
AC_MSG_NOTICE([$xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word]) |
||||
;; |
||||
-l* | --library=*) |
||||
AC_MSG_NOTICE([$xc_bad_var_msg libraries. Use LIBS for: $xc_word]) |
||||
;; |
||||
esac |
||||
done |
||||
fi |
||||
]) |
||||
|
||||
|
||||
dnl XC_CHECK_USER_FLAGS |
||||
dnl ------------------------------------------------- |
||||
dnl Public macro. |
||||
dnl |
||||
dnl Performs some sanity checks for LIBS, LDFLAGS, |
||||
dnl CPPFLAGS and CFLAGS values that the user might |
||||
dnl have set. When checks fails, user is noticed |
||||
dnl about errors detected in all of them and script |
||||
dnl execution is halted. |
||||
dnl |
||||
dnl Intended to be used early in configure script. |
||||
|
||||
AC_DEFUN([XC_CHECK_USER_FLAGS], [ |
||||
AC_PREREQ([2.50])dnl |
||||
AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl |
||||
dnl check order below matters |
||||
_XC_CHECK_VAR_LIBS |
||||
_XC_CHECK_VAR_LDFLAGS |
||||
_XC_CHECK_VAR_CPPFLAGS |
||||
_XC_CHECK_VAR_CFLAGS |
||||
if test $xc_bad_var_libs = yes || |
||||
test $xc_bad_var_cflags = yes || |
||||
test $xc_bad_var_ldflags = yes || |
||||
test $xc_bad_var_cppflags = yes; then |
||||
AC_MSG_ERROR([Can not continue. Fix errors mentioned immediately above this line.]) |
||||
fi |
||||
]) |
||||
|
||||
|
||||
dnl XC_CHECK_BUILD_FLAGS |
||||
dnl ------------------------------------------------- |
||||
dnl Public macro. |
||||
dnl |
||||
dnl Performs some sanity checks for LIBS, LDFLAGS, |
||||
dnl CPPFLAGS and CFLAGS values that the configure |
||||
dnl script might have set. When checks fails, user |
||||
dnl is noticed about errors detected in all of them |
||||
dnl but script continues execution. |
||||
dnl |
||||
dnl Intended to be used very late in configure script. |
||||
|
||||
AC_DEFUN([XC_CHECK_BUILD_FLAGS], [ |
||||
AC_PREREQ([2.50])dnl |
||||
dnl check order below matters |
||||
_XC_CHECK_VAR_LIBS |
||||
_XC_CHECK_VAR_LDFLAGS |
||||
_XC_CHECK_VAR_CPPFLAGS |
||||
_XC_CHECK_VAR_CFLAGS |
||||
if test $xc_bad_var_libs = yes || |
||||
test $xc_bad_var_cflags = yes || |
||||
test $xc_bad_var_ldflags = yes || |
||||
test $xc_bad_var_cppflags = yes; then |
||||
AC_MSG_WARN([Continuing even with errors mentioned immediately above this line.]) |
||||
fi |
||||
]) |
||||
|
@ -1,669 +0,0 @@ |
||||
#--------------------------------------------------------------------------- |
||||
# |
||||
# zz40-xc-ovr.m4 |
||||
# |
||||
# Copyright (c) Daniel Stenberg <daniel@haxx.se> |
||||
# |
||||
# Permission to use, copy, modify, and distribute this software for any |
||||
# purpose with or without fee is hereby granted, provided that the above |
||||
# copyright notice and this permission notice appear in all copies. |
||||
# |
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
||||
# |
||||
# SPDX-License-Identifier: MIT |
||||
#--------------------------------------------------------------------------- |
||||
|
||||
# serial 1 |
||||
|
||||
|
||||
dnl The funny name of this file is intentional in order to make it |
||||
dnl sort alphabetically after any libtool, autoconf or automake |
||||
dnl provided .m4 macro file that might get copied into this same |
||||
dnl subdirectory. This allows that macro (re)definitions from this |
||||
dnl file may override those provided in other files. |
||||
|
||||
|
||||
dnl Version macros |
||||
dnl ------------------------------------------------- |
||||
dnl Public macros. |
||||
|
||||
m4_define([XC_CONFIGURE_PREAMBLE_VER_MAJOR],[1])dnl |
||||
m4_define([XC_CONFIGURE_PREAMBLE_VER_MINOR],[0])dnl |
||||
|
||||
|
||||
dnl _XC_CFG_PRE_PREAMBLE |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
|
||||
AC_DEFUN([_XC_CFG_PRE_PREAMBLE], |
||||
[ |
||||
## -------------------------------- ## |
||||
@%:@@%:@ [XC_CONFIGURE_PREAMBLE] ver: []dnl |
||||
XC_CONFIGURE_PREAMBLE_VER_MAJOR.[]dnl |
||||
XC_CONFIGURE_PREAMBLE_VER_MINOR ## |
||||
## -------------------------------- ## |
||||
|
||||
xc_configure_preamble_ver_major='XC_CONFIGURE_PREAMBLE_VER_MAJOR' |
||||
xc_configure_preamble_ver_minor='XC_CONFIGURE_PREAMBLE_VER_MINOR' |
||||
|
||||
# |
||||
# Set IFS to space, tab and newline. |
||||
# |
||||
|
||||
xc_space=' ' |
||||
xc_tab=' ' |
||||
xc_newline=' |
||||
' |
||||
IFS="$xc_space$xc_tab$xc_newline" |
||||
|
||||
# |
||||
# Set internationalization behavior variables. |
||||
# |
||||
|
||||
LANG='C' |
||||
LC_ALL='C' |
||||
LANGUAGE='C' |
||||
export LANG |
||||
export LC_ALL |
||||
export LANGUAGE |
||||
|
||||
# |
||||
# Some useful variables. |
||||
# |
||||
|
||||
xc_msg_warn='configure: WARNING:' |
||||
xc_msg_abrt='Can not continue.' |
||||
xc_msg_err='configure: error:' |
||||
]) |
||||
|
||||
|
||||
dnl _XC_CFG_PRE_BASIC_CHK_CMD_ECHO |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
dnl |
||||
dnl Emits shell code that verifies that 'echo' command |
||||
dnl is available, otherwise aborts execution. |
||||
|
||||
AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO], |
||||
[dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_PREAMBLE])dnl |
||||
# |
||||
# Verify that 'echo' command is available, otherwise abort. |
||||
# |
||||
|
||||
xc_tst_str='unknown' |
||||
(`echo "$xc_tst_str" >/dev/null 2>&1`) && xc_tst_str='success' |
||||
case "x$xc_tst_str" in @%:@ (( |
||||
xsuccess) |
||||
: |
||||
;; |
||||
*) |
||||
# Try built-in echo, and fail. |
||||
echo "$xc_msg_err 'echo' command not found. $xc_msg_abrt" >&2 |
||||
exit 1 |
||||
;; |
||||
esac |
||||
]) |
||||
|
||||
|
||||
dnl _XC_CFG_PRE_BASIC_CHK_CMD_TEST |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
dnl |
||||
dnl Emits shell code that verifies that 'test' command |
||||
dnl is available, otherwise aborts execution. |
||||
|
||||
AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_CMD_TEST], |
||||
[dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO])dnl |
||||
# |
||||
# Verify that 'test' command is available, otherwise abort. |
||||
# |
||||
|
||||
xc_tst_str='unknown' |
||||
(`test -n "$xc_tst_str" >/dev/null 2>&1`) && xc_tst_str='success' |
||||
case "x$xc_tst_str" in @%:@ (( |
||||
xsuccess) |
||||
: |
||||
;; |
||||
*) |
||||
echo "$xc_msg_err 'test' command not found. $xc_msg_abrt" >&2 |
||||
exit 1 |
||||
;; |
||||
esac |
||||
]) |
||||
|
||||
|
||||
dnl _XC_CFG_PRE_BASIC_CHK_VAR_PATH |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
dnl |
||||
dnl Emits shell code that verifies that 'PATH' variable |
||||
dnl is set, otherwise aborts execution. |
||||
|
||||
AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_VAR_PATH], |
||||
[dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_TEST])dnl |
||||
# |
||||
# Verify that 'PATH' variable is set, otherwise abort. |
||||
# |
||||
|
||||
xc_tst_str='unknown' |
||||
(`test -n "$PATH" >/dev/null 2>&1`) && xc_tst_str='success' |
||||
case "x$xc_tst_str" in @%:@ (( |
||||
xsuccess) |
||||
: |
||||
;; |
||||
*) |
||||
echo "$xc_msg_err 'PATH' variable not set. $xc_msg_abrt" >&2 |
||||
exit 1 |
||||
;; |
||||
esac |
||||
]) |
||||
|
||||
|
||||
dnl _XC_CFG_PRE_BASIC_CHK_CMD_EXPR |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
dnl |
||||
dnl Emits shell code that verifies that 'expr' command |
||||
dnl is available, otherwise aborts execution. |
||||
|
||||
AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR], |
||||
[dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl |
||||
# |
||||
# Verify that 'expr' command is available, otherwise abort. |
||||
# |
||||
|
||||
xc_tst_str='unknown' |
||||
xc_tst_str=`expr "$xc_tst_str" : '.*' 2>/dev/null` |
||||
case "x$xc_tst_str" in @%:@ (( |
||||
x7) |
||||
: |
||||
;; |
||||
*) |
||||
echo "$xc_msg_err 'expr' command not found. $xc_msg_abrt" >&2 |
||||
exit 1 |
||||
;; |
||||
esac |
||||
]) |
||||
|
||||
|
||||
dnl _XC_CFG_PRE_BASIC_CHK_UTIL_SED |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
dnl |
||||
dnl Emits shell code that verifies that 'sed' utility |
||||
dnl is found within 'PATH', otherwise aborts execution. |
||||
dnl |
||||
dnl This 'sed' is required in order to allow configure |
||||
dnl script bootstrapping itself. No fancy testing for a |
||||
dnl proper 'sed' this early, that should be done later. |
||||
|
||||
AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_SED], |
||||
[dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl |
||||
# |
||||
# Verify that 'sed' utility is found within 'PATH', otherwise abort. |
||||
# |
||||
|
||||
xc_tst_str='unknown' |
||||
xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \ |
||||
| sed -e 's:unknown:success:' 2>/dev/null` |
||||
case "x$xc_tst_str" in @%:@ (( |
||||
xsuccess) |
||||
: |
||||
;; |
||||
*) |
||||
echo "$xc_msg_err 'sed' utility not found in 'PATH'. $xc_msg_abrt" >&2 |
||||
exit 1 |
||||
;; |
||||
esac |
||||
]) |
||||
|
||||
|
||||
dnl _XC_CFG_PRE_BASIC_CHK_UTIL_GREP |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
dnl |
||||
dnl Emits shell code that verifies that 'grep' utility |
||||
dnl is found within 'PATH', otherwise aborts execution. |
||||
dnl |
||||
dnl This 'grep' is required in order to allow configure |
||||
dnl script bootstrapping itself. No fancy testing for a |
||||
dnl proper 'grep' this early, that should be done later. |
||||
|
||||
AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_GREP], |
||||
[dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl |
||||
# |
||||
# Verify that 'grep' utility is found within 'PATH', otherwise abort. |
||||
# |
||||
|
||||
xc_tst_str='unknown' |
||||
(`echo "$xc_tst_str" 2>/dev/null \ |
||||
| grep 'unknown' >/dev/null 2>&1`) && xc_tst_str='success' |
||||
case "x$xc_tst_str" in @%:@ (( |
||||
xsuccess) |
||||
: |
||||
;; |
||||
*) |
||||
echo "$xc_msg_err 'grep' utility not found in 'PATH'. $xc_msg_abrt" >&2 |
||||
exit 1 |
||||
;; |
||||
esac |
||||
]) |
||||
|
||||
|
||||
dnl _XC_CFG_PRE_BASIC_CHK_UTIL_TR |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
dnl |
||||
dnl Emits shell code that verifies that 'tr' utility |
||||
dnl is found within 'PATH', otherwise aborts execution. |
||||
|
||||
AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_TR], |
||||
[dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl |
||||
# |
||||
# Verify that 'tr' utility is found within 'PATH', otherwise abort. |
||||
# |
||||
|
||||
xc_tst_str="${xc_tab}98s7u6c5c4e3s2s10" |
||||
xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \ |
||||
| tr -d "0123456789$xc_tab" 2>/dev/null` |
||||
case "x$xc_tst_str" in @%:@ (( |
||||
xsuccess) |
||||
: |
||||
;; |
||||
*) |
||||
echo "$xc_msg_err 'tr' utility not found in 'PATH'. $xc_msg_abrt" >&2 |
||||
exit 1 |
||||
;; |
||||
esac |
||||
]) |
||||
|
||||
|
||||
dnl _XC_CFG_PRE_BASIC_CHK_UTIL_WC |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
dnl |
||||
dnl Emits shell code that verifies that 'wc' utility |
||||
dnl is found within 'PATH', otherwise aborts execution. |
||||
|
||||
AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_WC], |
||||
[dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl |
||||
# |
||||
# Verify that 'wc' utility is found within 'PATH', otherwise abort. |
||||
# |
||||
|
||||
xc_tst_str='unknown unknown unknown unknown' |
||||
xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \ |
||||
| wc -w 2>/dev/null | tr -d "$xc_space$xc_tab" 2>/dev/null` |
||||
case "x$xc_tst_str" in @%:@ (( |
||||
x4) |
||||
: |
||||
;; |
||||
*) |
||||
echo "$xc_msg_err 'wc' utility not found in 'PATH'. $xc_msg_abrt" >&2 |
||||
exit 1 |
||||
;; |
||||
esac |
||||
]) |
||||
|
||||
|
||||
dnl _XC_CFG_PRE_BASIC_CHK_UTIL_CAT |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
dnl |
||||
dnl Emits shell code that verifies that 'cat' utility |
||||
dnl is found within 'PATH', otherwise aborts execution. |
||||
|
||||
AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_CAT], |
||||
[dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl |
||||
# |
||||
# Verify that 'cat' utility is found within 'PATH', otherwise abort. |
||||
# |
||||
|
||||
xc_tst_str='unknown' |
||||
xc_tst_str=`cat <<_EOT 2>/dev/null \ |
||||
| wc -l 2>/dev/null | tr -d "$xc_space$xc_tab" 2>/dev/null |
||||
unknown |
||||
unknown |
||||
unknown |
||||
_EOT` |
||||
case "x$xc_tst_str" in @%:@ (( |
||||
x3) |
||||
: |
||||
;; |
||||
*) |
||||
echo "$xc_msg_err 'cat' utility not found in 'PATH'. $xc_msg_abrt" >&2 |
||||
exit 1 |
||||
;; |
||||
esac |
||||
]) |
||||
|
||||
|
||||
dnl _XC_CFG_PRE_CHECK_PATH_SEPARATOR |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
dnl |
||||
dnl Emits shell code that computes the path separator |
||||
dnl and stores the result in 'PATH_SEPARATOR', unless |
||||
dnl the user has already set it with a non-empty value. |
||||
dnl |
||||
dnl This path separator is the symbol used to separate |
||||
dnl or diferentiate paths inside the 'PATH' environment |
||||
dnl variable. |
||||
dnl |
||||
dnl Non-empty user provided 'PATH_SEPARATOR' always |
||||
dnl overrides the auto-detected one. |
||||
|
||||
AC_DEFUN([_XC_CFG_PRE_CHECK_PATH_SEPARATOR], |
||||
[dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl |
||||
# |
||||
# Auto-detect and set 'PATH_SEPARATOR', unless it is already non-empty set. |
||||
# |
||||
|
||||
# Directory count in 'PATH' when using a colon separator. |
||||
xc_tst_dirs_col='x' |
||||
xc_tst_prev_IFS=$IFS; IFS=':' |
||||
for xc_tst_dir in $PATH; do |
||||
IFS=$xc_tst_prev_IFS |
||||
xc_tst_dirs_col="x$xc_tst_dirs_col" |
||||
done |
||||
IFS=$xc_tst_prev_IFS |
||||
xc_tst_dirs_col=`expr "$xc_tst_dirs_col" : '.*'` |
||||
|
||||
# Directory count in 'PATH' when using a semicolon separator. |
||||
xc_tst_dirs_sem='x' |
||||
xc_tst_prev_IFS=$IFS; IFS=';' |
||||
for xc_tst_dir in $PATH; do |
||||
IFS=$xc_tst_prev_IFS |
||||
xc_tst_dirs_sem="x$xc_tst_dirs_sem" |
||||
done |
||||
IFS=$xc_tst_prev_IFS |
||||
xc_tst_dirs_sem=`expr "$xc_tst_dirs_sem" : '.*'` |
||||
|
||||
if test $xc_tst_dirs_sem -eq $xc_tst_dirs_col; then |
||||
# When both counting methods give the same result we do not want to |
||||
# chose one over the other, and consider auto-detection not possible. |
||||
if test -z "$PATH_SEPARATOR"; then |
||||
# Stop dead until user provides 'PATH_SEPARATOR' definition. |
||||
echo "$xc_msg_err 'PATH_SEPARATOR' variable not set. $xc_msg_abrt" >&2 |
||||
exit 1 |
||||
fi |
||||
else |
||||
# Separator with the greater directory count is the auto-detected one. |
||||
if test $xc_tst_dirs_sem -gt $xc_tst_dirs_col; then |
||||
xc_tst_auto_separator=';' |
||||
else |
||||
xc_tst_auto_separator=':' |
||||
fi |
||||
if test -z "$PATH_SEPARATOR"; then |
||||
# Simply use the auto-detected one when not already set. |
||||
PATH_SEPARATOR=$xc_tst_auto_separator |
||||
elif test "x$PATH_SEPARATOR" != "x$xc_tst_auto_separator"; then |
||||
echo "$xc_msg_warn 'PATH_SEPARATOR' does not match auto-detected one." >&2 |
||||
fi |
||||
fi |
||||
xc_PATH_SEPARATOR=$PATH_SEPARATOR |
||||
AC_SUBST([PATH_SEPARATOR])dnl |
||||
]) |
||||
|
||||
|
||||
dnl _XC_CFG_PRE_POSTLUDE |
||||
dnl ------------------------------------------------- |
||||
dnl Private macro. |
||||
|
||||
AC_DEFUN([_XC_CFG_PRE_POSTLUDE], |
||||
[dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_PREAMBLE])dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO])dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_TEST])dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_SED])dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_GREP])dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_CAT])dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_CHECK_PATH_SEPARATOR])dnl |
||||
dnl |
||||
xc_configure_preamble_result='yes' |
||||
]) |
||||
|
||||
|
||||
dnl XC_CONFIGURE_PREAMBLE |
||||
dnl ------------------------------------------------- |
||||
dnl Public macro. |
||||
dnl |
||||
dnl This macro emits shell code which does some |
||||
dnl very basic checks related with the availability |
||||
dnl of some commands and utilities needed to allow |
||||
dnl configure script bootstrapping itself when using |
||||
dnl these to figure out other settings. Also emits |
||||
dnl code that performs PATH_SEPARATOR auto-detection |
||||
dnl and sets its value unless it is already set with |
||||
dnl a non-empty value. |
||||
dnl |
||||
dnl These basic checks are intended to be placed and |
||||
dnl executed as early as possible in the resulting |
||||
dnl configure script, and as such these must be pure |
||||
dnl and portable shell code. |
||||
dnl |
||||
dnl This macro may be used directly, or indirectly |
||||
dnl when using other macros that AC_REQUIRE it such |
||||
dnl as XC_CHECK_PATH_SEPARATOR. |
||||
dnl |
||||
dnl Currently the mechanism used to ensure that this |
||||
dnl macro expands early enough in generated configure |
||||
dnl script is making it override autoconf and libtool |
||||
dnl PATH_SEPARATOR check. |
||||
|
||||
AC_DEFUN([XC_CONFIGURE_PREAMBLE], |
||||
[dnl |
||||
AC_PREREQ([2.50])dnl |
||||
dnl |
||||
AC_BEFORE([$0],[_XC_CFG_PRE_PREAMBLE])dnl |
||||
AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_CMD_ECHO])dnl |
||||
AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_CMD_TEST])dnl |
||||
AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl |
||||
AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl |
||||
AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_SED])dnl |
||||
AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_GREP])dnl |
||||
AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl |
||||
AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl |
||||
AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_CAT])dnl |
||||
AC_BEFORE([$0],[_XC_CFG_PRE_CHECK_PATH_SEPARATOR])dnl |
||||
AC_BEFORE([$0],[_XC_CFG_PRE_POSTLUDE])dnl |
||||
dnl |
||||
AC_BEFORE([$0],[AC_CHECK_TOOL])dnl |
||||
AC_BEFORE([$0],[AC_CHECK_PROG])dnl |
||||
AC_BEFORE([$0],[AC_CHECK_TOOLS])dnl |
||||
AC_BEFORE([$0],[AC_CHECK_PROGS])dnl |
||||
dnl |
||||
AC_BEFORE([$0],[AC_PATH_TOOL])dnl |
||||
AC_BEFORE([$0],[AC_PATH_PROG])dnl |
||||
AC_BEFORE([$0],[AC_PATH_PROGS])dnl |
||||
dnl |
||||
AC_BEFORE([$0],[AC_PROG_SED])dnl |
||||
AC_BEFORE([$0],[AC_PROG_GREP])dnl |
||||
AC_BEFORE([$0],[AC_PROG_LN_S])dnl |
||||
AC_BEFORE([$0],[AC_PROG_MKDIR_P])dnl |
||||
AC_BEFORE([$0],[AC_PROG_INSTALL])dnl |
||||
AC_BEFORE([$0],[AC_PROG_MAKE_SET])dnl |
||||
AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl |
||||
dnl |
||||
AC_BEFORE([$0],[LT_INIT])dnl |
||||
AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl |
||||
AC_BEFORE([$0],[AC_LIBTOOL_WIN32_DLL])dnl |
||||
dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_PREAMBLE])dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO])dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_TEST])dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_SED])dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_GREP])dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_CAT])dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_CHECK_PATH_SEPARATOR])dnl |
||||
AC_REQUIRE([_XC_CFG_PRE_POSTLUDE])dnl |
||||
dnl |
||||
m4_pattern_forbid([^_*XC])dnl |
||||
m4_define([$0],[])dnl |
||||
]) |
||||
|
||||
|
||||
dnl Override autoconf and libtool PATH_SEPARATOR check |
||||
dnl ------------------------------------------------- |
||||
dnl Macros overriding. |
||||
dnl |
||||
dnl This is done to ensure that the same check is |
||||
dnl used across different autoconf versions and to |
||||
dnl allow expansion of XC_CONFIGURE_PREAMBLE macro |
||||
dnl early enough in the generated configure script. |
||||
|
||||
dnl |
||||
dnl Override when using autoconf 2.53 and newer. |
||||
dnl |
||||
|
||||
m4_ifdef([_AS_PATH_SEPARATOR_PREPARE], |
||||
[dnl |
||||
m4_undefine([_AS_PATH_SEPARATOR_PREPARE])dnl |
||||
m4_defun([_AS_PATH_SEPARATOR_PREPARE], |
||||
[dnl |
||||
AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl |
||||
m4_define([$0],[])dnl |
||||
])dnl |
||||
]) |
||||
|
||||
dnl |
||||
dnl Override when using autoconf 2.50 to 2.52 |
||||
dnl |
||||
|
||||
m4_ifdef([_AC_INIT_PREPARE_FS_SEPARATORS], |
||||
[dnl |
||||
m4_undefine([_AC_INIT_PREPARE_FS_SEPARATORS])dnl |
||||
m4_defun([_AC_INIT_PREPARE_FS_SEPARATORS], |
||||
[dnl |
||||
AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl |
||||
ac_path_separator=$PATH_SEPARATOR |
||||
m4_define([$0],[])dnl |
||||
])dnl |
||||
]) |
||||
|
||||
dnl |
||||
dnl Override when using libtool 1.4.2 |
||||
dnl |
||||
|
||||
m4_ifdef([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR], |
||||
[dnl |
||||
m4_undefine([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl |
||||
m4_defun([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR], |
||||
[dnl |
||||
AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl |
||||
lt_cv_sys_path_separator=$PATH_SEPARATOR |
||||
m4_define([$0],[])dnl |
||||
])dnl |
||||
]) |
||||
|
||||
|
||||
dnl XC_CHECK_PATH_SEPARATOR |
||||
dnl ------------------------------------------------- |
||||
dnl Public macro. |
||||
dnl |
||||
dnl Usage of this macro ensures that generated configure |
||||
dnl script uses the same PATH_SEPARATOR check irrespective |
||||
dnl of autoconf or libtool version being used to generate |
||||
dnl configure script. |
||||
dnl |
||||
dnl Emits shell code that computes the path separator |
||||
dnl and stores the result in 'PATH_SEPARATOR', unless |
||||
dnl the user has already set it with a non-empty value. |
||||
dnl |
||||
dnl This path separator is the symbol used to separate |
||||
dnl or diferentiate paths inside the 'PATH' environment |
||||
dnl variable. |
||||
dnl |
||||
dnl Non-empty user provided 'PATH_SEPARATOR' always |
||||
dnl overrides the auto-detected one. |
||||
dnl |
||||
dnl Strictly speaking the check is done in two steps. The |
||||
dnl first, which does the actual check, takes place in |
||||
dnl XC_CONFIGURE_PREAMBLE macro and happens very early in |
||||
dnl generated configure script. The second one shows and |
||||
dnl logs the result of the check into config.log at a later |
||||
dnl configure stage. Placement of this second stage in |
||||
dnl generated configure script will be done where first |
||||
dnl direct or indirect usage of this macro happens. |
||||
|
||||
AC_DEFUN([XC_CHECK_PATH_SEPARATOR], |
||||
[dnl |
||||
AC_PREREQ([2.50])dnl |
||||
dnl |
||||
AC_BEFORE([$0],[AC_CHECK_TOOL])dnl |
||||
AC_BEFORE([$0],[AC_CHECK_PROG])dnl |
||||
AC_BEFORE([$0],[AC_CHECK_TOOLS])dnl |
||||
AC_BEFORE([$0],[AC_CHECK_PROGS])dnl |
||||
dnl |
||||
AC_BEFORE([$0],[AC_PATH_TOOL])dnl |
||||
AC_BEFORE([$0],[AC_PATH_PROG])dnl |
||||
AC_BEFORE([$0],[AC_PATH_PROGS])dnl |
||||
dnl |
||||
AC_BEFORE([$0],[AC_PROG_SED])dnl |
||||
AC_BEFORE([$0],[AC_PROG_GREP])dnl |
||||
AC_BEFORE([$0],[AC_PROG_LN_S])dnl |
||||
AC_BEFORE([$0],[AC_PROG_MKDIR_P])dnl |
||||
AC_BEFORE([$0],[AC_PROG_INSTALL])dnl |
||||
AC_BEFORE([$0],[AC_PROG_MAKE_SET])dnl |
||||
AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl |
||||
dnl |
||||
AC_BEFORE([$0],[LT_INIT])dnl |
||||
AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl |
||||
AC_BEFORE([$0],[AC_LIBTOOL_WIN32_DLL])dnl |
||||
dnl |
||||
AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl |
||||
dnl |
||||
# |
||||
# Check that 'XC_CONFIGURE_PREAMBLE' has already run. |
||||
# |
||||
|
||||
if test -z "$xc_configure_preamble_result"; then |
||||
AC_MSG_ERROR([xc_configure_preamble_result not set (internal problem)]) |
||||
fi |
||||
|
||||
# |
||||
# Check that 'PATH_SEPARATOR' has already been set. |
||||
# |
||||
|
||||
if test -z "$xc_PATH_SEPARATOR"; then |
||||
AC_MSG_ERROR([xc_PATH_SEPARATOR not set (internal problem)]) |
||||
fi |
||||
if test -z "$PATH_SEPARATOR"; then |
||||
AC_MSG_ERROR([PATH_SEPARATOR not set (internal or config.site problem)]) |
||||
fi |
||||
AC_MSG_CHECKING([for path separator]) |
||||
AC_MSG_RESULT([$PATH_SEPARATOR]) |
||||
if test "x$PATH_SEPARATOR" != "x$xc_PATH_SEPARATOR"; then |
||||
AC_MSG_CHECKING([for initial path separator]) |
||||
AC_MSG_RESULT([$xc_PATH_SEPARATOR]) |
||||
AC_MSG_ERROR([path separator mismatch (internal or config.site problem)]) |
||||
fi |
||||
dnl |
||||
m4_pattern_forbid([^_*XC])dnl |
||||
m4_define([$0],[])dnl |
||||
]) |
||||
|
@ -1,4 +0,0 @@ |
||||
#!/bin/sh |
||||
# Copyright (C) The c-ares project and its contributors |
||||
# SPDX-License-Identifier: MIT |
||||
autoreconf -iv |
@ -1,56 +0,0 @@ |
||||
############################################################# |
||||
# |
||||
# Copyright (C) the Massachusetts Institute of Technology. |
||||
# Copyright (C) Daniel Stenberg |
||||
# |
||||
# Permission to use, copy, modify, and distribute this |
||||
# software and its documentation for any purpose and without |
||||
# fee is hereby granted, provided that the above copyright |
||||
# notice appear in all copies and that both that copyright |
||||
# notice and this permission notice appear in supporting |
||||
# documentation, and that the name of M.I.T. not be used in |
||||
# advertising or publicity pertaining to distribution of the |
||||
# software without specific, written prior permission. |
||||
# 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. |
||||
# |
||||
# SPDX-License-Identifier: MIT |
||||
# |
||||
############################################################# |
||||
AC_PREREQ(2.69) |
||||
AC_INIT([c-ares-test],[-],[-]) |
||||
AC_CONFIG_SRCDIR([ares-test.cc]) |
||||
AC_CONFIG_MACRO_DIR([../m4]) |
||||
|
||||
AM_INIT_AUTOMAKE([no-define]) |
||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
||||
|
||||
AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX_14]) |
||||
AX_REQUIRE_DEFINED([AX_PTHREAD]) |
||||
|
||||
dnl Checks for programs. |
||||
AC_PROG_CXX |
||||
AX_CXX_COMPILE_STDCXX_14([noext],[mandatory]) |
||||
LT_INIT |
||||
AC_SUBST(LIBTOOL_DEPS) |
||||
AX_PTHREAD([ CARES_THREADS=yes ], [ CARES_THREADS=no ]) |
||||
|
||||
PKG_CHECK_MODULES([GMOCK], [gmock]) |
||||
|
||||
if test "${CARES_THREADS}" = "yes" ; then |
||||
LIBS="$PTHREAD_LIBS $LIBS" |
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS" |
||||
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" |
||||
CC="$PTHREAD_CC" |
||||
CXX="$PTHREAD_CXX" |
||||
fi |
||||
|
||||
AX_CODE_COVERAGE |
||||
AX_CHECK_USER_NAMESPACE |
||||
AX_CHECK_UTS_NAMESPACE |
||||
|
||||
AC_CHECK_HEADERS(netdb.h netinet/tcp.h) |
||||
AC_CONFIG_HEADERS([config.h]) |
||||
AC_CONFIG_FILES([Makefile]) |
||||
AC_OUTPUT |
Loading…
Reference in new issue