macOS
brew install unifdeflocal Homebrew formula metadata
sudo port install unifdefMacPorts ports tree · devel/unifdef/Portfile · ソース: api.github.com
brew / 順位 9647
unifdef のインストール経路、実行ファイル、メタデータ、AI エージェント向けセキュリティノートを確認します。
インストール
brew install unifdeflocal Homebrew formula metadata
sudo port install unifdefMacPorts ports tree · devel/unifdef/Portfile · ソース: api.github.com
sudo apk add unifdefAlpine Linux edge package indexes · unifdef · ソース: dl-cdn.alpinelinux.org
sudo apt install unifdefDebian stable package indexes · unifdef · ソース: deb.debian.org
sudo dnf install unifdefFedora Rawhide package metadata · unifdef · ソース: dl.fedoraproject.org
nix profile install nixpkgs#unifdefnixpkgs package indexes · pkgs/by-name/un/unifdef/package.nix · ソース: api.github.com
sudo pacman -S unifdefArch Linux sync databases · unifdef · ソース: geo.mirror.pkgbuild.com
sudo zypper install unifdefopenSUSE Tumbleweed package metadata · unifdef · ソース: download.opensuse.org
概要
Selectively process conditional C preprocessor directives
履歴
unifdef is a source-filtering utility that selectively removes C preprocessor conditionals. The official manual says it processes `#if`, `#ifdef`, `#ifndef`, `#elif`, `#else`, and `#endif` lines when command-line macro definitions are sufficient to decide whether a block should be kept or removed.
unifdef is much older than its GitHub mirror. The official manual states that the command appeared in 2.9BSD, and that ANSI C support was added in FreeBSD 4.7. It also credits the original implementation to Dave Yost and Tony Finch's rewrite for ANSI C support.
Tony Finch's official project page explains the modern motivation: understanding `xterm`'s heavily conditionalized pty-handling code. That places unifdef in the Unix source-reading and source-cleanup tradition rather than in general-purpose preprocessing.
The current project page publishes release archives, manual documentation, a browsable source repository, and a GitHub collaboration mirror. The GitHub README warns that GitHub release downloads are incomplete and points users back to the official dotat.at release files, which is useful context for packagers.
The official homepage gives a concrete high-profile adoption example: the Linux kernel uses unifdef to strip `#ifdef __KERNEL__` sections from headers exported to userland. It also notes use outside C, including LaTeX workflows.
The supplied package facts show broad distribution packaging across Homebrew, Debian/Ubuntu, Fedora/DNF, Alpine, Arch, MacPorts, Nix, openSUSE, and others. That matches the tool's age and purpose: it is small, portable, and useful in build and source-export pipelines.
unifdef is used by specifying macros with `-D`, `-U`, or a definitions file, then filtering input files so known conditional branches are removed while unknown conditionals are preserved. It can operate on stdin/stdout or modify files in place.
The manual also documents `unifdefall`, a script that uses `unifdef -s` and `cpp -dM` to derive macro information and remove all conditional directives from a file. This shows the tool's role as a controlled partial preprocessor rather than a full C preprocessor replacement.
unifdef is important in the package-nerd niche because it is both tiny and historically deep: a BSD-era tool still used for practical source filtering. It belongs in base-system and package-manager collections because build scripts and source-export tasks can depend on it without pulling in a large toolchain beyond normal C build support.
Its Linux-kernel header-export use case is exactly the kind of quiet infrastructure job package maintainers care about: remove implementation-only conditional sections, preserve line-oriented source structure, and keep generated user-facing source understandable.
セキュリティ状態
unifdef に一致するローカルシークレット処理マニフェストは見つかりませんでした。将来の対応で安定したパッケージ URL を使えるよう、Nucleus パッケージメタデータはここに公開されています。
エージェントに無人実行させる前に、このツールが平文の認証情報を読むか、リモート状態を書き込むか、成果物を公開するか、プラグインを起動するかを確認してください。
実行可能ファイル
| コマンド | 種類 | 公開範囲 | メモ |
|---|---|---|---|
unifdef | 実行可能ファイル | インデックス済み実行可能ファイル | ローカル実行可能ファイルインデックスから検出されました。 |
unifdefall | 実行可能ファイル | インデックス済み実行可能ファイル | ローカル実行可能ファイルインデックスから検出されました。 |
鮮度
これらの信号は、ページ生成時期、パッケージマネージャの活動、上流リリース比較を分けて示します。バージョン遅れは、証拠 URL と比較可能なバージョンがある場合だけ警告されます。
インストールメタデータ
| パッケージキー | brew:unifdef |
|---|---|
| バージョン | 2.12 |
| パッケージマネージャ | Homebrew |
| ホームページ | https://dotat.at/prog/unifdef/ |
| リポジトリ | https://github.com/fanf2/unifdef |
| Bottle | 未記録 |
| サービス | 宣言なし |
ソースデータベース一致
一致は外部パッケージマネージャインデックスから取得され、ローカルの Automic Vault パッケージリンクとは分けて表示されます。
unifdef 2.12-1
Remove cpp '#ifdef' lines from files
sudo apt install unifdefunifdef
nix profile install nixpkgs#unifdefunifdef 2.12-1
Remove cpp '#ifdef' lines from files
sudo apt install unifdefunifdef 2.12-r4
Selectively remove C preprocessor conditionals
https://github.com/fanf2/unifdef
sudo apk add unifdefunifdef-doc 2.12-r4
Selectively remove C preprocessor conditionals (documentation)
https://github.com/fanf2/unifdef
sudo apk add unifdef-docunifdef 2.12-9.fc45
Selectively remove C preprocessor conditionals
https://dotat.at/prog/unifdef/
sudo dnf install unifdefunifdef 2.12-4
Remove #ifdef'ed lines
https://dotat.at/prog/unifdef/
sudo pacman -S unifdefunifdef 2.12-3.5
Removes ifdefs from C files
https://dotat.at/prog/unifdef/
sudo zypper install unifdefunifdef
sudo port install unifdefソース経路
このページは scripts/generate-pkg-sqlite.py が生成した非公開のパッケージ SQLite アーティファクトから av-web によって提供されます。
View the package source record on GitHub.