3 # stolen from ffmpeg configure like a pig
5 # Prevent locale nonsense from breaking basic text processing.
12 slib_file_name
=libharfbuzz.so.
${major}.${minor}.${micro}
13 slib_soname
=libharfbuzz.so.
${major}
61 rm -f ${slib_file_name}
62 for src_file
in ${srcs}
64 rm -f ${src_file/\.c/.o}
66 rm -f harfbuzz.pc hb-version.h
75 ${slib_install} ${slib_file_name} ${destdir}${sysroot}${libdir}/${slib_file_name}
76 ${ln_s} ${destdir}${sysroot}${libdir}/${slib_file_name} ${destdir}${sysroot}${libdir}/${slib_soname}
77 ${ln_s} ${destdir}${sysroot}${libdir}/${slib_file_name} ${destdir}${sysroot}${libdir}/libharfbuzz.so
78 ${file_install} harfbuzz.pc ${destdir}${sysroot}${libdir}/pkgconfig
/harfbuzz.pc
79 for hdr
in ${api_hdrs}
81 ${file_install} ${source_path}/${hdr} ${destdir}${sysroot}${incdir}/harfbuzz/${hdr}
86 ################################################################################
92 source_path
=$
(cd $
(dirname "$0"); pwd)
93 echo "$source_path" |
grep -q '[[:blank:]]' &&
94 die
"Out of tree builds are impossible with whitespace in source path."
95 test -e "$source_path/config.h" &&
96 die
"Out of tree builds are impossible with config.h in source dir."
103 [ $var = $value ] && return 0
111 eval "$var=\"\$$var $*\""
115 echo "Unknown option \"$1\"."
116 echo "See $0 --help for available options."
122 eval : \
${$opt:=\$${opt}_default}
148 prefix_default
="/usr/local"
149 incdir_default
='${prefix}/include'
150 libdir_default
='${prefix}/lib'
152 #command lin set defaults
153 #slib_cc_default='gcc -Wall -Wextra -Wno-missing-field-initializers -c -fPIC -fpic -Ofast -std=c99'
154 slib_cc_default
="gcc -Wall -Wextra -Wno-missing-field-initializers -c -fPIC -fpic -g -std=c99"
155 slib_ld_default
="gcc -shared -Wl,-soname=${LIB_SONAME}"
156 slib_install_default
='install -D --mode=755'
157 file_install_default
='install -D --mode=644'
158 ln_s_default
='ln --symbolic --force'
160 set_default
${PATHS_LIST}
161 set_default slib_cc slib_ld
162 set_default slib_install file_install ln_s
166 Usage: make [options] [operations]
168 Operations: [default is to build the shared library]:
169 clean clean build products
170 install install build products
173 Options: [defaults in brackets after descriptions]
176 --help print this message
180 --prefix=PREFIX install in PREFIX [$prefix_default]
181 --libdir=DIR install libs in DIR [PREFIX/lib]
182 --incdir=DIR install includes in DIR [PREFIX/include]
184 Advanced options (experts only):
185 --sysroot=PATH root of cross-build tree
186 --destdir=PATH installation root dir override
187 --slib-cc=CC use C compiler command line CC for shared lib object[$slib_cc_default]
188 --slib-ld=LD use linker command line LD for shared lib [$slib_ld_default]
204 optname
="${optname#--}"
205 optname
=$
(echo "$optname" |
sed 's/-/_/g')
206 if is_in
$optname $CMDLINE_SET; then
207 eval $optname='$optval'
208 elif is_in
$optname $CMDLINE_APPEND; then
209 append
$optname "$optval"
217 #for pkgconfig to pickup the right package files
218 export PKG_CONFIG_SYSROOT_DIR
=${sysroot}
220 #CPPFLAGS=-I./ -I${source_path} -DHAVE_OT -DHAVE_GLIB
221 CPPFLAGS
="-I./ -I${source_path} -DHAVE_GLIB \
222 $(pkg-config --cflags freetype2) \
223 $(pkg-config --cflags glib-2.0)
226 #generate the version header file
228 s/@HB_VERSION_MAJOR@/${major})/
229 s/@HB_VERSION_MINOR@/${minor}/
230 s/@HB_VERSION_MICRO@/${micro}/
231 s/@HB_VERSION@/${major}.${minor}.${micro}/
232 " ${source_path}/hb-version.h.
in >hb-version.h
234 #generate the pkgconfig file
236 s:%prefix%:${prefix}:
237 s:%exec_prefix%:${prefix}:
238 s:%libdir%:${libdir}:
239 s:%includedir%:${incdir}:
240 s:%VERSION%:${major}.${minor}.${micro}:
241 " ${source_path}/harfbuzz.pc.
in >harfbuzz.pc
243 #compile source files, build a list of objet files
244 for src_file
in ${srcs}
246 obj
=${src_file/\.c/.o}
247 echo "SLIB_CC ${src_file}"
248 ${slib_cc} ${CPPFLAGS} -o ${obj} ${source_path}/${src_file}
249 objs
="${obj} ${objs}"
253 echo "SLIB_LD ${slib_file_name}"
255 ${slib_ld} -o ${slib_file_name} ${objs}