[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dpkg build under Mac OS X failed


On Tue, 2011-09-20 at 22:12:36 -0700, stuart@zulazon.com wrote:
> I tried to build dpkg from source under Mac OS X 10.6.8, and succeeded
> only by
> altering  dpkg-linker.m4 to remove the -O1 flag the Apple linker ld didn't
> understand getting newer versions of autotools using the -i flag for
> autoreconf

For the ld issue, you can use --disable-linker-optimisations, but this
has already bitten some people, and using those flags by default is
clearly not portable, so I'll be disabling them on the next release

> It would have been very helpful if there had been a README or INSTALL with
> instructions, particularly the prerequisites and procedures for building
> dpkg.

I had at some point a slightly improved README with more documentation,
but seem to have lost it. I'm attaching a new more complete one which I
hope would have covered your needs? The only slight drawback is that it
duplicates some of the information already contained in the Debian
source package metadata, which could become out of date, but it should
be of help for people building from git.

The INSTALL file is present but only after having prepared the release
for distribution, which is not the case when getting the source from

> So, in m4/dpkg-linker.m4 I removed the -O1 flag from the default LDFLAGS,
> re-ran autoreconf etc., and everything build and installed Ok.  dpkg
> --help worked, but at this point I had no further need for dpkg, since I'd
> already dealt manually with the dependencies for building a number of
> packages from source.

Well that's always going to be true when bootstrapping a package
manager. Also I'm not sure it makes much sense to use dpkg on a
foreign system, when most (if not all) of the software installed is
not managed by dpkg, which kind of renders it purposeless.

If you are still interested in just having dpkg around in your
Mac OS X, then using the MacPorts dpkg port might be easier?

> make check doesn't get past CCLD t-test, which has an undefined symbol
> _libintl_gettext.  There had been no gettext on the system, but I
> build that, and the necessary symbol seems to be defined (according to
> nm) in the libintl.a and libintl.dylib in a directory I tried to tell
> the linker about via LDFLAGS, but apparently I haven't discovered the
> right way to let the dpkg build system know about it.  My time for
> this has run out now.

gettext should be required when preparing the tar distribution source
tree, and I'm surprised autoreconf didn't complain about missing

In any case if you get that error even when disabling NLS support, or
when building dpkg from a tarball release but w/o gettext installed
I'd be interested in the build logs, because that'd be a problem in
dpkg's build system.

dpkg - Debian's package maintenance system

The primary interface for the dpkg suite is the ‘dselect’ program;
a more low-level and less user-friendly interface is available in
the form of the ‘dpkg’ command.


The current legacy, stable and development releases can be found at:


For older releases check:


Mailing List

The subscription interface and web archives can be found at:


The mailing list address is:


Source Repository


Building from git source

To prepare the source tree before starting the build process, some software
needs to be installed, additional software might provide optional features.

The minimum software required to build dpkg is:

  C89 compiler with few C99 extensions (see doc/coding-style.txt)
  GNU make
  GNU autoconf >= 2.60
  GNU automake >= 1.8
  GNU gettext  >= 0.18

To run the test suite («make check»):

  TimeDate perl module
  IO-String perl module

To enable optional functionality or programs, this software might be needed:

  zlib (used instead of the command-line tool)
  liblzma (from the xz project; used instead of the command-line tool)
  libbzip2 (from the bzip2 project; used instead of the command-line tool)
  libselinux (needed for SELinux support)
  curses compatible library (needed for dselect)

To enable translated or additional («make doc») documentation this
software will be needed:

  po4a >= 0.36.4

To enable code coverage («./configure --enable-coverage; make coverage»)
this software is needed:

  lcov (from the Linux Test Project)
  Devel-Cover perl module

After installing the needed software, and running the following command on
the git tree:

  $ autoreconf -f -i

the source should be equivalent to the distributed tar source.

Building from tar source

The instructions to build the distributed source are included in the

The following configure options might be of interest to disable specific


And the following to disable modifications to the build flags:


To see all available configuration options please run «./configure --help».

Reply to: