Search code examples
gnupackagingautotoolsautoconfdeb

Autotools: Convert x86_64 to amd64 and so on


I am trying to enable packaging for my C project. I know that i can use the AC_CANONICAL_BUILD macro to get @build_cpu@. But the problem is, that the debian control file wants amd64 instead of x86_64. Is there a simple way to convert these uname outputs to the format that dpkg wants or do I need to check every possible architecture in an if statement?


Solution

  • It is not entirely clear what you are trying to do, and why you would need this mapping. My impression is that you might probably be trying to do something wrong.

    For packages that are portable, you should simply use one of the wildcards for the Architecture field. For example any, or if for whatever reason it's kernel specific, then something like linux-any or kfreebsd-any.

    If you really need to map between GNU triplets or components and dpkg architectures you can always use the dpkg-architecture command (please check its man page), but again, this usually smells like the wrong way of going about this, and more so from an upstream point of view, which should be distribution neutral.