Create an m4 directory for common macros and use it.

Split acinclude.m4 in multiple macro files.

Let it be known to autoconf and aclocal to use the m4 directory.
Ignore macro files copied or linked by libtool and intltool.
This commit is contained in:
Diego 'Flameeyes' Pettenò 2008-08-08 12:18:53 +02:00
parent f4e9b7d778
commit 2da79d5ade
8 changed files with 49 additions and 42 deletions

View file

@ -15,7 +15,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.
ACLOCAL_AMFLAGS = -I common
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = bootstrap.sh LICENSE GPL LGPL doxygen/Makefile.am doxygen/Makefile.in doxygen/doxygen.conf.in README todo
SUBDIRS=src doxygen man po

View file

@ -58,7 +58,7 @@ else
intltoolize --copy --force --automake
"$LIBTOOLIZE" -c --force --ltdl
run_versioned aclocal "$VERSION" -I common
run_versioned aclocal "$VERSION" -I m4
run_versioned autoconf 2.59 -Wall
run_versioned autoheader 2.59
run_versioned automake "$VERSION" --copy --foreign --add-missing

View file

@ -28,6 +28,7 @@ m4_define(PA_MICRO, [11])
AC_INIT([pulseaudio], PA_MAJOR.PA_MINOR.PA_MICRO,[mzchyfrnhqvb (at) 0pointer (dot) net])
AC_CONFIG_SRCDIR([src/daemon/main.c])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign 1.10 -Wall])

8
m4/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
argz.m4
intltool.m4
libtool.m4
ltdl.m4
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4

19
m4/acx_libwrap.m4 Normal file
View file

@ -0,0 +1,19 @@
AC_DEFUN([ACX_LIBWRAP], [
LIBWRAP_LIBS=
saved_LIBS="$LIBS"
LIBS="$LIBS -lwrap"
AC_MSG_CHECKING([for tcpwrap library and headers])
AC_LINK_IFELSE(
AC_LANG_PROGRAM(
[#include <tcpd.h>
#include <syslog.h>
int allow_severity = LOG_INFO;
int deny_severity = LOG_WARNING;],
[struct request_info *req;
return hosts_access (req);]),
[AC_DEFINE(HAVE_LIBWRAP, [], [Have tcpwrap?])
LIBWRAP_LIBS="-lwrap"
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
LIBS="$saved_LIBS"
])

6
m4/acx_lirc.m4 Normal file
View file

@ -0,0 +1,6 @@
AC_DEFUN([ACX_LIRC], [
LIRC_CFLAGS=
LIRC_LIBS=
AC_CHECK_HEADER(lirc/lirc_client.h,[AC_CHECK_LIB(lirc_client,lirc_init,[HAVE_LIRC=1
LIRC_LIBS=-llirc_client],HAVE_LIRC=0)],HAVE_LIRC=0)
])

View file

@ -346,43 +346,3 @@ else
fi
AC_LANG_RESTORE
])dnl ACX_PTHREAD
AC_DEFUN([AC_CHECK_DEFINE],[
AS_VAR_PUSHDEF([ac_var],[ac_cv_defined_$1_$2])dnl
AC_CACHE_CHECK([for $1 in $2], ac_var,
AC_TRY_COMPILE([#include <$2>],[
#ifdef $1
int ok;
#else
choke me
#endif
],AS_VAR_SET(ac_var, yes),AS_VAR_SET(ac_var, no)))
AS_IF([test AS_VAR_GET(ac_var) != "no"], [$3], [$4])dnl
AS_VAR_POPDEF([ac_var])dnl
])
AC_DEFUN([ACX_LIBWRAP], [
LIBWRAP_LIBS=
saved_LIBS="$LIBS"
LIBS="$LIBS -lwrap"
AC_MSG_CHECKING([for tcpwrap library and headers])
AC_LINK_IFELSE(
AC_LANG_PROGRAM(
[#include <tcpd.h>
#include <syslog.h>
int allow_severity = LOG_INFO;
int deny_severity = LOG_WARNING;],
[struct request_info *req;
return hosts_access (req);]),
[AC_DEFINE(HAVE_LIBWRAP, [], [Have tcpwrap?])
LIBWRAP_LIBS="-lwrap"
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
LIBS="$saved_LIBS"
])
AC_DEFUN([ACX_LIRC], [
LIRC_CFLAGS=
LIRC_LIBS=
AC_CHECK_HEADER(lirc/lirc_client.h,[AC_CHECK_LIB(lirc_client,lirc_init,[HAVE_LIRC=1
LIRC_LIBS=-llirc_client],HAVE_LIRC=0)],HAVE_LIRC=0)
])

13
m4/check_define.m4 Normal file
View file

@ -0,0 +1,13 @@
AC_DEFUN([AC_CHECK_DEFINE],[
AS_VAR_PUSHDEF([ac_var],[ac_cv_defined_$1_$2])dnl
AC_CACHE_CHECK([for $1 in $2], ac_var,
AC_TRY_COMPILE([#include <$2>],[
#ifdef $1
int ok;
#else
choke me
#endif
],AS_VAR_SET(ac_var, yes),AS_VAR_SET(ac_var, no)))
AS_IF([test AS_VAR_GET(ac_var) != "no"], [$3], [$4])dnl
AS_VAR_POPDEF([ac_var])dnl
])