OS Manuals

/usr/bin/h2xs

libperl development headers

From perl-dev 5.44.0-r4 (os), captured 2026-11-05 by running h2xs --help (exit 255). permalink

h2xs [OPTIONS ... ] [headerfile [extra_libraries]]
version: 1.23
OPTIONS:
    -A, --omit-autoload   Omit all autoloading facilities (implies -c).
    -B, --beta-version    Use beta $VERSION of 0.00_01 (ignored if -v).
    -C, --omit-changes    Omit creating the Changes file, add HISTORY heading
                          to stub POD.
    -F, --cpp-flags       Additional flags for C preprocessor/compile.
    -M, --func-mask       Mask to select C functions/macros
                          (default is select all).
    -O, --overwrite-ok    Allow overwriting of a pre-existing extension directory.
    -P, --omit-pod        Omit the stub POD section.
    -X, --omit-XS         Omit the XS portion (implies both -c and -f).
    -a, --gen-accessors   Generate get/set accessors for struct and union members
                          (used with -x).
    -b, --compat-version  Specify a perl version to be backwards compatible with.
    -c, --omit-constant   Omit the constant() function and specialised AUTOLOAD
                          from the XS file.
    -d, --debugging       Turn on debugging messages.
    -e, --omit-enums      Omit constants from enums in the constant() function.
                          If a pattern is given, only the matching enums are
                          ignored.
    -f, --force           Force creation of the extension even if the C header
                          does not exist.
    -g, --global          Include code for safely storing static data in the .xs file.
    -h, -?, --help        Display this help message.
    -k, --omit-const-func Omit 'const' attribute on function arguments
                          (used with -x).
    -m, --gen-tied-var    Generate tied variables for access to declared
                          variables.
    -n, --name            Specify a name to use for the extension (recommended).
    -o, --opaque-re       Regular expression for "opaque" types.
    -p, --remove-prefix   Specify a prefix which should be removed from the
                          Perl function names.
    -s, --const-subs      Create subroutines for specified macros.
    -t, --default-type    Default type for autoloaded constants (default is IV).
        --use-new-tests   Use Test::More in backward compatible modules.
        --use-old-tests   Use the module Test rather than Test::More.
        --skip-exporter   Do not export symbols.
        --skip-ppport     Do not use portability layer.
        --skip-autoloader Do not use the module C<AutoLoader>.
        --skip-strict     Do not use the pragma C<strict>.
        --skip-warnings   Do not use the pragma C<warnings>.
    -v, --version         Specify a version number for this extension.
    -x, --autogen-xsubs   Autogenerate XSUBs using C::Scan.
        --use-xsloader    Use XSLoader in backward compatible modules (ignored
                          when used with -X).

extra_libraries
         are any libraries that might be needed for loading the
         extension, e.g. -lm would try to link in the math library.
Options (33)
OptionDescriptionSource
-A, --omit-autoloadOmit all autoloading facilities (implies -c).help + man
-B, --beta-versionUse beta $VERSION of 0.00_01 (ignored if -v).help + man
-C, --omit-changesOmits creation of the Changes file, and adds a HISTORY section to the POD template.help + man
-F, --cpp-flags addflagsAdditional flags to specify to C preprocessor when scanning header for function declarations.help + man
-M, --func-mask regularMask to select C functions/macros (default is select all).help + man
-O, --overwrite-okAllows a pre-existing extension directory to be overwritten.help + man
-P, --omit-podOmit the autogenerated stub POD section.help + man
-X, --omit-XSOmit the XS portion (implies both -c and -f).help + man
-a, --gen-accessorsGenerate get/set accessors for struct and union members (used with -x).help + man
-b, --compat-version versionGenerates a .pm file which is backwards compatible with the specified perl version.help + man
-c, --omit-constantOmit constant() from the .xs file and corresponding specialised "AUTOLOAD" from the .pm file.help + man
-d, --debuggingTurn on debugging messages.help + man
-e, --omit-enumsOmit constants from enums in the constant() function.help
-f, --forceAllows an extension to be created for a header even if that header is not found in standard include directories.help + man
-g, --globalInclude code for safely storing static data in the .xs file.help + man
-h, -?, --helpPrint the usage, help and version for this h2xs and exit.help + man
-m, --gen-tied-varExperimental: for each variable declared in the header file(s), declare a perl variable of the same name magically tied to the C variable.help + man
-n, --name module_nameSpecifies a name to be used for the extension, e.g., -n RPC::DCEhelp + man
-o, --opaque-re regularUse "opaque" data type for the C types matched by the regular expression, even if these types are "typedef"-equivalent to types from typemaps.help + man
-p, --remove-prefix prefixSpecify a prefix which should be removed from the Perl function names, e.g., -p sec_rgy_ This sets up the XS PREFIX keyword and removes the prefix from functions that are autoloaded via the…help + man
-s, --const-subs sub1Create a perl subroutine for the specified macros rather than autoload with the constant() subroutine.help + man
-t, --default-type typeSpecify the internal type that the constant() mechanism uses for macros.help + man
--use-new-testsWhen --compat-version (-b) is present the generated tests will use "Test::More" rather than "Test" which is the default for versions before 5.6.2.help + man
--use-old-testsWill force the generation of test code that uses the older "Test" module.help + man
--skip-exporterDo not use "Exporter" and/or export any symbol.help + man
--skip-ppportDo not use "Devel::PPPort": no portability to older version.help + man
--skip-strictDo not use the pragma C<strict>.help + man
--skip-warningsDo not use the pragma C<warnings>.help + man
-v, --version versionSpecify a version number for this extension.help + man
-x, --autogen-xsubsAutomatically generate XSUBs basing on function declarations in the header file.help + man
--use-xsloaderUse XSLoader in backward compatible modules (ignored when used with -X).help
-k, --omit-const-funcFor function arguments declared as "const", omit the const attribute in the generated XS code. (in the manual page but not in --help)man
--skip-autoloaderDo not use the module "AutoLoader"; (in the manual page but not in --help)man
Examples (4) from the manual page, untested

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.