182 --with-png=*) with_png="$optarg";; |
183 --with-png=*) with_png="$optarg";; |
183 --with-libpng) with_png="2";; |
184 --with-libpng) with_png="2";; |
184 --without-libpng) with_png="0";; |
185 --without-libpng) with_png="0";; |
185 --with-libpng=*) with_png="$optarg";; |
186 --with-libpng=*) with_png="$optarg";; |
186 |
187 |
|
188 --with-libtimidity) with_libtimidity="2";; |
|
189 --without-libtimidity) with_libtimidity="0";; |
|
190 --with-libtimidity=*) with_libtimidity="$optarg";; |
|
191 |
187 --with-freetype) with_freetype="2";; |
192 --with-freetype) with_freetype="2";; |
188 --without-freetype) with_freetype="0";; |
193 --without-freetype) with_freetype="0";; |
189 --with-freetype=*) with_freetype="$optarg";; |
194 --with-freetype=*) with_freetype="$optarg";; |
190 --with-libfreetype) with_freetype="2";; |
195 --with-libfreetype) with_freetype="2";; |
191 --without-libfreetype) with_freetype="0";; |
196 --without-libfreetype) with_freetype="0";; |
1271 fi |
1286 fi |
1272 |
1287 |
1273 log 1 "checking COCOA... found" |
1288 log 1 "checking COCOA... found" |
1274 } |
1289 } |
1275 |
1290 |
1276 detect_zlib() { |
1291 detect_library() { |
|
1292 # $1 - config-param ($with_zlib value) |
|
1293 # $2 - library name ('zlib', sets $zlib) |
|
1294 # $3 - static library name (libz.a) |
|
1295 # $4 - header name (zlib.h) |
|
1296 |
1277 # 0 means no, 1 is auto-detect, 2 is force |
1297 # 0 means no, 1 is auto-detect, 2 is force |
1278 if [ "$with_zlib" = "0" ]; then |
1298 if [ "$1" = "0" ]; then |
1279 log 1 "checking zlib... disabled" |
1299 log 1 "checking $2... disabled" |
1280 |
1300 |
1281 zlib="" |
1301 eval "$2=\"\"" |
1282 return 0 |
1302 return 0 |
1283 fi |
1303 fi |
1284 |
1304 |
1285 log 2 "detecting zlib" |
1305 log 2 "detecting $2" |
1286 |
1306 |
1287 if [ "$with_zlib" = "1" ] || [ "$with_zlib" = "" ] || [ "$with_zlib" = "2" ]; then |
1307 if [ "$1" = "1" ] || [ "$1" = "" ] || [ "$1" = "2" ]; then |
1288 zlib=`ls -1 /usr/include/*.h 2>/dev/null | grep "\/zlib.h$"` |
1308 eval "$2=`ls -1 /usr/include/*.h 2>/dev/null | grep \"\/$4\$\"`" |
1289 if [ -z "$zlib" ]; then |
1309 eval "res=\$$2" |
1290 log 2 " trying /usr/include/zlib.h... no" |
1310 if [ -z "$res" ]; then |
1291 zlib=`ls -1 /usr/local/include/*.h 2>/dev/null | grep "\/zlib.h$"` |
1311 log 2 " trying /usr/include/$4... no" |
1292 fi |
1312 eval "$2=`ls -1 /usr/local/include/*.h 2>/dev/null | grep \"\/$4\$\"`" |
1293 if [ -z "$zlib" ]; then |
1313 fi |
1294 log 2 " trying /usr/local/include/zlib.h... no" |
1314 eval "res=\$$2" |
1295 fi |
1315 if [ -z "$res" ]; then |
1296 |
1316 log 2 " trying /usr/local/include/$4... no" |
1297 if [ -n "$zlib" ] && [ "$enable_static" != "0" ] && [ "$os" != "OSX" ]; then |
1317 fi |
1298 log 2 " trying $zlib... found" |
1318 |
|
1319 eval "res=\$$2" |
|
1320 if [ -n "$res" ] && [ "$enable_static" != "0" ] && [ "$os" != "OSX" ]; then |
|
1321 eval "res=\$$2" |
|
1322 log 2 " trying $res... found" |
1299 # Now find the static lib, if needed |
1323 # Now find the static lib, if needed |
1300 zlib=`ls /lib/*.a 2>/dev/null | grep "\/libz.a$"` |
1324 eval "$2=`ls /lib/*.a 2>/dev/null | grep \"\/$3\$\"`" |
1301 if [ -z "$zlib" ]; then |
1325 eval "res=\$$2" |
1302 log 2 " trying /lib/libz.a... no" |
1326 if [ -z "$res" ]; then |
1303 zlib=`ls /usr/lib/*.a 2>/dev/null | grep "\/libz.a$"` |
1327 log 2 " trying /lib/$3... no" |
|
1328 eval "$2=`ls /usr/lib/*.a 2>/dev/null | grep \"\/$3\$\"`" |
1304 fi |
1329 fi |
1305 if [ -z "$zlib" ]; then |
1330 eval "res=\$$2" |
1306 log 2 " trying /usr/lib/libz.a... no" |
1331 if [ -z "$res" ]; then |
1307 zlib=`ls /usr/local/lib/*.a 2>/dev/null | grep "\/libz.a$"` |
1332 log 2 " trying /usr/lib/$3... no" |
|
1333 eval "$2=`ls /usr/local/lib/*.a 2>/dev/null | grep \"\/$3\$\"`" |
1308 fi |
1334 fi |
1309 if [ -z "$zlib" ]; then |
1335 eval "res=\$$2" |
1310 log 2 " trying /usr/local/lib/libz.a... no" |
1336 if [ -z "$res" ]; then |
1311 log 1 "configure: error: zlib couldn't be found" |
1337 log 2 " trying /usr/local/lib/$3... no" |
1312 log 1 "configure: error: you requested a static link, but I can't find zlib.a" |
1338 log 1 "configure: error: $2 couldn't be found" |
|
1339 log 1 "configure: error: you requested a static link, but I can't find $3" |
1313 |
1340 |
1314 exit 1 |
1341 exit 1 |
1315 fi |
1342 fi |
1316 fi |
1343 fi |
1317 else |
1344 else |
1318 # Make sure it exists |
1345 # Make sure it exists |
1319 if [ -f "$with_zlib" ]; then |
1346 if [ -f "$1" ]; then |
1320 zlib=`ls $with_zlib 2>/dev/null` |
1347 eval "$2=`ls $1 2>/dev/null`" |
1321 else |
1348 else |
1322 zlib=`ls $with_zlib/libz.a 2>/dev/null` |
1349 eval "$2=`ls $1/$3 2>/dev/null`" |
1323 fi |
1350 fi |
1324 fi |
1351 fi |
1325 |
1352 |
1326 if [ -z "$zlib" ]; then |
1353 eval "res=\$$2" |
1327 log 1 "checking zlib... not found" |
1354 if [ -z "$res" ]; then |
1328 if [ "$with_zlib" = "2" ]; then |
1355 log 1 "checking $2... not found" |
1329 log 1 "configure: error: zlib couldn't be found" |
1356 if [ "$1" = "2" ]; then |
1330 |
1357 log 1 "configure: error: $2 couldn't be found" |
1331 exit 1 |
1358 |
1332 elif [ "$with_zlib" != "1" ]; then |
1359 exit 1 |
1333 log 1 "configure: error: zlib couldn't be found" |
1360 elif [ "$1" != "1" ]; then |
1334 log 1 "configure: error: you supplied '$with_zlib', but it seems invalid" |
1361 log 1 "configure: error: $2 couldn't be found" |
|
1362 log 1 "configure: error: you supplied '$1', but it seems invalid" |
1335 |
1363 |
1336 exit 1 |
1364 exit 1 |
1337 fi |
1365 fi |
1338 |
1366 |
1339 return 0 |
1367 return 0 |
1340 fi |
1368 fi |
1341 |
1369 |
1342 log 2 " trying $zlib... found" |
1370 eval "res=\$$2" |
1343 |
1371 log 2 " trying $res... found" |
1344 log 1 "checking zlib... found" |
1372 |
|
1373 log 1 "checking $2... found" |
|
1374 } |
|
1375 |
|
1376 detect_zlib() { |
|
1377 detect_library "$with_zlib" "zlib" "libz.a" "zlib.h" |
|
1378 } |
|
1379 |
|
1380 detect_libtimidity() { |
|
1381 detect_library "$with_libtimidity" "libtimidity" "libtimidity.a" "timidity.h" |
1345 } |
1382 } |
1346 |
1383 |
1347 detect_png() { |
1384 detect_png() { |
1348 # 0 means no, 1 is auto-detect, 2 is force |
1385 # 0 means no, 1 is auto-detect, 2 is force |
1349 if [ "$with_png" = "0" ]; then |
1386 if [ "$with_png" = "0" ]; then |