Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
2230cc17
Commit
2230cc17
authored
Jul 31, 2017
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix compilations on dev-machine
Change-Id: I402166c0666ee6d6a12d6d223261e51ebb760b5a
parent
4c2c7802
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
32 deletions
+34
-32
Makefile
Makefile
+7
-7
config_brpc.sh
config_brpc.sh
+27
-25
No files found.
Makefile
View file @
2230cc17
...
...
@@ -208,31 +208,31 @@ clean:
output/include output/lib output/bin
libbase.a
:
$(BASE_OBJS)
@
echo
"
Lin
king
$@
"
@
echo
"
Pac
king
$@
"
@
ar crs
$@
$^
libbvar.a
:
$(BVAR_OBJS)
@
echo
"
Lin
king
$@
"
@
echo
"
Pac
king
$@
"
@
ar crs
$@
$^
libbthread.a
:
$(BTHREAD_OBJS)
@
echo
"
Lin
king
$@
"
@
echo
"
Pac
king
$@
"
@
ar crs
$@
$^
libjson2pb.a
:
$(JSON2PB_OBJS)
@
echo
"
Lin
king
$@
"
@
echo
"
Pac
king
$@
"
@
ar crs
$@
$^
libmcpack2pb.a
:
$(MCPACK2PB_OBJS)
@
echo
"
Lin
king
$@
"
@
echo
"
Pac
king
$@
"
@
ar crs
$@
$^
protoc-gen-mcpack
:
mcpack2pb/generator.o libmcpack2pb.a libbase.a libbthread.a libbvar.a
@
echo
"Linking
$@
"
@
$(CXX)
-o
protoc-gen-mcpack
-L
$(LIBPATH)
-Xlinker
"-("
$^
-Xlinker
"-)"
$(LDFLAGS)
@
$(CXX)
-o
protoc-gen-mcpack
$(LIBPATH)
-Xlinker
"-("
$^
-Xlinker
"-)"
$(LDFLAGS)
libbrpc.a
:
$(BRPC_OBJS)
@
echo
"
Lin
king
$@
"
@
echo
"
Pac
king
$@
"
@
ar crs libbrpc.a
$^
.PHONY
:
output/include
...
...
config_brpc.sh
View file @
2230cc17
...
...
@@ -27,13 +27,17 @@ while true; do
*
)
break
;;
esac
done
if
[
-z
"
$INCS
"
]
||
[
-z
"
$LIBS
"
]
;
then
$ERROR
"config_brpc: --incs=INCPATHS --libs=LIBPATHS must be specified"
exit
1
fi
find_dir_of_lib
()
{
dirname
$(
find
${
LIBS
}
-name
"lib
${
1
}
.a"
-o
-name
"lib
${
1
}
.so"
|
head
-n1
)
local
lib
=
$(
find
${
LIBS
}
-name
"lib
${
1
}
.a"
-o
-name
"lib
${
1
}
.so*"
|
head
-n1
)
if
[
!
-z
"
$lib
"
]
;
then
dirname
$lib
fi
}
find_dir_of_lib_or_die
()
{
local dir
=
$(
find_dir_of_lib
$1
)
...
...
@@ -45,8 +49,12 @@ find_dir_of_lib_or_die() {
fi
}
find_bin
()
{
find
${
LIBS
}
-name
"
$1
"
|
head
-n1
}
find_dir_of_header
()
{
find
${
INCS
}
-path
"*/
$1
"
|
sed
"s|
$1
||g"
find
${
INCS
}
-path
"*/
$1
"
|
head
-n1
|
sed
"s|
$1
||g"
}
find_dir_of_header_or_die
()
{
local dir
=
$(
find_dir_of_header
$1
)
...
...
@@ -83,15 +91,19 @@ fi
PROTOC
=
$(
which protoc 2>/dev/null
)
if
[
-z
"
$PROTOC
"
]
;
then
PROTOC
=
$(
find_dir_of_lib_or_die protoc
)
/protoc
PROTOC
=
$(
find_bin protoc
)
if
[
-z
"
$PROTOC
"
]
;
then
$ERROR
"Fail to find protoc"
exit
1
fi
fi
GFLAGS_INC
=
$(
find_dir_of_header gflags/gflags.h
)
PROTOBUF_INC
=
$(
find_dir_of_header google/protobuf/message.h
)
LEVELDB_INC
=
$(
find_dir_of_header leveldb/db.h
)
INCS
=
$(
$ECHO
"
$GFLAGS_INC
\n
$PROTOBUF_INC
\n
$LEVELDB_INC
"
|
sort
|
uniq
)
LIBS
=
$(
$ECHO
"
$GFLAGS_DIR
\n
$PROTOBUF_DIR
\n
$LEVELDB_DIR
\n
$SNAPPY_DIR
\n
$PROTOC_DIR
"
|
sort
|
uniq
)
INCS
2
=
$(
$ECHO
"
$GFLAGS_INC
\n
$PROTOBUF_INC
\n
$LEVELDB_INC
"
|
sort
|
uniq
)
LIBS
2
=
$(
$ECHO
"
$GFLAGS_DIR
\n
$PROTOBUF_DIR
\n
$LEVELDB_DIR
\n
$SNAPPY_DIR
\n
$PROTOC_DIR
"
|
sort
|
uniq
)
absent_in_the_list
()
{
TMP
=
$(
$ECHO
"
`
$ECHO
"
$1
\n
$2
"
|
sort
|
uniq
`
"
)
...
...
@@ -102,8 +114,8 @@ absent_in_the_list() {
}
#can't use \n in texts because sh does not support -e
CONTENT
=
"INCS=
$(
$ECHO
$INCS
)
"
CONTENT
=
"
${
CONTENT
}
\n
LIBS=
$(
$ECHO
$LIBS
)
"
CONTENT
=
"INCS=
$(
$ECHO
$INCS
2
)
"
CONTENT
=
"
${
CONTENT
}
\n
LIBS=
$(
$ECHO
$LIBS
2
)
"
CONTENT
=
"
${
CONTENT
}
\n
PROTOC=
$PROTOC
"
CONTENT
=
"
${
CONTENT
}
\n
PROTOBUF_INC=
$PROTOBUF_INC
"
CONTENT
=
"
${
CONTENT
}
\n
CC=
$CC
"
...
...
@@ -114,13 +126,14 @@ CONTENT="${CONTENT}\nifeq (\$(LINK_PERFTOOLS), 1)"
# required by cpu/heap profiler
TCMALLOC_DIR
=
$(
find_dir_of_lib tcmalloc_and_profiler
)
if
[
!
-z
"
$TCMALLOC_DIR
"
]
;
then
if
absent_in_the_list
"
$TCMALLOC_DIR
"
"
$LIBS
"
;
then
if
absent_in_the_list
"
$TCMALLOC_DIR
"
"
$LIBS
2
"
;
then
CONTENT
=
"
${
CONTENT
}
\n
LIBS+=
$TCMALLOC_DIR
"
LIBS
=
"
${
LIBS
}
\n
$TCMALLOC_DIR
"
LIBS
2
=
"
${
LIBS2
}
\n
$TCMALLOC_DIR
"
fi
TCMALLOC_INC
=
$(
find_dir_of_header google/tcmalloc.h
)
if
absent_in_the_list
"
$TCMALLOC_INC
"
"
$INCS
"
;
then
if
absent_in_the_list
"
$TCMALLOC_INC
"
"
$INCS
2
"
;
then
CONTENT
=
"
${
CONTENT
}
\n
INCS+=
$TCMALLOC_INC
"
INCS2
=
"
${
INCS2
}
\n
$TCMALLOC_INC
"
fi
if
[
-f
$TCMALLOC_DIR
/libtcmalloc_and_profiler.a
]
;
then
CONTENT
=
"
${
CONTENT
}
\n
STATIC_LINKING+=-ltcmalloc_and_profiler"
...
...
@@ -131,28 +144,17 @@ fi
# required by tcmalloc('s profiler)
UNWIND_DIR
=
$(
find_dir_of_lib unwind
)
if
[
!
-z
"
$UNWIND_DIR
"
]
;
then
if
absent_in_the_list
"
$UNWIND_DIR
"
"
$LIBS
"
;
then
if
absent_in_the_list
"
$UNWIND_DIR
"
"
$LIBS
2
"
;
then
CONTENT
=
"
${
CONTENT
}
\n
LIBS+=
$UNWIND_DIR
"
LIBS
=
"
${
LIBS
}
\n
$UNWIND_DIR
"
LIBS
2
=
"
${
LIBS2
}
\n
$UNWIND_DIR
"
fi
if
[
-f
$UNWIND_DIR
/libunwind.a
]
;
then
CONTENT
=
"
${
CONTENT
}
\n
STATIC_LINKING+=-lunwind"
else
CONTENT
=
"
${
CONTENT
}
\n
DYNAMIC_LINKING+=-lunwind"
fi
fi
# required by libunwind
LZMA_DIR
=
$(
find_dir_of_lib lzma
)
if
[
!
-z
"
$LZMA_DIR
"
]
;
then
if
absent_in_the_list
"
$LZMA_DIR
"
"
$LIBS
"
;
then
CONTENT
=
"
${
CONTENT
}
\n
LIBS+=
$LZMA_DIR
"
LIBS
=
"
${
LIBS
}
\n
$LZMA_DIR
"
fi
if
[
-f
$LZMA_DIR
/liblzma.a
]
;
then
CONTENT
=
"
${
CONTENT
}
\n
STATIC_LINKING+=-llzma"
else
CONTENT
=
"
${
CONTENT
}
\n
DYNAMIC_LINKING+=-llzma"
fi
# required by libunwind
CONTENT
=
"
${
CONTENT
}
\n
DYNAMIC_LINKING+=-llzma"
fi
CONTENT
=
"
${
CONTENT
}
\n
endif"
$ECHO
"
$CONTENT
"
>
config.mk
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment