}
check_cc() {
- local tempname="/tmp/temp.$$.$RANDOM"
+ local tempname="$(mktemp)"
# Can use "-o /dev/null", but older gcc tend to *unlink it* on failure! :(
# "-xc": C language. "/dev/null" is an empty source file.
- if $CC $1 -shared -xc /dev/null -o "$tempname".o >/dev/null 2>&1; then
+ if $CC $CPPFLAGS $CFLAGS $1 -shared -xc /dev/null -o "$tempname".o >/dev/null 2>&1; then
echo "$1";
else
echo "$2";
fi
- rm "$tempname".o 2>/dev/null
+ rm -f "$tempname" "$tempname".o
}
check_libc_is_glibc() {
- local tempname="/tmp/temp.$$.$RANDOM"
+ local tempname="$(mktemp)"
echo "\
#include <stdlib.h>
/* Apparently uclibc defines __GLIBC__ (compat trick?). Oh well. */
syntax error here
#endif
" >"$tempname".c
- if $CC "$tempname".c -c -o "$tempname".o >/dev/null 2>&1; then
+ if $CC $CPPFLAGS $CFLAGS "$tempname".c -c -o "$tempname".o >/dev/null 2>&1; then
echo "$2";
else
echo "$1";
fi
- rm "$tempname".c "$tempname".o 2>/dev/null
+ rm -f "$tempname" "$tempname".[co]
}
EXE="$1"
}
rm -- "$sharedlib_dir/applet.c" $EXE.out
$STRIP -s --remove-section=.note --remove-section=.comment $EXE
+ # Let user see that we do something - list the names of created binaries:
+ echo "$EXE"
done <applet_lst.tmp
fi