1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/pconf_detect.c)
AM_INIT_AUTOMAKE(libprinterconf, 0.5)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_PROG_LN_S
AM_PROG_LIBTOOL
AM_CONFIG_HEADER(config.h)
WARNS=""
AC_ARG_ENABLE(debug,
[ --enable-debug turn on debugging (assumes gcc/gdb) [default=no]],
WARNS="-W -Wall -Wundef -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wshadow -O0 -ggdb3")
AC_SUBST(WARNS)
AC_ARG_ENABLE(local-snmpkit,
[ --enable-local-snmpkit specify the local paths to snmpkit],
[ SNMPKIT_LIBS="${enableval}/libsnmpkit.la"
SNMPKIT_INCLUDES="-I${enableval}"
],[
SNMPKIT_LIBS=""
]
)
AC_SUBST(SNMPKIT_LIBS)
AC_SUBST(SNMPKIT_INCLUDES)
AM_PATH_GLIB(1.2.0, [], [
AC_MSG_ERROR(You must have glib to compile this version of LPR)
])
AC_PROG_CXX
AC_LANG_CPLUSPLUS
AC_ARG_ENABLE(local-printsys,
[ --enable-local-printsys specify the local paths to printsys],
[ PRINTSYS_LIBS="${enableval}/libprintsys.la"
PRINTSYS_INCLUDES="-I${enableval}"
],[
PRINTSYS_LIBS=""
PRINTSYS_INCLUDES="-I${enableval}"
]
)
AC_SUBST(PRINTSYS_LIBS)
AC_SUBST(PRINTSYS_INCLUDES)
AC_CHECK_FUNC(pthread_join,
AC_MSG_RESULT(using libc's pthread_join),
AC_CHECK_LIB(pthread, pthread_join))
AC_CHECK_LIB(tdb, tdb_store, LIBS="$LIBS -ltdb", AC_MSG_ERROR(You must have tdb ))
if test -z "${PRINTSYS_LIBS}"; then
AC_CHECK_LIB(printsys,lps_init,[],
AC_MSG_ERROR(must have libprintsys to compile),-lglib -ltdb)
fi
# if the --enable-local-snmpkit was passed in assume that the
# the person who is building this knows what they are doing and
# skip the test to make sure that the header file and lib is
# actually installed.
if test -z "${SNMPKIT_LIBS}"; then
AC_CHECK_HEADER(snmpkit,,[
AC_MSG_ERROR(Must have snmpkit headers to compile libprinterconf)])
LIBS="$LIBS -lsnmpkit"
AC_TRY_LINK([#include <snmpkit>],[set_snmpsock_props(30, 5, 0)],
[ : ],
[AC_MSG_ERROR(Must have snmpkit library to compile libprinterconf)])
fi
dnl loads in the magic pixie dust for the m4 files
TESTSCRIPTS=`cd src/tests && echo *.m4 | sed "s/m4/sh/g"`
AC_SUBST(TESTSCRIPTS)
AC_OUTPUT(Makefile src/Makefile src/tests/Makefile doc/Makefile printerconf.spec)
|