📄 acinclude.m4
字号:
dnl Process this file with aclocal to get an aclocal.m4 file. Thendnl process that with autoconf.dnl ====================================================================dnldnl acinclude.m4dnldnl Various autoconf macros that are shared between differentdnl eCos packages.dnldnl ====================================================================dnl####COPYRIGHTBEGIN####dnl dnl ----------------------------------------------------------------------------dnl Copyright (C) 1998, 1999, 2000 Red Hat, Inc.dnldnl This file is part of the eCos host tools.dnldnl This program is free software; you can redistribute it and/or modify it dnl under the terms of the GNU General Public License as published by the Free dnl Software Foundation; either version 2 of the License, or (at your option) dnl any later version.dnl dnl This program is distributed in the hope that it will be useful, but WITHOUT dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for dnl more details.dnl dnl You should have received a copy of the GNU General Public License along withdnl this program; if not, write to the Free Software Foundation, Inc., dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.dnldnl ----------------------------------------------------------------------------dnl dnl####COPYRIGHTEND####dnl ====================================================================dnl#####DESCRIPTIONBEGIN####dnldnl Author(s): bartvdnl Contact(s): bartvdnl Date: 1998/12/16dnl Version: 0.01dnldnl####DESCRIPTIONEND####dnl ====================================================================dnl ====================================================================dnl The AM_INIT_AUTOMAKE() will define a symbol VERSION for thednl package's version number. Unfortunately this symbol is ratherdnl hard to share if several different packages are involved, so thisdnl macro is used to define an alternative symbolAC_DEFUN(CYG_AC_SUBST_VERSION,[ AC_REQUIRE([AM_INIT_AUTOMAKE]) ifelse($#,1,,AC_MSG_ERROR([Invalid number of arguments passed to CYG AC_SUBST_VERSION])) AC_DEFINE_UNQUOTED($1, "$VERSION")])dnl ====================================================================dnl Provide support for an automake conditional MSVC. Also set adnl variable MSVC to true or false, which may help other tests.AC_DEFUN(CYG_AC_PROG_MSVC,[ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_CXX]) AC_MSG_CHECKING("for Visual C++") MSVC="no"; if test "${CC}" = "cl" ; then MSVC="yes" fi if test "${CXX}" = "cl" ; then MSVC="yes" fi AM_CONDITIONAL(MSVC, test "${MSVC}" = "yes") AC_MSG_RESULT(${MSVC})])dnl ====================================================================dnl Set up sensible flags for the various different compilers. Thisdnl is achieved by redefining CC and CXX. dnldnl A better way of doing this sort of thing would be to detectdnl arguments to add and remove to the set of compiler flags, anddnl then update CFLAGS and CXXFLAGS (or even better, the AMdnl versions of those flags?)dnldnl There is no point in checking the cache, this macro doesdnl not do any feature tests.dnldnl The VC++ variant might benefit from -Za, but the header filesdnl shipped with the compiler are incompatible with this option.AC_DEFUN(CYG_AC_PROG_STANDARD_COMPILER_FLAGS, [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([CYG_AC_PROG_MSVC]) AC_MSG_CHECKING("the default compiler flags") dnl Add a user-settable flag to control whether or debugging info is dnl incorporated at compile-time. dnl dnl NOTE: there may also have to be a flag to control whether or dnl the VC++ multi-threading flags are enabled. cygflags_enable_debug="no" AC_ARG_ENABLE(debug,[ --enable-debug do a debug rather than a release build], [case "${enableval}" in yes) cygflags_enable_debug="yes" ;; *) cygflags_enable_debug="no" ;; esac]) dnl For VC++ builds also provide a flag for ANSI vs. unicode builds. dnl For now this does not actually affect the compiler flags. cygflags_enable_ansi="no" if test "${MSVC}" = "yes" ; then AC_ARG_ENABLE(ansi,[ --enable-ansi Do an ANSI rather than a unicode build], [case "${enableval}" in yes) cygflags_enable_ansi="yes" ;; *) cygflags_enable_ansi="no" ;; esac]) fi if test "${GCC}" = "yes" ; then CC="$CC -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs" CXX="$CXX -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual" elif test "${MSVC}" = "yes" ; then CC="$CC -nologo -W3" CXX="$CXX -nologo -W3 -GR -GX" if test "${cygflags_enable_debug}" = "yes" ; then CC="$CC -MDd -Zi" CXX="$CXX -MDd -Zi" else CC="$CC -MD -O2" CXX="$CXX -MD -O2" fi else AC_MSG_ERROR("default flags for ${CC} are not known") fi AC_MSG_RESULT(done)])dnl --------------------------------------------------------------------dnl User-settable options for assertions and tracing.dnldnl The settable options are:dnl --disable-assertsdnl --disable-preconditionsdnl --disable-postconditionsdnl --disable-invariantsdnl --disable-loopinvariantsdnl --disable-tracingdnl --disable-fntracingAC_DEFUN(CYG_AC_ARG_INFRASTRUCTURE, [AC_REQUIRE([CYG_AC_PROG_STANDARD_COMPILER_FLAGS])if test "${cygflags_enable_debug}" = "yes" ; then cyginfra_asserts=yes cyginfra_preconditions=yes cyginfra_postconditions=yes cyginfra_invariants=yes cyginfra_loopinvariants=yes cyginfra_tracing=yes cyginfra_fntracing=yeselse cyginfra_asserts=no cyginfra_preconditions=no cyginfra_postconditions=no cyginfra_invariants=no cyginfra_loopinvariants=no cyginfra_tracing=no cyginfra_fntracing=nofiAC_ARG_ENABLE(asserts,[ --disable-asserts disable all assertions],[case "${enableval}" in yes) cyginfra_asserts=yes ;; no) cyginfra_asserts=no ;; *) AC_MSG_ERROR([bad value ${enableval} for disable-asserts option]) ;;esac])if test "${cyginfra_asserts}" = "yes"; then AC_DEFINE(CYGDBG_USE_ASSERTS)fiAC_ARG_ENABLE(preconditions, [ --disable-preconditions disable a subset of the assertions],[case "${enableval}" in yes) cyginfra_preconditions=yes ;; no) cyginfra_preconditions=no ;; *) AC_MSG_ERROR([bad value ${enableval} for disable-preconditions option]) ;;esac])if test "${cyginfra_preconditions}" = "yes"; then AC_DEFINE(CYGDBG_INFRA_DEBUG_PRECONDITIONS)fiAC_ARG_ENABLE(postconditions, [ --disable-postconditions disable a subset of the assertions],[case "${enableval}" in yes) cyginfra_postconditions=yes ;; no) cyginfra_postconditions=no ;; *) AC_MSG_ERROR([bad value ${enableval} for disable-postconditions option]) ;;esac])if test "${cyginfra_postconditions}" = "yes"; then AC_DEFINE(CYGDBG_INFRA_DEBUG_POSTCONDITIONS)fiAC_ARG_ENABLE(invariants, [ --disable-invariants disable a subset of the assertions],[case "${enableval}" in yes) cyginfra_invariants=yes ;; no) cyginfra_invariants=no ;; *) AC_MSG_ERROR([bad value ${enableval} for disable-invariants option]) ;;esac])if test "${cyginfra_invariants}" = "yes"; then AC_DEFINE(CYGDBG_INFRA_DEBUG_INVARIANTS)fiAC_ARG_ENABLE(loopinvariants, [ --disable-loopinvariants disable a subset of the assertions],[case "${enableval}" in yes) cyginfra_loopinvariants=yes ;; no) cyginfra_loopinvariants=no ;; *) AC_MSG_ERROR([bad value ${enableval} for disable-loopinvariants option]) ;;esac])if test "${cyginfra_loopinvariants}" = "yes"; then AC_DEFINE(CYGDBG_INFRA_DEBUG_LOOP_INVARIANTS)fiAC_ARG_ENABLE(tracing,[ --disable-tracing disable tracing],[case "${enableval}" in yes) cyginfra_tracing=yes ;; no) cyginfra_tracing=no ;; *) AC_MSG_ERROR([bad value ${enableval} for disable-tracing option]) ;;esac])if test "${cyginfra_tracing}" = "yes"; then AC_DEFINE(CYGDBG_USE_TRACING)fiAC_ARG_ENABLE(fntracing,[ --disable-fntracing disable function entry/exit tracing],[case "${enableval}" in yes) cyginfra_fntracing=yes ;; no) cyginfra_fntracing=no ;; *) AC_MSG_ERROR([bad value ${enableval} for disable-fntracing option]) ;;esac])if test "${cyginfra_fntracing}" = "yes"; then AC_DEFINE(CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS)fi])dnl --------------------------------------------------------------------dnl Convert a cygwin pathname to something acceptable to VC++ (butdnl still invoked from bash and cygwin's make). This means usingdnl the cygpath utility and then translating any backslashes intodnl forward slashes to avoid confusing make.AC_DEFUN(CYG_AC_MSVC_PATH, [ AC_REQUIRE([CYG_AC_PROG_MSVC]) ifelse($#, 1, , AC_MSG_ERROR("Invalid number of arguments passed to CYG AC_MSVC_PATH")) if test "${MSVC}" = "yes" ; then $1=`cygpath -w ${$1} | tr \\\\\\\\ /` fi])dnl --------------------------------------------------------------------dnl Work out details of the Tcl installation that should be used.dnl This adds two command-line options, --with-tcl=<prefix> todnl specify the Tcl install directory, and --with-tcl-version=<vsn>dnl to control which version of Tcl should be used.dnldnl On Unix systems and under cygwin there should be a filednl $(tcl_prefix)/lib/tclConfig.sh containing all the informationdnl needed for Tcl. This file are consulted and the appropriatednl variables extracted.dnldnl To confuse matters, subtly different naming conventions are useddnl under Unix and NT. Under Unix the Tcl library will be calleddnl libtcl8.0.a, libtcl8.1.a, etc. with a dot between the major anddnl minor version. Under NT (including cygwin) the library will bednl called tcl80.lib, dnl tcl81.lib, libtcl80.a, libtcl81.a, etc.dnl without a dot.dnldnl The macro should really assume that it is running inside devo,dnl with tcl and tcl8.1 directories present and already configured.dnl This is tricky for a number of reasons, including confusion aboutdnl the meaning of top_srcdir.dnldnl This macro defines four new shell variables which will bednl substituted (typically into Makefile.in):dnldnl cyg_ac_tcl_version - the version of Tcl that is to be useddnl cyg_ac_tcl_incdir - location of <tcl.h> etc aldnl cyg_ac_tcl_libdir - location of libtcl.a/tcl.lib etc.dnl cyg_ac_tcl_libs - all of the libraries that are needed for TclAC_DEFUN(CYG_AC_PATH_TCL, [AC_REQUIRE([CYG_AC_PROG_MSVC])AC_REQUIRE([AC_CYGWIN])dnl Look for the version of Tcl. If none is specified, default todnl 8.0 under VC++ and cygwin, nothing under Unix. A version has to bednl specified under NT because there is no symbolic link from libtcl.adnl to whatever happens to be the most recent installed version.AC_MSG_CHECKING(for Tcl version)AC_ARG_WITH(tcl-version,[ --with-tcl-version=<vsn> version of Tcl to be used],[ cyg_ac_tcl_version=${with_tcl_version}],[ if test "${MSVC}" = "yes" ; then cyg_ac_tcl_version=80 else if test "${ac_cv_cygwin}" = "yes" ; then cyg_ac_tcl_version=80 else cyg_ac_tcl_version="" fi fi])AC_MSG_RESULT(${cyg_ac_tcl_version})AC_SUBST(cyg_ac_tcl_version)dnl Where is the Tcl installation? By default assume Tcl is alreadydnl installed in the same place as the eCos host-side.AC_ARG_WITH(tcl,[ --with-tcl-header=<path> location of Tcl header])AC_ARG_WITH(tcl,[ --with-tcl-lib=<path> location of Tcl libraries])AC_MSG_CHECKING(for Tcl installation)AC_ARG_WITH(tcl,[ --with-tcl=<path> location of Tcl header and libraries],[ cyg_ac_tcl_incdir=${with_tcl}/include cyg_ac_tcl_libdir=${with_tcl}/lib],[ if test "${with_tcl_header}" = "no"; then cyg_ac_tcl_incdir=${prefix}/include else with_tcl=yes cyg_ac_tcl_incdir=${with_tcl_header}/include fi if test "${with_tcl_lib}" = "no"; then cyg_ac_tcl_libdir=${prefix}/lib else with_tcl=yes cyg_ac_tcl_libdir=${with_tcl_lib}/lib fi])AC_MSG_RESULT(${cyg_ac_tcl_libdir})dnl Sanity check, make sure that there is a tcl.h header file.dnl If not then there is no point in proceeding.if test \! -r ${cyg_ac_tcl_incdir}/tcl.h ; then AC_MSG_ERROR(unable to locate Tcl header file tcl.h)fidnl If using VC++ then there is no tclConfig.sh file, so thednl library information has to be hard-wired. Otherwise therdnl should be a tclConfig.sh file containing the necessary information.if test "${MSVC}" = "yes" ; then cyg_ac_tcl_libs="tcl${cyg_ac_tcl_version}.lib" CYG_AC_MSVC_PATH(cyg_ac_tcl_incdir) CYG_AC_MSVC_PATH(cyg_ac_tcl_libdir)else if test \! -r ${cyg_ac_tcl_libdir}/tclConfig.sh ; then AC_MSG_ERROR(unable to locate Tcl config file tclConfig.sh) else . ${cyg_ac_tcl_libdir}/tclConfig.sh cyg_ac_tcl_libs="-ltcl${cyg_ac_tcl_version} ${TCL_LIBS}" fifiAC_SUBST(cyg_ac_tcl_incdir)AC_SUBST(cyg_ac_tcl_libdir)AC_SUBST(cyg_ac_tcl_libs)AC_SUBST(cyg_ac_tk_libs)])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -