111
112
113
114
115
116
117
|
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
SHOBJEXT="dll"
SHOBJFLAGS="-mno-cygwin -mms-bitfields -DPIC"
SHOBJLDFLAGS='-shared -Wl,--enable-auto-image-base -Wl,--output-def,$[@].def,--out-implib,$[@].a'
;;
esac
])
AC_DEFUN(DC_ASK_OPTLIB, [
AC_ARG_WITH($5, [ --with-$5 $4], [
# Specified
LIBSPEC=$withval
], [
# Not specified
LIBSPECFLAGS=`pkg-config --libs $5 2>/dev/null`
LIBSPECCFLAGS=`pkg-config --cflags $5 2>/dev/null`
AC_CHECK_LIB($1, $2, [
OLDCPPFLAGS="$CPPFLAGS"
OLDCFLAGS="$CFLAGS"
CPPFLAGS="$CPPFLAGS $LIBSPECCFLAGS"
CFLAGS="$CFLAGS $LIBSPECCFLAGS"
AC_CHECK_HEADER($3, [
LIBSPEC=yes
], [
LIBSPEC=no
])
CPPFLAGS="$OLDCPPFLAGS"
CFLAGS="$OLDCFLAGS"
], [
LIBSPEC=no
AC_MSG_WARN(Didn't find $5)
], $LIBSPECFLAGS)
])
case $LIBSPEC in
no)
AC_MSG_WARN(Support for $5 disabled)
;;
*)
if test "${LIBSPEC}" = "yes"; then
true
else
LIBSPECFLAGS="-L${LIBSPEC}/lib ${LIBSPECFLAGS}"
LIBSPECCFLAGS="-I${LIBSPEC}/include ${LIBSPECCFLAGS}"
fi
AC_CHECK_LIB($1, $2, [
OLDCFLAGS="$CFLAGS"
OLDCPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS ${LIBSPECCFLAGS}"
CFLAGS="$CFLAGS ${LIBSPECCFLAGS}"
AC_CHECK_HEADER($3, [
if test -n "$7"; then
AC_DEFINE($7, [1], [Define to 1 if you have the <$3> header file.])
fi
if test -n "$6"; then
AC_DEFINE($6, [1], [Define to 1 if you have $2 from $5])
fi
LDFLAGS="$LDFLAGS $LIBSPECFLAGS"
LIBS="$LIBS -l$1"
], [
CFLAGS="$OLDCFLAGS"
CPPFLAGS="$OLDCPPFLAGS"
AC_MSG_ERROR(Could not find $3)
])
], [
AC_MSG_ERROR(Could not find $5)
], $LIBSPECFLAGS)
;;
esac
])
|