Mercurial > octave-nkf
comparison aclocal.m4 @ 9403:4af6e29449c1
[mq]: graphics_text_engine
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Fri, 26 Jun 2009 21:12:09 +0100 |
parents | 8a5a04b6c46b |
children | eee9b3150446 |
comparison
equal
deleted
inserted
replaced
9402:cdfb9ad48080 | 9403:4af6e29449c1 |
---|---|
1462 yes) | 1462 yes) |
1463 AC_DEFINE([HAVE_C99_VSNPRINTF], [1], [Define if you have a c99 vsnprintf]) | 1463 AC_DEFINE([HAVE_C99_VSNPRINTF], [1], [Define if you have a c99 vsnprintf]) |
1464 ;; | 1464 ;; |
1465 esac | 1465 esac |
1466 ]) | 1466 ]) |
1467 | |
1468 ############################################################################## | |
1469 ############################################################################## | |
1470 | |
1471 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- | |
1472 # | |
1473 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>. | |
1474 # | |
1475 # This program is free software; you can redistribute it and/or modify | |
1476 # it under the terms of the GNU General Public License as published by | |
1477 # the Free Software Foundation; either version 2 of the License, or | |
1478 # (at your option) any later version. | |
1479 # | |
1480 # This program is distributed in the hope that it will be useful, but | |
1481 # WITHOUT ANY WARRANTY; without even the implied warranty of | |
1482 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
1483 # General Public License for more details. | |
1484 # | |
1485 # You should have received a copy of the GNU General Public License | |
1486 # along with this program; if not, write to the Free Software | |
1487 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
1488 # | |
1489 # As a special exception to the GNU General Public License, if you | |
1490 # distribute this file as part of a program that contains a | |
1491 # configuration script generated by Autoconf, you may include it under | |
1492 # the same distribution terms that you use for the rest of that program. | |
1493 | |
1494 # PKG_PROG_PKG_CONFIG([MIN-VERSION]) | |
1495 # ---------------------------------- | |
1496 AC_DEFUN([PKG_PROG_PKG_CONFIG], | |
1497 [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) | |
1498 m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) | |
1499 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl | |
1500 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then | |
1501 AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) | |
1502 fi | |
1503 if test -n "$PKG_CONFIG"; then | |
1504 _pkg_min_version=m4_default([$1], [0.9.0]) | |
1505 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) | |
1506 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then | |
1507 AC_MSG_RESULT([yes]) | |
1508 else | |
1509 AC_MSG_RESULT([no]) | |
1510 PKG_CONFIG="" | |
1511 fi | |
1512 | |
1513 fi[]dnl | |
1514 ])# PKG_PROG_PKG_CONFIG | |
1515 | |
1516 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) | |
1517 # | |
1518 # Check to see whether a particular set of modules exists. Similar | |
1519 # to PKG_CHECK_MODULES(), but does not set variables or print errors. | |
1520 # | |
1521 # | |
1522 # Similar to PKG_CHECK_MODULES, make sure that the first instance of | |
1523 # this or PKG_CHECK_MODULES is called, or make sure to call | |
1524 # PKG_CHECK_EXISTS manually | |
1525 # -------------------------------------------------------------- | |
1526 AC_DEFUN([PKG_CHECK_EXISTS], | |
1527 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl | |
1528 if test -n "$PKG_CONFIG" && \ | |
1529 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then | |
1530 m4_ifval([$2], [$2], [:]) | |
1531 m4_ifvaln([$3], [else | |
1532 $3])dnl | |
1533 fi]) | |
1534 | |
1535 | |
1536 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) | |
1537 # --------------------------------------------- | |
1538 m4_define([_PKG_CONFIG], | |
1539 [if test -n "$PKG_CONFIG"; then | |
1540 if test -n "$$1"; then | |
1541 pkg_cv_[]$1="$$1" | |
1542 else | |
1543 PKG_CHECK_EXISTS([$3], | |
1544 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], | |
1545 [pkg_failed=yes]) | |
1546 fi | |
1547 else | |
1548 pkg_failed=untried | |
1549 fi[]dnl | |
1550 ])# _PKG_CONFIG | |
1551 | |
1552 # _PKG_SHORT_ERRORS_SUPPORTED | |
1553 # ----------------------------- | |
1554 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], | |
1555 [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) | |
1556 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then | |
1557 _pkg_short_errors_supported=yes | |
1558 else | |
1559 _pkg_short_errors_supported=no | |
1560 fi[]dnl | |
1561 ])# _PKG_SHORT_ERRORS_SUPPORTED | |
1562 | |
1563 | |
1564 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], | |
1565 # [ACTION-IF-NOT-FOUND]) | |
1566 # | |
1567 # | |
1568 # Note that if there is a possibility the first call to | |
1569 # PKG_CHECK_MODULES might not happen, you should be sure to include an | |
1570 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac | |
1571 # | |
1572 # | |
1573 # -------------------------------------------------------------- | |
1574 AC_DEFUN([PKG_CHECK_MODULES], | |
1575 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl | |
1576 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl | |
1577 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl | |
1578 | |
1579 pkg_failed=no | |
1580 AC_MSG_CHECKING([for $1]) | |
1581 | |
1582 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) | |
1583 _PKG_CONFIG([$1][_LIBS], [libs], [$2]) | |
1584 | |
1585 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS | |
1586 and $1[]_LIBS to avoid the need to call pkg-config. | |
1587 See the pkg-config man page for more details.]) | |
1588 | |
1589 if test $pkg_failed = yes; then | |
1590 _PKG_SHORT_ERRORS_SUPPORTED | |
1591 if test $_pkg_short_errors_supported = yes; then | |
1592 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` | |
1593 else | |
1594 $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` | |
1595 fi | |
1596 # Put the nasty error message in config.log where it belongs | |
1597 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD | |
1598 | |
1599 ifelse([$4], , [AC_MSG_ERROR(dnl | |
1600 [Package requirements ($2) were not met: | |
1601 | |
1602 $$1_PKG_ERRORS | |
1603 | |
1604 Consider adjusting the PKG_CONFIG_PATH environment variable if you | |
1605 installed software in a non-standard prefix. | |
1606 | |
1607 _PKG_TEXT | |
1608 ])], | |
1609 [AC_MSG_RESULT([no]) | |
1610 $4]) | |
1611 elif test $pkg_failed = untried; then | |
1612 ifelse([$4], , [AC_MSG_FAILURE(dnl | |
1613 [The pkg-config script could not be found or is too old. Make sure it | |
1614 is in your PATH or set the PKG_CONFIG environment variable to the full | |
1615 path to pkg-config. | |
1616 | |
1617 _PKG_TEXT | |
1618 | |
1619 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])], | |
1620 [$4]) | |
1621 else | |
1622 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS | |
1623 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS | |
1624 AC_MSG_RESULT([yes]) | |
1625 ifelse([$3], , :, [$3]) | |
1626 fi[]dnl | |
1627 ])# PKG_CHECK_MODULES | |
1628 | |
1629 ############################################################################## | |
1630 ############################################################################## |