---
name: "dh-autoreconf"
section: "7"
platform: "linux"
package: "dh-autoreconf"
version: "20"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/dh-autoreconf"
---

# dh-autoreconf(7)

debhelper add-on to run autoreconf during build

## NAME

dh-autoreconf - debhelper add-on to run autoreconf during build

## DESCRIPTION

The dh-autoreconf package provides a sequence addon for debhelper 7 and is enabled by default since compatibility level 10. For earlier compatibility levels it can be enabled in the following way:

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

This will call dh\_autoreconf prior to dh\_auto\_configure and will call dh\_autoreconf\_clean before dh\_clean.

For more information on how to control the autoreconf process or how to other possible options, read the [**dh\_autoreconf**(1)](/dh_autoreconf/1.md) and [**dh\_autoreconf\_clean**(1)](/dh_autoreconf_clean/1.md) manual pages.

## CDBS INTEGRATION

This package also provides */usr/share/cdbs/1/rules/autoreconf.mk* for packages using **CDBS**. The variable `"DEB_DH_AUTORECONF_ARGS"` can be used to pass extra arguments to dh\_autoreconf, and the variable `"DEB_DH_AUTORECONF_CLEAN_ARGS"` to pass arguments to dh\_autoreconf\_clean. See their manual pages for information on available arguments.

## 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 changed during autoreconf) by passing the argument **--as-needed** to dh\_autoreconf, as demonstrated in the following example:

```
    override_dh_autoreconf:
        dh_autoreconf --as-needed
```

and for CDBS, by adding it to the correct variable such as:

```
    DEB_DH_AUTORECONF_ARGS = --as-needed
```

For more information about this feature, see [**dh\_autoreconf**(1)](/dh_autoreconf/1.md)

### RUNNING MULTIPLE COMMANDS WITH DH\_AUTORECONF

Please note that you may run dh\_autoreconf only once. If you need to run multiple commands, you can put the commands into a script or 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 put the following into your debian/rules if you use dh:

```
    override_dh_autoreconf:
        dh_autoreconf debian/autogen.sh
```

Or, if you use CDBS:

```
    DEB_DH_AUTORECONF_ARGS += debian/autogen.sh
```

## CAVEATS

dh\_autoreconf is mostly a superset of the dh\_update\_autotools\_config debhelper command included in debhelper since version 9.20160115. When using the dh sequencer, dh\_update\_autotools\_config is run 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.

From time to time, there might be a short breakage for those using automatic ltmain.sh patching, when the patch no longer applies to the ltmain.sh.

You can only run dh\_autoreconf once. Future versions may be able to be run multiple times, but this requires slightly more planning.

## SEE ALSO

[**debhelper**(7)](/debhelper/7.md), [**dh**(1)](/dh/1.md), [**dh\_autoreconf**(1)](/dh_autoreconf/1.md), [**dh\_autoreconf\_clean**(1)](/dh_autoreconf_clean/1.md)

## AUTHOR

Julian Andres Klode \<jak@debian.org\>
