dnl $CoreSDI: aclocal.m4,v 1.9.4.1 2002/01/02 23:51:17 claudio Exp $ dnl dnl Copyright (c) 2000, 2001, Core SDI S.A., Argentina dnl All rights reserved dnl dnl Redistribution and use in source and binary forms, with or without dnl modification, are permitted provided that the following conditions dnl are met: dnl dnl 1. Redistributions of source code must retain the above copyright dnl notice, this list of conditions and the following disclaimer. dnl 2. Redistributions in binary form must reproduce the above copyright dnl notice, this list of conditions and the following disclaimer in the dnl documentation and/or other materials provided with the distribution. dnl 3. Neither name of the Core SDI S.A. nor the names of its contributors dnl may be used to endorse or promote products derived from this software dnl without specific prior written permission. dnl dnl THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR dnl IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES dnl OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. dnl IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, dnl INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT dnl NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, dnl DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY dnl THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT dnl (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF dnl THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. dnl dnl dnl Search for specific program. dnl input: $1=progname, dnl output: $2=program pathname dnl AC_DEFUN(AU_PROG, [ AC_MSG_CHECKING(for $1) for i in /bin /usr/bin /usr/local/bin; do if test -f $i/$1; then $2=$i/$1 fi done if ! test "$2"; then AC_MSG_ERROR("$1 program not found.") fi AC_MSG_RESULT($i/$1) ]) dnl dnl Print "lib$1 not found. $2" fatal error message. dnl AC_DEFUN(AU_NEEDLIB, [ AC_MSG_ERROR("lib$1 not found. $2") ]) dnl dnl PGSQL attribute options dnl AC_DEFUN(AU_ATTR_PGSQL, [ AC_ARG_WITH(pgsql-incdir, [ --with-pgsql-incdir=dir PGSQL include directory ], [ PGSQL_INCDIR="-I$withval" ], [ PGSQL_INCDIR="-I/usr/include/pgsql" ]) AC_ARG_WITH(pgsql-libdir, [ --with-pgsql-libdir=dir PGSQL library directory ], [ PGSQL_LIBDIR="-L$withval" ], [ PGSQL_LIBDIR="" ]) AC_ARG_WITH(pgsql, [ --with-pgsql Enables pgsql stuff ], [ ORIG_LDFLAGS="$LDFLAGS" ORIG_LIBS="$LIBS" LDFLAGS="$LDFLAGS $PGSQL_LIBDIR" AC_CHECK_LIB(pq, PQsetdbLogin, , AU_NEEDLIB(pq)) LIBS="$ORIG_LIBS" LDFLAGS="$ORIG_LDFLAGS" EXTRA_DIRS="$EXTRA_DIRS pgsql" PGSQL_MAKEFILE="src/modules/attr/pgsql/Makefile" ]) ]) dnl dnl MySQL attribute options dnl AC_DEFUN(AU_ATTR_MYSQL, [ AC_ARG_WITH(mysql-incdir, [ --with-mysql-incdir=dir MySQL include directory ], [ MYSQL_INCDIR="-I$withval" ], [ MYSQL_INCDIR="" ]) AC_ARG_WITH(mysql-libdir, [ --with-mysql-libdir=dir MySQL library directory ], [ MYSQL_LIBDIR="-L$withval" ], [ MYSQL_LIBDIR="-L/usr/lib/mysql" ]) AC_ARG_WITH(mysql, [ --with-mysql Enables mysql stuff ], [ ORIG_LDFLAGS="$LDFLAGS" ORIG_LIBS="$LIBS" LDFLAGS="$LDFLAGS $MYSQL_LIBDIR" AC_CHECK_LIB(mysqlclient, mysql_real_connect, , AU_NEEDLIB(mysqlclient)) LIBS="$ORIG_LIBS" LDFLAGS="$ORIG_LDFLAGS" EXTRA_DIRS="$EXTRA_DIRS mysql" MYSQL_MAKEFILE="src/modules/attr/mysql/Makefile" ]) ]) dnl dnl Linux specific options dnl AC_DEFUN(AU_LINUX, [ if test "$UNAME" = "Linux"; then LDFLAGS="$LDFLAGS -Wl,-E" SHLIB_FLAGS="-x -shared" PICFLAGS="" STRIPLIB="-s" AC_CHECK_HEADER(shadow.h, [ AUTH_RAW_DEFS="-DHAVE_SHADOW" ]) fi ]) dnl dnl NetBSD specific options dnl AC_DEFUN(AU_NETBSD, [ if test "$UNAME" = "NetBSD"; then LDFLAGS="$LDFLAGS -Xlinker -E" SHLIB_FLAGS="-x -shared" PICFLAGS="-fPIC -DPIC" STRIPLIB="" fi ]) dnl dnl FreeBSD specific options dnl AC_DEFUN(AU_FREEBSD, [ if test "$UNAME" = "FreeBSD"; then LDFLAGS="$LDFLAGS -Xlinker -E" SHLIB_FLAGS="-x -shared" PICFLAGS="-fPIC -DPIC" STRIPLIB="" fi ]) dnl dnl Install options: dnl BINOWN, BINGRP, BINMOD, MANOWN, MANGRP, MANMOD, DIRMOD dnl AC_DEFUN(AU_INSTALL_OPTIONS, [ AC_ARG_WITH(binown, [ --with-binown=owner Binaries owner ], [ BINOWN="$withval" ], [ BINOWN=0 ]) AC_ARG_WITH(bingrp, [ --with-bingrp=group Binaries group ], [ BINGRP="$withval" ], [ BINGRP=0 ]) AC_ARG_WITH(binmode, [ --with-binmode=mode Binaries mode ], [ BINMODE="$withval" ], [ BINMODE=555 ]) AC_ARG_WITH(manown, [ --with-manown=owner Man pages owner ], [ MANOWN="$withval" ], [ MANOWN=0 ]) AC_ARG_WITH(mangrp, [ --with-mangrp=group Man pages group ], [ MANGRP="$withval" ], [ MANGRP=0 ]) AC_ARG_WITH(manmode, [ --with-manmode=mode Man pages mode ], [ MANMODE="$withval" ], [ MANMODE=444 ]) AC_ARG_WITH(dirmode, [ --with-dirmode=mode Directories mode ], [ DIRMODE="$withval" ], [ DIRMODE=755 ]) AC_ARG_WITH(audit-libdir, [ --with-audit-libdir=dir Audit libraries directory (build time) ], [ AUDIT_LIBDIR="$withval" ], [ AUDIT_LIBDIR="/usr/local/lib/alat" ]) AC_ARG_WITH(audit-rlibdir, [ --with-audit-rlibdir=dir Audit libraries directory (runtime)], [ DEFAULT_MODULES_PATH="-DDEFAULT_MODULES_PATH=\"\\\"$withval\\\"\"" ], []) ])