forked from versat/cntlm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Autoconf-like build and feature test tools implemented
- Loading branch information
dave
committed
Aug 19, 2007
1 parent
b8eac1b
commit 23fdff3
Showing
18 changed files
with
138 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#define config_endian 1 | ||
#define config_strdup 1 | ||
#define config_gethostname 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <stdio.h> | ||
#include <stdint.h> | ||
|
||
uint8_t num[] = { 0xEF, 0xBE }; | ||
|
||
/* | ||
* RC: 1 = LE, 0 = BE | ||
*/ | ||
int main(int argc, char **argv) { | ||
int rc; | ||
|
||
rc = (*((uint16_t *)num) == 0xBEEF); | ||
printf("%s\n", rc ? "little endian" : "big endian"); | ||
|
||
return rc; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include <unistd.h> | ||
|
||
int main(int argc, char **argv) { | ||
char *tmp[300]; | ||
|
||
memset(tmp, 0, sizeof(tmp)); | ||
gethostname(tmp, sizeof(tmp)-1); | ||
if (strlen(tmp)) | ||
printf("%s", tmp); | ||
|
||
return !(!strlen(tmp)); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include <string.h> | ||
|
||
int main(int argc, char **argv) { | ||
return !strcmp("hello", strdup("hello")); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
|
||
CC=gcc | ||
STAMP=.config-stamp | ||
CONFIG=config/config.h | ||
TESTS="endian strdup gethostname" | ||
|
||
#[ -f $STAMP ] && exit 0 | ||
touch $STAMP | ||
|
||
rm -f $CONFIG | ||
for i in $TESTS; do | ||
printf "Checking $i... " | ||
printf "#define config_$i " >> $CONFIG | ||
OUT=`gcc -Wall -pedantic -O3 -D_POSIX_C_SOURCE=199506L -D_ISOC99_SOURCE -D_REENTRANT -o config/$i config/$i.c 2>&1` | ||
rc=$? | ||
|
||
if [ $rc -ne 0 ]; then # -o -n "$OUT" ]; then | ||
rc=0 | ||
RET=no | ||
else | ||
RET=`./config/$i` | ||
rc=$? | ||
[ -z "$RET" ] && if [ $rc -eq 0 ]; then RET="no"; else RET=yes; fi | ||
fi | ||
|
||
echo $rc >> $CONFIG | ||
echo $RET | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.