-
Notifications
You must be signed in to change notification settings - Fork 2
/
maketest
executable file
·58 lines (45 loc) · 1.21 KB
/
maketest
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh
# SCRIPT: maketest
# Builds the test program for the hashing routines
# Usage: maketest
# Uncomment the next 2 lines, if you set the paths manually
#APRPATH=
#APUPATH=
# Set APRPATH to where apr-1-config is located
# Set APUPATH to where apu-1-config is located
OS=`uname`
# Some variable magic
if [ -z $APRPATH ]; then
APRCFG=`which apr-1-config`
else
APRCFG=$APRPATH/apr-1-config
fi
if [ -z $APRCFG ] || [ ! -e $APRCFG ]; then
echo "apr-1-config not found. Please set APRPATH at the beginning of the script."
exit 1
fi
if [ -z $APUPATH ]; then
APUCFG=`which apu-1-config`
else
APUCFG=$APUPATH/apu-1-config
fi
if [ -z $APUCFG ] || [ ! -e $APUCFG ]; then
echo "apu-1-config not found. Please set APUPATH at the beginning of the script."
exit 1
fi
APR_FLAGS="`$APRCFG --cppflags --includes --libs --link-ld`"
APU_FLAGS="`$APUCFG --includes --link-ld --libs`"
# additional flags for Darwin
if [ "$OS" == "Darwin" ]; then
D_C_FLAGS="-arch x86_64"
fi
if [ "$1" == "-v" ]; then
echo "APR_FLAGS : " $APR_FLAGS
echo "APU_FLAGS : " $APU_FLAGS
echo
echo "APRCFG : " $APRCFG
echo "APUCFG : " $APUCFG
echo
fi
# Compile the program.
gcc -o test_hash test_hash.c hash.c $APR_FLAGS $APU_FLAGS $D_C_FLAGS