"Fossies" - the Fresh Open Source Software Archive

Member "links-1.03/aclocal.m4" (24 Nov 2011, 13109 Bytes) of archive /linux/www/links-1.03.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "aclocal.m4": 2.8_vs_1.03.

    1 dnl aclocal.m4 generated automatically by aclocal 1.4
    2 
    3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
    4 dnl This file is free software; the Free Software Foundation
    5 dnl gives unlimited permission to copy and/or distribute it,
    6 dnl with or without modifications, as long as this notice is preserved.
    7 
    8 dnl This program is distributed in the hope that it will be useful,
    9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
   10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
   11 dnl PARTICULAR PURPOSE.
   12 
   13 # lib-prefix.m4 serial 5 (gettext-0.15)
   14 dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
   15 dnl This file is free software; the Free Software Foundation
   16 dnl gives unlimited permission to copy and/or distribute it,
   17 dnl with or without modifications, as long as this notice is preserved.
   18 
   19 dnl From Bruno Haible.
   20 
   21 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
   22 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
   23 dnl require excessive bracketing.
   24 ifdef([AC_HELP_STRING],
   25 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
   26 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
   27 
   28 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
   29 dnl to access previously installed libraries. The basic assumption is that
   30 dnl a user will want packages to use other packages he previously installed
   31 dnl with the same --prefix option.
   32 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
   33 dnl libraries, but is otherwise very convenient.
   34 AC_DEFUN([AC_LIB_PREFIX],
   35 [
   36   AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
   37   AC_REQUIRE([AC_PROG_CC])
   38   AC_REQUIRE([AC_CANONICAL_HOST])
   39   AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
   40   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
   41   dnl By default, look in $includedir and $libdir.
   42   use_additional=yes
   43   AC_LIB_WITH_FINAL_PREFIX([
   44     eval additional_includedir=\"$includedir\"
   45     eval additional_libdir=\"$libdir\"
   46   ])
   47   AC_LIB_ARG_WITH([lib-prefix],
   48 [  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
   49   --without-lib-prefix    don't search for libraries in includedir and libdir],
   50 [
   51     if test "X$withval" = "Xno"; then
   52       use_additional=no
   53     else
   54       if test "X$withval" = "X"; then
   55         AC_LIB_WITH_FINAL_PREFIX([
   56           eval additional_includedir=\"$includedir\"
   57           eval additional_libdir=\"$libdir\"
   58         ])
   59       else
   60         additional_includedir="$withval/include"
   61         additional_libdir="$withval/$acl_libdirstem"
   62       fi
   63     fi
   64 ])
   65   if test $use_additional = yes; then
   66     dnl Potentially add $additional_includedir to $CPPFLAGS.
   67     dnl But don't add it
   68     dnl   1. if it's the standard /usr/include,
   69     dnl   2. if it's already present in $CPPFLAGS,
   70     dnl   3. if it's /usr/local/include and we are using GCC on Linux,
   71     dnl   4. if it doesn't exist as a directory.
   72     if test "X$additional_includedir" != "X/usr/include"; then
   73       haveit=
   74       for x in $CPPFLAGS; do
   75         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
   76         if test "X$x" = "X-I$additional_includedir"; then
   77           haveit=yes
   78           break
   79         fi
   80       done
   81       if test -z "$haveit"; then
   82         if test "X$additional_includedir" = "X/usr/local/include"; then
   83           if test -n "$GCC"; then
   84             case $host_os in
   85               linux* | gnu* | k*bsd*-gnu) haveit=yes;;
   86             esac
   87           fi
   88         fi
   89         if test -z "$haveit"; then
   90           if test -d "$additional_includedir"; then
   91             dnl Really add $additional_includedir to $CPPFLAGS.
   92             CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
   93           fi
   94         fi
   95       fi
   96     fi
   97     dnl Potentially add $additional_libdir to $LDFLAGS.
   98     dnl But don't add it
   99     dnl   1. if it's the standard /usr/lib,
  100     dnl   2. if it's already present in $LDFLAGS,
  101     dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
  102     dnl   4. if it doesn't exist as a directory.
  103     if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
  104       haveit=
  105       for x in $LDFLAGS; do
  106         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  107         if test "X$x" = "X-L$additional_libdir"; then
  108           haveit=yes
  109           break
  110         fi
  111       done
  112       if test -z "$haveit"; then
  113         if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
  114           if test -n "$GCC"; then
  115             case $host_os in
  116               linux*) haveit=yes;;
  117             esac
  118           fi
  119         fi
  120         if test -z "$haveit"; then
  121           if test -d "$additional_libdir"; then
  122             dnl Really add $additional_libdir to $LDFLAGS.
  123             LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
  124           fi
  125         fi
  126       fi
  127     fi
  128   fi
  129 ])
  130 
  131 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
  132 dnl acl_final_exec_prefix, containing the values to which $prefix and
  133 dnl $exec_prefix will expand at the end of the configure script.
  134 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
  135 [
  136   dnl Unfortunately, prefix and exec_prefix get only finally determined
  137   dnl at the end of configure.
  138   if test "X$prefix" = "XNONE"; then
  139     acl_final_prefix="$ac_default_prefix"
  140   else
  141     acl_final_prefix="$prefix"
  142   fi
  143   if test "X$exec_prefix" = "XNONE"; then
  144     acl_final_exec_prefix='${prefix}'
  145   else
  146     acl_final_exec_prefix="$exec_prefix"
  147   fi
  148   acl_save_prefix="$prefix"
  149   prefix="$acl_final_prefix"
  150   eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
  151   prefix="$acl_save_prefix"
  152 ])
  153 
  154 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
  155 dnl variables prefix and exec_prefix bound to the values they will have
  156 dnl at the end of the configure script.
  157 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
  158 [
  159   acl_save_prefix="$prefix"
  160   prefix="$acl_final_prefix"
  161   acl_save_exec_prefix="$exec_prefix"
  162   exec_prefix="$acl_final_exec_prefix"
  163   $1
  164   exec_prefix="$acl_save_exec_prefix"
  165   prefix="$acl_save_prefix"
  166 ])
  167 
  168 dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
  169 dnl the basename of the libdir, either "lib" or "lib64".
  170 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
  171 [
  172   dnl There is no formal standard regarding lib and lib64. The current
  173   dnl practice is that on a system supporting 32-bit and 64-bit instruction
  174   dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
  175   dnl libraries go under $prefix/lib. We determine the compiler's default
  176   dnl mode by looking at the compiler's library search path. If at least
  177   dnl of its elements ends in /lib64 or points to a directory whose absolute
  178   dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
  179   dnl default, namely "lib".
  180   acl_libdirstem=lib
  181   searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
  182   if test -n "$searchpath"; then
  183     acl_save_IFS="${IFS= 	}"; IFS=":"
  184     for searchdir in $searchpath; do
  185       if test -d "$searchdir"; then
  186         case "$searchdir" in
  187           */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
  188           *) searchdir=`cd "$searchdir" && pwd`
  189              case "$searchdir" in
  190                */lib64 ) acl_libdirstem=lib64 ;;
  191              esac ;;
  192         esac
  193       fi
  194     done
  195     IFS="$acl_save_IFS"
  196   fi
  197 ])
  198 
  199 # Do all the work for Automake.  This macro actually does too much --
  200 # some checks are only needed if your package does certain things.
  201 # But this isn't really a big deal.
  202 
  203 # serial 1
  204 
  205 dnl Usage:
  206 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
  207 
  208 AC_DEFUN(AM_INIT_AUTOMAKE,
  209 [AC_REQUIRE([AC_PROG_INSTALL])
  210 PACKAGE=[$1]
  211 AC_SUBST(PACKAGE)
  212 VERSION=[$2]
  213 AC_SUBST(VERSION)
  214 dnl test to see if srcdir already configured
  215 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
  216   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
  217 fi
  218 ifelse([$3],,
  219 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
  220 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
  221 AC_REQUIRE([AM_SANITY_CHECK])
  222 AC_REQUIRE([AC_ARG_PROGRAM])
  223 dnl FIXME This is truly gross.
  224 missing_dir=`cd $ac_aux_dir && pwd`
  225 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
  226 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
  227 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
  228 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
  229 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
  230 AC_REQUIRE([AC_PROG_MAKE_SET])])
  231 
  232 #
  233 # Check to make sure that the build environment is sane.
  234 #
  235 
  236 AC_DEFUN(AM_SANITY_CHECK,
  237 [AC_MSG_CHECKING([whether build environment is sane])
  238 # Just in case
  239 sleep 1
  240 echo timestamp > conftestfile
  241 # Do `set' in a subshell so we don't clobber the current shell's
  242 # arguments.  Must try -L first in case configure is actually a
  243 # symlink; some systems play weird games with the mod time of symlinks
  244 # (eg FreeBSD returns the mod time of the symlink's containing
  245 # directory).
  246 if (
  247    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
  248    if test "[$]*" = "X"; then
  249       # -L didn't work.
  250       set X `ls -t $srcdir/configure conftestfile`
  251    fi
  252    if test "[$]*" != "X $srcdir/configure conftestfile" \
  253       && test "[$]*" != "X conftestfile $srcdir/configure"; then
  254 
  255       # If neither matched, then we have a broken ls.  This can happen
  256       # if, for instance, CONFIG_SHELL is bash and it inherits a
  257       # broken ls alias from the environment.  This has actually
  258       # happened.  Such a system could not be considered "sane".
  259       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
  260 alias in your environment])
  261    fi
  262 
  263    test "[$]2" = conftestfile
  264    )
  265 then
  266    # Ok.
  267    :
  268 else
  269    AC_MSG_ERROR([newly created file is older than distributed files!
  270 Check your system clock])
  271 fi
  272 rm -f conftest*
  273 AC_MSG_RESULT(yes)])
  274 
  275 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
  276 dnl The program must properly implement --version.
  277 AC_DEFUN(AM_MISSING_PROG,
  278 [AC_MSG_CHECKING(for working $2)
  279 # Run test in a subshell; some versions of sh will print an error if
  280 # an executable is not found, even if stderr is redirected.
  281 # Redirect stdin to placate older versions of autoconf.  Sigh.
  282 if ($2 --version) < /dev/null > /dev/null 2>&1; then
  283    $1=$2
  284    AC_MSG_RESULT(found)
  285 else
  286    $1="$3/missing $2"
  287    AC_MSG_RESULT(missing)
  288 fi
  289 AC_SUBST($1)])
  290 
  291 # Like AC_CONFIG_HEADER, but automatically create stamp file.
  292 
  293 AC_DEFUN(AM_CONFIG_HEADER,
  294 [AC_PREREQ([2.12])
  295 AC_CONFIG_HEADER([$1])
  296 dnl When config.status generates a header, we must update the stamp-h file.
  297 dnl This file resides in the same directory as the config header
  298 dnl that is generated.  We must strip everything past the first ":",
  299 dnl and everything past the last "/".
  300 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
  301 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
  302 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
  303 <<am_indx=1
  304 for am_file in <<$1>>; do
  305   case " <<$>>CONFIG_HEADERS " in
  306   *" <<$>>am_file "*<<)>>
  307     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
  308     ;;
  309   esac
  310   am_indx=`expr "<<$>>am_indx" + 1`
  311 done<<>>dnl>>)
  312 changequote([,]))])
  313 
  314 
  315 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
  316 dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
  317 dnl also defines GSTUFF_PKG_ERRORS on error
  318 AC_DEFUN(PKG_CHECK_MODULES, [
  319   succeeded=no
  320 
  321   if test -z "$PKG_CONFIG"; then
  322     AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  323   fi
  324 
  325   if test "$PKG_CONFIG" = "no" ; then
  326      echo "*** The pkg-config script could not be found. Make sure it is"
  327      echo "*** in your path, or set the PKG_CONFIG environment variable"
  328      echo "*** to the full path to pkg-config."
  329      echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  330   else
  331      PKG_CONFIG_MIN_VERSION=0.9.0
  332      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
  333         AC_MSG_CHECKING(for $2)
  334 
  335         if $PKG_CONFIG --exists "$2" ; then
  336             AC_MSG_RESULT(yes)
  337             succeeded=yes
  338 
  339             AC_MSG_CHECKING($1_CFLAGS)
  340             $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
  341             AC_MSG_RESULT($$1_CFLAGS)
  342 
  343             AC_MSG_CHECKING($1_LIBS)
  344             $1_LIBS=`$PKG_CONFIG --libs "$2"`
  345             AC_MSG_RESULT($$1_LIBS)
  346         else
  347             $1_CFLAGS=""
  348             $1_LIBS=""
  349             ## If we have a custom action on failure, don't print errors, but 
  350             ## do set a variable so people can do so.
  351             $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
  352             ifelse([$4], ,echo $$1_PKG_ERRORS,)
  353         fi
  354 
  355         AC_SUBST($1_CFLAGS)
  356         AC_SUBST($1_LIBS)
  357      else
  358         echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
  359         echo "*** See http://www.freedesktop.org/software/pkgconfig"
  360      fi
  361   fi
  362 
  363   if test $succeeded = yes; then
  364      ifelse([$3], , :, [$3])
  365   else
  366      ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
  367   fi
  368 ])
  369 
  370 
  371