]>
git.saurik.com Git - apple/libresolv.git/blob - BUILD
2 # This script will build resolver library
7 echo "=================================================="
9 echo "=================================================="
11 PROJECT_ROOT
=..
/netinfo.build
/root
12 TARGET_DYNAMIC_LIB
=libresolv
.9.dylib
13 TARGET_LIB_LINK
=libresolv.dylib
14 TARGET_STATIC_LIB
=libresolv.a
19 TARGET_MAN_DIR
=/usr
/share
/man
/man5
22 DERIVED_SRC_DIR
=$BLD/derived_src
23 OBJECT_DIR
=$BLD/objects
25 DST_DIR
=$PROJECT_ROOT/$TARGET_DIR
26 PUBLIC_HEADERS_DIR
=$PROJECT_ROOT/usr
/include
27 PRIVATE_HEADERS_DIR
=$PROJECT_ROOT/usr
/local
/include
28 PROJECT_HEADERS_DIR
=..
/netinfo.build
/ProjectHeaders
29 MAN_DIR
=${PROJECT_ROOT}${TARGET_MAN_DIR}
31 CFLAGS
="-g -dynamic -fno-common -Wall -D_REENTRANT"
32 INCLUDE
="-I. -I$PUBLIC_HEADERS_DIR"
34 nm
/usr
/lib
/libSystem.B.dylib
| grep -q pselect
36 CFLAGS
="$CFLAGS -DNEED_PSELECT"
43 if [ ${1}x
= cleanx
]; then
48 if [ ${1}x
= freshx
]; then
56 if [ $CLEAN = 1 ]; then
57 echo "Cleaning $TARGET"
62 if [ $BUILD = 0 ]; then
67 if [ ! -d $BLD ]; then
70 if [ ! -d $DERIVED_SRC_DIR ]; then
71 mkdir $DERIVED_SRC_DIR
72 ln -s ..
/..
$DERIVED_SRC_DIR/NetInfo
74 if [ ! -d $OBJECT_DIR ]; then
78 if [ ! -d $DST_DIR ]; then
79 if [ -f /bin
/mkdirs
]; then
86 if [ ! -d $PUBLIC_HEADERS_DIR ]; then
87 if [ -f /bin
/mkdirs
]; then
88 mkdirs
$PUBLIC_HEADERS_DIR
89 mkdirs
$PUBLIC_HEADERS_DIR/arpa
91 mkdir -p $PUBLIC_HEADERS_DIR
92 mkdir -p $PUBLIC_HEADERS_DIR/arpa
96 if [ ! -d $PRIVATE_HEADERS_DIR ]; then
97 if [ -f /bin
/mkdirs
]; then
98 mkdirs
$PRIVATE_HEADERS_DIR
100 mkdir -p $PRIVATE_HEADERS_DIR
104 if [ ! -d $PROJECT_HEADERS_DIR ]; then
105 if [ -f /bin
/mkdirs
]; then
106 mkdirs
$PROJECT_HEADERS_DIR
108 mkdir -p $PROJECT_HEADERS_DIR
112 if [ ! -f $PUBLIC_HEADERS_DIR/dns.h
]; then
113 echo "cp dns.h $PUBLIC_HEADERS_DIR"
114 cp dns.h
$PUBLIC_HEADERS_DIR
117 if [ ! -f $PUBLIC_HEADERS_DIR/dns_util.h
]; then
118 echo "cp dns_util.h $PUBLIC_HEADERS_DIR"
119 cp dns_util.h
$PUBLIC_HEADERS_DIR
122 if [ ! -f $PRIVATE_HEADERS_DIR/dns_private.h
]; then
123 echo "cp dns_private.h $PRIVATE_HEADERS_DIR"
124 cp dns_private.h
$PRIVATE_HEADERS_DIR
127 if [ ! -f $PROJECT_HEADERS_DIR/dns_private.h
]; then
128 echo "cp dns_private.h $PROJECT_HEADERS_DIR"
129 cp dns_private.h
$PROJECT_HEADERS_DIR
132 if [ ! -f $PUBLIC_HEADERS_DIR/resolv.h
]; then
133 echo "cp resolv.h $PUBLIC_HEADERS_DIR"
134 cp resolv.h
$PUBLIC_HEADERS_DIR
137 if [ ! -f $PUBLIC_HEADERS_DIR/nameser.h
]; then
138 echo "cp nameser.h $PUBLIC_HEADERS_DIR"
139 cp nameser.h
$PUBLIC_HEADERS_DIR
140 echo "ln -s ../nameser.h $PUBLIC_HEADERS_DIR/arpa/nameser.h"
141 ln -s ..
/nameser.h
$PUBLIC_HEADERS_DIR/arpa
/nameser.h
144 if [ ! -d $MAN_DIR ]; then
145 if [ -f /bin
/mkdirs
]; then
152 if [ ! -f $MAN_DIR/resolver
.5 ]; then
153 echo "cp resolver.5 $MAN_DIR"
154 cp resolver
.5 $MAN_DIR
158 if [ ! -f $DST_DIR/$TARGET_DYNAMIC_LIB ]; then
164 OBJ
=`echo $c | sed 's/..$/.o/'`
170 RECENT
=`/bin/ls -1t $DST $SRC | head -1`
171 if [ $RECENT = $DST ]; then
176 if [ $MAKEIT = 1 ]; then
178 echo cc
-c $CFLAGS $INCLUDE -o $DST $SRC
179 cc
-c $CFLAGS $INCLUDE -o $DST $SRC
183 if [ $MAKE_TARGET = 1 ]; then
184 echo libtool
-dynamic -install_name /${TARGET_DIR}/${TARGET_DYNAMIC_LIB} -compatibility_version $COMPAT_VERS -current_version $CURR_VERS -arch_only ppc
-o $DST_DIR/${TARGET_DYNAMIC_LIB} $OBJECT_DIR/*.o
-lcc_dynamic -framework System
185 libtool
-dynamic -install_name /${TARGET_DIR}/${TARGET_DYNAMIC_LIB} -compatibility_version $COMPAT_VERS -current_version $CURR_VERS -arch_only ppc
-o $DST_DIR/${TARGET_DYNAMIC_LIB} $OBJECT_DIR/*.o
-lcc_dynamic -ldnsinfo -framework System
186 echo "ln -s $TARGET_DYNAMIC_LIB $DST_DIR/${TARGET_LIB_LINK}"
187 ln -s $TARGET_DYNAMIC_LIB $DST_DIR/${TARGET_LIB_LINK}
190 echo "Finished building $TARGET"