@@ -86,32 +86,6 @@ OPTIONS:
8686EOF
8787}
8888
89- function correct_pc_file(){
90- local fix_path=" $1 "
91- local dir=${PWD}
92-
93- echo " fix pc files in folder: $fix_path "
94- cd " $fix_path "
95-
96- for pc in ` find . -type f -name " *.pc" ` ;
97- do
98- local pkgconfig=$( cd $( dirname " $pc " ) ; pwd)
99- local lib_dir=$( cd $( dirname " $pkgconfig " ) ; pwd)
100- local base_dir=$( cd $( dirname " $lib_dir " ) ; pwd)
101- local include_dir=" ${base_dir} /include"
102- local bin_dir=" ${base_dir} /bin"
103-
104- my_sed_i " s|^prefix=.*|prefix=$base_dir |" " $pc "
105- my_sed_i " s|^exec_prefix=[^$].*|exec_prefix=$bin_dir |" $pc
106- my_sed_i " s|^libdir=[^$].*|libdir=$lib_dir |" " $pc "
107- my_sed_i " s|^includedir=[^$].*include|includedir=$include_dir |" " $pc "
108- my_sed_i " s|-L/[^ ]*lib|-L$lib_dir |" " $pc "
109- my_sed_i " s|-I/[^ ]*include|-I$include_dir |" " $pc "
110- done
111-
112- cd " $dir "
113- }
114-
11589function parse_path()
11690{
11791 local p=" $1 "
@@ -149,6 +123,7 @@ arch=
149123libs=
150124workspace=
151125debug=
126+ pc_file_dir=
152127
153128case $1 in
154129 init | install)
@@ -166,7 +141,6 @@ case $1 in
166141 ;;
167142esac
168143
169- export -f correct_pc_file
170144export MR_ACTION=$action
171145
172146while [[ $# -gt 0 ]]; do
@@ -213,8 +187,7 @@ while [[ $# -gt 0 ]]; do
213187 ;;
214188 -correct-pc)
215189 shift
216- correct_pc_file " $1 "
217- exit 0
190+ pc_file_dir=" $1 "
218191 ;;
219192 ** )
220193 echo " unkonwn option:$1 "
@@ -224,6 +197,7 @@ while [[ $# -gt 0 ]]; do
224197done
225198
226199if [[ -z " $platform " ]]; then
200+ echo " platform can't empty"
227201 help
228202 exit 1
229203fi
@@ -233,7 +207,9 @@ if [[ "$platform" != 'ios' && "$platform" != 'macos' && "$platform" != 'tvos' &&
233207 exit 1
234208fi
235209
236- if [[ -z " $libs " ]]; then
210+ export MR_PC_FILE_DIR=" $pc_file_dir "
211+
212+ if [[ -z " $MR_PC_FILE_DIR " && -z " $libs " ]]; then
237213 echo " libs can't be nil, use -l specify libs"
238214 exit 1
239215fi
293269 done
294270fi
295271
272+
296273echo " MR_ACTION : [$MR_ACTION ]"
297274echo " MR_PLAT : [$MR_PLAT ]"
298275echo " MR_CMD : [$MR_CMD ]"
@@ -304,5 +281,6 @@ echo "MR_INIT_CFLAGS : [$MR_INIT_CFLAGS]"
304281echo " SKIP_PULL_BASE : [$SKIP_PULL_BASE ]"
305282echo " SKIP_FFMPEG_PATHCHES : [$SKIP_FFMPEG_PATHCHES ]"
306283echo " MR_SKIP_MAKE_XCFRAMEWORK" : [$MR_SKIP_MAKE_XCFRAMEWORK ]
284+ [[ -n $MR_PC_FILE_DIR ]] && echo " MR_PC_FILE_DIR : [$MR_PC_FILE_DIR ]"
307285
308- unset platform cmd arch libs workspace debug action cflags
286+ unset platform cmd arch libs workspace debug action cflags pc_file_dir
0 commit comments