-dnl Process this file with autoconf to produce a configure script.
+dnl configure.in for RPM
+dnl
+dnl Don't add checks for things we can't work around, unless those checks
+dnl failing causes the script to bomb out with a message. If we can't fix
+dnl it, why check it?
+
AC_INIT(rpm.c)
topdir=`pwd`
+echo -n "checking for /usr/local/lib..."
+if test -d /usr/local/lib ; then
+ LIBS="$LIBS -L/usr/local/lib"
+ LIBPATH="$LIBPATH -L/usr/local/lib"
+
+ echo " yes"
+else
+ echo " no"
+fi
+
+echo -n "checking for /usr/local/include..."
+if test -d /usr/local/include ; then
+ INCPATH="$INCPATH -I/usr/local/include"
+
+ echo " yes"
+else
+ echo " no"
+fi
+
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
)
)
-AC_CHECK_LIB(gdbm, dbminit, [], AC_MSG_WARN([sorry this package needs libgdbm.a (from the gdbm package)]))
+AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
+
+if test "$XGETTEXT" != ""; then
+ if xgettext --help 2>&1 | grep illegal >/dev/null ; then
+ echo "xgettext isn't GNU version"
+ XGETTEXT=""
+ fi
+fi
+
+if test "$XGETTEXT" != "" -a "$LIBINTL" != ""; then
+ echo "xgettext and libintl.a exist; will build i18n support"
+ INTLDEF=-D_\\\(String\\\)=gettext\\\(String\\\)
+ PO=po
+ GETTEXTSTUB=""
+else
+ echo "xgettext and libintl.a don't both exist; will not build i18n support"
+ INTLDEF=-D_\\\(a\\\)=a
+ XGETTEXT=""
+ LIBINTL=""
+ PO=""
+ GETTEXTSTUB="gettextstub.o"
+fi
+
AC_CHECK_FUNC(dbopen, [],
AC_CHECK_LIB(db, dbopen, [], AC_MSG_WARN([sorry this package needs libdb.a
-(from the db package)]))
+(from the db package)]), $LIBS)
)
AC_CHECK_LIB(socket, socket, [LIBSOCKET="-lsocket -lnsl"])
[if test ${zlib} = gz; then
AC_MSG_WARN([sorry this package needs libz.a or libgz.a (from the zlib package)])
fi]
- )
+ , $LIBS)
done
AC_SUBST(ZLIB)
-dnl Checks for header files.
-AC_HEADER_DIRENT
-AC_HEADER_STDC
-AC_CHECK_HEADERS(sys/socket.h ftw.h getopt.h regex.h regexp.h endian.h)
-AC_CHECK_HEADERS(machine/endian.h sys/byteorder.h machine/types.h)
-AC_CHECK_HEADERS(netinet_in_systm.h malloc.h string.h sys/select.h)
-AC_CHECK_HEADERS(fcntl.h limits.h paths.h sys/file.h sys/time.h unistd.h)
-AC_CHECK_HEADERS(sys/socket.h sys/utsname.h)
-
-dnl Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_C_INLINE
-AC_TYPE_UID_T
-AC_TYPE_MODE_T
-AC_TYPE_OFF_T
-AC_TYPE_PID_T
-AC_TYPE_SIZE_T
-AC_STRUCT_ST_RDEV
-AC_HEADER_TIME
-AC_STRUCT_TM
+dnl Checks for header files we can live without.
+AC_CHECK_HEADERS(netinet/in_systm.h)
+AC_C_BIGENDIAN
dnl Checks for library functions.
-AC_FUNC_ALLOCA
-AC_FUNC_MEMCMP
-AC_TYPE_SIGNAL
-AC_FUNC_VPRINTF
-AC_CHECK_FUNC(vfork)
-AC_CHECK_FUNC(setenv)
-AC_CHECK_FUNC(inet_aton)
-AC_CHECK_FUNC(realpath, REALPATH='', REALPATH='realpath.o' LIBMISC='-lmisc')
-AC_CHECK_FUNC(ftw, FTW='', FTW='ftw.o' LIBMISC='-lmisc')
-AC_CHECK_FUNC(getopt_long, GETOPT='' GETOPT1='', GETOPT='getopt.o' GETOPT1='getopt1.o' LIBMISC='-lmisc')
+AC_CHECK_FUNC(inet_aton, AC_DEFINE(HAVE_INET_ATON), MISCOBJS="$MISCOBJS inet_aton.o")
+AC_CHECK_FUNC(realpath, [], MISCOBJS="$MISCOBJS realpath.o")
+AC_CHECK_FUNC(setenv, [], MISCOBJS="$MISCOBJS setenv.o")
+AC_CHECK_FUNC(getopt_long, [], MISCOBJS="$MISCOBJS getopt.o getopt1.o")
+
+if test -n "$MISCOBJS"; then
+ LIBMISC=-lmisc
+fi
if test "x$varprefix" = "x"; then
varprefix=`echo $prefix | sed 's/usr/var/'`
fi
fi
-AC_SUBST(REALPATH)
-AC_SUBST(FTW)
-AC_SUBST(GETOPT)
-AC_SUBST(GETOPT1)
+AC_CANONICAL_SYSTEM
+
+if echo "$build" | grep solaris >/dev/null ; then
+ # Solaris needs -ldl to use -lnsl, and it can't build static
+ # binaries if you use -ldl
+ echo "hacking things up for solaris"
+ LIBDL=-ldl
+else
+ RPMSTATIC=rpm
+fi
+
+AC_SUBST(MISCOBJS)
+AC_SUBST(INCPATH)
AC_SUBST(LIBMISC)
AC_SUBST(LIBINTL)
AC_SUBST(LIBSOCKET)
AC_SUBST(varprefix)
AC_SUBST(tmpdir)
AC_SUBST(topdir)
+AC_SUBST(INTLDEF)
+AC_SUBST(XGETTEXT)
+AC_SUBST(LIBINTL)
+AC_SUBST(LIBPATH)
+AC_SUBST(LIBDL)
+AC_SUBST(PO)
+AC_SUBST(GETTEXTSTUB)
+AC_SUBST(RPMSTATIC)
AC_OUTPUT(Makefile Makefile.inc lib-rpmrc lib/Makefile build/Makefile tools/Makefile po/Makefile misc/Makefile)