Explorar el Código

Disable default automake preprocessor include paths

Tell automake not to add “-I.” to the preprocessor flags, to avoid
file collisions with system headers. Re-add the path where config.h
is located. Namespace and use bracketed file inclusions for libdpkg
headers, and use quoted inclusions for program headers.
Guillem Jover hace 17 años
padre
commit
7fa96f351b
Se han modificado 89 ficheros con 209 adiciones y 199 borrados
  1. 1 1
      configure.ac
  2. 1 1
      dpkg-deb/Makefile.am
  3. 5 4
      dpkg-deb/build.c
  4. 4 3
      dpkg-deb/extract.c
  5. 4 3
      dpkg-deb/info.c
  6. 3 3
      dpkg-deb/main.c
  7. 1 1
      dpkg-split/Makefile.am
  8. 4 3
      dpkg-split/info.c
  9. 4 3
      dpkg-split/join.c
  10. 3 3
      dpkg-split/main.c
  11. 4 3
      dpkg-split/queue.c
  12. 4 3
      dpkg-split/split.c
  13. 2 2
      dselect/Makefile.am
  14. 2 2
      dselect/basecmds.cc
  15. 2 2
      dselect/baselist.cc
  16. 1 1
      dselect/basetop.cc
  17. 2 2
      dselect/bindings.cc
  18. 1 1
      dselect/curkeys.cc
  19. 2 1
      dselect/dselect.h
  20. 3 3
      dselect/main.cc
  21. 1 1
      dselect/methkeys.cc
  22. 2 2
      dselect/methlist.cc
  23. 3 3
      dselect/method.cc
  24. 2 2
      dselect/methparse.cc
  25. 2 2
      dselect/pkgcmds.cc
  26. 2 2
      dselect/pkgdepcon.cc
  27. 2 2
      dselect/pkgdisplay.cc
  28. 2 2
      dselect/pkginfo.cc
  29. 1 1
      dselect/pkgkeys.cc
  30. 2 2
      dselect/pkglist.cc
  31. 2 2
      dselect/pkgsublist.cc
  32. 2 2
      dselect/pkgtop.cc
  33. 1 0
      lib/dpkg/Makefile.am
  34. 2 1
      lib/dpkg/cleanup.c
  35. 2 2
      lib/dpkg/compression.c
  36. 2 2
      lib/dpkg/database.c
  37. 2 2
      lib/dpkg/dbmodify.c
  38. 3 3
      lib/dpkg/dump.c
  39. 2 2
      lib/dpkg/ehandle.c
  40. 4 4
      lib/dpkg/fields.c
  41. 2 2
      lib/dpkg/lock.c
  42. 2 2
      lib/dpkg/log.c
  43. 3 3
      lib/dpkg/mlib.c
  44. 2 2
      lib/dpkg/myopt-util.c
  45. 2 2
      lib/dpkg/myopt.c
  46. 3 4
      lib/dpkg/nfmalloc.c
  47. 3 3
      lib/dpkg/parse.c
  48. 4 5
      lib/dpkg/parsehelp.c
  49. 2 1
      lib/dpkg/path.c
  50. 3 4
      lib/dpkg/showpkg.c
  51. 1 1
      lib/dpkg/string.c
  52. 2 2
      lib/dpkg/subproc.c
  53. 2 2
      lib/dpkg/tarfn.c
  54. 1 1
      lib/dpkg/test.h
  55. 1 1
      lib/dpkg/test/Makefile.am
  56. 1 1
      lib/dpkg/test/t-path.c
  57. 1 1
      lib/dpkg/test/t-pkginfo.c
  58. 1 1
      lib/dpkg/test/t-string.c
  59. 1 1
      lib/dpkg/test/t-varbuf.c
  60. 1 1
      lib/dpkg/test/t-version.c
  61. 2 2
      lib/dpkg/trigdeferred.l
  62. 3 3
      lib/dpkg/triglib.c
  63. 3 1
      lib/dpkg/utils.c
  64. 2 2
      lib/dpkg/varbuf.c
  65. 3 3
      lib/dpkg/vercmp.c
  66. 1 1
      src/Makefile.am
  67. 4 4
      src/archives.c
  68. 4 4
      src/cleanup.c
  69. 2 2
      src/configure.c
  70. 2 2
      src/depcon.c
  71. 2 2
      src/divertdb.c
  72. 3 3
      src/enquiry.c
  73. 3 3
      src/errors.c
  74. 4 4
      src/filesdb.c
  75. 3 3
      src/help.c
  76. 3 3
      src/main.c
  77. 3 3
      src/packages.c
  78. 2 2
      src/pkg-array.c
  79. 1 1
      src/pkg-array.h
  80. 2 2
      src/pkg-show.c
  81. 4 4
      src/processarc.c
  82. 4 4
      src/query.c
  83. 3 3
      src/remove.c
  84. 3 3
      src/select.c
  85. 2 2
      src/statdb.c
  86. 3 3
      src/trigcmd.c
  87. 2 2
      src/trigproc.c
  88. 3 3
      src/update.c
  89. 1 1
      utils/Makefile.am

+ 1 - 1
configure.ac

@@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM
 AC_GNU_SOURCE
 DPKG_ARCHITECTURE
 
-AM_INIT_AUTOMAKE([1.8 gnu])
+AM_INIT_AUTOMAKE([1.8 gnu nostdinc])
 
 AM_GNU_GETTEXT_VERSION([0.16.1])
 AM_GNU_GETTEXT([external])

+ 1 - 1
dpkg-deb/Makefile.am

@@ -4,7 +4,7 @@ localedir = $(datadir)/locale
 INCLUDES = \
 	-DLOCALEDIR=\"$(localedir)\" \
 	-idirafter $(top_srcdir)/lib/compat \
-	-I$(top_srcdir)/lib/dpkg \
+	-I$(top_builddir) \
 	-I$(top_srcdir)/lib
 
 

+ 5 - 4
dpkg-deb/build.c

@@ -24,7 +24,6 @@
 #include <compat.h>
 
 #include <dpkg/i18n.h>
-#include <myopt.h>
 
 #include <stdio.h>
 #include <string.h>
@@ -44,10 +43,12 @@
 #include <zlib.h>
 #endif
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/dpkg-priv.h>
+#include <dpkg/myopt.h>
+
 #include "dpkg-deb.h"
-#include "dpkg-priv.h"
 
 #ifndef S_ISLNK
 # define S_ISLNK(mode) ((mode&0xF000) == S_IFLNK)

+ 4 - 3
dpkg-deb/extract.c

@@ -41,9 +41,10 @@
 #include <zlib.h>
 #endif
 
-#include <dpkg.h>
-#include <dpkg-deb.h>
-#include <myopt.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/myopt.h>
+
+#include "dpkg-deb.h"
 
 static void movecontrolfiles(const char *thing) {
   char buf[200];

+ 4 - 3
dpkg-deb/info.c

@@ -37,9 +37,10 @@
 #include <limits.h>
 #include <ctype.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include <myopt.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/myopt.h>
+
 #include "dpkg-deb.h"
 
 static void cu_info_prepare(int argc, void **argv) {

+ 3 - 3
dpkg-deb/main.c

@@ -42,9 +42,9 @@
 #endif
 
 #include <dpkg/macros.h>
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include <myopt.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/myopt.h>
 
 #include "dpkg-deb.h"
 

+ 1 - 1
dpkg-split/Makefile.am

@@ -5,7 +5,7 @@ INCLUDES = \
 	-DLOCALEDIR=\"$(localedir)\" \
 	-DADMINDIR=\"$(admindir)\" -DMKSPLITSCRIPT=\"$(pkglibdir)/mksplit\" \
 	-idirafter $(top_srcdir)/lib/compat \
-	-I$(top_srcdir)/lib/dpkg \
+	-I$(top_builddir) \
 	-I$(top_srcdir)/lib
 
 

+ 4 - 3
dpkg-split/info.c

@@ -22,7 +22,6 @@
 #include <compat.h>
 
 #include <dpkg/i18n.h>
-#include <myopt.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -34,8 +33,10 @@
 #include <ar.h>
 #include <ctype.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/myopt.h>
+
 #include "dpkg-split.h"
 
 static unsigned long unsignedlong(const char *value, const char *fn, const char *what) {

+ 4 - 3
dpkg-split/join.c

@@ -22,7 +22,6 @@
 #include <compat.h>
 
 #include <dpkg/i18n.h>
-#include <myopt.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -30,8 +29,10 @@
 #include <assert.h>
 #include <string.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/myopt.h>
+
 #include "dpkg-split.h"
 
 void reassemble(struct partinfo **partlist, const char *outputfile) {

+ 3 - 3
dpkg-split/main.c

@@ -36,9 +36,9 @@
 #endif
 
 #include <dpkg/macros.h>
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include <myopt.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/myopt.h>
 
 #include "dpkg-split.h"
 

+ 4 - 3
dpkg-split/queue.c

@@ -31,7 +31,6 @@
 #include <compat.h>
 
 #include <dpkg/i18n.h>
-#include <myopt.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -43,8 +42,10 @@
 #include <dirent.h>
 #include <string.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/myopt.h>
+
 #include "dpkg-split.h"
 
 static int decompose_filename(const char *filename, struct partqueue *pq) {

+ 4 - 3
dpkg-split/split.c

@@ -22,7 +22,6 @@
 #include <compat.h>
 
 #include <dpkg/i18n.h>
-#include <myopt.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -32,8 +31,10 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/myopt.h>
+
 #include "dpkg-split.h"
 
 void do_split(const char *const *argv) {

+ 2 - 2
dselect/Makefile.am

@@ -8,7 +8,7 @@ INCLUDES = \
 	-DADMINDIR=\"$(admindir)\" -DLIBDIR=\"$(pkglibdir)\" \
 	-DLOCALLIBDIR=\"/usr/local/lib/dpkg\" \
 	-idirafter $(top_srcdir)/lib/compat \
-	-I$(top_srcdir)/lib/dpkg \
+	-I$(top_builddir) \
 	-I$(top_srcdir)/lib
 
 
@@ -49,7 +49,7 @@ CLEANFILES = curkeys.h
 
 curkeys.$(OBJEXT): curkeys.h
 curkeys.h: $(srcdir)/keyoverride $(srcdir)/mkcurkeys.pl
-	cursesfile=`echo '#include <dselect-curses.h>' | \
+	cursesfile=`echo '#include "dselect-curses.h"' | \
 		$(CPP) -I$(top_srcdir) -I$(srcdir) - | \
 		grep 'curses.h' | head -n 1 | \
 		sed -e 's/^[^"]*"//; s/".*$$//'`; \

+ 2 - 2
dselect/basecmds.cc

@@ -28,8 +28,8 @@
 #include <stdio.h>
 #include <string.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 #include "dselect.h"
 #include "helpmsgs.h"

+ 2 - 2
dselect/baselist.cc

@@ -33,8 +33,8 @@
 #include <sys/ioctl.h>
 #include <sys/termios.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 #include "dselect.h"
 #include "bindings.h"

+ 1 - 1
dselect/basetop.cc

@@ -22,7 +22,7 @@
 #include <config.h>
 #include <compat.h>
 
-#include <dpkg-db.h>
+#include <dpkg/dpkg-db.h>
 
 #include "dselect.h"
 

+ 2 - 2
dselect/bindings.cc

@@ -27,8 +27,8 @@
 #include <stdio.h>
 #include <string.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 #include "dselect.h"
 #include "bindings.h"

+ 1 - 1
dselect/curkeys.cc

@@ -22,7 +22,7 @@
 #include <config.h>
 #include <compat.h>
 
-#include <dpkg-db.h>
+#include <dpkg/dpkg-db.h>
 
 #include "dselect.h"
 #include "bindings.h"

+ 2 - 1
dselect/dselect.h

@@ -29,7 +29,8 @@
 #define MAX_DISPLAY_INFO 120
 
 #include <signal.h>
-#include <dselect-curses.h>
+
+#include "dselect-curses.h"
 
 struct helpmenuentry {
   char key;

+ 3 - 3
dselect/main.cc

@@ -51,9 +51,9 @@
 #include <term.h>
 #endif
 
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include <myopt.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/myopt.h>
 
 #include "dselect.h"
 #include "bindings.h"

+ 1 - 1
dselect/methkeys.cc

@@ -22,7 +22,7 @@
 #include <config.h>
 #include <compat.h>
 
-#include <dpkg-db.h>
+#include <dpkg/dpkg-db.h>
 
 #include "dselect.h"
 #include "bindings.h"

+ 2 - 2
dselect/methlist.cc

@@ -30,8 +30,8 @@
 #include <assert.h>
 #include <errno.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 #include "dselect.h"
 #include "bindings.h"

+ 3 - 3
dselect/method.cc

@@ -42,10 +42,10 @@
 #include <fcntl.h>
 #include <sys/file.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/dpkg-priv.h>
 
-#include <dpkg-priv.h>
 #include "dselect.h"
 #include "method.h"
 

+ 2 - 2
dselect/methparse.cc

@@ -37,8 +37,8 @@
 #include <ctype.h>
 #include <assert.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 #include "dselect.h"
 #include "bindings.h"

+ 2 - 2
dselect/pkgcmds.cc

@@ -25,8 +25,8 @@
 #include <stdio.h>
 #include <string.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 #include "dselect.h"
 #include "pkglist.h"

+ 2 - 2
dselect/pkgdepcon.cc

@@ -26,8 +26,8 @@
 #include <string.h>
 #include <assert.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 #include "dselect.h"
 #include "pkglist.h"

+ 2 - 2
dselect/pkgdisplay.cc

@@ -27,8 +27,8 @@
 #include <stdio.h>
 #include <string.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 #include "dselect.h"
 #include "pkglist.h"

+ 2 - 2
dselect/pkginfo.cc

@@ -28,8 +28,8 @@
 #include <string.h>
 #include <ctype.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 #include "dselect.h"
 #include "bindings.h"

+ 1 - 1
dselect/pkgkeys.cc

@@ -22,7 +22,7 @@
 #include <config.h>
 #include <compat.h>
 
-#include <dpkg-db.h>
+#include <dpkg/dpkg-db.h>
 
 #include "dselect.h"
 #include "bindings.h"

+ 2 - 2
dselect/pkglist.cc

@@ -31,8 +31,8 @@
 #include <assert.h>
 #include <errno.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 #include "dselect.h"
 #include "bindings.h"

+ 2 - 2
dselect/pkgsublist.cc

@@ -28,8 +28,8 @@
 #include <string.h>
 #include <assert.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 #include "dselect.h"
 #include "bindings.h"

+ 2 - 2
dselect/pkgtop.cc

@@ -29,8 +29,8 @@
 #include <assert.h>
 #include <ctype.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 #include "dselect.h"
 #include "pkglist.h"

+ 1 - 0
lib/dpkg/Makefile.am

@@ -9,6 +9,7 @@ INCLUDES = \
 	-DCONFIGDIR=\"$(pkgconfdir)\" \
 	-DCOPYINGFILE=\"$(datadir)/common-licenses/GPL-2\" \
 	-idirafter $(top_srcdir)/lib/compat \
+	-I$(top_builddir) \
 	-I$(top_srcdir)/lib
 
 

+ 2 - 1
lib/dpkg/cleanup.c

@@ -22,11 +22,12 @@
 #include <config.h>
 #include <compat.h>
 
-#include <dpkg.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <dirent.h>
 
+#include <dpkg/dpkg.h>
+
 void
 cu_closepipe(int argc, void **argv)
 {

+ 2 - 2
lib/dpkg/compression.c

@@ -15,8 +15,8 @@
 #include <bzlib.h>
 #endif
 
-#include <dpkg.h>
-#include "dpkg-db.h"
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 static void
 fd_fd_filter(int fd_in, int fd_out,

+ 2 - 2
lib/dpkg/database.c

@@ -27,8 +27,8 @@
 #include <string.h>
 #include <stdlib.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 #define BINS 8191
  /* This must always be a prime for optimal performance.

+ 2 - 2
lib/dpkg/dbmodify.c

@@ -39,8 +39,8 @@
 #include <time.h>
 #include <assert.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 char *statusfile=NULL, *availablefile=NULL;
 char *triggersdir, *triggersfilefile, *triggersnewfilefile;

+ 3 - 3
lib/dpkg/dump.c

@@ -36,9 +36,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include "parsedump.h"
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/parsedump.h>
 
 void w_name(struct varbuf *vb,
             const struct pkginfo *pigp, const struct pkginfoperfile *pifp,

+ 2 - 2
lib/dpkg/ehandle.c

@@ -32,8 +32,8 @@
 #include <assert.h>
 
 #include <dpkg/macros.h>
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 static const char *errmsg; /* points to errmsgbuf or malloc'd */
 static char errmsgbuf[4096];

+ 4 - 4
lib/dpkg/fields.c

@@ -28,10 +28,10 @@
 #include <ctype.h>
 #include <string.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include <dpkg-priv.h>
-#include "parsedump.h"
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/dpkg-priv.h>
+#include <dpkg/parsedump.h>
 
 static int
 convert_string(struct parsedb_state *ps, const char *what, int otherwise,

+ 2 - 2
lib/dpkg/lock.c

@@ -32,8 +32,8 @@
 #include <fcntl.h>
 #include <sys/file.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 static void
 cu_unlock_file(int argc, void **argv)

+ 2 - 2
lib/dpkg/log.c

@@ -31,8 +31,8 @@
 #include <time.h>
 #include <errno.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 const char *log_file = NULL;
 

+ 3 - 3
lib/dpkg/mlib.c

@@ -34,9 +34,9 @@
 #include <unistd.h>
 #include <sys/types.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include <md5.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/md5.h>
 
 void *m_malloc(size_t amount) {
 #ifdef MDEBUG

+ 2 - 2
lib/dpkg/myopt-util.c

@@ -22,13 +22,13 @@
 #include <compat.h>
 
 #include <dpkg/i18n.h>
-#include <myopt.h>
 
 #include <stdlib.h>
 #include <unistd.h>
 #include <fcntl.h>
 
-#include <dpkg.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/myopt.h>
 
 void
 helponly(const struct cmdinfo *cip, const char *value)

+ 2 - 2
lib/dpkg/myopt.c

@@ -30,8 +30,8 @@
 #include <stdarg.h>
 #include <stdlib.h>
 
-#include <myopt.h>
-#include <dpkg.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/myopt.h>
 
 void
 badusage(const char *fmt, ...)

+ 3 - 4
lib/dpkg/nfmalloc.c

@@ -25,12 +25,11 @@
 
 #include <stdlib.h>
 #include <string.h>
-
-#include <dpkg.h>
-#include <dpkg-db.h>
-
 #include <obstack.h>
 
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+
 #define obstack_chunk_alloc m_malloc
 #define obstack_chunk_free free
 

+ 3 - 3
lib/dpkg/parse.c

@@ -37,9 +37,9 @@
 #include <assert.h>
 
 #include <dpkg/macros.h>
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include "parsedump.h"
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/parsedump.h>
 
 #ifdef HAVE_MMAP
 #include <sys/mman.h>

+ 4 - 5
lib/dpkg/parsehelp.c

@@ -28,11 +28,10 @@
 #include <ctype.h>
 #include <string.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include <dpkg-priv.h>
-
-#include "parsedump.h"
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/dpkg-priv.h>
+#include <dpkg/parsedump.h>
 
 static void
 parse_error_msg(struct parsedb_state *ps, const struct pkginfo *pigp,

+ 2 - 1
lib/dpkg/path.c

@@ -24,7 +24,8 @@
 #include <compat.h>
 
 #include <string.h>
-#include <dpkg-priv.h>
+
+#include <dpkg/dpkg-priv.h>
 
 size_t
 path_rtrim_slash_slashdot(char *path)

+ 3 - 4
lib/dpkg/showpkg.c

@@ -26,10 +26,9 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
-
-#include <parsedump.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/parsedump.h>
 
 
 typedef enum { invalid, string, field } itemtype_t;

+ 1 - 1
lib/dpkg/string.c

@@ -23,7 +23,7 @@
 #include <config.h>
 #include <compat.h>
 
-#include <dpkg-priv.h>
+#include <dpkg/dpkg-priv.h>
 
 char *
 str_escape_fmt(char *dst, const char *src)

+ 2 - 2
lib/dpkg/subproc.c

@@ -31,8 +31,8 @@
 #include <string.h>
 #include <signal.h>
 
-#include <dpkg.h>
-#include <dpkg-priv.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-priv.h>
 
 static int catch_signals[] = { SIGQUIT, SIGINT };
 static struct sigaction uncatch_signals[sizeof_array(catch_signals)];

+ 2 - 2
lib/dpkg/tarfn.c

@@ -14,10 +14,10 @@
 #include <pwd.h>
 #include <grp.h>
 #include <errno.h>
-#include <tarfn.h>
 
 #include <dpkg/macros.h>
-#include <dpkg.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/tarfn.h>
 
 #define TAR_MAGIC_USTAR "ustar\0" "00"
 #define TAR_MAGIC_GNU   "ustar "  " \0"

+ 1 - 1
lib/dpkg/test.h

@@ -26,7 +26,7 @@
 #include <compat.h>
 
 #ifndef TEST_MAIN_PROVIDED
-#include <dpkg.h>
+#include <dpkg/dpkg.h>
 #endif
 
 #include <assert.h>

+ 1 - 1
lib/dpkg/test/Makefile.am

@@ -2,7 +2,7 @@
 
 INCLUDES = \
 	-idirafter $(top_srcdir)/lib/compat \
-	-I$(top_srcdir)/lib/dpkg \
+	-I$(top_builddir) \
 	-I$(top_srcdir)/lib
 
 

+ 1 - 1
lib/dpkg/test/t-path.c

@@ -20,7 +20,7 @@
  */
 
 #include <dpkg/test.h>
-#include <dpkg-priv.h>
+#include <dpkg/dpkg-priv.h>
 
 #include <stdlib.h>
 

+ 1 - 1
lib/dpkg/test/t-pkginfo.c

@@ -20,7 +20,7 @@
  */
 
 #include <dpkg/test.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg-db.h>
 
 static void
 test_pkginfo_informative(void)

+ 1 - 1
lib/dpkg/test/t-string.c

@@ -20,7 +20,7 @@
  */
 
 #include <dpkg/test.h>
-#include <dpkg-priv.h>
+#include <dpkg/dpkg-priv.h>
 
 #include <string.h>
 

+ 1 - 1
lib/dpkg/test/t-varbuf.c

@@ -20,7 +20,7 @@
  */
 
 #include <dpkg/test.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg-db.h>
 
 static void
 test_varbuf_init(void)

+ 1 - 1
lib/dpkg/test/t-version.c

@@ -20,7 +20,7 @@
  */
 
 #include <dpkg/test.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg-db.h>
 
 #define version(epoch, version, revision) \
 	(struct versionrevision) { (epoch), (version), (revision) }

+ 2 - 2
lib/dpkg/trigdeferred.l

@@ -42,8 +42,8 @@
 #include <sys/stat.h>
 #include <sys/fcntl.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 #define YY_NO_INPUT
 

+ 3 - 3
lib/dpkg/triglib.c

@@ -32,9 +32,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include <dlist.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/dlist.h>
 
 const char *
 illegal_triggername(const char *p)

+ 3 - 1
lib/dpkg/utils.c

@@ -22,9 +22,11 @@
 #include <compat.h>
 
 #include <dpkg/i18n.h>
-#include <dpkg.h>
+
 #include <string.h>
 
+#include <dpkg/dpkg.h>
+
 /* Reimplementation of the standard ctype.h is* functions. Since gettext
  * has overloaded the meaning of LC_CTYPE we can't use that to force C
  * locale, so use these cis* functions instead.

+ 2 - 2
lib/dpkg/varbuf.c

@@ -25,8 +25,8 @@
 #include <string.h>
 #include <stdio.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 void
 varbufaddc(struct varbuf *v, int c)

+ 3 - 3
lib/dpkg/vercmp.c

@@ -24,9 +24,9 @@
 #include <ctype.h>
 #include <string.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include "parsedump.h"
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/parsedump.h>
 
 int epochsdiffer(const struct versionrevision *a,
                  const struct versionrevision *b) {

+ 1 - 1
src/Makefile.am

@@ -5,7 +5,7 @@ INCLUDES = \
 	-DLOCALEDIR=\"$(localedir)\" \
 	-DADMINDIR=\"$(admindir)\" \
 	-idirafter $(top_srcdir)/lib/compat \
-	-I$(top_srcdir)/lib/dpkg \
+	-I$(top_builddir) \
 	-I$(top_srcdir)/lib
 
 

+ 4 - 4
src/archives.c

@@ -41,10 +41,10 @@
 #define obstack_chunk_alloc m_malloc
 #define obstack_chunk_free free
 
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include <tarfn.h>
-#include <myopt.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/tarfn.h>
+#include <dpkg/myopt.h>
 
 #ifdef WITH_SELINUX
 #include <selinux/selinux.h>

+ 4 - 4
src/cleanup.c

@@ -35,10 +35,10 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include <tarfn.h>
-#include <myopt.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/tarfn.h>
+#include <dpkg/myopt.h>
 
 #include "filesdb.h"
 #include "main.h"

+ 2 - 2
src/configure.c

@@ -43,8 +43,8 @@
 #include <sys/termios.h>
 
 #include <dpkg/macros.h>
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 #include "filesdb.h"
 #include "main.h"

+ 2 - 2
src/depcon.c

@@ -29,8 +29,8 @@
 #include <sys/types.h>
 #include <assert.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 #include "main.h"
 

+ 2 - 2
src/divertdb.c

@@ -36,8 +36,8 @@
 #include <grp.h>
 #include <sys/types.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 #include "filesdb.h"
 #include "main.h"

+ 3 - 3
src/enquiry.c

@@ -37,9 +37,9 @@
 #include <sys/termios.h>
 #include <fcntl.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include <myopt.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/myopt.h>
 
 #include "filesdb.h"
 #include "main.h"

+ 3 - 3
src/errors.c

@@ -36,9 +36,9 @@
 #include <limits.h>
 #include <ctype.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include <myopt.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/myopt.h>
 
 #include "main.h"
 

+ 4 - 4
src/filesdb.c

@@ -36,11 +36,11 @@
 #include <grp.h>
 #include <sys/types.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include <dpkg-priv.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/dpkg-priv.h>
+#include <dpkg/progress.h>
 
-#include "progress.h"
 #include "filesdb.h"
 #include "main.h"
 

+ 3 - 3
src/help.c

@@ -34,9 +34,9 @@
 #include <sys/wait.h>
 #include <time.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include <dpkg-priv.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/dpkg-priv.h>
 
 #include "filesdb.h"
 #include "main.h"

+ 3 - 3
src/main.c

@@ -42,9 +42,9 @@
 #endif
 
 #include <dpkg/macros.h>
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include <myopt.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/myopt.h>
 
 #include "main.h"
 #include "filesdb.h"

+ 3 - 3
src/packages.c

@@ -36,9 +36,9 @@
 #include <string.h>
 #include <assert.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include <myopt.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/myopt.h>
 
 #include "filesdb.h"
 #include "main.h"

+ 2 - 2
src/pkg-array.c

@@ -27,8 +27,8 @@
 #include <string.h>
 #include <stdlib.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 #include "pkg-array.h"
 

+ 1 - 1
src/pkg-array.h

@@ -22,7 +22,7 @@
 #include <config.h>
 #include <compat.h>
 
-#include <dpkg-db.h>
+#include <dpkg/dpkg-db.h>
 
 DPKG_BEGIN_DECLS
 

+ 2 - 2
src/pkg-show.c

@@ -27,8 +27,8 @@
 #include <string.h>
 
 #include <dpkg/macros.h>
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 void
 limiteddescription(struct pkginfo *pkg,

+ 4 - 4
src/processarc.c

@@ -38,10 +38,10 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include <tarfn.h>
-#include <myopt.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/tarfn.h>
+#include <dpkg/myopt.h>
 
 #include "filesdb.h"
 #include "main.h"

+ 4 - 4
src/query.c

@@ -39,10 +39,10 @@
 #include <locale.h>
 #endif
 
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include <dpkg-priv.h>
-#include <myopt.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/dpkg-priv.h>
+#include <dpkg/myopt.h>
 
 #include "pkg-array.h"
 #include "filesdb.h"

+ 3 - 3
src/remove.c

@@ -37,9 +37,9 @@
 #include <string.h>
 #include <assert.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include <myopt.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/myopt.h>
 
 #include "filesdb.h"
 #include "main.h"

+ 3 - 3
src/select.c

@@ -22,7 +22,6 @@
 #include <compat.h>
 
 #include <dpkg/i18n.h>
-#include <myopt.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -30,8 +29,9 @@
 #include <fnmatch.h>
 #include <ctype.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/myopt.h>
 
 #include "pkg-array.h"
 #include "filesdb.h"

+ 2 - 2
src/statdb.c

@@ -36,8 +36,8 @@
 #include <grp.h>
 #include <sys/types.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 #include "filesdb.h"
 #include "main.h"

+ 3 - 3
src/trigcmd.c

@@ -39,9 +39,9 @@
 #include <locale.h>
 #endif
 
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include <myopt.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/myopt.h>
 
 static const char *bypackage, *activate, *admindir = ADMINDIR;
 static int f_noact, f_check;

+ 2 - 2
src/trigproc.c

@@ -30,8 +30,8 @@
 #include <sys/stat.h>
 #include <sys/fcntl.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
 
 #include "main.h"
 #include "filesdb.h"

+ 3 - 3
src/update.c

@@ -30,9 +30,9 @@
 #include <fnmatch.h>
 #include <unistd.h>
 
-#include <dpkg.h>
-#include <dpkg-db.h>
-#include <myopt.h>
+#include <dpkg/dpkg.h>
+#include <dpkg/dpkg-db.h>
+#include <dpkg/myopt.h>
 
 #include "main.h"
 

+ 1 - 1
utils/Makefile.am

@@ -4,7 +4,7 @@ localedir = $(datadir)/locale
 INCLUDES = \
 	-DLOCALEDIR=\"$(localedir)\" \
 	-idirafter $(top_srcdir)/lib/compat \
-	-I$(top_srcdir)/lib/dpkg \
+	-I$(top_builddir) \
 	-I$(top_srcdir)/lib
 
 sbin_PROGRAMS =