1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
#!/bin/sh
#require compiletest
#require cflags
#phase init
#after init_cflags
#phase header
case $PHASE in
init)
dispn "Checking for firestring library..."
PROGRAM="#include <firestring.h>
int main() {
firestring_printf(\"test %e\",&ESTR_S(\"foo\"));
return 0;
}"
compile_test_wrapper "$PROGRAM" "" "" "-lfirestring" || \
compile_test_wrapper "$PROGRAM" "-I/usr/local/include" "-L/usr/local/lib" "-lfirestring" || \
compile_test_wrapper "$PROGRAM" "-I/usr/local/include" "-L/usr/local/lib -R/usr/local/lib" "-lfirestring" || \
{
if (module "subdir" && test -x firestring/configure); then
subdir firestring
disp "Adding -Ifirestring/ to CFLAGS"
FM_CFLAGS="$FM_CFLAGS -Ifirestring/"
disp "Adding firestring/libfirestring.a to STATICLIBS"
FM_STATICLIBS="$FM_STATICLIBS firestring/libfirestring.a"
elif (module "subdir" && test "$FM_IN_SUBDIR" = "y" && test -x ../firestring/configure); then
parentdir ../firestring
disp "Adding -I../firestring/ to CFLAGS"
FM_CFLAGS="$FM_CFLAGS -I../firestring/"
disp "Adding ../firestring/libfirestring.a to STATICLIBS"
FM_STATICLIBS="$FM_STATICLIBS ../firestring/libfirestring.a"
else
disp "not found, unable to continue"
exit 1
fi
}
;;
header)
disp "Adding \"#include <firestring.h>\" to header"
$ECHO "#include <firestring.h>"
;;
esac
|