Macro: peti_enable_dynamic_linking

Back to the Main Page. | Download the M4 Source.

# peti_enable_dynamic_linking

## Synopsis

`PETI_ENABLED_DYNAMIC_LINKING`

## Version

1.1.1.1 (2001/07/26) Miscellaneous @ ac-archive-0.5.32

## Author

Peter Simons <simons@computer.org>

## Description

This macro give the user a comfortable way to add "-static" to the linker flags, that is, to build statically linked binaries. Currently only the "-static" flags is used to achieve that, but on some operating systems, more sophisticated LDFLAGS might be necessary.

## M4 Source Code

    AC_DEFUN([PETI_ENABLED_DYNAMIC_LINKING], [
    AC_MSG_CHECKING(whether what binaries we shall create)
    AC_ARG_ENABLE(dynamic-link,
    [  --enable-dynamic-link   Create dynamically linked binaries (default)],
    if test "$enableval" = "yes"; then
        AC_MSG_RESULT(dynamically linked)
    else
        LDFLAGS="$LDFLAGS -static"
        AC_MSG_RESULT(statically linked)
    fi,
    AC_MSG_RESULT(dynamically linked))
    ])