summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2005-01-17 23:58:09 +0000
committerjbj <devnull@localhost>2005-01-17 23:58:09 +0000
commit217c588baacf213a4570ee13e27477683baa3e88 (patch)
tree693227cc46d5576aa50746e5a195d5cea0373537
parentcd3d87df20647dc49e9091115a4e78922387ceb0 (diff)
downloadrpm-217c588baacf213a4570ee13e27477683baa3e88.tar.gz
rpm-217c588baacf213a4570ee13e27477683baa3e88.tar.bz2
rpm-217c588baacf213a4570ee13e27477683baa3e88.zip
Build on macosx.
CVS patchset: 7701 CVS date: 2005/01/17 23:58:09
-rw-r--r--Makefile.am2
-rwxr-xr-xautogen.sh23
-rw-r--r--build/Makefile.am1
-rw-r--r--configure.ac25
-rwxr-xr-xdb/dist/configure3
-rwxr-xr-xfile/autogen.sh16
-rw-r--r--lib/Makefile.am4
-rw-r--r--lib/formats.c6
-rw-r--r--lib/poptALL.c1
-rw-r--r--lib/rpmrc.c7
-rw-r--r--lua/Makefile.am2
-rw-r--r--misc/glob.h2
-rw-r--r--popt/Makefile.am2
-rwxr-xr-xpopt/autogen.sh12
-rw-r--r--python/header-py.h2
-rw-r--r--python/rpmmodule.c4
-rw-r--r--rpm2cpio.c1
-rw-r--r--rpmdb/Makefile.am1
-rw-r--r--rpmio/Makefile.am3
-rw-r--r--rpmio/fts.c6
-rw-r--r--rpmio/fts.h4
-rw-r--r--rpmio/rpmdav.c4
-rw-r--r--rpmio/rpmdav.h2
-rw-r--r--rpmio/rpmio.h2
-rwxr-xr-xrpmqv.c1
-rw-r--r--system.h2
-rw-r--r--tools/Makefile.am20
-rw-r--r--tools/convertdb1.c1
-rw-r--r--tools/dump.c1
-rw-r--r--tools/dumpdb.c1
-rw-r--r--tools/rpmcache.c2
-rw-r--r--tools/rpmdeps.c1
-rw-r--r--tools/rpmgraph.c1
-rw-r--r--tools/rpminject.c1
-rw-r--r--tools/rpmsort.c1
-rw-r--r--tools/rpmtool.c1
-rw-r--r--tools/rpmxml.c2
-rw-r--r--tools/rpmxp.c2
38 files changed, 134 insertions, 38 deletions
diff --git a/Makefile.am b/Makefile.am
index de17d3d6f..3cff70afa 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,6 +23,7 @@ INCLUDES = \
-I$(top_srcdir)/rpmio \
@WITH_BEECRYPT_INCLUDE@ \
-I$(top_srcdir)/popt \
+ -I$(top_srcdir)/misc \
@WITH_LIBELF_INCLUDE@ \
@INCPATH@
@@ -36,7 +37,6 @@ myLDADD = \
$(top_builddir)/rpmio/librpmio.la \
$(top_builddir)/popt/libpopt.la \
@WITH_ZLIB_LIB@ \
- @INTLLIBS@ \
@LIBMISC@
rpmbindir = `echo $(bindir) | sed -e s,usr/bin,bin,`
diff --git a/autogen.sh b/autogen.sh
index 9df187c71..c5061adea 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -16,9 +16,24 @@ checked if you need to, as rpm should build (and has built) with all
recent versions of libtool/autoconf/automake.
"
-[ "`libtoolize --version | head -1`" != "$LTV" ] && echo "$USAGE" && exit 1
+libtoolize=`which glibtoolize 2>/dev/null`
+case $libtoolize in
+/*) ;;
+*) libtoolize=`which libtoolize 2>/dev/null`
+ case $libtoolize in
+ /*) ;;
+ *) libtoolize=libtoolize
+ esac
+esac
+
+[ "`$libtoolize --version | head -1`" != "$LTV" ] && echo "$USAGE" && exit 1
[ "`autoconf --version | head -1`" != "$ACV" ] && echo "$USAGE" && exit 1
-[ "`automake --version | head -1 | sed -e 's/1\.4[a-z]/1.4/'`" != "$AMV" ] && echo "$USAGE" && exit 1
+[ "`automake --version | head -1 | sed -e 's/1\.4[a-z]/1.4/'`" != "$AMV" ] && echo "$USAGE" # && exit 1
+
+if [ X"$@" = X -a "X`uname -s`" = "XDarwin" -a -d /opt/local ]; then
+ export myprefix=/opt/local
+ export CPPFLAGS="-I${myprefix}/include"
+fi
if [ -d popt ]; then
(echo "--- popt"; cd popt; ./autogen.sh --noconfigure "$@")
@@ -37,7 +52,7 @@ if [ -d file ]; then
fi
echo "--- rpm"
-libtoolize --copy --force
+$libtoolize --copy --force
aclocal
autoheader
automake -a -c
@@ -62,5 +77,5 @@ if [ X"$@" = X -a "X`uname -s`" = "XLinux" ]; then
fi
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --infodir=${infodir} --mandir=${mandir} ${enable_posixmutexes} "$@"
else
- ./configure "$@"
+ ./configure --prefix=${myprefix} "$@"
fi
diff --git a/build/Makefile.am b/build/Makefile.am
index 6866eb734..d02bdb71c 100644
--- a/build/Makefile.am
+++ b/build/Makefile.am
@@ -12,6 +12,7 @@ INCLUDES = -I. \
@WITH_BEECRYPT_INCLUDE@ \
-I$(top_srcdir)/file/src \
-I$(top_srcdir)/popt \
+ -I$(top_srcdir)/misc \
@WITH_LIBELF_INCLUDE@ \
@INCPATH@
diff --git a/configure.ac b/configure.ac
index 5ad32987b..000642ebf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -110,14 +110,17 @@ dnl LDFLAGS_STATIC="-all"
dnl to attempt static executables using libtool. Otherwise
dnl LDFLAGS_STATIC=""
dnl
+with_selinuxval=no
AC_MSG_CHECKING(flag used by libtool to link rpm)
if test X"$GCC" = Xyes ; then
case "$target" in
+ *-*-linux*) LDFLAGS_STATIC="-all-static"
+ with_selinuxval=yes ;;
*-*-solaris*) LDFLAGS_STATIC="-static";;
*-*-hpux*) LDFLAGS_STATIC="-static";;
*-*-darwin*) LDFLAGS_STATIC="";; # Mac OS X does not do static binaries.
*-*-sysv5uw*) LDFLAGS_STATUS="-static";; # Unixware has no shared libthread.
- *-*-*) LDFLAGS_STATIC="-all-static";;
+ *-*-*) LDFLAGS_STATIC="";;
esac
elif test X"$CC" = Xcc ; then
case "$target" in
@@ -130,7 +133,7 @@ elif test X"$CC" = Xcc ; then
*-*-irix*) LDFLAGS_STATIC="-static";; #should be -non_shared, but can't
# link because of crt1.o then.
*-*-ultrix*) LDFLAGS_STATIC="-all-static";; #ultrix doesn't have shared libs.
- *-*-*) LDFLAGS_STATIC="-static"
+ *-*-*) LDFLAGS_STATIC=""
AC_MSG_WARN([
Unable to guess what option to pass to $CC to generate a static
@@ -346,7 +349,7 @@ do
AC_MSG_CHECKING(for $dir/include in INCPATH)
if test -d $dir/include 2>/dev/null ; then
- if [ "$dir" != "/usr/local" ] ; then
+ if [[ "$dir" != "/usr/local" ]] ; then
INCPATH="$INCPATH -I$dir/include"
fi
AC_MSG_RESULT(yes)
@@ -400,15 +403,19 @@ AC_SUBST(WITH_LIBELF_INCLUDE)
AC_SUBST(WITH_LIBELF_LIB)
WITH_LIBDWARF_INCLUDE=
+WITH_LIBDWARF_DEBUGEDIT=
AC_CHECK_HEADER([dwarf.h], [
AC_DEFINE(HAVE_DWARF_H, 1, [Define to 1 if you have the <dwarf.h> header file.])
+ WITH_LIBDWARF_DEBUGEDIT="debugedit"
], [
if test -d elfutils/libdwarf ; then
AC_DEFINE(HAVE_DWARF_H, 1, [Define to 1 if you have the <dwarf.h> header file.])
WITH_LIBDWARF_INCLUDE="-I\${top_srcdir}/${WITH_ELFUTILS_SUBDIR}/libdwarf"
+ WITH_LIBDWARF_DEBUGEDIT="debugedit"
fi
])
AC_SUBST(WITH_LIBDWARF_INCLUDE)
+AC_SUBST(WITH_LIBDWARF_DEBUGEDIT)
#=================
# Check for beecrypt library. Prefer external, otherwise internal.
@@ -421,7 +428,7 @@ AC_CHECK_HEADER([beecrypt/beecrypt.h], [
AC_CHECK_HEADER([beecrypt/api.h], [
AC_DEFINE(HAVE_BEECRYPT_API_H, 1, [Define to 1 if you have the <beecrypt/api.h> header file.])
])
- WITH_BEECRYPT_INCLUDE="-I/usr/include/beecrypt"
+ WITH_BEECRYPT_INCLUDE="-I${includedir}/beecrypt"
WITH_BEECRYPT_LIB="-lbeecrypt"
])
], [
@@ -447,7 +454,7 @@ AC_CHECK_HEADER([neon/ne_session.h], [
AC_CHECK_LIB(neon, ne_get_response_header, [
AC_DEFINE(HAVE_NEON_NE_GET_RESPONSE_HEADER, 1, [Define to 1 if you have ne_get_response_header() in libneon.])
])
- WITH_NEON_INCLUDE="-I/usr/include/neon"
+ WITH_NEON_INCLUDE="-I${includedir}/neon"
WITH_NEON_LIB="-lneon"
])
], [
@@ -556,9 +563,9 @@ dnl TVM:
dnl horrible *temporary* hack to make sure that if we found gettext() in
dnl -lintl that we add -lintl *back* to $LIBS.
dnl
-if test X$gt_cv_func_gettext_libintl = Xyes ; then
- LIBS="-lintl $LIBS"
-fi
+dnl if test X$gt_cv_func_gettext_libintl = Xyes ; then
+dnl LIBS="-lintl $LIBS"
+dnl fi
dnl Checks for header files we can live without.
AC_HEADER_STDC
@@ -922,7 +929,7 @@ elif test $withval = yes -a $__DOXYGEN = no ; then
fi
WITH_SELINUX_LIB=
-withval=yes
+withval=${with_selinuxval}
AC_ARG_WITH(selinux, [ --with-selinux build with selinux support ])
if test $withval != no ; then
AC_DEFINE(WITH_SELINUX, 1, [Build with selinux support?])
diff --git a/db/dist/configure b/db/dist/configure
index 144beef27..6cda7d877 100755
--- a/db/dist/configure
+++ b/db/dist/configure
@@ -33801,7 +33801,8 @@ echo "${ECHO_T}yes" >&6
-e 's/return;//' \
-e 's/^}/__dbsrv_timeout(0);}/' \
-e '}' \
- -e '1,/^#include/s/^#include/#include "db_config.h"\n#include "db_int_def.h"\
+ -e '1,/^#include/s/^#include/#include "db_config.h"\
+#include "db_int_def.h"\
&/' > db_server_svc.c
$RPCGEN -c $XDR_FILE |
diff --git a/file/autogen.sh b/file/autogen.sh
index 0f9cc5eb5..ff9b215ca 100755
--- a/file/autogen.sh
+++ b/file/autogen.sh
@@ -16,11 +16,21 @@ checked if you need to, as rpm should build (and has built) with all
recent versions of libtool/autoconf/automake.
"
-[ "`libtoolize --version | head -1`" != "$LTV" ] && echo "$USAGE" && exit 1
+libtoolize=`which glibtoolize 2>/dev/null`
+case $libtoolize in
+/*) ;;
+*) libtoolize=`which libtoolize 2>/dev/null`
+ case $libtoolize in
+ /*) ;;
+ *) libtoolize=libtoolize
+ esac
+esac
+
+[ "`$libtoolize --version | head -1`" != "$LTV" ] && echo "$USAGE" && exit 1
[ "`autoconf --version | head -1`" != "$ACV" ] && echo "$USAGE" && exit 1
-[ "`automake --version | head -1 | sed -e 's/1\.4[a-z]/1.4/'`" != "$AMV" ] && echo "$USAGE" && exit 1
+[ "`automake --version | head -1 | sed -e 's/1\.4[a-z]/1.4/'`" != "$AMV" ] && echo "$USAGE" # && exit 1
-libtoolize --copy --force
+$libtoolize --copy --force
aclocal
autoheader
automake -a -c
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 0233b5921..abe3a6403 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -11,6 +11,7 @@ INCLUDES = -I. \
-I$(top_srcdir)/rpmio \
@WITH_BEECRYPT_INCLUDE@ \
-I$(top_srcdir)/popt \
+ -I$(top_srcdir)/misc \
@INCPATH@
EXTRA_DIST = getdate.y tgi.c rpmgi.c rpmgi.h
@@ -44,7 +45,8 @@ librpm_la_LDFLAGS = -release 4.4 $(LDFLAGS) \
$(top_builddir)/rpmdb/librpmdb.la \
$(top_builddir)/rpmio/librpmio.la \
$(top_builddir)/popt/libpopt.la \
- @WITH_SELINUX_LIB@
+ @WITH_SELINUX_LIB@ \
+ @INTLLIBS@
getdate.c: getdate.y
@echo expect 10 shift/reduce conflicts
diff --git a/lib/formats.c b/lib/formats.c
index dd0272209..e7e03e1ce 100644
--- a/lib/formats.c
+++ b/lib/formats.c
@@ -980,10 +980,12 @@ static int filerequireTag(Header h, /*@out@*/ rpmTagType * type,
/* I18N look aside diversions */
+#if defined(ENABLE_NLS)
/*@-exportlocal -exportheadervar@*/
/*@unchecked@*/
-int _nl_msg_cat_cntr; /* XXX GNU gettext voodoo */
+extern int _nl_msg_cat_cntr; /* XXX GNU gettext voodoo */
/*@=exportlocal =exportheadervar@*/
+#endif
/*@observer@*/ /*@unchecked@*/
static const char * language = "LANGUAGE";
@@ -1035,7 +1037,9 @@ static int i18nTag(Header h, int_32 tag, /*@out@*/ rpmTagType * type,
/* change to en_US for msgkey -> msgid resolution */
langval = getenv(language);
(void) setenv(language, "en_US", 1);
+#if defined(ENABLE_NLS)
/*@i@*/ ++_nl_msg_cat_cntr;
+#endif
msgid = NULL;
/*@-branchstate@*/
diff --git a/lib/poptALL.c b/lib/poptALL.c
index ac192f127..e1c6e43fa 100644
--- a/lib/poptALL.c
+++ b/lib/poptALL.c
@@ -4,6 +4,7 @@
*/
#include "system.h"
+const char *__progname;
#include <rpmcli.h>
#include <fts.h>
diff --git a/lib/rpmrc.c b/lib/rpmrc.c
index d7375dd3a..fed9b2390 100644
--- a/lib/rpmrc.c
+++ b/lib/rpmrc.c
@@ -1131,6 +1131,13 @@ static void defaultMachine(/*@out@*/ const char ** arch,
strcpy(un.machine, __power_pc() ? "ppc" : "rs6000");
sprintf(un.sysname,"aix%s.%s", un.version, un.release);
}
+ else if(!strcmp(un.sysname, "Darwin")) {
+#ifdef __ppc__
+ strcpy(un.machine, "ppc");
+#else ifdef __i386__
+ strcpy(un.machine, "i386");
+#endif
+ }
else if (!strcmp(un.sysname, "SunOS")) {
if (!strncmp(un.release,"4", 1)) /* SunOS 4.x */ {
int fd;
diff --git a/lua/Makefile.am b/lua/Makefile.am
index 20669fca4..293e000df 100644
--- a/lua/Makefile.am
+++ b/lua/Makefile.am
@@ -12,7 +12,7 @@ EXTRA_DIST = \
local/linit.lua
LDADD = liblua.la
-INCLUDES = -I$(srcdir)/include -I$(srcdir)/local
+INCLUDES = -I$(srcdir)/include -I$(srcdir)/local -I$(includedir)
lua_lua_SOURCES = lua/lua.c
lua_lua_CFLAGS = -DLUA_USERCONFIG='"$(srcdir)/local/userconfig.c"'
diff --git a/misc/glob.h b/misc/glob.h
index c0c7b302b..a52d1096c 100644
--- a/misc/glob.h
+++ b/misc/glob.h
@@ -46,7 +46,7 @@ extern "C" {
#endif /* C++ or ANSI C. */
/* We need `size_t' for the following definitions. */
-#ifndef __size_t
+#if !defined(__size_t) && !defined(_BSD_SIZE_T_DEFINED_)
# if defined __GNUC__ && __GNUC__ >= 2
typedef __SIZE_TYPE__ __size_t;
# ifdef _XOPEN_SOURCE
diff --git a/popt/Makefile.am b/popt/Makefile.am
index 3c2e61821..59414dbb6 100644
--- a/popt/Makefile.am
+++ b/popt/Makefile.am
@@ -37,7 +37,9 @@ include_HEADERS = popt.h
usrlibdir = $(libdir)@MARK64@
usrlib_LTLIBRARIES = libpopt.la
+
libpopt_la_SOURCES = popt.c findme.c poptparse.c poptconfig.c popthelp.c
+libpopt_la_LDFLAGS = @INTLLIBS@
man_MANS = popt.3
diff --git a/popt/autogen.sh b/popt/autogen.sh
index 0ccf99700..cded31195 100755
--- a/popt/autogen.sh
+++ b/popt/autogen.sh
@@ -5,8 +5,18 @@ test -z "$srcdir" && srcdir=.
THEDIR="`pwd`"
+libtoolize=`which glibtoolize 2>/dev/null`
+case $libtoolize in
+/*) ;;
+*) libtoolize=`which libtoolize 2>/dev/null`
+ case $libtoolize in
+ /*) ;;
+ *) libtoolize=libtoolize
+ esac
+esac
+
cd "$srcdir"
-libtoolize --copy --force
+$libtoolize --copy --force
aclocal
autoheader
automake -a -c
diff --git a/python/header-py.h b/python/header-py.h
index acd170db5..49a2d068c 100644
--- a/python/header-py.h
+++ b/python/header-py.h
@@ -14,7 +14,7 @@ extern PyTypeObject hdr_Type;
/** \ingroup py_c
*/
-PyObject * pyrpmError;
+extern PyObject * pyrpmError;
hdrObject * hdr_Wrap(Header h)
/*@*/;
diff --git a/python/rpmmodule.c b/python/rpmmodule.c
index 204717edd..44e134e23 100644
--- a/python/rpmmodule.c
+++ b/python/rpmmodule.c
@@ -39,6 +39,10 @@
/**
*/
+PyObject * pyrpmError;
+
+/**
+ */
static PyObject * archScore(PyObject * self, PyObject * args, PyObject * kwds)
{
char * arch;
diff --git a/rpm2cpio.c b/rpm2cpio.c
index 7397e8373..06e389a09 100644
--- a/rpm2cpio.c
+++ b/rpm2cpio.c
@@ -1,6 +1,7 @@
/* rpmarchive: spit out the main archive portion of a package */
#include "system.h"
+const char *__progname;
#include <rpmlib.h>
#include <rpmpgp.h>
diff --git a/rpmdb/Makefile.am b/rpmdb/Makefile.am
index 10f7d0a84..d533d209f 100644
--- a/rpmdb/Makefile.am
+++ b/rpmdb/Makefile.am
@@ -11,6 +11,7 @@ INCLUDES = -I. \
-I$(top_srcdir)/rpmio \
@WITH_BEECRYPT_INCLUDE@ \
-I$(top_srcdir)/popt \
+ -I$(top_srcdir)/misc \
@WITH_LIBELF_INCLUDE@ \
@INCPATH@
diff --git a/rpmio/Makefile.am b/rpmio/Makefile.am
index ca7a0b9cd..8a6a723a1 100644
--- a/rpmio/Makefile.am
+++ b/rpmio/Makefile.am
@@ -13,6 +13,7 @@ INCLUDES = -I. \
@WITH_BEECRYPT_INCLUDE@ \
@WITH_LUA_INCLUDE@ \
-I$(top_srcdir)/popt \
+ -I$(top_srcdir)/misc \
@INCPATH@
pkgincdir = $(pkgincludedir)
@@ -37,7 +38,7 @@ librpmio_la_LDFLAGS = -release 4.4 $(LDFLAGS) \
@WITH_LUA_LIB@ \
$(top_builddir)/file/src/libmagic.la \
@WITH_ZLIB_LIB@ \
- -lneon -lrt -lpthread
+ -lneon -lpthread
librpmio_la_LIBADD = # $(BEECRYPTLOBJS)
librpmio_la_DEPENDENCIES = # .created
diff --git a/rpmio/fts.c b/rpmio/fts.c
index a46de3536..4ce33fec5 100644
--- a/rpmio/fts.c
+++ b/rpmio/fts.c
@@ -59,6 +59,12 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
# define _STAT_VER 0
# define __fxstat64(_stat_ver, _fd, _sbp) fstat((_fd), (_sbp))
#endif
+#if defined(__APPLE__)
+# define __errno_location() (__error())
+# define stat64 stat
+# define _STAT_VER 0
+# define __fxstat64(_stat_ver, _fd, _sbp) fstat((_fd), (_sbp))
+#endif
#include "system.h"
#include "fts.h"
#include "rpmio.h"
diff --git a/rpmio/fts.h b/rpmio/fts.h
index 7429101a1..eaa4a8b31 100644
--- a/rpmio/fts.h
+++ b/rpmio/fts.h
@@ -55,6 +55,10 @@
# define _D_EXACT_NAMLEN(d) ((d)->d_reclen)
#endif
+#if defined(__APPLE__)
+# define _D_EXACT_NAMLEN(d) ((d)->d_reclen)
+#endif
+
#endif
#include <sys/types.h>
diff --git a/rpmio/rpmdav.c b/rpmio/rpmdav.c
index 12b6bde32..d990fc670 100644
--- a/rpmio/rpmdav.c
+++ b/rpmio/rpmdav.c
@@ -1406,7 +1406,9 @@ struct dirent * avReaddir(DIR * dir)
dp->d_reclen = 0; /* W2DO? */
#if !defined(hpux) && !defined(sun)
+#if !defined(__APPLE__)
dp->d_off = 0; /* W2DO? */
+#endif
/*@-boundsread@*/
dp->d_type = dt[i];
/*@=boundsread@*/
@@ -1528,7 +1530,9 @@ struct dirent * davReaddir(DIR * dir)
dp->d_reclen = 0; /* W2DO? */
#if !defined(hpux) && !defined(sun)
+#if !defined(__APPLE__)
dp->d_off = 0; /* W2DO? */
+#endif
/*@-boundsread@*/
dp->d_type = dt[i];
/*@=boundsread@*/
diff --git a/rpmio/rpmdav.h b/rpmio/rpmdav.h
index 1d64867ed..8a0722456 100644
--- a/rpmio/rpmdav.h
+++ b/rpmio/rpmdav.h
@@ -17,7 +17,7 @@ struct __dirstream {
};
#endif
-#if !defined(DT_DIR)
+#if !defined(DT_DIR) || defined(__APPLE__)
# define DT_UNKNOWN 0
# define DT_FIFO 1
# define DT_CHR 2
diff --git a/rpmio/rpmio.h b/rpmio/rpmio.h
index 92642323b..2129d6169 100644
--- a/rpmio/rpmio.h
+++ b/rpmio/rpmio.h
@@ -10,7 +10,7 @@
#include <sys/stat.h>
#include <dirent.h>
/*@-noparams@*/
-#include <glob.h>
+#include "glob.h"
/*@=noparams@*/
#include <stdio.h>
#include <stdlib.h>
diff --git a/rpmqv.c b/rpmqv.c
index 4bf31adba..21a065a7d 100755
--- a/rpmqv.c
+++ b/rpmqv.c
@@ -1,4 +1,5 @@
#include "system.h"
+const char *__progname;
#define _AUTOHELP
diff --git a/system.h b/system.h
index 1a26fa379..87455f78b 100644
--- a/system.h
+++ b/system.h
@@ -448,7 +448,7 @@ extern void muntrace (void)
}
#endif
/*@unchecked@*/
-const char *__progname;
+extern const char *__progname;
#if HAVE_NETDB_H
#include <netdb.h>
diff --git a/tools/Makefile.am b/tools/Makefile.am
index f0ab8adfe..b29dbf1ca 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -13,24 +13,22 @@ INCLUDES = -I. \
@WITH_LIBELF_INCLUDE@ \
@WITH_LIBDWARF_INCLUDE@ \
-I$(top_srcdir)/file/src \
- @INCPATH@ \
- -I/usr/include/libxml2
- -I$(top_srcdir)/misc
+ -I$(top_srcdir)/misc \
+ @INCPATH@
EXTRA_DIST = rpminject.c rpmsort.c rpmxml.c rpmxp.c rpmxp.h hashtab.h
-EXTRA_PROGRAMS = convertdb1 rpminject rpmsort rpmtool rpmxml
+EXTRA_PROGRAMS = debugedit convertdb1 rpminject rpmsort rpmtool rpmxml
LDADD = \
- $(top_builddir)/lib/librpm.la \
- @INTLLIBS@
+ $(top_builddir)/lib/librpm.la
staticLDFLAGS = @LDFLAGS_STATIC@ @LDFLAGS_NPTL@
noinst_PROGRAMS = dumpdb
pkgbindir = @RPMCONFIGDIR@
-pkgbin_PROGRAMS = debugedit javadeps rpmcache rpmdeps rpmfile
+pkgbin_PROGRAMS = @WITH_LIBDWARF_DEBUGEDIT@ javadeps rpmcache rpmdeps rpmfile
MAGIC = $(pkgbindir)/magic
bin_PROGRAMS = rpmgraph
@@ -44,11 +42,11 @@ debugedit_LDADD = @LDFLAGS_STATIC@ @WITH_LIBELF_LIB@ \
javadeps_SOURCES = javadeps.c
rpmcache_SOURCES = rpmcache.c
-#rpmcache_LDFLAGS = $(staticLDFLAGS)
+#rpmcache_LDFLAGS = -L$(libdir) # $(staticLDFLAGS)
rpmdeps_SOURCES = rpmdeps.c
-rpmdeps_LDADD = $(top_builddir)/build/librpmbuild.la
#rpmdeps_LDFLAGS = $(staticLDFLAGS)
+rpmdeps_LDADD = $(top_builddir)/build/librpmbuild.la
rpmfile.c: $(top_srcdir)/file/src/file.c
rm -f $@
@@ -66,13 +64,15 @@ rpminject_SOURCES = rpminject.c
#rpminject_LDFLAGS = $(staticLDFLAGS)
rpmsort_SOURCES = rpmsort.c
-#rpmsort_LDFLAGS = $(staticLDFLAGS)
+#rpmsort_LDFLAGS = (staticLDFLAGS)
rpmtool_SOURCES = rpmtool.c rpmxp.c
+rpmtool_CFLAGS = -I$(includedir)/libxml2
#rpmtool_LDFLAGS = $(staticLDFLAGS)
rpmtool_LDADD = $(LDADD) -lxml2
rpmxml_SOURCES = rpmxml.c # rpmxp.c
+rpmxml_CFLAGS = -I$(includedir)/libxml2
#rpmxml_LDFLAGS = $(staticLDFLAGS)
rpmxml_LDADD = $(LDADD) -lxml2
diff --git a/tools/convertdb1.c b/tools/convertdb1.c
index 829768dc5..aad86cbb8 100644
--- a/tools/convertdb1.c
+++ b/tools/convertdb1.c
@@ -1,5 +1,6 @@
#if defined(HAVE_CONFIG_H)
#include "system.h"
+const char *__progname;
#else
#include <sys/types.h>
#include <fcntl.h>
diff --git a/tools/dump.c b/tools/dump.c
index 584372fab..e66d13e71 100644
--- a/tools/dump.c
+++ b/tools/dump.c
@@ -1,4 +1,5 @@
#include "system.h"
+const char *__progname;
#include <rpmlib.h>
#include "header_internal.h"
diff --git a/tools/dumpdb.c b/tools/dumpdb.c
index 745c81ba3..97ff38649 100644
--- a/tools/dumpdb.c
+++ b/tools/dumpdb.c
@@ -1,4 +1,5 @@
#include "system.h"
+const char *__progname;
#include <rpmlib.h>
#include "header_internal.h"
diff --git a/tools/rpmcache.c b/tools/rpmcache.c
index 650c25f42..36619148b 100644
--- a/tools/rpmcache.c
+++ b/tools/rpmcache.c
@@ -3,6 +3,8 @@
*/
#include "system.h"
+const char *__progname;
+
#include <fnmatch.h>
#include <fts.h>
diff --git a/tools/rpmdeps.c b/tools/rpmdeps.c
index fa9e52426..58574241f 100644
--- a/tools/rpmdeps.c
+++ b/tools/rpmdeps.c
@@ -1,4 +1,5 @@
#include "system.h"
+const char *__progname;
#include <rpmbuild.h>
#include <argv.h>
diff --git a/tools/rpmgraph.c b/tools/rpmgraph.c
index 302c82a03..6104af7fd 100644
--- a/tools/rpmgraph.c
+++ b/tools/rpmgraph.c
@@ -1,4 +1,5 @@
#include "system.h"
+const char *__progname;
#include <rpmcli.h>
diff --git a/tools/rpminject.c b/tools/rpminject.c
index 4b1a68ab5..3f83643a8 100644
--- a/tools/rpminject.c
+++ b/tools/rpminject.c
@@ -1,4 +1,5 @@
#include "system.h"
+const char *__progname;
#include "rpmbuild.h"
#include "buildio.h"
diff --git a/tools/rpmsort.c b/tools/rpmsort.c
index 4fa605630..5169eb949 100644
--- a/tools/rpmsort.c
+++ b/tools/rpmsort.c
@@ -1,4 +1,5 @@
#include "system.h"
+const char *__progname;
#include <rpmlib.h>
#include <rpmmacro.h>
diff --git a/tools/rpmtool.c b/tools/rpmtool.c
index 90b35997e..9502665a9 100644
--- a/tools/rpmtool.c
+++ b/tools/rpmtool.c
@@ -1,4 +1,5 @@
#include "system.h"
+const char *__progname;
#include <rpmcli.h>
#include <rpmxp.h>
diff --git a/tools/rpmxml.c b/tools/rpmxml.c
index 37adbaf80..97782a6a0 100644
--- a/tools/rpmxml.c
+++ b/tools/rpmxml.c
@@ -1,4 +1,6 @@
#include "system.h"
+const char *__progname;
+
#include <rpmlib.h>
#define _RPMXP_INTERNAL
#include "rpmxp.h"
diff --git a/tools/rpmxp.c b/tools/rpmxp.c
index 00f0e6139..6cefc0e79 100644
--- a/tools/rpmxp.c
+++ b/tools/rpmxp.c
@@ -1,4 +1,6 @@
#include "system.h"
+const char *__progname;
+
#include <header.h>
#define _RPMXP_INTERNAL
#include "rpmxp.h"