Line 0
Link Here
|
|
|
1 |
--- make.sh.orig 2016-08-08 09:17:50.000000000 +0200 |
2 |
+++ make.sh 2016-10-07 18:02:59.835681000 +0200 |
3 |
@@ -1,58 +1,21 @@ |
4 |
-tmp_src_filename=fdfs_check_bits.c |
5 |
-cat <<EOF > $tmp_src_filename |
6 |
-#include <stdio.h> |
7 |
-#include <unistd.h> |
8 |
-#include <fcntl.h> |
9 |
-int main() |
10 |
-{ |
11 |
- printf("%d\n", (int)sizeof(long)); |
12 |
- printf("%d\n", (int)sizeof(off_t)); |
13 |
- return 0; |
14 |
-} |
15 |
-EOF |
16 |
|
17 |
-gcc -D_FILE_OFFSET_BITS=64 -o a.out $tmp_src_filename |
18 |
-output=$(./a.out) |
19 |
+DESTDIR= |
20 |
|
21 |
-if [ -f /bin/expr ]; then |
22 |
- EXPR=/bin/expr |
23 |
-else |
24 |
- EXPR=/usr/bin/expr |
25 |
-fi |
26 |
- |
27 |
-count=0 |
28 |
-int_bytes=4 |
29 |
-off_bytes=8 |
30 |
-for col in $output; do |
31 |
- if [ $count -eq 0 ]; then |
32 |
- int_bytes=$col |
33 |
- else |
34 |
- off_bytes=$col |
35 |
- fi |
36 |
- |
37 |
- count=$($EXPR $count + 1) |
38 |
-done |
39 |
- |
40 |
-/bin/rm -f a.out $tmp_src_filename |
41 |
-if [ "$int_bytes" -eq 8 ]; then |
42 |
+if [ "$(/usr/bin/uname -m)" = "amd64" ]; then |
43 |
OS_BITS=64 |
44 |
-else |
45 |
- OS_BITS=32 |
46 |
-fi |
47 |
- |
48 |
-if [ "$off_bytes" -eq 8 ]; then |
49 |
OFF_BITS=64 |
50 |
else |
51 |
+ OS_BITS=32 |
52 |
OFF_BITS=32 |
53 |
fi |
54 |
|
55 |
ENABLE_STATIC_LIB=0 |
56 |
ENABLE_SHARED_LIB=1 |
57 |
-TARGET_PREFIX=$DESTDIR/usr |
58 |
-TARGET_CONF_PATH=$DESTDIR/etc/fdfs |
59 |
+TARGET_PREFIX=$DESTDIR/usr/local |
60 |
+TARGET_CONF_PATH=$DESTDIR/usr/local/etc/fdfs |
61 |
TARGET_INIT_PATH=$DESTDIR/etc/init.d |
62 |
|
63 |
-WITH_LINUX_SERVICE=1 |
64 |
+WITH_LINUX_SERVICE=0 |
65 |
|
66 |
DEBUG_FLAG=1 |
67 |
|
68 |
@@ -74,7 +37,7 @@ |
69 |
fi |
70 |
CFLAGS="$CFLAGS" |
71 |
elif [ "$uname" = "FreeBSD" ] || [ "$uname" = "Darwin" ]; then |
72 |
- LIBS="$LIBS -L/usr/lib" |
73 |
+ LIBS="$LIBS -L/usr/local/lib" |
74 |
CFLAGS="$CFLAGS" |
75 |
if [ "$uname" = "Darwin" ]; then |
76 |
CFLAGS="$CFLAGS -DDARWIN" |
77 |
@@ -180,26 +143,3 @@ |
78 |
perl -pi -e "s#\\\$\(TARGET_PREFIX\)#$TARGET_PREFIX#g" Makefile |
79 |
cd .. |
80 |
|
81 |
-if [ "$1" = "install" ]; then |
82 |
- cd .. |
83 |
- cp -f restart.sh $TARGET_PREFIX/bin |
84 |
- cp -f stop.sh $TARGET_PREFIX/bin |
85 |
- |
86 |
- if [ "$uname" = "Linux" ]; then |
87 |
- if [ "$WITH_LINUX_SERVICE" = "1" ]; then |
88 |
- if [ ! -d /etc/fdfs ]; then |
89 |
- mkdir -p /etc/fdfs |
90 |
- cp -f conf/tracker.conf $TARGET_CONF_PATH/tracker.conf.sample |
91 |
- cp -f conf/storage.conf $TARGET_CONF_PATH/storage.conf.sample |
92 |
- cp -f conf/client.conf $TARGET_CONF_PATH/client.conf.sample |
93 |
- cp -f conf/storage_ids.conf $TARGET_CONF_PATH/storage_ids.conf.sample |
94 |
- fi |
95 |
- mkdir -p $TARGET_INIT_PATH |
96 |
- cp -f init.d/fdfs_trackerd $TARGET_INIT_PATH |
97 |
- cp -f init.d/fdfs_storaged $TARGET_INIT_PATH |
98 |
-# /sbin/chkconfig --add fdfs_trackerd |
99 |
-# /sbin/chkconfig --add fdfs_storaged |
100 |
- fi |
101 |
- fi |
102 |
-fi |
103 |
- |