1 #! /bin/sh 2 3 FILE=`mktemp` 4 FILE2=`mktemp` 5 6 echo \*\*\* HTTPing v`grep VERSION version | cut -d = -f 2` configure script \*\*\* 7 echo 8 9 if [ -z "$CC" ] 10 then 11 CC=gcc 12 fi 13 14 F_TFO=0 15 F_NC=0 16 F_OS=0 17 F_FW=0 18 for var in "$@" 19 do 20 case "$var" in 21 --with-tfo) 22 F_TFO=1 23 ;; 24 25 --with-ncurses) 26 F_NC=1 27 ;; 28 29 --with-openssl) 30 F_OS=1 31 ;; 32 33 --with-fftw3) 34 F_FW=1 35 ;; 36 37 --help) 38 echo "--with-tfo force enable tcp fast open" 39 echo "--with-ncurses force enable ncurses" 40 echo "--with-openssl force enable openssl" 41 echo "--with-fftw3 force enable fftw3" 42 exit 0 43 ;; 44 45 *) 46 echo WARNING: Command line parameter \"$var\" is not understood. 47 echo Re-run this script with --help to see a list of switches. 48 ;; 49 esac 50 done 51 52 $CC -O0 -o $FILE test_TFO.c 2> $FILE2 53 if [ $? -eq 0 ] || [ $F_TFO -eq 1 ] ; then 54 echo \+ system supports TCP fast open 55 TFO="TFO=yes" 56 else 57 echo \- this system does NOT support TCP fast open - this is an optional feature 58 TFO="" 59 fi 60 61 $CC -O0 -o $FILE test_ncurses.c -lncursesw 2> $FILE2 62 if [ $? -eq 0 ] || [ $F_NC -eq 1 ] ; then 63 echo \+ system has ncurses development libraries 64 NC="NC=yes" 65 else 66 echo \- this system does NOT have the ncurses development libraries - they are optional 67 NC="" 68 fi 69 70 $CC -O0 -o $FILE test_openssl.c -lssl -lcrypto 2> $FILE2 71 if [ $? -eq 0 ] || [ $F_OS -eq 1 ] ; then 72 echo \+ system has OpenSSL development libraries 73 SSL="SSL=yes" 74 else 75 echo \- this system does NOT have the OpenSSL development libraries - they are optional 76 SSL="SSL=no" 77 fi 78 79 $CC -O0 -o $FILE test_fftw3.c -lfftw3 2> $FILE2 80 if [ $? -eq 0 ] || [ $F_FW -eq 1 ] ; then 81 echo \+ system has FFTW3 development libraries 82 FW="FW=yes" 83 else 84 echo \- this system does NOT have the FFTW3 development libraries - they are optional and only useful when also including ncurses 85 FW="" 86 fi 87 88 > makefile.inc 89 echo $NC >> makefile.inc 90 echo $SSL >> makefile.inc 91 echo $TFO >> makefile.inc 92 echo $FW >> makefile.inc 93 94 rm -f $FILE $FILE2 95 96 echo