📄 acinclude.m4
字号:
dnl this is somehow a fat lie, but prevents other macros from double checking AC_PROVIDE([AC_PROG_CC]) AC_PROVIDE([AC_PROG_CPP]) AC_PROVIDE([AC_PROG_CXX]) AC_PROVIDE([AC_PROG_CXXCPP]) AC_ARG_ENABLE(debug,[ --enable-debug creates debugging code [default=no]], [ if test $enableval = "no"; dnl then kde_use_debug_code="no" kde_use_debug_define=yes else kde_use_debug_code="yes" kde_use_debug_define=no fi ], [kde_use_debug_code="no" kde_use_debug_define=no ]) AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)], [ if test $enableval = "no"; then kde_use_strict_options="no" else kde_use_strict_options="yes" fi ], [kde_use_strict_options="no"]) AC_ARG_ENABLE(profile,[ --enable-profile creates profiling infos [default=no]], [kde_use_profiling=$enableval], [kde_use_profiling="no"] )dnl this was AC_PROG_CC. I had to include it manualy, since I had to patch it AC_MSG_CHECKING(for a C-Compiler) dnl if there is one, print out. if not, don't matter AC_MSG_RESULT($CC) if test -z "$CC"; then AC_CHECK_PROG(CC, gcc, gcc) fi if test -z "$CC"; then AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) fi if test -z "$CC"; then AC_CHECK_PROG(CC, xlc, xlc) fi test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) AC_PROG_CC_WORKS AC_PROG_CC_GNU if test $ac_cv_prog_gcc = yes; then GCC=yes else GCC= fi USER_CFLAGS=$CFLAGS CFLAGS= if test -z "$CFLAGS"; then if test "$kde_use_debug_code" = "yes"; then AC_PROG_CC_G if test $ac_cv_prog_cc_g = yes; then CFLAGS="-g" case $host in *-*-linux-gnu) CFLAGS="$CFLAGS -ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE -D_BSD_SOURCE" ;; esac fi else if test "$GCC" = "yes"; then CFLAGS="-O2" else CFLAGS="" fi if test "$kde_use_debug_define" = "yes"; then CFLAGS="$CFLAGS -DNDEBUG" fi fi if test "$kde_use_profiling" = yes; then KDE_PROG_CC_PG if test "$kde_cv_prog_cc_pg" = yes; then CFLAGS="$CFLAGS -pg" fi fi if test "$GCC" = "yes"; then CFLAGS="$CFLAGS" if test "$kde_use_strict_options" = "yes"; then CFLAGS="$CFLAGS -W -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings" fi fi fi case "$host" in *-*-sysv4.2uw*) CFLAGS="$CFLAGS -D_UNIXWARE";; esac if test -n "$USER_CFLAGS"; then CFLAGS="$CFLAGS $USER_CFLAGS" fi if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then LDFLAGS="" fidnl this is AC_PROG_CPP. I had to include it here, since autoconf checksdnl dependecies between AC_PROG_CPP and AC_PROG_CC (or is it automake?) AC_MSG_CHECKING(how to run the C preprocessor) # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then AC_CACHE_VAL(ac_cv_prog_CPP, [ # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. dnl Use a header file that comes with gcc, so configuring glibc dnl with a fresh cross-compiler works. AC_TRY_CPP([#include <assert.h> Syntax Error], , CPP="${CC-cc} -E -traditional-cpp" AC_TRY_CPP([#include <assert.h> Syntax Error], , CPP=/lib/cpp)) ac_cv_prog_CPP="$CPP"])dnl CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi AC_MSG_RESULT($CPP) AC_SUBST(CPP)dnl AC_MSG_CHECKING(for a C++-Compiler) dnl if there is one, print out. if not, don't matter AC_MSG_RESULT($CXX) if test -z "$CXX"; then AC_CHECK_PROG(CXX, g++, g++) fi if test -z "$CXX"; then AC_CHECK_PROG(CXX, CC, CC) fi if test -z "$CXX"; then AC_CHECK_PROG(CXX, xlC, xlC) fi if test -z "$CXX"; then AC_CHECK_PROG(CXX, DCC, DCC) fi test -z "$CXX" && AC_MSG_ERROR([no acceptable C++-compiler found in \$PATH]) AC_PROG_CXX_WORKS AC_PROG_CXX_GNU if test $ac_cv_prog_gxx = yes; then GXX=yes fi USER_CXXFLAGS=$CXXFLAGS CXXFLAGS="" if test -z "$CXXFLAGS"; then if test "$kde_use_debug_code" = "yes"; then AC_PROG_CXX_G if test $ac_cv_prog_cxx_g = yes; then CXXFLAGS="-g" case $host in dnl *-*-linux-gnu) CXXFLAGS="$CXXFLAGS -ansi -D_XOPEN_SOURCE -D_BSD_SOURCE -Wbad-function-cast -Wcast-align -Wundef -Wconversion" ;; esac fi else if test "$GXX" = "yes"; then CXXFLAGS="-O2" fi if test "$kde_use_debug_define" = "yes"; then CXXFLAGS="$CXXFLAGS -DNDEBUG" fi fi if test "$kde_use_profiling" = yes; then KDE_PROG_CXX_PG if test "$kde_cv_prog_cxx_pg" = yes; then CXXFLAGS="$CXXFLAGS -pg" fi fi KDE_CHECK_COMPILER_FLAG(fno-exceptions, [ CXXFLAGS="$CXXFLAGS -fno-exceptions" ])dnl WABA: Nothing wrong with RTTI, keep it on.dnl KDE_CHECK_COMPILER_FLAG(fno-rtti,dnl [dnl CXXFLAGS="$CXXFLAGS -fno-rtti"dnl ]) KDE_CHECK_COMPILER_FLAG(fno-check-new, [ CXXFLAGS="$CXXFLAGS -fno-check-new" ]) if test "$GXX" = "yes"; then CXXFLAGS="$CXXFLAGS" if test true || test "$kde_use_debug_code" = "yes"; then CXXFLAGS="$CXXFLAGS -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings" KDE_CHECK_COMPILER_FLAG(Wno-long-long, [ CXXFLAGS="$CXXFLAGS -Wno-long-long" ]) KDE_CHECK_COMPILER_FLAG(fno-builtin, [ CXXFLAGS="$CXXFLAGS -fno-builtin" ]) fi if test "$kde_use_strict_options" = "yes"; then CXXFLAGS="$CXXFLAGS -Wcast-qual -Wbad-function-cast -Wshadow -Wcast-align" fi if test "$kde_very_strict" = "yes"; then CXXFLAGS="$CXXFLAGS -Wold-style-cast -Wredundant-decls -Wconversion" fi fi fi KDE_CHECK_COMPILER_FLAG(fexceptions, [ USE_EXCEPTIONS="-fexceptions" ], USE_EXCEPTIONS= ) AC_SUBST(USE_EXCEPTIONS) KDE_CHECK_COMPILER_FLAG(frtti, [ USE_RTTI="-frtti" ], USE_RTTI= ) AC_SUBST(USE_RTTI) case "$host" in *-*-irix*) test "$GXX" = yes && CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS" ;; *-*-sysv4.2uw*) CXXFLAGS="$CXXFLAGS -D_UNIXWARE";; esac if test -n "$USER_CXXFLAGS"; then CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS" fi AC_VALIDIFY_CXXFLAGS AC_MSG_CHECKING(how to run the C++ preprocessor) if test -z "$CXXCPP"; then AC_CACHE_VAL(ac_cv_prog_CXXCPP, [ AC_LANG_SAVE[]dnl AC_LANG_CPLUSPLUS[]dnl CXXCPP="${CXX-g++} -E" AC_TRY_CPP([#include <stdlib.h>], , CXXCPP=/lib/cpp) ac_cv_prog_CXXCPP="$CXXCPP" AC_LANG_RESTORE[]dnl ])dnl CXXCPP="$ac_cv_prog_CXXCPP" fi AC_MSG_RESULT($CXXCPP) AC_SUBST(CXXCPP)dnl # the following is to allow programs, that are known to # have problems when compiled with -O2 if test -n "$CXXFLAGS"; then kde_safe_IFS=$IFS IFS=" " NOOPT_CXXFLAGS="" for i in $CXXFLAGS; do case $i in -O*) ;; *) NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS $i" ;; esac done IFS=$kde_safe_IFS fi AC_SUBST(NOOPT_CXXFLAGS) KDE_CHECK_FINAL ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), []) KDE_CXXFLAGS= AC_SUBST(KDE_CXXFLAGS)])AC_DEFUN(KDE_ADD_DEPENDENCIES,[ [A]M_DEPENDENCIES(CC) [A]M_DEPENDENCIES(CXX)])dnl just a wrapper to clean up configure.inAC_DEFUN(KDE_PROG_LIBTOOL,[AC_REQUIRE([AC_CHECK_COMPILERS])AC_REQUIRE([AC_ENABLE_SHARED])AC_REQUIRE([AC_ENABLE_STATIC])AC_REQUIRE([AC_LIBTOOL_DLOPEN])AC_LANG_SAVEAC_LANG_CAC_OBJEXTAC_EXEEXTAC_LANG_RESTOREAM_PROG_LIBTOOLAC_LIBTOOL_CXXLIBTOOL_SHELL="/bin/sh ./libtool"# LIBTOOL="$LIBTOOL --silent"KDE_PLUGIN="-avoid-version -module -no-undefined"AC_SUBST(KDE_PLUGIN)])AC_DEFUN(KDE_CHECK_TYPES,[ AC_CHECK_SIZEOF(int, 4)dnl AC_CHECK_SIZEOF(long, 4)dnl AC_CHECK_SIZEOF(char *, 4)dnl])dnlAC_DEFUN(KDE_DO_IT_ALL,[AC_CANONICAL_SYSTEMAC_ARG_PROGRAMAM_INIT_AUTOMAKE($1, $2)AM_DISABLE_LIBRARIESAC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})AC_CHECK_COMPILERSKDE_PROG_LIBTOOLAM_KDE_WITH_NLSAC_PATH_KDE])AC_DEFUN(AC_CHECK_RPATH,[AC_MSG_CHECKING(for rpath)AC_ARG_ENABLE(rpath, [ --disable-rpath do not use the rpath feature of ld], USE_RPATH=$enableval, USE_RPATH=yes)if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then KDE_RPATH="-R \$(kde_libraries)" if test -n "$qt_libraries"; then KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)" fi dnl $x_libraries is set to /usr/lib in case if test -n "$X_LDFLAGS"; then KDE_RPATH="$KDE_RPATH -R \$(x_libraries)" fi if test -n "$KDE_EXTRA_RPATH"; then KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)" fifiAC_SUBST(KDE_EXTRA_RPATH)AC_SUBST(KDE_RPATH)AC_MSG_RESULT($USE_RPATH)])dnl Check for the type of the third argument of getsocknameAC_DEFUN(AC_CHECK_KSIZE_T,[AC_MSG_CHECKING(for the third argument of getsockname)AC_CACHE_VAL(ac_cv_ksize_t,AC_LANG_SAVEAC_LANG_CPLUSPLUS[AC_TRY_COMPILE([#include <sys/types.h>#include <sys/socket.h>],[socklen_t a=0;getsockname(0,(struct sockaddr*)0, &a);],ac_cv_ksize_t=socklen_t,ac_cv_ksize_t=)if test -z "$ac_cv_ksize_t"; thenac_safe_cxxflags="$CXXFLAGS"if test "$GCC" = "yes"; then CXXFLAGS="-Werror $CXXFLAGS"fiAC_TRY_COMPILE([#include <sys/types.h>#include <sys/socket.h>],[int a=0;getsockname(0,(struct sockaddr*)0, &a);],ac_cv_ksize_t=int,ac_cv_ksize_t=size_t)CXXFLAGS="$ac_safe_cxxflags"fiAC_LANG_RESTORE])if test -z "$ac_cv_ksize_t"; then ac_cv_ksize_t=intfiAC_MSG_RESULT($ac_cv_ksize_t)AC_DEFINE_UNQUOTED(ksize_t, $ac_cv_ksize_t, [Define the type of the third argument for getsockname])])dnl This is a merge of some macros out of the gettext aclocal.m4dnl since we don't need anything, I took the things we needdnl the copyright for them is:dnl >dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.dnl This Makefile.in is free software; the Free Software Foundationdnl gives unlimited permission to copy and/or distribute it,dnl with or without modifications, as long as this notice is preserved.dnl This program is distributed in the hope that it will be useful,dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; withoutdnl even the implied warranty of MERCHANTABILITY or FITNESS FOR Adnl PARTICULAR PURPOSE.dnl >dnl for this file it is relicensed under LGPLAC_DEFUN(AM_KDE_WITH_NLS, [ dnl If we use NLS figure out what method AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt, [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it]) GMSGFMT=":" fi MSGFMT=$GMSGFMT AC_SUBST(GMSGFMT) AC_SUBST(MSGFMT) AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then dnl If it is no GNU xgettext we define it as : so that the dnl Makefiles still can work. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else AC_MSG_RESULT( [found xgettext programs is not GNU xgettext; ignore it]) XGETTEXT=":" fi fi AC_SUBST(XGETTEXT) ])# Search path for a program which passes the given test.# Ulrich Drepper <drepper@cygnus.com>, 1996.# serial 1# Stephan Kulow: I appended a _KDE against name conflictsdnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE,[# Extract the first word of "$2", so it can be a program name with args.set dummy $2; ac_word=[$]2AC_MSG_CHECKING([for $ac_word])AC_CACHE_VAL(ac_cv_path_$1,[case "[$]$1" in /*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in ifelse([$5], , $PATH, [$5]); do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs"dnl If no 4th arg is given, leave the cache variable unset,dnl so AC_PATH_PROGS will keep looking.ifelse([$4], , , [ test -z
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -