dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.2) AC_INIT(rpm2html.h) AC_REVISION dnl dnl Checks for platform information dnl AC_CANONICAL_SYSTEM AC_CONFIG_HEADER(config.h) dnl Checks for programs. AC_PROG_CC AC_PROG_LN_S AC_PROG_INSTALL AC_PATH_PROG(CP, cp, /bin/cp) AC_PATH_PROG(RM, rm, /bin/rm) AC_PATH_PROG(MV, mv, /bin/mv) AC_PATH_PROG(TAR, tar, /bin/tar) AC_PATH_PROG(GZIP, gzip, /bin/gzip) dnl Checks for libraries. dnl Replace `main' with a function in -lrpm: for z in z gz ; do AC_CHECK_LIB(${z}, deflate, [LIBS="-l${z} $LIBS"; break]) done AC_CHECK_LIB(intl, gettext) AC_CHECK_FUNC(dbopen, [], [ AC_CHECK_LIB(db-3.1, db_create, [LIBS="-ldb-3.1 $LIBS"], AC_CHECK_LIB(db-3.0, db_create, [LIBS="-ldb-3.0 $LIBS"], AC_CHECK_LIB(db1, dbopen, [LIBS="-ldb1 $LIBS"], AC_CHECK_LIB(db, dbopen, [LIBS="-ldb $LIBS"], AC_MSG_ERROR([*** db lib not found]))))) ]) AC_CHECK_LIB(popt, poptGetContext, [LIBS="-lpopt $LIBS"], AC_MSG_ERROR(*** libpopt not found)) AC_CHECK_LIB(rpmio, Fopen, [LIBS="-lrpmio $LIBS"; AC_DEFINE_UNQUOTED(USE_RPMIO, 1) AC_SUBST(USE_RPMIO) ]) AC_CHECK_LIB(rpm, rpmReadConfigFiles, [LIBS="-lrpm $LIBS"], AC_MSG_ERROR(*** librpm not found)) dnl dnl Is there a specific path for RPM stuff ? dnl RPM_CFLAGS="-I/usr/include/rpm" RPM_LIBS="-L/usr/lib" AC_ARG_WITH(rpm-prefix, [ --with-rpm-prefix Prefix for RPM (/usr)]) if test "$with_rpm_prefix" != "" ; then RPM_CFLAGS="-I$with_rpm_prefix/include/rpm" RPM_LIBS="-L$with_rpm_prefix/libs" fi AC_ARG_WITH(rpm-includes, [ --with-rpm-includes Includes for RPM (/usr/include/rpm)]) if test "$with_rpm_includes" != "" ; then RPM_CFLAGS="-I$with_rpm_includes" fi AC_ARG_WITH(rpm-flags, [ --with-rpm-flags Libs for RPM (/usr/lib)]) if test "$with_rpm_flags" != "" ; then RPM_LIBS="-L$with_rpm_flags" fi AC_SUBST(RPM_CFLAGS) AC_SUBST(RPM_LIBS) dnl hack: we're gonna use rpm-3.1 AC_DEFINE_UNQUOTED(USE_RPM310, 1) AC_SUBST(USE_RPM310) AC_CHECK_LIB(rpm, rpmReadConfigFiles,,AC_MSG_ERROR(*** rpm lib not found)) dnl dnl Checking for libxml dnl AC_CHECK_PROG(XML_CONFIG, xml-config, xml-config) if test "$XML_CONFIG" != "" then XML_LIBS="`xml-config --libs`" XML_CFLAGS="`xml-config --cflags`" else echo rpm2html needs libxml to be installed echo On Linux you will need the libxml and libxml-devel packages echo You can find them at ftp://rpmfind.net/pub/veillard exit 1 fi AC_SUBST(XML_LIBS) AC_SUBST(XML_CFLAGS) dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS(db_185.h db1/db.h) AC_CHECK_HEADERS(fcntl.h unistd.h ctype.h dirent.h errno.h malloc.h) AC_CHECK_HEADERS(rpm/rpmio.h) AC_CHECK_HEADERS(stdarg.h sys/stat.h sys/types.h time.h) AC_CHECK_HEADERS(zlib.h rpm/rpmlib.h) dnl Checks for library functions. AC_FUNC_STRFTIME AC_CHECK_FUNCS(gethostname strdup strndup strerror snprintf unlink) dnl dnl Do we plug in the database backend ? dnl SQL_FLAGS= SQL_OBJ= SQL_PROGS= AC_ARG_WITH(sql, [ --with-sql Add the SQL support (off)]) if test "$with_sql" = "yes" ; then AC_CHECK_LIB(mysqlclient, mysql_init, [LIBS="-lmysqlclient $LIBS"], AC_MSG_ERROR(*** libmysqlclient not found)) echo Enabling SQL support SQL_FLAGS="-DWITH_SQL" SQL_OBJ=sql.o SQL_PROGS=sqltools fi AC_SUBST(SQL_FLAGS) AC_SUBST(SQL_PROGS) AC_SUBST(SQL_OBJ) dnl dnl Do we plug in the gpg? dnl GPG_FLAGS= GPG_PROG= AC_ARG_WITH(gpg, [ --with-gpg Add the GPG support (off)]) if test "x$with_gpg" != "x" ; then if test "$with_gpg" = "yes" ; then AC_PATH_PROG(GPG_PROG, gpg, /usr/bin/gpg) else AC_PATH_PROG(GPG_PROG, gpg, "$with_gpg") fi dnl for now, signature resolving code is implemented only with librpmio dnl so without librpmio it wont work if "x$USE_RPMIO" != "x1" ; then AC_MSG_ERROR(*** librpmio not found, use --without-gpg) fi echo Enabling GPG support GPG_FLAGS="-DWITH_GPG -DGPG_PROG=\\\"$GPG_PROG\\\"" fi AC_SUBST(GPG_FLAGS) AC_SUBST(GPG_PROG) AC_OUTPUT(Makefile)