208 # |
208 # |
209 |
209 |
210 # create buffer for make variables required by dependencies |
210 # create buffer for make variables required by dependencies |
211 echo > "$TEMP_DIR/make.mk" |
211 echo > "$TEMP_DIR/make.mk" |
212 |
212 |
|
213 test_pkg_config() |
|
214 { |
|
215 if "$PKG_CONFIG" --exists "$1" ; then : |
|
216 else return 1 ; fi |
|
217 if [ -n "$2" ] && "$PKG_CONFIG" --atleast-version="$2" "$1" ; then : |
|
218 else return 1 ; fi |
|
219 if [ -n "$3" ] && "$PKG_CONFIG" --exact-version="$3" "$1" ; then : |
|
220 else return 1 ; fi |
|
221 if [ -n "$4" ] && "$PKG_CONFIG" --max-version="$4" "$1" ; then : |
|
222 else return 1 ; fi |
|
223 return 0 |
|
224 } |
|
225 |
213 dependency_error_libpq() |
226 dependency_error_libpq() |
214 { |
227 { |
215 printf "checking for libpq... " |
228 printf "checking for libpq... " |
216 # dependency libpq |
229 # dependency libpq |
217 while true |
230 while true |
218 do |
231 do |
219 if [ -z "$PKG_CONFIG" ]; then |
232 if [ -z "$PKG_CONFIG" ]; then |
220 break |
233 break |
221 fi |
234 fi |
222 if $PKG_CONFIG libpq ; then |
235 if test_pkg_config "libpq" "" "" "" ; then |
223 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libpq`" |
236 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libpq`" |
224 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libpq`" |
237 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libpq`" |
225 else |
238 else |
226 break |
239 break |
227 fi |
240 fi |