~ubuntu-branches/ubuntu/saucy/lordsawar/saucy

« back to all changes in this revision

Viewing changes to m4/lib-link.m4

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese, Barry deFreese
  • Date: 2008-12-20 13:52:12 UTC
  • mfrom: (1.1.6 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20081220135212-noeb2w3y98ebo7o9
Tags: 0.1.4-1
[ Barry deFreese ]
* New upstream release.
* Move 0.0.8-2.1 changelog entry to correct point in changelog.
* Make lordsawar-data suggest lordsawar.
* Update my e-mail address.
* Add build-depends on intltool, uuid-dev, and libboost-dev.
* Don't install locales since there are no translations currently.
* Add simple man page for new lordsawar-pbm binary.
* Drop gcc4.3 patches as they have been fixed upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# lib-link.m4 serial 4 (gettext-0.12)
2
 
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
3
 
dnl This file is free software, distributed under the terms of the GNU
4
 
dnl General Public License.  As a special exception to the GNU General
5
 
dnl Public License, this file may be distributed as part of a program
6
 
dnl that contains a configuration script generated by Autoconf, under
7
 
dnl the same distribution terms as the rest of that program.
 
1
# lib-link.m4 serial 13 (gettext-0.17)
 
2
dnl Copyright (C) 2001-2007 Free Software Foundation, Inc.
 
3
dnl This file is free software; the Free Software Foundation
 
4
dnl gives unlimited permission to copy and/or distribute it,
 
5
dnl with or without modifications, as long as this notice is preserved.
8
6
 
9
7
dnl From Bruno Haible.
10
8
 
 
9
AC_PREREQ(2.54)
 
10
 
11
11
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
12
12
dnl the libraries corresponding to explicit and implicit dependencies.
13
13
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
14
14
dnl augments the CPPFLAGS variable.
 
15
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
 
16
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
15
17
AC_DEFUN([AC_LIB_LINKFLAGS],
16
18
[
17
19
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
24
26
    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
25
27
    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
26
28
    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
 
29
    ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
27
30
  ])
28
31
  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
29
32
  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
30
33
  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
 
34
  LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
31
35
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
32
36
  AC_SUBST([LIB]NAME)
33
37
  AC_SUBST([LTLIB]NAME)
 
38
  AC_SUBST([LIB]NAME[_PREFIX])
34
39
  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
35
40
  dnl results of this search when this library appears as a dependency.
36
41
  HAVE_LIB[]NAME=yes
46
51
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
47
52
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
48
53
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
 
54
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
 
55
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
49
56
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
50
57
[
51
58
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
82
89
    CPPFLAGS="$ac_save_CPPFLAGS"
83
90
    LIB[]NAME=
84
91
    LTLIB[]NAME=
 
92
    LIB[]NAME[]_PREFIX=
85
93
  fi
86
94
  AC_SUBST([HAVE_LIB]NAME)
87
95
  AC_SUBST([LIB]NAME)
88
96
  AC_SUBST([LTLIB]NAME)
 
97
  AC_SUBST([LIB]NAME[_PREFIX])
89
98
  undefine([Name])
90
99
  undefine([NAME])
91
100
])
92
101
 
93
102
dnl Determine the platform dependent parameters needed to use rpath:
94
 
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
95
 
dnl hardcode_direct, hardcode_minus_L.
 
103
dnl   acl_libext,
 
104
dnl   acl_shlibext,
 
105
dnl   acl_hardcode_libdir_flag_spec,
 
106
dnl   acl_hardcode_libdir_separator,
 
107
dnl   acl_hardcode_direct,
 
108
dnl   acl_hardcode_minus_L.
96
109
AC_DEFUN([AC_LIB_RPATH],
97
110
[
 
111
  dnl Tell automake >= 1.10 to complain if config.rpath is missing.
 
112
  m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
98
113
  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
99
114
  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
100
115
  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
107
122
    acl_cv_rpath=done
108
123
  ])
109
124
  wl="$acl_cv_wl"
110
 
  libext="$acl_cv_libext"
111
 
  shlibext="$acl_cv_shlibext"
112
 
  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
113
 
  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
114
 
  hardcode_direct="$acl_cv_hardcode_direct"
115
 
  hardcode_minus_L="$acl_cv_hardcode_minus_L"
 
125
  acl_libext="$acl_cv_libext"
 
126
  acl_shlibext="$acl_cv_shlibext"
 
127
  acl_libname_spec="$acl_cv_libname_spec"
 
128
  acl_library_names_spec="$acl_cv_library_names_spec"
 
129
  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
 
130
  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
 
131
  acl_hardcode_direct="$acl_cv_hardcode_direct"
 
132
  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
116
133
  dnl Determine whether the user wants rpath handling at all.
117
134
  AC_ARG_ENABLE(rpath,
118
135
    [  --disable-rpath         do not hardcode runtime library paths],
122
139
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
123
140
dnl the libraries corresponding to explicit and implicit dependencies.
124
141
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
 
142
dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
 
143
dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
125
144
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
126
145
[
 
146
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
127
147
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
128
148
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
149
  dnl Autoconf >= 2.61 supports dots in --with options.
 
150
  define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
129
151
  dnl By default, look in $includedir and $libdir.
130
152
  use_additional=yes
131
153
  AC_LIB_WITH_FINAL_PREFIX([
132
154
    eval additional_includedir=\"$includedir\"
133
155
    eval additional_libdir=\"$libdir\"
134
156
  ])
135
 
  AC_LIB_ARG_WITH([lib$1-prefix],
136
 
[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
137
 
  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
 
157
  AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix],
 
158
[  --with-lib]N_A_M_E[-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
 
159
  --without-lib]N_A_M_E[-prefix     don't search for lib$1 in includedir and libdir],
138
160
[
139
161
    if test "X$withval" = "Xno"; then
140
162
      use_additional=no
146
168
        ])
147
169
      else
148
170
        additional_includedir="$withval/include"
149
 
        additional_libdir="$withval/lib"
 
171
        additional_libdir="$withval/$acl_libdirstem"
150
172
      fi
151
173
    fi
152
174
])
155
177
  LIB[]NAME=
156
178
  LTLIB[]NAME=
157
179
  INC[]NAME=
 
180
  LIB[]NAME[]_PREFIX=
158
181
  rpathdirs=
159
182
  ltrpathdirs=
160
183
  names_already_handled=
194
217
          found_la=
195
218
          found_so=
196
219
          found_a=
 
220
          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
 
221
          if test -n "$acl_shlibext"; then
 
222
            shrext=".$acl_shlibext"             # typically: shrext=.so
 
223
          else
 
224
            shrext=
 
225
          fi
197
226
          if test $use_additional = yes; then
198
 
            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
199
 
              found_dir="$additional_libdir"
200
 
              found_so="$additional_libdir/lib$name.$shlibext"
201
 
              if test -f "$additional_libdir/lib$name.la"; then
202
 
                found_la="$additional_libdir/lib$name.la"
203
 
              fi
204
 
            else
205
 
              if test -f "$additional_libdir/lib$name.$libext"; then
206
 
                found_dir="$additional_libdir"
207
 
                found_a="$additional_libdir/lib$name.$libext"
208
 
                if test -f "$additional_libdir/lib$name.la"; then
209
 
                  found_la="$additional_libdir/lib$name.la"
 
227
            dir="$additional_libdir"
 
228
            dnl The same code as in the loop below:
 
229
            dnl First look for a shared library.
 
230
            if test -n "$acl_shlibext"; then
 
231
              if test -f "$dir/$libname$shrext"; then
 
232
                found_dir="$dir"
 
233
                found_so="$dir/$libname$shrext"
 
234
              else
 
235
                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
 
236
                  ver=`(cd "$dir" && \
 
237
                        for f in "$libname$shrext".*; do echo "$f"; done \
 
238
                        | sed -e "s,^$libname$shrext\\\\.,," \
 
239
                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
 
240
                        | sed 1q ) 2>/dev/null`
 
241
                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
 
242
                    found_dir="$dir"
 
243
                    found_so="$dir/$libname$shrext.$ver"
 
244
                  fi
 
245
                else
 
246
                  eval library_names=\"$acl_library_names_spec\"
 
247
                  for f in $library_names; do
 
248
                    if test -f "$dir/$f"; then
 
249
                      found_dir="$dir"
 
250
                      found_so="$dir/$f"
 
251
                      break
 
252
                    fi
 
253
                  done
210
254
                fi
211
255
              fi
212
256
            fi
 
257
            dnl Then look for a static library.
 
258
            if test "X$found_dir" = "X"; then
 
259
              if test -f "$dir/$libname.$acl_libext"; then
 
260
                found_dir="$dir"
 
261
                found_a="$dir/$libname.$acl_libext"
 
262
              fi
 
263
            fi
 
264
            if test "X$found_dir" != "X"; then
 
265
              if test -f "$dir/$libname.la"; then
 
266
                found_la="$dir/$libname.la"
 
267
              fi
 
268
            fi
213
269
          fi
214
270
          if test "X$found_dir" = "X"; then
215
271
            for x in $LDFLAGS $LTLIB[]NAME; do
217
273
              case "$x" in
218
274
                -L*)
219
275
                  dir=`echo "X$x" | sed -e 's/^X-L//'`
220
 
                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
221
 
                    found_dir="$dir"
222
 
                    found_so="$dir/lib$name.$shlibext"
223
 
                    if test -f "$dir/lib$name.la"; then
224
 
                      found_la="$dir/lib$name.la"
225
 
                    fi
226
 
                  else
227
 
                    if test -f "$dir/lib$name.$libext"; then
 
276
                  dnl First look for a shared library.
 
277
                  if test -n "$acl_shlibext"; then
 
278
                    if test -f "$dir/$libname$shrext"; then
228
279
                      found_dir="$dir"
229
 
                      found_a="$dir/lib$name.$libext"
230
 
                      if test -f "$dir/lib$name.la"; then
231
 
                        found_la="$dir/lib$name.la"
 
280
                      found_so="$dir/$libname$shrext"
 
281
                    else
 
282
                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
 
283
                        ver=`(cd "$dir" && \
 
284
                              for f in "$libname$shrext".*; do echo "$f"; done \
 
285
                              | sed -e "s,^$libname$shrext\\\\.,," \
 
286
                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
 
287
                              | sed 1q ) 2>/dev/null`
 
288
                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
 
289
                          found_dir="$dir"
 
290
                          found_so="$dir/$libname$shrext.$ver"
 
291
                        fi
 
292
                      else
 
293
                        eval library_names=\"$acl_library_names_spec\"
 
294
                        for f in $library_names; do
 
295
                          if test -f "$dir/$f"; then
 
296
                            found_dir="$dir"
 
297
                            found_so="$dir/$f"
 
298
                            break
 
299
                          fi
 
300
                        done
232
301
                      fi
233
302
                    fi
234
303
                  fi
 
304
                  dnl Then look for a static library.
 
305
                  if test "X$found_dir" = "X"; then
 
306
                    if test -f "$dir/$libname.$acl_libext"; then
 
307
                      found_dir="$dir"
 
308
                      found_a="$dir/$libname.$acl_libext"
 
309
                    fi
 
310
                  fi
 
311
                  if test "X$found_dir" != "X"; then
 
312
                    if test -f "$dir/$libname.la"; then
 
313
                      found_la="$dir/$libname.la"
 
314
                    fi
 
315
                  fi
235
316
                  ;;
236
317
              esac
237
318
              if test "X$found_dir" != "X"; then
246
327
              dnl Linking with a shared library. We attempt to hardcode its
247
328
              dnl directory into the executable's runpath, unless it's the
248
329
              dnl standard /usr/lib.
249
 
              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
 
330
              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
250
331
                dnl No hardcoding is needed.
251
332
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
252
333
              else
265
346
                  ltrpathdirs="$ltrpathdirs $found_dir"
266
347
                fi
267
348
                dnl The hardcoding into $LIBNAME is system dependent.
268
 
                if test "$hardcode_direct" = yes; then
 
349
                if test "$acl_hardcode_direct" = yes; then
269
350
                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
270
351
                  dnl resulting binary.
271
352
                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
272
353
                else
273
 
                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
 
354
                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
274
355
                    dnl Use an explicit option to hardcode DIR into the resulting
275
356
                    dnl binary.
276
357
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
301
382
                    if test -z "$haveit"; then
302
383
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
303
384
                    fi
304
 
                    if test "$hardcode_minus_L" != no; then
 
385
                    if test "$acl_hardcode_minus_L" != no; then
305
386
                      dnl FIXME: Not sure whether we should use
306
387
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
307
388
                      dnl here.
308
389
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
309
390
                    else
310
 
                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
 
391
                      dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
311
392
                      dnl here, because this doesn't fit in flags passed to the
312
393
                      dnl compiler. So give up. No hardcoding. This affects only
313
394
                      dnl very old systems.
332
413
            dnl Assume the include files are nearby.
333
414
            additional_includedir=
334
415
            case "$found_dir" in
335
 
              */lib | */lib/)
336
 
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
 
416
              */$acl_libdirstem | */$acl_libdirstem/)
 
417
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
 
418
                LIB[]NAME[]_PREFIX="$basedir"
337
419
                additional_includedir="$basedir/include"
338
420
                ;;
339
421
            esac
350
432
                if test "X$additional_includedir" = "X/usr/local/include"; then
351
433
                  if test -n "$GCC"; then
352
434
                    case $host_os in
353
 
                      linux*) haveit=yes;;
 
435
                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
354
436
                    esac
355
437
                  fi
356
438
                fi
394
476
                    dnl   3. if it's already present in $LDFLAGS or the already
395
477
                    dnl      constructed $LIBNAME,
396
478
                    dnl   4. if it doesn't exist as a directory.
397
 
                    if test "X$additional_libdir" != "X/usr/lib"; then
 
479
                    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
398
480
                      haveit=
399
 
                      if test "X$additional_libdir" = "X/usr/local/lib"; then
 
481
                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
400
482
                        if test -n "$GCC"; then
401
483
                          case $host_os in
402
 
                            linux*) haveit=yes;;
 
484
                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
403
485
                          esac
404
486
                        fi
405
487
                      fi
495
577
    done
496
578
  done
497
579
  if test "X$rpathdirs" != "X"; then
498
 
    if test -n "$hardcode_libdir_separator"; then
 
580
    if test -n "$acl_hardcode_libdir_separator"; then
499
581
      dnl Weird platform: only the last -rpath option counts, the user must
500
582
      dnl pass all path elements in one option. We can arrange that for a
501
583
      dnl single library, but not when more than one $LIBNAMEs are used.
502
584
      alldirs=
503
585
      for found_dir in $rpathdirs; do
504
 
        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
 
586
        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
505
587
      done
506
 
      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
 
588
      dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
507
589
      acl_save_libdir="$libdir"
508
590
      libdir="$alldirs"
509
 
      eval flag=\"$hardcode_libdir_flag_spec\"
 
591
      eval flag=\"$acl_hardcode_libdir_flag_spec\"
510
592
      libdir="$acl_save_libdir"
511
593
      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
512
594
    else
514
596
      for found_dir in $rpathdirs; do
515
597
        acl_save_libdir="$libdir"
516
598
        libdir="$found_dir"
517
 
        eval flag=\"$hardcode_libdir_flag_spec\"
 
599
        eval flag=\"$acl_hardcode_libdir_flag_spec\"
518
600
        libdir="$acl_save_libdir"
519
601
        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
520
602
      done
549
631
    fi
550
632
  done
551
633
])
 
634
 
 
635
dnl For those cases where a variable contains several -L and -l options
 
636
dnl referring to unknown libraries and directories, this macro determines the
 
637
dnl necessary additional linker options for the runtime path.
 
638
dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
 
639
dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
 
640
dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
 
641
dnl otherwise linking without libtool is assumed.
 
642
AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
 
643
[
 
644
  AC_REQUIRE([AC_LIB_RPATH])
 
645
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
 
646
  $1=
 
647
  if test "$enable_rpath" != no; then
 
648
    if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
 
649
      dnl Use an explicit option to hardcode directories into the resulting
 
650
      dnl binary.
 
651
      rpathdirs=
 
652
      next=
 
653
      for opt in $2; do
 
654
        if test -n "$next"; then
 
655
          dir="$next"
 
656
          dnl No need to hardcode the standard /usr/lib.
 
657
          if test "X$dir" != "X/usr/$acl_libdirstem"; then
 
658
            rpathdirs="$rpathdirs $dir"
 
659
          fi
 
660
          next=
 
661
        else
 
662
          case $opt in
 
663
            -L) next=yes ;;
 
664
            -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
 
665
                 dnl No need to hardcode the standard /usr/lib.
 
666
                 if test "X$dir" != "X/usr/$acl_libdirstem"; then
 
667
                   rpathdirs="$rpathdirs $dir"
 
668
                 fi
 
669
                 next= ;;
 
670
            *) next= ;;
 
671
          esac
 
672
        fi
 
673
      done
 
674
      if test "X$rpathdirs" != "X"; then
 
675
        if test -n ""$3""; then
 
676
          dnl libtool is used for linking. Use -R options.
 
677
          for dir in $rpathdirs; do
 
678
            $1="${$1}${$1:+ }-R$dir"
 
679
          done
 
680
        else
 
681
          dnl The linker is used for linking directly.
 
682
          if test -n "$acl_hardcode_libdir_separator"; then
 
683
            dnl Weird platform: only the last -rpath option counts, the user
 
684
            dnl must pass all path elements in one option.
 
685
            alldirs=
 
686
            for dir in $rpathdirs; do
 
687
              alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
 
688
            done
 
689
            acl_save_libdir="$libdir"
 
690
            libdir="$alldirs"
 
691
            eval flag=\"$acl_hardcode_libdir_flag_spec\"
 
692
            libdir="$acl_save_libdir"
 
693
            $1="$flag"
 
694
          else
 
695
            dnl The -rpath options are cumulative.
 
696
            for dir in $rpathdirs; do
 
697
              acl_save_libdir="$libdir"
 
698
              libdir="$dir"
 
699
              eval flag=\"$acl_hardcode_libdir_flag_spec\"
 
700
              libdir="$acl_save_libdir"
 
701
              $1="${$1}${$1:+ }$flag"
 
702
            done
 
703
          fi
 
704
        fi
 
705
      fi
 
706
    fi
 
707
  fi
 
708
  AC_SUBST([$1])
 
709
])