The R Project SVN R

Rev

Rev 49237 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 49237 Rev 69087
Line 1... Line 1...
1
## concatentation of files in gettext-0.14.5/autoconf-lib-link/m4
1
## concatentation of files in gettext-0.19.5.1/gettext-runtime/gnulib-m4
-
 
2
## cat lib-ld.m4 lib-link.m4 lib-prefix.m4 > gettext-lib.m4
-
 
3
 
2
# lib-ld.m4 serial 3 (gettext-0.13)
4
# lib-ld.m4 serial 6
3
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
5
dnl Copyright (C) 1996-2003, 2009-2015 Free Software Foundation, Inc.
4
dnl This file is free software; the Free Software Foundation
6
dnl This file is free software; the Free Software Foundation
5
dnl gives unlimited permission to copy and/or distribute it,
7
dnl gives unlimited permission to copy and/or distribute it,
6
dnl with or without modifications, as long as this notice is preserved.
8
dnl with or without modifications, as long as this notice is preserved.
7
 
9
 
8
dnl Subroutines of libtool.m4,
10
dnl Subroutines of libtool.m4,
9
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
11
dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
10
dnl with libtool.m4.
12
dnl collision with libtool.m4.
11
 
13
 
12
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
14
dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
13
AC_DEFUN([AC_LIB_PROG_LD_GNU],
15
AC_DEFUN([AC_LIB_PROG_LD_GNU],
14
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
16
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
15
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
17
[# I'd rather use --version here, but apparently some GNU lds only accept -v.
16
case `$LD -v 2>&1 </dev/null` in
18
case `$LD -v 2>&1 </dev/null` in
17
*GNU* | *'with BFD'*)
19
*GNU* | *'with BFD'*)
18
  acl_cv_prog_gnu_ld=yes ;;
20
  acl_cv_prog_gnu_ld=yes
-
 
21
  ;;
19
*)
22
*)
20
  acl_cv_prog_gnu_ld=no ;;
23
  acl_cv_prog_gnu_ld=no
-
 
24
  ;;
21
esac])
25
esac])
22
with_gnu_ld=$acl_cv_prog_gnu_ld
26
with_gnu_ld=$acl_cv_prog_gnu_ld
23
])
27
])
24
 
28
 
25
dnl From libtool-1.4. Sets the variable LD.
29
dnl From libtool-2.4. Sets the variable LD.
26
AC_DEFUN([AC_LIB_PROG_LD],
30
AC_DEFUN([AC_LIB_PROG_LD],
27
[AC_ARG_WITH(gnu-ld,
-
 
28
     [AS_HELP_STRING([--with-gnu-ld],
-
 
29
	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
-
 
30
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
-
 
31
AC_REQUIRE([AC_PROG_CC])dnl
31
[AC_REQUIRE([AC_PROG_CC])dnl
32
AC_REQUIRE([AC_CANONICAL_HOST])dnl
32
AC_REQUIRE([AC_CANONICAL_HOST])dnl
-
 
33
 
-
 
34
AC_ARG_WITH([gnu-ld],
-
 
35
    [AS_HELP_STRING([--with-gnu-ld],
-
 
36
        [assume the C compiler uses GNU ld [default=no]])],
-
 
37
    [test "$withval" = no || with_gnu_ld=yes],
-
 
38
    [with_gnu_ld=no])dnl
-
 
39
 
33
# Prepare PATH_SEPARATOR.
40
# Prepare PATH_SEPARATOR.
34
# The user is always right.
41
# The user is always right.
35
if test "${PATH_SEPARATOR+set}" != set; then
42
if test "${PATH_SEPARATOR+set}" != set; then
36
  echo "#! /bin/sh" >conf$$.sh
43
  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
-
 
44
  # contains only /bin. Note that ksh looks also at the FPATH variable,
37
  echo  "exit 0"   >>conf$$.sh
45
  # so we have to set that as well for the test.
38
  chmod +x conf$$.sh
46
  PATH_SEPARATOR=:
39
  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
47
  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
40
    PATH_SEPARATOR=';'
48
    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
41
  else
-
 
42
    PATH_SEPARATOR=:
49
           || PATH_SEPARATOR=';'
43
  fi
50
       }
44
  rm -f conf$$.sh
-
 
45
fi
51
fi
-
 
52
 
46
ac_prog=ld
53
ac_prog=ld
47
if test "$GCC" = yes; then
54
if test "$GCC" = yes; then
48
  # Check if gcc -print-prog-name=ld gives a path.
55
  # Check if gcc -print-prog-name=ld gives a path.
49
  AC_MSG_CHECKING([for ld used by GCC])
56
  AC_MSG_CHECKING([for ld used by $CC])
50
  case $host in
57
  case $host in
51
  *-*-mingw*)
58
  *-*-mingw*)
52
    # gcc leaves a trailing carriage return which upsets mingw
59
    # gcc leaves a trailing carriage return which upsets mingw
53
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
60
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
54
  *)
61
  *)
55
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
62
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
56
  esac
63
  esac
57
  case $ac_prog in
64
  case $ac_prog in
58
    # Accept absolute paths.
65
    # Accept absolute paths.
59
    [[\\/]* | [A-Za-z]:[\\/]*)]
66
    [[\\/]]* | ?:[[\\/]]*)
60
      [re_direlt='/[^/][^/]*/\.\./']
67
      re_direlt='/[[^/]][[^/]]*/\.\./'
61
      # Canonicalize the path of ld
68
      # Canonicalize the pathname of ld
62
      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
69
      ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
63
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
70
      while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
64
	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
71
        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
65
      done
72
      done
66
      test -z "$LD" && LD="$ac_prog"
73
      test -z "$LD" && LD="$ac_prog"
67
      ;;
74
      ;;
68
  "")
75
  "")
69
    # If it fails, then pretend we aren't using GCC.
76
    # If it fails, then pretend we aren't using GCC.
Line 77... Line 84...
77
elif test "$with_gnu_ld" = yes; then
84
elif test "$with_gnu_ld" = yes; then
78
  AC_MSG_CHECKING([for GNU ld])
85
  AC_MSG_CHECKING([for GNU ld])
79
else
86
else
80
  AC_MSG_CHECKING([for non-GNU ld])
87
  AC_MSG_CHECKING([for non-GNU ld])
81
fi
88
fi
82
AC_CACHE_VAL(acl_cv_path_LD,
89
AC_CACHE_VAL([acl_cv_path_LD],
83
[if test -z "$LD"; then
90
[if test -z "$LD"; then
84
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
91
  acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
85
  for ac_dir in $PATH; do
92
  for ac_dir in $PATH; do
-
 
93
    IFS="$acl_save_ifs"
86
    test -z "$ac_dir" && ac_dir=.
94
    test -z "$ac_dir" && ac_dir=.
87
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
95
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
88
      acl_cv_path_LD="$ac_dir/$ac_prog"
96
      acl_cv_path_LD="$ac_dir/$ac_prog"
89
      # Check to see if the program is GNU ld.  I'd rather use --version,
97
      # Check to see if the program is GNU ld.  I'd rather use --version,
90
      # but apparently some GNU ld's only accept -v.
98
      # but apparently some variants of GNU ld only accept -v.
91
      # Break only if it was the GNU/non-GNU ld that we prefer.
99
      # Break only if it was the GNU/non-GNU ld that we prefer.
92
      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
100
      case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
93
      *GNU* | *'with BFD'*)
101
      *GNU* | *'with BFD'*)
94
	test "$with_gnu_ld" != no && break ;;
102
        test "$with_gnu_ld" != no && break
-
 
103
        ;;
95
      *)
104
      *)
96
	test "$with_gnu_ld" != yes && break ;;
105
        test "$with_gnu_ld" != yes && break
-
 
106
        ;;
97
      esac
107
      esac
98
    fi
108
    fi
99
  done
109
  done
100
  IFS="$ac_save_ifs"
110
  IFS="$acl_save_ifs"
101
else
111
else
102
  acl_cv_path_LD="$LD" # Let the user override the test with a path.
112
  acl_cv_path_LD="$LD" # Let the user override the test with a path.
103
fi])
113
fi])
104
LD="$acl_cv_path_LD"
114
LD="$acl_cv_path_LD"
105
if test -n "$LD"; then
115
if test -n "$LD"; then
106
  AC_MSG_RESULT($LD)
116
  AC_MSG_RESULT([$LD])
107
else
117
else
108
  AC_MSG_RESULT(no)
118
  AC_MSG_RESULT([no])
109
fi
119
fi
110
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
120
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
111
AC_LIB_PROG_LD_GNU
121
AC_LIB_PROG_LD_GNU
112
])
122
])
113
# lib-link.m4 serial 6 (gettext-0.14.3)
123
# lib-link.m4 serial 26 (gettext-0.18.2)
114
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
124
dnl Copyright (C) 2001-2015 Free Software Foundation, Inc.
115
dnl This file is free software; the Free Software Foundation
125
dnl This file is free software; the Free Software Foundation
116
dnl gives unlimited permission to copy and/or distribute it,
126
dnl gives unlimited permission to copy and/or distribute it,
117
dnl with or without modifications, as long as this notice is preserved.
127
dnl with or without modifications, as long as this notice is preserved.
118
 
128
 
119
dnl From Bruno Haible.
129
dnl From Bruno Haible.
120
 
130
 
121
AC_PREREQ(2.50)
131
AC_PREREQ([2.54])
122
 
132
 
123
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
133
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
124
dnl the libraries corresponding to explicit and implicit dependencies.
134
dnl the libraries corresponding to explicit and implicit dependencies.
125
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
135
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
126
dnl augments the CPPFLAGS variable.
136
dnl augments the CPPFLAGS variable.
-
 
137
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
-
 
138
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
127
AC_DEFUN([AC_LIB_LINKFLAGS],
139
AC_DEFUN([AC_LIB_LINKFLAGS],
128
[
140
[
129
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
141
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
130
dnl  AC_REQUIRE([AC_LIB_RPATH])
142
  AC_REQUIRE([AC_LIB_RPATH])
131
  define([Name],[translit([$1],[./-], [___])])
143
  pushdef([Name],[m4_translit([$1],[./+-], [____])])
132
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
144
  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
133
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
145
                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
134
  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
146
  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
135
    AC_LIB_LINKFLAGS_BODY([$1], [$2])
147
    AC_LIB_LINKFLAGS_BODY([$1], [$2])
136
    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
148
    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
137
    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
149
    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
138
    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
150
    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
-
 
151
    ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
139
  ])
152
  ])
140
  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
153
  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
141
  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
154
  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
142
  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
155
  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
-
 
156
  LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
143
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
157
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
144
  AC_SUBST([LIB]NAME)
158
  AC_SUBST([LIB]NAME)
145
  AC_SUBST([LTLIB]NAME)
159
  AC_SUBST([LTLIB]NAME)
-
 
160
  AC_SUBST([LIB]NAME[_PREFIX])
146
  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
161
  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
147
  dnl results of this search when this library appears as a dependency.
162
  dnl results of this search when this library appears as a dependency.
148
  HAVE_LIB[]NAME=yes
163
  HAVE_LIB[]NAME=yes
149
  undefine([Name])
164
  popdef([NAME])
150
  undefine([NAME])
165
  popdef([Name])
151
])
166
])
152
 
167
 
153
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
168
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
154
dnl searches for libname and the libraries corresponding to explicit and
169
dnl searches for libname and the libraries corresponding to explicit and
155
dnl implicit dependencies, together with the specified include files and
170
dnl implicit dependencies, together with the specified include files and
156
dnl the ability to compile and link the specified testcode. If found, it
171
dnl the ability to compile and link the specified testcode. The missing-message
-
 
172
dnl defaults to 'no' and may contain additional hints for the user.
157
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
173
dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
158
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
174
dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
159
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
175
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
160
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
176
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
-
 
177
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
-
 
178
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
161
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
179
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
162
[
180
[
163
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
181
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
164
dnl  AC_REQUIRE([AC_LIB_RPATH])
182
  AC_REQUIRE([AC_LIB_RPATH])
165
  define([Name],[translit([$1],[./-], [___])])
183
  pushdef([Name],[m4_translit([$1],[./+-], [____])])
166
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
184
  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
167
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
185
                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
168
 
186
 
169
  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
187
  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
170
  dnl accordingly.
188
  dnl accordingly.
171
  AC_LIB_LINKFLAGS_BODY([$1], [$2])
189
  AC_LIB_LINKFLAGS_BODY([$1], [$2])
172
 
190
 
Line 176... Line 194...
176
  ac_save_CPPFLAGS="$CPPFLAGS"
194
  ac_save_CPPFLAGS="$CPPFLAGS"
177
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
195
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
178
 
196
 
179
  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
197
  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
180
    ac_save_LIBS="$LIBS"
198
    ac_save_LIBS="$LIBS"
-
 
199
    dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
-
 
200
    dnl because these -l options might require -L options that are present in
-
 
201
    dnl LIBS. -l options benefit only from the -L options listed before it.
-
 
202
    dnl Otherwise, add it to the front of LIBS, because it may be a static
-
 
203
    dnl library that depends on another static library that is present in LIBS.
-
 
204
    dnl Static libraries benefit only from the static libraries listed after
-
 
205
    dnl it.
-
 
206
    case " $LIB[]NAME" in
181
    LIBS="$LIBS $LIB[]NAME"
207
      *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
-
 
208
      *)       LIBS="$LIB[]NAME $LIBS" ;;
-
 
209
    esac
-
 
210
    AC_LINK_IFELSE(
-
 
211
      [AC_LANG_PROGRAM([[$3]], [[$4]])],
-
 
212
      [ac_cv_lib[]Name=yes],
182
    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
213
      [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
183
    LIBS="$ac_save_LIBS"
214
    LIBS="$ac_save_LIBS"
184
  ])
215
  ])
185
  if test "$ac_cv_lib[]Name" = yes; then
216
  if test "$ac_cv_lib[]Name" = yes; then
186
    HAVE_LIB[]NAME=yes
217
    HAVE_LIB[]NAME=yes
187
    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
218
    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
188
    AC_MSG_CHECKING([how to link with lib[]$1])
219
    AC_MSG_CHECKING([how to link with lib[]$1])
189
    AC_MSG_RESULT([$LIB[]NAME])
220
    AC_MSG_RESULT([$LIB[]NAME])
190
  else
221
  else
191
    HAVE_LIB[]NAME=no
222
    HAVE_LIB[]NAME=no
192
    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
223
    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
193
    dnl $INC[]NAME either.
224
    dnl $INC[]NAME either.
194
    CPPFLAGS="$ac_save_CPPFLAGS"
225
    CPPFLAGS="$ac_save_CPPFLAGS"
195
    LIB[]NAME=
226
    LIB[]NAME=
196
    LTLIB[]NAME=
227
    LTLIB[]NAME=
-
 
228
    LIB[]NAME[]_PREFIX=
197
  fi
229
  fi
198
  AC_SUBST([HAVE_LIB]NAME)
230
  AC_SUBST([HAVE_LIB]NAME)
199
  AC_SUBST([LIB]NAME)
231
  AC_SUBST([LIB]NAME)
200
  AC_SUBST([LTLIB]NAME)
232
  AC_SUBST([LTLIB]NAME)
-
 
233
  AC_SUBST([LIB]NAME[_PREFIX])
201
  undefine([Name])
234
  popdef([NAME])
202
  undefine([NAME])
235
  popdef([Name])
203
])
236
])
204
 
237
 
205
dnl Determine the platform dependent parameters needed to use rpath:
238
dnl Determine the platform dependent parameters needed to use rpath:
-
 
239
dnl   acl_libext,
-
 
240
dnl   acl_shlibext,
-
 
241
dnl   acl_libname_spec,
-
 
242
dnl   acl_library_names_spec,
-
 
243
dnl   acl_hardcode_libdir_flag_spec,
206
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
244
dnl   acl_hardcode_libdir_separator,
-
 
245
dnl   acl_hardcode_direct,
207
dnl hardcode_direct, hardcode_minus_L.
246
dnl   acl_hardcode_minus_L.
208
AC_DEFUN([AC_LIB_RPATH],
247
AC_DEFUN([AC_LIB_RPATH],
209
[
248
[
210
  dnl Tell automake >= 1.10 to complain if config.rpath is missing.
249
  dnl Tell automake >= 1.10 to complain if config.rpath is missing.
211
  m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
250
  m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
212
  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
251
  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
213
dnl  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
252
  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
214
  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
253
  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
215
  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
254
  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
216
  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
255
  AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
217
    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
256
    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
218
    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
257
    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
219
    . ./conftest.sh
258
    . ./conftest.sh
220
    rm -f ./conftest.sh
259
    rm -f ./conftest.sh
221
    acl_cv_rpath=done
260
    acl_cv_rpath=done
222
  ])
261
  ])
223
  wl="$acl_cv_wl"
262
  wl="$acl_cv_wl"
224
  libext="$acl_cv_libext"
263
  acl_libext="$acl_cv_libext"
225
  shlibext="$acl_cv_shlibext"
264
  acl_shlibext="$acl_cv_shlibext"
-
 
265
  acl_libname_spec="$acl_cv_libname_spec"
-
 
266
  acl_library_names_spec="$acl_cv_library_names_spec"
226
  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
267
  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
227
  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
268
  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
228
  hardcode_direct="$acl_cv_hardcode_direct"
269
  acl_hardcode_direct="$acl_cv_hardcode_direct"
229
  hardcode_minus_L="$acl_cv_hardcode_minus_L"
270
  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
230
  dnl Determine whether the user wants rpath handling at all.
271
  dnl Determine whether the user wants rpath handling at all.
231
dnl   AC_ARG_ENABLE(rpath,
272
  AC_ARG_ENABLE([rpath],
232
dnl     [  --disable-rpath         do not hardcode runtime library paths],
273
    [  --disable-rpath         do not hardcode runtime library paths],
233
dnl     :, enable_rpath=yes)
274
    :, enable_rpath=yes)
-
 
275
])
-
 
276
 
-
 
277
dnl AC_LIB_FROMPACKAGE(name, package)
-
 
278
dnl declares that libname comes from the given package. The configure file
-
 
279
dnl will then not have a --with-libname-prefix option but a
-
 
280
dnl --with-package-prefix option. Several libraries can come from the same
-
 
281
dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
-
 
282
dnl macro call that searches for libname.
-
 
283
AC_DEFUN([AC_LIB_FROMPACKAGE],
-
 
284
[
-
 
285
  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
-
 
286
                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
-
 
287
  define([acl_frompackage_]NAME, [$2])
-
 
288
  popdef([NAME])
-
 
289
  pushdef([PACK],[$2])
-
 
290
  pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
-
 
291
                                     [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
-
 
292
  define([acl_libsinpackage_]PACKUP,
-
 
293
    m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
-
 
294
  popdef([PACKUP])
-
 
295
  popdef([PACK])
234
])
296
])
235
 
297
 
236
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
298
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
237
dnl the libraries corresponding to explicit and implicit dependencies.
299
dnl the libraries corresponding to explicit and implicit dependencies.
238
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
300
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
-
 
301
dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
-
 
302
dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
239
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
303
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
240
[
304
[
-
 
305
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
241
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
306
  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
242
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
307
                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
-
 
308
  pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
-
 
309
  pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
-
 
310
                                     [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
-
 
311
  pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
-
 
312
  dnl Autoconf >= 2.61 supports dots in --with options.
-
 
313
  pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
243
  dnl By default, look in $includedir and $libdir.
314
  dnl By default, look in $includedir and $libdir.
244
  use_additional=yes
315
  use_additional=yes
245
  AC_LIB_WITH_FINAL_PREFIX([
316
  AC_LIB_WITH_FINAL_PREFIX([
246
    eval additional_includedir=\"$includedir\"
317
    eval additional_includedir=\"$includedir\"
247
    eval additional_libdir=\"$libdir\"
318
    eval additional_libdir=\"$libdir\"
248
  ])
319
  ])
249
  AC_LIB_ARG_WITH([lib$1-prefix],
320
  AC_ARG_WITH(P_A_C_K[-prefix],
250
[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
321
[[  --with-]]P_A_C_K[[-prefix[=DIR]  search for ]PACKLIBS[ in DIR/include and DIR/lib
251
  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
322
  --without-]]P_A_C_K[[-prefix     don't search for ]PACKLIBS[ in includedir and libdir]],
252
[
323
[
253
    if test "X$withval" = "Xno"; then
324
    if test "X$withval" = "Xno"; then
254
      use_additional=no
325
      use_additional=no
255
    else
326
    else
256
      if test "X$withval" = "X"; then
327
      if test "X$withval" = "X"; then
Line 258... Line 329...
258
          eval additional_includedir=\"$includedir\"
329
          eval additional_includedir=\"$includedir\"
259
          eval additional_libdir=\"$libdir\"
330
          eval additional_libdir=\"$libdir\"
260
        ])
331
        ])
261
      else
332
      else
262
        additional_includedir="$withval/include"
333
        additional_includedir="$withval/include"
263
        additional_libdir="$withval/lib"
334
        additional_libdir="$withval/$acl_libdirstem"
-
 
335
        if test "$acl_libdirstem2" != "$acl_libdirstem" \
-
 
336
           && ! test -d "$withval/$acl_libdirstem"; then
-
 
337
          additional_libdir="$withval/$acl_libdirstem2"
-
 
338
        fi
264
      fi
339
      fi
265
    fi
340
    fi
266
])
341
])
267
  dnl Search the library and its dependencies in $additional_libdir and
342
  dnl Search the library and its dependencies in $additional_libdir and
268
  dnl $LDFLAGS. Using breadth-first-seach.
343
  dnl $LDFLAGS. Using breadth-first-seach.
269
  LIB[]NAME=
344
  LIB[]NAME=
270
  LTLIB[]NAME=
345
  LTLIB[]NAME=
271
  INC[]NAME=
346
  INC[]NAME=
-
 
347
  LIB[]NAME[]_PREFIX=
-
 
348
  dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
-
 
349
  dnl computed. So it has to be reset here.
-
 
350
  HAVE_LIB[]NAME=
272
  rpathdirs=
351
  rpathdirs=
273
  ltrpathdirs=
352
  ltrpathdirs=
274
  names_already_handled=
353
  names_already_handled=
275
  names_next_round='$1 $2'
354
  names_next_round='$1 $2'
276
  while test -n "$names_next_round"; do
355
  while test -n "$names_next_round"; do
Line 286... Line 365...
286
      done
365
      done
287
      if test -z "$already_handled"; then
366
      if test -z "$already_handled"; then
288
        names_already_handled="$names_already_handled $name"
367
        names_already_handled="$names_already_handled $name"
289
        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
368
        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
290
        dnl or AC_LIB_HAVE_LINKFLAGS call.
369
        dnl or AC_LIB_HAVE_LINKFLAGS call.
291
        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
370
        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
292
        eval value=\"\$HAVE_LIB$uppername\"
371
        eval value=\"\$HAVE_LIB$uppername\"
293
        if test -n "$value"; then
372
        if test -n "$value"; then
294
          if test "$value" = yes; then
373
          if test "$value" = yes; then
295
            eval value=\"\$LIB$uppername\"
374
            eval value=\"\$LIB$uppername\"
296
            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
375
            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
Line 306... Line 385...
306
          dnl and the already constructed $LIBNAME/$LTLIBNAME.
385
          dnl and the already constructed $LIBNAME/$LTLIBNAME.
307
          found_dir=
386
          found_dir=
308
          found_la=
387
          found_la=
309
          found_so=
388
          found_so=
310
          found_a=
389
          found_a=
-
 
390
          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
-
 
391
          if test -n "$acl_shlibext"; then
-
 
392
            shrext=".$acl_shlibext"             # typically: shrext=.so
-
 
393
          else
-
 
394
            shrext=
-
 
395
          fi
311
          if test $use_additional = yes; then
396
          if test $use_additional = yes; then
-
 
397
            dir="$additional_libdir"
-
 
398
            dnl The same code as in the loop below:
-
 
399
            dnl First look for a shared library.
-
 
400
            if test -n "$acl_shlibext"; then
312
            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
401
              if test -f "$dir/$libname$shrext"; then
313
              found_dir="$additional_libdir"
402
                found_dir="$dir"
314
              found_so="$additional_libdir/lib$name.$shlibext"
403
                found_so="$dir/$libname$shrext"
-
 
404
              else
-
 
405
                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
-
 
406
                  ver=`(cd "$dir" && \
-
 
407
                        for f in "$libname$shrext".*; do echo "$f"; done \
-
 
408
                        | sed -e "s,^$libname$shrext\\\\.,," \
-
 
409
                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
-
 
410
                        | sed 1q ) 2>/dev/null`
315
              if test -f "$additional_libdir/lib$name.la"; then
411
                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
-
 
412
                    found_dir="$dir"
316
                found_la="$additional_libdir/lib$name.la"
413
                    found_so="$dir/$libname$shrext.$ver"
317
              fi
414
                  fi
318
            else
415
                else
319
              if test -f "$additional_libdir/lib$name.$libext"; then
416
                  eval library_names=\"$acl_library_names_spec\"
320
                found_dir="$additional_libdir"
417
                  for f in $library_names; do
321
                found_a="$additional_libdir/lib$name.$libext"
418
                    if test -f "$dir/$f"; then
322
                if test -f "$additional_libdir/lib$name.la"; then
419
                      found_dir="$dir"
323
                  found_la="$additional_libdir/lib$name.la"
420
                      found_so="$dir/$f"
-
 
421
                      break
-
 
422
                    fi
-
 
423
                  done
324
                fi
424
                fi
325
              fi
425
              fi
326
            fi
426
            fi
-
 
427
            dnl Then look for a static library.
-
 
428
            if test "X$found_dir" = "X"; then
-
 
429
              if test -f "$dir/$libname.$acl_libext"; then
-
 
430
                found_dir="$dir"
-
 
431
                found_a="$dir/$libname.$acl_libext"
-
 
432
              fi
-
 
433
            fi
-
 
434
            if test "X$found_dir" != "X"; then
-
 
435
              if test -f "$dir/$libname.la"; then
-
 
436
                found_la="$dir/$libname.la"
-
 
437
              fi
-
 
438
            fi
327
          fi
439
          fi
328
          if test "X$found_dir" = "X"; then
440
          if test "X$found_dir" = "X"; then
329
            for x in $LDFLAGS $LTLIB[]NAME; do
441
            for x in $LDFLAGS $LTLIB[]NAME; do
330
              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
442
              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
331
              case "$x" in
443
              case "$x" in
332
                -L*)
444
                -L*)
333
                  dir=`echo "X$x" | sed -e 's/^X-L//'`
445
                  dir=`echo "X$x" | sed -e 's/^X-L//'`
334
                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
-
 
335
                    found_dir="$dir"
-
 
336
                    found_so="$dir/lib$name.$shlibext"
446
                  dnl First look for a shared library.
337
                    if test -f "$dir/lib$name.la"; then
447
                  if test -n "$acl_shlibext"; then
338
                      found_la="$dir/lib$name.la"
-
 
339
                    fi
-
 
340
                  else
-
 
341
                    if test -f "$dir/lib$name.$libext"; then
448
                    if test -f "$dir/$libname$shrext"; then
342
                      found_dir="$dir"
449
                      found_dir="$dir"
343
                      found_a="$dir/lib$name.$libext"
450
                      found_so="$dir/$libname$shrext"
-
 
451
                    else
-
 
452
                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
-
 
453
                        ver=`(cd "$dir" && \
-
 
454
                              for f in "$libname$shrext".*; do echo "$f"; done \
-
 
455
                              | sed -e "s,^$libname$shrext\\\\.,," \
-
 
456
                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
-
 
457
                              | sed 1q ) 2>/dev/null`
-
 
458
                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
-
 
459
                          found_dir="$dir"
-
 
460
                          found_so="$dir/$libname$shrext.$ver"
-
 
461
                        fi
-
 
462
                      else
-
 
463
                        eval library_names=\"$acl_library_names_spec\"
-
 
464
                        for f in $library_names; do
344
                      if test -f "$dir/lib$name.la"; then
465
                          if test -f "$dir/$f"; then
-
 
466
                            found_dir="$dir"
345
                        found_la="$dir/lib$name.la"
467
                            found_so="$dir/$f"
-
 
468
                            break
-
 
469
                          fi
-
 
470
                        done
346
                      fi
471
                      fi
347
                    fi
472
                    fi
348
                  fi
473
                  fi
-
 
474
                  dnl Then look for a static library.
-
 
475
                  if test "X$found_dir" = "X"; then
-
 
476
                    if test -f "$dir/$libname.$acl_libext"; then
-
 
477
                      found_dir="$dir"
-
 
478
                      found_a="$dir/$libname.$acl_libext"
-
 
479
                    fi
-
 
480
                  fi
-
 
481
                  if test "X$found_dir" != "X"; then
-
 
482
                    if test -f "$dir/$libname.la"; then
-
 
483
                      found_la="$dir/$libname.la"
-
 
484
                    fi
-
 
485
                  fi
349
                  ;;
486
                  ;;
350
              esac
487
              esac
351
              if test "X$found_dir" != "X"; then
488
              if test "X$found_dir" != "X"; then
352
                break
489
                break
353
              fi
490
              fi
Line 358... Line 495...
358
            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
495
            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
359
            if test "X$found_so" != "X"; then
496
            if test "X$found_so" != "X"; then
360
              dnl Linking with a shared library. We attempt to hardcode its
497
              dnl Linking with a shared library. We attempt to hardcode its
361
              dnl directory into the executable's runpath, unless it's the
498
              dnl directory into the executable's runpath, unless it's the
362
              dnl standard /usr/lib.
499
              dnl standard /usr/lib.
-
 
500
              if test "$enable_rpath" = no \
-
 
501
                 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
363
              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
502
                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
364
                dnl No hardcoding is needed.
503
                dnl No hardcoding is needed.
365
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
504
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
366
              else
505
              else
367
                dnl Use an explicit option to hardcode DIR into the resulting
506
                dnl Use an explicit option to hardcode DIR into the resulting
368
                dnl binary.
507
                dnl binary.
Line 377... Line 516...
377
                done
516
                done
378
                if test -z "$haveit"; then
517
                if test -z "$haveit"; then
379
                  ltrpathdirs="$ltrpathdirs $found_dir"
518
                  ltrpathdirs="$ltrpathdirs $found_dir"
380
                fi
519
                fi
381
                dnl The hardcoding into $LIBNAME is system dependent.
520
                dnl The hardcoding into $LIBNAME is system dependent.
382
                if test "$hardcode_direct" = yes; then
521
                if test "$acl_hardcode_direct" = yes; then
383
                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
522
                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
384
                  dnl resulting binary.
523
                  dnl resulting binary.
385
                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
524
                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
386
                else
525
                else
387
                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
526
                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
388
                    dnl Use an explicit option to hardcode DIR into the resulting
527
                    dnl Use an explicit option to hardcode DIR into the resulting
389
                    dnl binary.
528
                    dnl binary.
390
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
529
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
391
                    dnl Potentially add DIR to rpathdirs.
530
                    dnl Potentially add DIR to rpathdirs.
392
                    dnl The rpathdirs will be appended to $LIBNAME at the end.
531
                    dnl The rpathdirs will be appended to $LIBNAME at the end.
Line 413... Line 552...
413
                      fi
552
                      fi
414
                    done
553
                    done
415
                    if test -z "$haveit"; then
554
                    if test -z "$haveit"; then
416
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
555
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
417
                    fi
556
                    fi
418
                    if test "$hardcode_minus_L" != no; then
557
                    if test "$acl_hardcode_minus_L" != no; then
419
                      dnl FIXME: Not sure whether we should use
558
                      dnl FIXME: Not sure whether we should use
420
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
559
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
421
                      dnl here.
560
                      dnl here.
422
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
561
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
423
                    else
562
                    else
424
                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
563
                      dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
425
                      dnl here, because this doesn't fit in flags passed to the
564
                      dnl here, because this doesn't fit in flags passed to the
426
                      dnl compiler. So give up. No hardcoding. This affects only
565
                      dnl compiler. So give up. No hardcoding. This affects only
427
                      dnl very old systems.
566
                      dnl very old systems.
428
                      dnl FIXME: Not sure whether we should use
567
                      dnl FIXME: Not sure whether we should use
429
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
568
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
Line 444... Line 583...
444
              fi
583
              fi
445
            fi
584
            fi
446
            dnl Assume the include files are nearby.
585
            dnl Assume the include files are nearby.
447
            additional_includedir=
586
            additional_includedir=
448
            case "$found_dir" in
587
            case "$found_dir" in
-
 
588
              */$acl_libdirstem | */$acl_libdirstem/)
-
 
589
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
-
 
590
                if test "$name" = '$1'; then
-
 
591
                  LIB[]NAME[]_PREFIX="$basedir"
449
              */lib | */lib/)
592
                fi
-
 
593
                additional_includedir="$basedir/include"
-
 
594
                ;;
-
 
595
              */$acl_libdirstem2 | */$acl_libdirstem2/)
450
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
596
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
-
 
597
                if test "$name" = '$1'; then
-
 
598
                  LIB[]NAME[]_PREFIX="$basedir"
-
 
599
                fi
451
                additional_includedir="$basedir/include"
600
                additional_includedir="$basedir/include"
452
                ;;
601
                ;;
453
            esac
602
            esac
454
            if test "X$additional_includedir" != "X"; then
603
            if test "X$additional_includedir" != "X"; then
455
              dnl Potentially add $additional_includedir to $INCNAME.
604
              dnl Potentially add $additional_includedir to $INCNAME.
Line 506... Line 655...
506
                    dnl   1. if it's the standard /usr/lib,
655
                    dnl   1. if it's the standard /usr/lib,
507
                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
656
                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
508
                    dnl   3. if it's already present in $LDFLAGS or the already
657
                    dnl   3. if it's already present in $LDFLAGS or the already
509
                    dnl      constructed $LIBNAME,
658
                    dnl      constructed $LIBNAME,
510
                    dnl   4. if it doesn't exist as a directory.
659
                    dnl   4. if it doesn't exist as a directory.
511
                    if test "X$additional_libdir" != "X/usr/lib"; then
660
                    if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
-
 
661
                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
512
                      haveit=
662
                      haveit=
513
                      if test "X$additional_libdir" = "X/usr/local/lib"; then
663
                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
-
 
664
                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
514
                        if test -n "$GCC"; then
665
                        if test -n "$GCC"; then
515
                          case $host_os in
666
                          case $host_os in
516
                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
667
                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
517
                          esac
668
                          esac
518
                        fi
669
                        fi
Line 607... Line 758...
607
        fi
758
        fi
608
      fi
759
      fi
609
    done
760
    done
610
  done
761
  done
611
  if test "X$rpathdirs" != "X"; then
762
  if test "X$rpathdirs" != "X"; then
612
    if test -n "$hardcode_libdir_separator"; then
763
    if test -n "$acl_hardcode_libdir_separator"; then
613
      dnl Weird platform: only the last -rpath option counts, the user must
764
      dnl Weird platform: only the last -rpath option counts, the user must
614
      dnl pass all path elements in one option. We can arrange that for a
765
      dnl pass all path elements in one option. We can arrange that for a
615
      dnl single library, but not when more than one $LIBNAMEs are used.
766
      dnl single library, but not when more than one $LIBNAMEs are used.
616
      alldirs=
767
      alldirs=
617
      for found_dir in $rpathdirs; do
768
      for found_dir in $rpathdirs; do
618
        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
769
        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
619
      done
770
      done
620
      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
771
      dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
621
      acl_save_libdir="$libdir"
772
      acl_save_libdir="$libdir"
622
      libdir="$alldirs"
773
      libdir="$alldirs"
623
      eval flag=\"$hardcode_libdir_flag_spec\"
774
      eval flag=\"$acl_hardcode_libdir_flag_spec\"
624
      libdir="$acl_save_libdir"
775
      libdir="$acl_save_libdir"
625
      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
776
      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
626
    else
777
    else
627
      dnl The -rpath options are cumulative.
778
      dnl The -rpath options are cumulative.
628
      for found_dir in $rpathdirs; do
779
      for found_dir in $rpathdirs; do
629
        acl_save_libdir="$libdir"
780
        acl_save_libdir="$libdir"
630
        libdir="$found_dir"
781
        libdir="$found_dir"
631
        eval flag=\"$hardcode_libdir_flag_spec\"
782
        eval flag=\"$acl_hardcode_libdir_flag_spec\"
632
        libdir="$acl_save_libdir"
783
        libdir="$acl_save_libdir"
633
        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
784
        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
634
      done
785
      done
635
    fi
786
    fi
636
  fi
787
  fi
Line 639... Line 790...
639
    dnl executables is -R. The -R options are cumulative.
790
    dnl executables is -R. The -R options are cumulative.
640
    for found_dir in $ltrpathdirs; do
791
    for found_dir in $ltrpathdirs; do
641
      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
792
      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
642
    done
793
    done
643
  fi
794
  fi
-
 
795
  popdef([P_A_C_K])
-
 
796
  popdef([PACKLIBS])
-
 
797
  popdef([PACKUP])
-
 
798
  popdef([PACK])
-
 
799
  popdef([NAME])
644
])
800
])
645
 
801
 
646
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
802
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
647
dnl unless already present in VAR.
803
dnl unless already present in VAR.
648
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
804
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
Line 661... Line 817...
661
    if test -z "$haveit"; then
817
    if test -z "$haveit"; then
662
      [$1]="${[$1]}${[$1]:+ }$element"
818
      [$1]="${[$1]}${[$1]:+ }$element"
663
    fi
819
    fi
664
  done
820
  done
665
])
821
])
-
 
822
 
-
 
823
dnl For those cases where a variable contains several -L and -l options
-
 
824
dnl referring to unknown libraries and directories, this macro determines the
-
 
825
dnl necessary additional linker options for the runtime path.
-
 
826
dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
-
 
827
dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
-
 
828
dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
-
 
829
dnl otherwise linking without libtool is assumed.
-
 
830
AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
-
 
831
[
-
 
832
  AC_REQUIRE([AC_LIB_RPATH])
-
 
833
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
-
 
834
  $1=
-
 
835
  if test "$enable_rpath" != no; then
-
 
836
    if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
-
 
837
      dnl Use an explicit option to hardcode directories into the resulting
-
 
838
      dnl binary.
-
 
839
      rpathdirs=
-
 
840
      next=
-
 
841
      for opt in $2; do
-
 
842
        if test -n "$next"; then
-
 
843
          dir="$next"
-
 
844
          dnl No need to hardcode the standard /usr/lib.
-
 
845
          if test "X$dir" != "X/usr/$acl_libdirstem" \
-
 
846
             && test "X$dir" != "X/usr/$acl_libdirstem2"; then
-
 
847
            rpathdirs="$rpathdirs $dir"
-
 
848
          fi
-
 
849
          next=
-
 
850
        else
-
 
851
          case $opt in
-
 
852
            -L) next=yes ;;
-
 
853
            -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
-
 
854
                 dnl No need to hardcode the standard /usr/lib.
-
 
855
                 if test "X$dir" != "X/usr/$acl_libdirstem" \
-
 
856
                    && test "X$dir" != "X/usr/$acl_libdirstem2"; then
-
 
857
                   rpathdirs="$rpathdirs $dir"
-
 
858
                 fi
-
 
859
                 next= ;;
-
 
860
            *) next= ;;
-
 
861
          esac
-
 
862
        fi
-
 
863
      done
-
 
864
      if test "X$rpathdirs" != "X"; then
-
 
865
        if test -n ""$3""; then
-
 
866
          dnl libtool is used for linking. Use -R options.
-
 
867
          for dir in $rpathdirs; do
-
 
868
            $1="${$1}${$1:+ }-R$dir"
-
 
869
          done
-
 
870
        else
-
 
871
          dnl The linker is used for linking directly.
-
 
872
          if test -n "$acl_hardcode_libdir_separator"; then
-
 
873
            dnl Weird platform: only the last -rpath option counts, the user
-
 
874
            dnl must pass all path elements in one option.
-
 
875
            alldirs=
-
 
876
            for dir in $rpathdirs; do
-
 
877
              alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
-
 
878
            done
-
 
879
            acl_save_libdir="$libdir"
-
 
880
            libdir="$alldirs"
-
 
881
            eval flag=\"$acl_hardcode_libdir_flag_spec\"
-
 
882
            libdir="$acl_save_libdir"
-
 
883
            $1="$flag"
-
 
884
          else
-
 
885
            dnl The -rpath options are cumulative.
-
 
886
            for dir in $rpathdirs; do
-
 
887
              acl_save_libdir="$libdir"
-
 
888
              libdir="$dir"
-
 
889
              eval flag=\"$acl_hardcode_libdir_flag_spec\"
-
 
890
              libdir="$acl_save_libdir"
-
 
891
              $1="${$1}${$1:+ }$flag"
-
 
892
            done
-
 
893
          fi
-
 
894
        fi
-
 
895
      fi
-
 
896
    fi
-
 
897
  fi
-
 
898
  AC_SUBST([$1])
-
 
899
])
666
# lib-prefix.m4 serial 4 (gettext-0.14.2)
900
# lib-prefix.m4 serial 7 (gettext-0.18)
667
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
901
dnl Copyright (C) 2001-2005, 2008-2015 Free Software Foundation, Inc.
668
dnl This file is free software; the Free Software Foundation
902
dnl This file is free software; the Free Software Foundation
669
dnl gives unlimited permission to copy and/or distribute it,
903
dnl gives unlimited permission to copy and/or distribute it,
670
dnl with or without modifications, as long as this notice is preserved.
904
dnl with or without modifications, as long as this notice is preserved.
671
 
905
 
672
dnl From Bruno Haible.
906
dnl From Bruno Haible.
Line 687... Line 921...
687
AC_DEFUN([AC_LIB_PREFIX],
921
AC_DEFUN([AC_LIB_PREFIX],
688
[
922
[
689
  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
923
  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
690
  AC_REQUIRE([AC_PROG_CC])
924
  AC_REQUIRE([AC_PROG_CC])
691
  AC_REQUIRE([AC_CANONICAL_HOST])
925
  AC_REQUIRE([AC_CANONICAL_HOST])
-
 
926
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
692
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
927
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
693
  dnl By default, look in $includedir and $libdir.
928
  dnl By default, look in $includedir and $libdir.
694
  use_additional=yes
929
  use_additional=yes
695
  AC_LIB_WITH_FINAL_PREFIX([
930
  AC_LIB_WITH_FINAL_PREFIX([
696
    eval additional_includedir=\"$includedir\"
931
    eval additional_includedir=\"$includedir\"
Line 708... Line 943...
708
          eval additional_includedir=\"$includedir\"
943
          eval additional_includedir=\"$includedir\"
709
          eval additional_libdir=\"$libdir\"
944
          eval additional_libdir=\"$libdir\"
710
        ])
945
        ])
711
      else
946
      else
712
        additional_includedir="$withval/include"
947
        additional_includedir="$withval/include"
713
        additional_libdir="$withval/lib"
948
        additional_libdir="$withval/$acl_libdirstem"
714
      fi
949
      fi
715
    fi
950
    fi
716
])
951
])
717
  if test $use_additional = yes; then
952
  if test $use_additional = yes; then
718
    dnl Potentially add $additional_includedir to $CPPFLAGS.
953
    dnl Potentially add $additional_includedir to $CPPFLAGS.
Line 750... Line 985...
750
    dnl But don't add it
985
    dnl But don't add it
751
    dnl   1. if it's the standard /usr/lib,
986
    dnl   1. if it's the standard /usr/lib,
752
    dnl   2. if it's already present in $LDFLAGS,
987
    dnl   2. if it's already present in $LDFLAGS,
753
    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
988
    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
754
    dnl   4. if it doesn't exist as a directory.
989
    dnl   4. if it doesn't exist as a directory.
755
    if test "X$additional_libdir" != "X/usr/lib"; then
990
    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
756
      haveit=
991
      haveit=
757
      for x in $LDFLAGS; do
992
      for x in $LDFLAGS; do
758
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
993
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
759
        if test "X$x" = "X-L$additional_libdir"; then
994
        if test "X$x" = "X-L$additional_libdir"; then
760
          haveit=yes
995
          haveit=yes
761
          break
996
          break
762
        fi
997
        fi
763
      done
998
      done
764
      if test -z "$haveit"; then
999
      if test -z "$haveit"; then
765
        if test "X$additional_libdir" = "X/usr/local/lib"; then
1000
        if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
766
          if test -n "$GCC"; then
1001
          if test -n "$GCC"; then
767
            case $host_os in
1002
            case $host_os in
768
              linux*) haveit=yes;;
1003
              linux*) haveit=yes;;
769
            esac
1004
            esac
770
          fi
1005
          fi
Line 814... Line 1049...
814
  exec_prefix="$acl_final_exec_prefix"
1049
  exec_prefix="$acl_final_exec_prefix"
815
  $1
1050
  $1
816
  exec_prefix="$acl_save_exec_prefix"
1051
  exec_prefix="$acl_save_exec_prefix"
817
  prefix="$acl_save_prefix"
1052
  prefix="$acl_save_prefix"
818
])
1053
])
-
 
1054
 
-
 
1055
dnl AC_LIB_PREPARE_MULTILIB creates
-
 
1056
dnl - a variable acl_libdirstem, containing the basename of the libdir, either
-
 
1057
dnl   "lib" or "lib64" or "lib/64",
-
 
1058
dnl - a variable acl_libdirstem2, as a secondary possible value for
-
 
1059
dnl   acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
-
 
1060
dnl   "lib/amd64".
-
 
1061
AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
-
 
1062
[
-
 
1063
  dnl There is no formal standard regarding lib and lib64.
-
 
1064
  dnl On glibc systems, the current practice is that on a system supporting
-
 
1065
  dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
-
 
1066
  dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
-
 
1067
  dnl the compiler's default mode by looking at the compiler's library search
-
 
1068
  dnl path. If at least one of its elements ends in /lib64 or points to a
-
 
1069
  dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
-
 
1070
  dnl Otherwise we use the default, namely "lib".
-
 
1071
  dnl On Solaris systems, the current practice is that on a system supporting
-
 
1072
  dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
-
 
1073
  dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
-
 
1074
  dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
-
 
1075
  AC_REQUIRE([AC_CANONICAL_HOST])
-
 
1076
  acl_libdirstem=lib
-
 
1077
  acl_libdirstem2=
-
 
1078
  case "$host_os" in
-
 
1079
    solaris*)
-
 
1080
      dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
-
 
1081
      dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
-
 
1082
      dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
-
 
1083
      dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
-
 
1084
      dnl symlink is missing, so we set acl_libdirstem2 too.
-
 
1085
      AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
-
 
1086
        [AC_EGREP_CPP([sixtyfour bits], [
-
 
1087
#ifdef _LP64
-
 
1088
sixtyfour bits
-
 
1089
#endif
-
 
1090
           ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
-
 
1091
        ])
-
 
1092
      if test $gl_cv_solaris_64bit = yes; then
-
 
1093
        acl_libdirstem=lib/64
-
 
1094
        case "$host_cpu" in
-
 
1095
          sparc*)        acl_libdirstem2=lib/sparcv9 ;;
-
 
1096
          i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
-
 
1097
        esac
-
 
1098
      fi
-
 
1099
      ;;
-
 
1100
    *)
-
 
1101
      searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
-
 
1102
      if test -n "$searchpath"; then
-
 
1103
        acl_save_IFS="${IFS= 	}"; IFS=":"
-
 
1104
        for searchdir in $searchpath; do
-
 
1105
          if test -d "$searchdir"; then
-
 
1106
            case "$searchdir" in
-
 
1107
              */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
-
 
1108
              */../ | */.. )
-
 
1109
                # Better ignore directories of this form. They are misleading.
-
 
1110
                ;;
-
 
1111
              *) searchdir=`cd "$searchdir" && pwd`
-
 
1112
                 case "$searchdir" in
-
 
1113
                   */lib64 ) acl_libdirstem=lib64 ;;
-
 
1114
                 esac ;;
-
 
1115
            esac
-
 
1116
          fi
-
 
1117
        done
-
 
1118
        IFS="$acl_save_IFS"
-
 
1119
      fi
-
 
1120
      ;;
-
 
1121
  esac
-
 
1122
  test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
-
 
1123
])