~ubuntu-branches/ubuntu/saucy/gnash/saucy-proposed

« back to all changes in this revision

Viewing changes to macros/gnashpkgtool.m4

  • Committer: Bazaar Package Importer
  • Author(s): Sindhudweep Narayan Sarkar
  • Date: 2009-10-07 00:06:10 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20091007000610-mj9rwqe774gizn1j
Tags: 0.8.6-0ubuntu1
new upstream release 0.8.6 (LP: #435897)

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
[
32
32
  pushdef([UP], translit([$1], [a-z], [A-Z]))dnl Uppercase
33
33
  pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl Lowercase
34
 
  pushdef([UPHEADER], translit([$2], [a-z./], [A-Z__]))dnl Uppercase header
35
 
 
36
 
dnl   AC_ARG_ENABLE($1, AC_HELP_STRING([--enable-$1], [Enable support for $3.]), [
37
 
dnl     case "${enableval}" in
38
 
dnl       yes) $1=yes ;;        
39
 
dnl       no)  $1=no ;;
40
 
dnl       *)   AC_MSG_ERROR([bad value ${enableval} for enable-$1 option]) ;;
41
 
dnl     esac], $1=yes)
 
34
  pushdef([DASHDOWN], translit([$1], [A-Z_], [a-z-]))dnl Lowercase
 
35
  pushdef([UPHEADER], translit([$2], [a-z./-], [A-Z___]))dnl Uppercase header
42
36
 
43
37
    $1=yes
44
38
    if test x$4 = x; then
45
 
      name=$1 
 
39
      name=DASHDOWN
46
40
    else
47
 
      name=$1-$4
 
41
      name=DASHDOWN-$4
48
42
    fi
49
43
 
50
44
    dnl Look for the header
51
45
    if test x"${$1}" = x"yes"; then
52
46
      AC_ARG_WITH($1_incl, AC_HELP_STRING([--with-$1-incl], [directory where $2 is]), with_$1_incl=${withval})
53
 
            AC_CACHE_VAL(ac_cv_path_$1_incl, [
54
 
          if test x"${with_$1_incl}" != x ; then
55
 
              if test -f ${with_$1_incl}/$2 ; then
56
 
              ac_cv_path_$1_incl="-I`(cd ${with_$1_incl}; pwd)`"
57
 
              found_$1_incl="yes"
58
 
              else
59
 
                AC_MSG_ERROR([${with_$1_incl} directory doesn't contain $2.])
60
 
              fi
61
 
            fi
62
 
          ])
 
47
      AC_CACHE_VAL(ac_cv_path_$1_incl, [
 
48
      if test x"${with_$1_incl}" != x ; then
 
49
        if test -f ${with_$1_incl}/$2 ; then
 
50
          ac_cv_path_$1_incl="-I`(cd ${with_$1_incl}; pwd)`"
 
51
          found_$1_incl="yes"
 
52
        else
 
53
          AC_MSG_ERROR([${with_$1_incl} directory doesn't contain $2.])
 
54
        fi
 
55
      fi
 
56
    ])
63
57
 
64
58
  if test x$cross_compiling = xno; then
65
59
    if test x"$PKG_CONFIG" != x -a x"${ac_cv_path_$1_incl}" = x; then
66
60
      AC_MSG_CHECKING([for $2 header using pkg-config])
67
 
      $PKG_CONFIG --exists DOWN[] && ac_cv_path_$1_incl="`$PKG_CONFIG --cflags DOWN[]`"
 
61
      $PKG_CONFIG --exists DASHDOWN[] && ac_cv_path_$1_incl="`$PKG_CONFIG --cflags DASHDOWN[]`"
68
62
      $PKG_CONFIG --exists $name && ac_cv_path_$1_incl="`$PKG_CONFIG --cflags $name`"
69
63
      if test x"${ac_cv_path_$1_incl}" != x; then
70
64
        AC_MSG_RESULT(${ac_cv_path_$1_incl})
87
81
    fi
88
82
  fi
89
83
 
90
 
        dnl If the path hasn't been specified, go look for it.
91
 
        if test x"${ac_cv_path_$1_incl}" = x; then
92
 
          AC_CHECK_HEADER($2, [ac_cv_path_$1_incl=""; found_$1_incl="yes"], [
93
 
            AC_CHECK_HEADER($1/$2, [ac_cv_path_$1_incl="-I/usr/include/$1"; found_$1_incl="yes"], [
94
 
              AC_CHECK_HEADER($name/$2, [ac_cv_path_$1_incl="-I/usr/include/$name"; found_$1_incl="yes"], [
95
 
                AC_CHECK_HEADER($2, [ac_cv_path_$1_incl="-I/usr/include/$2"; found_$1_incl="yes"], [
96
 
                if test x"${ac_cv_path_$1_incl}" = x; then
97
 
                  for i in $incllist; do
98
 
                    if test -f $i/$name; then
99
 
                found_$1_incl="yes"
100
 
                            if test x"$i" != x"/usr/include"; then
101
 
                              ac_cv_path_$1_incl="-I$i"
102
 
                              break
103
 
                            else
104
 
                              ac_cv_path_$1_incl=""
105
 
                              break
106
 
                            fi
107
 
                    else
108
 
                            if test -f $i/$name/$2; then
109
 
                  found_$1_incl="yes"
110
 
                              ac_cv_path_$1_incl="-I$i/$name"
111
 
                              break
112
 
                            else
113
 
                              if test -f $i/$2; then
114
 
                    found_$1_incl="yes"
115
 
                                  ac_cv_path_$1_incl="-I$i"
116
 
                                  break
117
 
                              fi
118
 
                            fi
119
 
                    fi
120
 
                  done
121
 
                fi
122
 
              ])
 
84
  dnl If the path hasn't been specified, go look for it.
 
85
  if test x"${ac_cv_path_$1_incl}" = x; then
 
86
    AC_CHECK_HEADER($2, [ac_cv_path_$1_incl=""; found_$1_incl="yes"], [
 
87
      AC_CHECK_HEADER($1/$2, [ac_cv_path_$1_incl="-I/usr/include/$1"; found_$1_incl="yes"], [
 
88
        AC_CHECK_HEADER($name/$2, [ac_cv_path_$1_incl="-I/usr/include/$name"; found_$1_incl="yes"], [
 
89
          AC_CHECK_HEADER($2, [ac_cv_path_$1_incl="-I/usr/include/$2"; found_$1_incl="yes"], [
 
90
          if test x"${ac_cv_path_$1_incl}" = x; then
 
91
            for i in $incllist; do
 
92
              if test -f $i/$name; then
 
93
                found_$1_incl="yes"
 
94
                if test x"$i" != x"/usr/include"; then
 
95
                  ac_cv_path_$1_incl="-I$i"
 
96
                else
 
97
                  ac_cv_path_$1_incl=""
 
98
                fi
 
99
                break
 
100
              else
 
101
                found_$1_incl="yes"
 
102
                if test -f $i/$name/$2; then
 
103
                  ac_cv_path_$1_incl="-I$i/$name"
 
104
                else
 
105
                  if test -f $i/$2; then
 
106
                    ac_cv_path_$1_incl="-I$i"
 
107
                  fi
 
108
                fi
 
109
                break
 
110
              fi
 
111
            done
 
112
          fi
 
113
        ])
123
114
      ])
124
115
    ])
125
 
        ])
 
116
  ])
126
117
  fi
127
118
 
128
119
  if test x"${found_$1_incl}" = "xyes"; then
150
141
[
151
142
pushdef([UP], translit([$1], [a-z], [A-Z]))dnl Uppercase
152
143
pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl Lowercase
 
144
pushdef([DASHDOWN], translit([$1], [A-Z_], [a-z-]))dnl Lowercase
153
145
 
154
146
has_$1=no
155
147
 
156
 
AC_ARG_ENABLE($1, AC_HELP_STRING([--enable-$1], [Enable support for $3.]),
157
 
[case "${enableval}" in
158
 
        yes) $1=yes ;;  
159
 
        no)  $1=no ;;
160
 
        *)   
161
 
        AC_MSG_ERROR([bad value ${enableval} for enable-$1 option]) ;;
162
 
esac], $1=yes)
163
 
 
164
 
if test x$4 = x; then
165
 
        name=$1 
166
 
else
167
 
        name=$1-$4
168
 
fi
169
 
 
170
148
if test x"${$1}" = x"yes"; then
171
 
        dnl Look for the library
172
 
        AC_ARG_WITH($1_lib, AC_HELP_STRING([--with-$1-lib], [directory where $1 library is]), with_$1_lib=${withval})
173
 
        AC_CACHE_VAL(ac_cv_path_$1_lib,[
174
 
        if test x"${with_$1_lib}" != x ; then
175
 
                AC_MSG_CHECKING([for lib$1 library in specified directory])
176
 
                if test -f ${with_$1_lib}/lib$name.a -o -f ${with_$1_lib}/lib$name.${shlibext}; then
177
 
                        tmp="`(cd ${with_$1_lib}; pwd)`"
178
 
                        ac_cv_path_$1_lib="-L${tmp} -l$name"
179
 
                        AC_MSG_RESULT([yes])
180
 
                else
181
 
                        AC_MSG_ERROR([${with_$1_lib} directory doesn't contain library $name.])
182
 
                        AC_MSG_RESULT([no])
183
 
                fi
184
 
        fi
185
 
        ])
 
149
  dnl Look for the library
 
150
  AC_ARG_WITH($1_lib, AC_HELP_STRING([--with-$1-lib], [directory where $1 library is]), with_$1_lib=${withval})
 
151
  AC_CACHE_VAL(ac_cv_path_$1_lib,[
 
152
  if test x"${with_$1_lib}" != x ; then
 
153
    AC_MSG_CHECKING([for lib$1 library in specified directory])
 
154
    if test -f ${with_$1_lib}/lib$name.a -o -f ${with_$1_lib}/lib$name.${shlibext}; then
 
155
      tmp="`(cd ${with_$1_lib}; pwd)`"
 
156
      ac_cv_path_$1_lib="-L${tmp} -l$name"
 
157
      AC_MSG_RESULT([yes])
 
158
          else
 
159
      AC_MSG_ERROR([${with_$1_lib} directory doesn't contain library $name.])
 
160
      AC_MSG_RESULT([no])
 
161
          fi
 
162
  fi
 
163
  ])
186
164
 
187
 
        dnl If the header doesn't exist, there is no point looking for the library.
 
165
  dnl If the header doesn't exist, there is no point looking for the library.
188
166
  if test x$cross_compiling = xno; then
189
 
          if test x"$PKG_CONFIG" != x -a x"${ac_cv_path_$1_lib}" = x; then
190
 
                  $PKG_CONFIG --exists libDOWN[] && ac_cv_path_$1_lib="`$PKG_CONFIG --libs-only-l libDOWN[]`"
191
 
                  $PKG_CONFIG --exists DOWN[] && ac_cv_path_$1_lib="`$PKG_CONFIG --libs-only-l DOWN[]`"
192
 
                  $PKG_CONFIG --exists lib$name && ac_cv_path_$1_lib="`$PKG_CONFIG --libs-only-l lib$name`"
193
 
                  $PKG_CONFIG --exists $name && ac_cv_path_$1_lib="`$PKG_CONFIG --libs-only-l $name`"
194
 
                  AC_MSG_CHECKING([for lib$1 library])      
195
 
                  AC_MSG_RESULT(${ac_cv_path_$1_lib})
196
 
          fi
 
167
    if test x"$PKG_CONFIG" != x -a x"${ac_cv_path_$1_lib}" = x; then
 
168
      $PKG_CONFIG --exists [lib]DASHDOWN && ac_cv_path_$1_lib="`$PKG_CONFIG --libs-only-l libDOWN[]`"
 
169
      $PKG_CONFIG --exists DASHDOWN && ac_cv_path_$1_lib="`$PKG_CONFIG --libs-only-l DASHDOWN`"
 
170
      $PKG_CONFIG --exists lib$name && ac_cv_path_$1_lib="`$PKG_CONFIG --libs-only-l lib$name`"
 
171
      $PKG_CONFIG --exists $name && ac_cv_path_$1_lib="`$PKG_CONFIG --libs-only-l $name`"
 
172
      AC_MSG_CHECKING([for lib$1 library])      
 
173
      AC_MSG_RESULT(${ac_cv_path_$1_lib})
 
174
    fi
197
175
    if test x"${ac_cv_path_$1_lib}" = x; then
198
176
      AC_PATH_PROG(UP[]_CONFIG, $1-config)
199
177
      if test x"${UP[]_CONFIG}" != x; then
204
182
    fi
205
183
  fi
206
184
 
207
 
        if test x"${ac_cv_path_$1_lib}" = x; then
208
 
                ac_save_LIBS=$LIBS
209
 
                LIBS=""
210
 
                for i in $libslist; do
211
 
                        if test -f $i/lib$1.a -o -f $i/lib$1.${shlibext}; then
212
 
                                if test -f "$i/lib$1.a" -o -f "$i/lib$1.${shlibext}"; then
213
 
                                        if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then
214
 
                                                ac_cv_path_$1_lib="-L$i -l$1 $5"
215
 
                                                break
216
 
                                        else
217
 
                                                ac_cv_path_$1_lib="-l$1 $5"
218
 
                                                break
219
 
                                        fi
220
 
                                fi
221
 
                        else
222
 
                                if test -f "$i/lib$name.a" -o -f "$i/lib$name.${shlibext}"; then
223
 
                                        if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then
224
 
                                                ac_cv_path_$1_lib="-L$i -l$name $5"
225
 
                                                break
226
 
                                        else
227
 
                                                ac_cv_path_$1_lib="-l$name $5"
228
 
                                                break
229
 
                                        fi
230
 
                                fi
231
 
                        fi
232
 
                done
233
 
                LIBS=$ac_save_LIBS
234
 
        fi
 
185
  if test x"${ac_cv_path_$1_lib}" = x; then
 
186
    ac_save_LIBS=$LIBS
 
187
    LIBS=""
 
188
    for i in $libslist; do
 
189
      if test -f $i/lib$1.a -o -f $i/lib$1.${shlibext}; then
 
190
        if test -f "$i/lib$1.a" -o -f "$i/lib$1.${shlibext}"; then
 
191
          if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then
 
192
            ac_cv_path_$1_lib="-L$i -l$1 $5"
 
193
          else
 
194
            ac_cv_path_$1_lib="-l$1 $5"
 
195
          fi
 
196
          break
 
197
        fi
 
198
      else
 
199
        if test -f "$i/lib$name.a" -o -f "$i/lib$name.${shlibext}"; then
 
200
          if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then
 
201
            ac_cv_path_$1_lib="-L$i -l$name $5"
 
202
          else
 
203
            ac_cv_path_$1_lib="-l$name $5"
 
204
          fi
 
205
        break
 
206
        fi
 
207
      fi
 
208
    done
 
209
    LIBS=$ac_save_LIBS
 
210
  fi
235
211
 
236
 
        if test x"${ac_cv_path_$1_lib}" = x ; then
 
212
  if test x"${ac_cv_path_$1_lib}" = x ; then
237
213
    AC_SEARCH_LIBS($2, $1 $name, [ac_cv_path_$1_lib="$LIBS $5"])
238
214
  fi
239
215
 
240
 
        if test x"${ac_cv_path_$1_lib}" != x ; then
241
 
                UP[]_LIBS="${ac_cv_path_$1_lib}"
242
 
                has_$1=yes
243
 
        else
244
 
                UP[]_LIBS=""
245
 
        fi
 
216
  if test x"${ac_cv_path_$1_lib}" != x ; then
 
217
    UP[]_LIBS="${ac_cv_path_$1_lib}"
 
218
    has_$1=yes
 
219
  else
 
220
    UP[]_LIBS=""
 
221
  fi
246
222
fi
247
223
 
248
 
        AC_SUBST(UP[]_LIBS)
 
224
AC_SUBST(UP[]_LIBS)
249
225
 
250
226
popdef([UP])
251
227
popdef([DOWN])