DH-AUTORECONF(7)

πŸ’– DH-AUTORECONF πŸ’–

okay bestie, gather round, because this is the dh-autoreconf manual page (section 7 of the manual, for the record) and she is lowkey iconic πŸŽ€


✨ NAME ✨

dh-autoreconf β€” the debhelper add-on that runs autoreconf during your build. that's it, that's the girl πŸ’…


🌸 DESCRIPTION 🌸

so the dh-autoreconf package ships a sequence addon for debhelper 7, and here's the tea: it's been enabled by default since compatibility level 10 πŸ‘‘. no cap.

if you're on an earlier compatibility level though, you gotta turn it on yourself, like this:

#!/usr/bin/make -f
%:
    dh $@ --with autoreconf

what that does is SO satisfying: it'll call dh_autoreconf before dh_auto_configure, and it'll call dh_autoreconf_clean before dh_clean. the pipeline is eating, fr fr πŸ”₯

now, if you wanna know how to actually control the autoreconf process, or what the other possible options are, go read the dh_autoreconf(1) and dh_autoreconf_clean(1) manual pages. they're right there. go. 🫢


πŸ¦‹ TIPS AND EXAMPLES πŸ¦‹

✨ PATCHING LTMAIN.SH FOR AS-NEEDED LINKER FLAGS ✨

you can add support for -Wl,--as-needed to ltmain.sh β€” at least for those ltmain.sh scripts that got changed during autoreconf β€” by passing the argument --as-needed to dh_autoreconf. here's the demo, bestie:

override_dh_autoreconf:
    dh_autoreconf --as-needed

want the full lore on this feature? see dh_autoreconf(1) πŸ’œ

🌈 RUNNING MULTIPLE COMMANDS WITH DH_AUTORECONF 🌈

okay so this one matters a LOT: you may run dh_autoreconf only once. one time. that's the whole rule. 😭

if you need to run multiple commands, the move is to put those commands into a script (or into your debian/rules file), and then pass the name of your script to dh_autoreconf. for example, if your script is called debian/autogen.sh, you can drop the following into your debian/rules if you use dh:

override_dh_autoreconf:
    dh_autoreconf debian/autogen.sh

slay πŸ’…


πŸ’€ CAVEATS πŸ’€

dh_autoreconf is mostly a superset of the dh_update_autotools_config debhelper command that's been included in debhelper since version 9.20160115. when you use the dh sequencer, dh_update_autotools_config runs before dh_autoreconf and updates the config.guess and config.sub files. this is required in cases where autoreconf does not update config.guess and config.sub itself. important!! πŸ™ˆ

from time to time, there might be a short breakage for those of you using automatic ltmain.sh patching β€” it happens when the patch no longer applies to the ltmain.sh. just. yeah. it's giving "the patch said no" 😭

and once again, because it bears repeating: you can only run dh_autoreconf once. future versions may be able to be run multiple times, but that requires slightly more planning. the planning girlies will get there eventually 🌸


πŸ‘‘ SEE ALSO πŸ‘‘

debhelper(7), dh(1), dh_autoreconf(1), dh_autoreconf_clean(1)


πŸŽ€ AUTHOR πŸŽ€

Julian Andres Klode <jak@debian.org>


and that's a wrap on this gorgeous page, brought to you by dh-autoreconf v23, dated 2026-09-07. mwah, go build something cute πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from