~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/lib-link.m4

  • Committer: Brian Aker
  • Date: 2009-04-16 20:12:59 UTC
  • mfrom: (992.1.20 mordred)
  • Revision ID: brian@gaz-20090416201259-2x3czxb5hsdisr6h
Merge Monty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
  undefine([NAME])
44
44
])
45
45
 
46
 
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
 
46
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [system])
47
47
dnl searches for libname and the libraries corresponding to explicit and
48
48
dnl implicit dependencies, together with the specified include files and
49
49
dnl the ability to compile and link the specified testcode. If found, it
63
63
 
64
64
  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
65
65
  dnl accordingly.
66
 
  AC_LIB_LINKFLAGS_BODY([$1], [$2])
 
66
  AC_LIB_LINKFLAGS_BODY([$1], [$2], [$5])
67
67
 
68
68
  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
69
69
  dnl because if the user has installed lib[]Name and not disabled its use
136
136
    :, enable_rpath=yes)
137
137
])
138
138
 
139
 
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
140
 
dnl the libraries corresponding to explicit and implicit dependencies.
 
139
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies, system]) searches for 
 
140
dnl libname and the libraries corresponding to explicit and 
 
141
dnl implicit dependencies.
141
142
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
142
143
dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
143
144
dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
 
145
dnl If system==system, -isystem is used instead of -I
144
146
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
145
147
[
146
148
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
150
152
  define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
151
153
  dnl By default, look in $includedir and $libdir.
152
154
  use_additional=yes
 
155
  if test "x$GCC" = "xyes" -a "x$3" = "xsystem"
 
156
  then
 
157
    i_system="-isystem "
 
158
  else
 
159
    i_system="-I"
 
160
  fi
153
161
  AC_LIB_WITH_FINAL_PREFIX([
154
162
    eval additional_includedir=\"$includedir\"
155
163
    eval additional_libdir=\"$libdir\"
439
447
                if test -z "$haveit"; then
440
448
                  for x in $CPPFLAGS $INC[]NAME; do
441
449
                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
442
 
                    if test "X$x" = "X-I$additional_includedir"; then
 
450
                    if test "X$x" = "X${i_system}$additional_includedir"; then
443
451
                      haveit=yes
444
452
                      break
445
453
                    fi
447
455
                  if test -z "$haveit"; then
448
456
                    if test -d "$additional_includedir"; then
449
457
                      dnl Really add $additional_includedir to $INCNAME.
450
 
                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
 
458
                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }${i_system}$additional_includedir"
451
459
                    fi
452
460
                  fi
453
461
                fi