# HG changeset patch # User Rob Landley # Date 1397617182 18000 # Node ID 565980862743a72d26db097c51e60469e869101d # Parent fd0a595f5486fce26e1a313d57834e8486c8e6fe Probes for O_NOFOLLOW that compile and run something aren't compatible with cross compiling, so just #define it to 0 if it's not in fcntl.h where posix-2008 says. diff -r fd0a595f5486 -r 565980862743 Makefile --- a/Makefile Sun Apr 13 16:07:22 2014 -0500 +++ b/Makefile Tue Apr 15 21:59:42 2014 -0500 @@ -44,9 +44,8 @@ rm -rf toybox toybox_unstripped generated/config.h generated/Config.in \ generated/newtoys.h generated/globals.h testdir \ generated/Config.probed generated/oldtoys.h generated/flags.h \ - generated/portability.h .singleconfig .singleconfig.old \ - generated/instlist generated/mkflags generated/config2help \ - generated/help.h + .singleconfig .singleconfig.old generated/help.h \ + generated/instlist generated/mkflags generated/config2help distclean: clean rm -f toybox_old .config* diff -r fd0a595f5486 -r 565980862743 lib/portability.h --- a/lib/portability.h Sun Apr 13 16:07:22 2014 -0500 +++ b/lib/portability.h Tue Apr 15 21:59:42 2014 -0500 @@ -158,5 +158,8 @@ #include #include -// compile time probes for stuff libc didn't provide -#include "generated/portability.h" +// Some systems don't define O_NOFOLLOW, and it varies by architecture, so... +#include +#ifndef O_NOFOLLOW +#define O_NOFOLLOW 0 +#endif diff -r fd0a595f5486 -r 565980862743 scripts/genconfig.sh --- a/scripts/genconfig.sh Sun Apr 13 16:07:22 2014 -0500 +++ b/scripts/genconfig.sh Tue Apr 15 21:59:42 2014 -0500 @@ -49,33 +49,5 @@ done } -headerprobes() -{ - ${CROSS_COMPILE}${CC} $CFLAGS -xc -o /dev/null - 2>/dev/null << EOF - #include - #ifndef O_NOFOLLOW - #error posix 2008 was a while ago now - #endif -EOF - if [ $? -ne 0 ] - then - rm -f a.out - ${CROSS_COMPILE}${CC} $CFLAGS -xc - 2>/dev/null << EOF - #include - #include - #include - - int main(int argc, char *argv[]) - { - printf("0x%x\n", O_NOFOLLOW); - } -EOF - X=$(./a.out) 2>/dev/null - rm -f a.out - echo "#define O_NOFOLLOW ${X:-0}" - fi -} - probeconfig > generated/Config.probed || rm generated/Config.probed genconfig > generated/Config.in || rm generated/Config.in -headerprobes > generated/portability.h || rm generated/portability.h