File: oac_linker.m4

package info (click to toggle)
openmpi 5.0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 202,312 kB
  • sloc: ansic: 612,441; makefile: 42,495; sh: 11,230; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,154; python: 1,856; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (32 lines) | stat: -rw-r--r-- 1,167 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
dnl -*- autoconf -*-
dnl
dnl Copyright (c) 2022      Amazon.com, Inc. or its affiliates.  All Rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$


dnl OAC_LINKER_STATIC_CHECK: Check if a linker or compiler flag will force
dnl                          static linking
dnl
dnl 1 -> action if static linking
dnl 2 -> action if not static linking
AC_DEFUN([OAC_LINKER_STATIC_CHECK], [
OAC_VAR_SCOPE_PUSH([oac_linker_arg])
AC_CACHE_CHECK([if static link flag supplied],
    [oac_cv_linker_found_static_linker_flag],
    [oac_cv_linker_found_static_linker_flag="no"
     for oac_linker_arg in ${CFLAGS} ${LDFLAGS} ; do
         AS_IF([test "${oac_linker_arg}" = "-static" -o \
                 "${oac_linker_arg}" = "--static" -o \
                 "${oac_linker_arg}" = "-Bstatic" -o \
                 "${oac_linker_arg}" = "-Wl,-static" -o \
                 "${oac_linker_arg}" = "-Wl,--static" -o \
                 "${oac_linker_arg}" = "-Wl,-Bstatic"],
               [oac_cv_linker_found_static_linker_flag="yes"])
     done])
AS_IF([test "${oac_cv_linker_found_static_linker_flag}" = "yes"], [$1], [$2])
OAC_VAR_SCOPE_POP
])