source: web/old/remctl-2.14/m4/lib-pathname.m4 @ f6f3e91

web
Last change on this file since f6f3e91 was f6f3e91, checked in by Jessica B. Hamrick <jhamrick@…>, 15 years ago

Preserve directory hierarchy (not sure what happened to it)

  • Property mode set to 100644
File size: 1.6 KB
Line 
1dnl lib-pathname.m4 -- Determine the library path name.
2dnl
3dnl Red Hat systems and some other Linux systems use lib64 and lib32 rather
4dnl than just lib in some circumstances.  This file provides an Autoconf
5dnl macro, RRA_SET_LDFLAGS, which given a variable and a prefix, adds
6dnl -Lprefix/lib, -Lprefix/lib32, or -Lprefix/lib64 to the variable depending
7dnl on which directories exist and the size of a long in the compilation
8dnl environment.
9dnl
10dnl Written by Russ Allbery <rra@stanford.edu>
11dnl Copyright 2008 Board of Trustees, Leland Stanford Jr. University
12dnl
13dnl See LICENSE for licensing terms.
14
15dnl Probe for the alternate library name that we should attempt on this
16dnl architecture, given the size of an int, and set rra_lib_arch_name to that
17dnl name.  Separated out so that it can be AC_REQUIRE'd and not run multiple
18dnl times.
19dnl
20dnl There is an unfortunate abstraction violation here where we assume we know
21dnl the cache variable name used by Autoconf.  Unfortunately, Autoconf doesn't
22dnl provide any other way of getting at that information in shell that I can
23dnl see.
24AC_DEFUN([_RRA_LIB_ARCH_NAME],
25[rra_lib_arch_name=lib
26 AC_CHECK_SIZEOF([long])
27 AS_IF([test "$ac_cv_sizeof_long" -eq 4 && test -d /usr/lib32],
28     [rra_lib_arch_name=lib32],
29     [AS_IF([test "$ac_cv_sizeof_long" -eq 8 && test -d /usr/lib64],
30         [rra_lib_arch_name=lib64])])])
31
32dnl The public interface.  Set VARIABLE to PREFIX/lib{,32,64} as appropriate.
33AC_DEFUN([RRA_SET_LDFLAGS],
34[AC_REQUIRE([_RRA_LIB_ARCH_NAME])
35 AS_IF([test -d "$2/$rra_lib_arch_name"],
36    [$1="-L$2/$rra_lib_arch_name"],
37    [$1="-L$2/lib"])])
Note: See TracBrowser for help on using the repository browser.