#!/bin/sh # stolen from ffmpeg configure like a pig # Prevent locale nonsense from breaking basic text processing. LC_ALL=C export LC_ALL major=0 minor=9 micro=30 slib_file_name=libharfbuzz.so.$major.$minor.$micro slib_soname=libharfbuzz.so.$major api_hdrs=' hb-blob.h hb-buffer.h hb-common.h hb-coretext.h hb-deprecated.h hb-face.h hb-font.h hb-ft.h hb-glib.h hb-gobject.h hb-gobject-structs.h hb-graphite2.h hb.h hb-icu.h hb-ot-font.h hb-ot.h hb-ot-layout.h hb-ot-shape.h hb-ot-tag.h hb-set.h hb-shape.h hb-shape-plan.h hb-unicode.h hb-uniscribe.h ' srcs=' hb-blob.c hb-buffer.c hb-common.c hb-face.c hb-fallback-shape.c hb-font.c hb-ft.c hb-glib.c hb-open-file.c hb-ot-layout.c hb-ot-tag.c hb-shape.c hb-shape-plan.c hb-shaper.c hb-unicode.c hb-utf-private.c ' clean_do(){ rm -Rf fake_root for src_file in $srcs do o_file=${src_file%.c} o_file=${o_file}.o rm -f "$o_file" done rm -f harfbuzz.pc hb-version.h exit 0 } ################################################################################ # find source path if test -f make; then src_path=. else src_path=$(cd $(dirname "$0"); pwd) echo "$src_path" | grep -q '[[:blank:]]' && die "Out of tree builds are impossible with whitespace in source path." test -e "$src_path/config.h" && die "Out of tree builds are impossible with config.h in source dir." fi is_in(){ value=$1 shift for var in $*; do [ $var = $value ] && return 0 done return 1 } append(){ var=$1 shift eval "$var=\"\$$var $*\"" } die_unknown(){ echo "Unknown option \"$1\"." echo "See $0 --help for available options." exit 1 } set_default(){ for opt; do eval : \${$opt:=\$${opt}_default} done } PATHS_LIST=' prefix incdir libdir pkg-config-sysroot ' CMDLINE_APPEND=" extra_cflags extra_cxxflags host_cppflags " CMDLINE_SET=" $PATHS_LIST slib_cc slib_ccld alib_ar disable-glib " #path defaults prefix_default='/usr/local' incdir_default='$prefix/include' libdir_default='$prefix/lib' pkg_config_sysroot='' #command lin set defaults #for your information: harbuzz C API is shit when enabling c90 pedantic compilation slib_cc_default='gcc -Wall -Wextra -Wno-missing-field-initializers -c -fPIC -O2 -std=c90' slib_ccld_default="gcc -shared -Wl,-soname=$slib_soname" alib_ar_default='ar rucs' ln_s_default='ln -sf' disable_glib_default=no set_default $PATHS_LIST set_default alib_ar slib_cc slib_ccld disable_glib show_help(){ cat <<EOF Usage: make [options] [operations] Operations: [default is to build the shared library]: clean clean build products Options: [defaults in brackets after descriptions] Help options: --help print this message Features: --disable-glib disable glib support [glib support is enabled] Path options for pkg-config file: --prefix=PREFIX install in PREFIX [$prefix_default] --libdir=DIR install libs in DIR [$incdir_default] --incdir=DIR install includes in DIR [$libdir_default] Advanced options (experts only): --pkg-config-sysroot=SYSROOT if you need to tell pkg-config that you cross-compile --slib-cc=CC use C compiler command line CC for shared lib object[$slib_cc_default] --slib-ccld=CCLD use linker command line LD for shared lib [$slib_ccld_default] --alib-ar=AR use archive command line AR to create the static library archive [$alib_ar_default] EOF exit 0 } for opt do optval="${opt#*=}" case "$opt" in clean) clean_do ;; --help|-h) show_help ;; --disable-glib) disable_glib=yes ;; *) optname="${opt%%=*}" optname="${optname#--}" optname=$(echo "$optname" | sed 's/-/_/g') if is_in $optname $CMDLINE_SET; then eval $optname='$optval' elif is_in $optname $CMDLINE_APPEND; then append $optname "$optval" else die_unknown $opt fi ;; esac done #for pkgconfig to pickup the right package files if test -n "$pkg_config_sysroot"; then export PKG_CONFIG_SYSROOT_DIR=$pkg_config_sysroot fi #------------------------------------------------------------------------------- CPPFLAGS="-I./ -I$src_path \ $(pkg-config --cflags freetype2) \ " if test x$disable_glib = xno; then CPPFLAGS="$CPPFLAGS -DHAVE_GLIB \ $(pkg-config --cflags glib-2.0) \ " fi #------------------------------------------------------------------------------- #generate the version header file sed -e " s/@HB_VERSION_MAJOR@/$major/ s/@HB_VERSION_MINOR@/$minor/ s/@HB_VERSION_MICRO@/$micro/ s/@HB_VERSION@/$major.$minor.$micro/ " $src_path/hb-version.h.in >hb-version.h #evaluate the final paths (depth of one) eval "e_incdir=$incdir" eval "e_libdir=$libdir" #generate the pkg-config file sed -e " s:%prefix%:$prefix: s:%exec_prefix%:$prefix: s:%libdir%:$e_libdir: s:%includedir%:$e_incdir: s:%VERSION%:$major.$minor.$micro: " $src_path/harfbuzz.pc.in >harfbuzz.pc #compile source files, build a list of objet files for src_file in $srcs do obj=${src_file%.c} obj=${obj}.o echo "SLIB_CC $src_file" $slib_cc $CPPFLAGS -o "$obj" "$src_path/$src_file" objs="$obj $objs" done #link the shared lib echo "SLIB_CCLD $slib_file_name" echo $objs mkdir -p "fake_root/$e_libdir" $slib_ccld -o "fake_root/$e_libdir/$slib_file_name" $objs #install the other files in the fake root ln -sf "$slib_file_name" "fake_root/$e_libdir/$slib_soname" ln -sf "$slib_soname" "fake_root/$e_libdir/libharfbuzz.so" # create the library archive echo "ALIB_AR libharfbuzz.a" $alib_ar fake_root$e_libdir/libharfbuzz.a $objs mkdir -p "fake_root/$e_libdir/pkgconfig" cp -f harfbuzz.pc fake_root/$e_libdir/pkgconfig/harfbuzz.pc mkdir -p "fake_root/$e_incdir/harfbuzz" for hdr in $api_hdrs do cp -f $src_path/$hdr "fake_root/$e_incdir/harfbuzz/$hdr" cp -f hb-version.h "fake_root/$e_incdir/harfbuzz/" done
Mode | Type | Size | Ref | File |
---|---|---|---|---|
100644 | blob | 215 | 9381999f3aeff23f92475e7aef7a141e7b31c938 | ABBREVIATIONS |
100644 | blob | 120 | b5b8344f6c0ab2a879570909dfc67753d036ea10 | FIXME |
100644 | blob | 241 | 9c28271a27b1d0acd9a2a8f412a4f107767e4df2 | README |
100644 | blob | 219 | bc171ca45d9157358b008496850fe8f73dd0c66b | harfbuzz.pc.in |
100644 | blob | 1192 | 833e0c5e348c3c7663711b84cd05baf7f2ec4b6b | hb-atomic-private.h |
100644 | blob | 119 | 154fbbb0957b9a8247993436984ab9cda943720c | hb-blob-private.h |
100644 | blob | 4603 | 6cc79394dfa9884d604a6e958268d841c370f3f1 | hb-blob.c |
100644 | blob | 3534 | ef3fc98c05de6d2fa43f6303d6419f6620d474bf | hb-blob.h |
100644 | blob | 1326 | 3b93b65480793ced5bdd1c6e2587d3c2a66f3a53 | hb-buffer-private.h |
100644 | blob | 11355 | 24118c098a5412ec39226fe2a18b7e192dd902b2 | hb-buffer.c |
100644 | blob | 10513 | d3a2512d800fde857f72764b150aaa392fd8b15d | hb-buffer.h |
100644 | blob | 3302 | 92b54dbaf82493e6f281bb20231df3e1ecb9d63c | hb-common.c |
100644 | blob | 13612 | af17d780c27fc757441d5ce0fce1db120bd87c9b | hb-common.h |
100644 | blob | 1746 | 82066e4e0dc0b2770a8800f9a9fb417e14d9d7d0 | hb-coretext.h |
100644 | blob | 1584 | 30ae4b1caf76dd03cc682eda7458728b5380ad6c | hb-deprecated.h |
100644 | blob | 1175 | 5e43e30983efc3b0936efbdaf3921eecbfc1635a | hb-face-private.h |
100644 | blob | 5222 | 770d81b8c6b9bafd4c9eb018f1420e369ba09647 | hb-face.c |
100644 | blob | 2985 | 91237b70850bc9750516c73aca7051228e5c22c1 | hb-face.h |
100644 | blob | 3268 | cdc0ae9a6a50a1b444db3a148db08f01bececa7c | hb-fallback-shape.c |
100644 | blob | 2875 | dce2474d44b59f5349528718422dd9af7975cf52 | hb-font-private.h |
100644 | blob | 24805 | 80df40b5a885a7e2ae668ef1fc01020247a4e155 | hb-font.c |
100644 | blob | 13844 | c3165e1d74c123fc1aa289ce503e38f870b43611 | hb-font.h |
100644 | blob | 2502 | 551d6e47f67a13ce27d21f4bfadc86a8091507ce | hb-ft.c |
100644 | blob | 3790 | dc8ef8558484cb4faaa3cbe6906a84d8005a3a10 | hb-ft.h |
100644 | blob | 3637 | 1468f247a5f2d3c48a0de2a9a9156e17fe4521dc | hb-glib.c |
100644 | blob | 1627 | a6b6ff82026f3a0016eab1f5201e13afbde93feb | hb-glib.h |
100644 | blob | 3140 | 0ea3b12cf1676dc6a2da8e546d9d6b7cbc60ed41 | hb-gobject-structs.h |
100644 | blob | 1334 | ea1bd25df82d46a222436a1ad078d0fc95d5c303 | hb-gobject.h |
100644 | blob | 1461 | 122c3e476366b341bc74ced282f424d863255ca7 | hb-graphite2.h |
100644 | blob | 1525 | 2db6a7b6797bddc46688f7b583de991a956a2e2a | hb-icu.h |
100644 | blob | 2133 | 3e4514517efb14434d2ac3a08b82a06eedf8ffaa | hb-open-file-private.h |
100644 | blob | 2674 | 18b89705a885521c6d8d08448eac1f65395a3a0d | hb-open-file.c |
100644 | blob | 65 | 642c3d3d45fdc42619d000cc9f7b3c890bdc0190 | hb-ot-face-private.h |
100644 | blob | 1365 | 80eaa54b1add7333d975fbee27c00bc777f3e046 | hb-ot-font.h |
100644 | blob | 2784 | 91122b51fbb221aeb52634439405e47e700a1e80 | hb-ot-layout.c |
100644 | blob | 9658 | eb23d45b68aabd24538b46bb482ac187c5f61d73 | hb-ot-layout.h |
100644 | blob | 1712 | 7b1bcc0637808bbbceda020409b61d947237d925 | hb-ot-shape.h |
100644 | blob | 730 | bfa3d45093e12bf9aa7a0a8920d6a573145e1f99 | hb-ot-tag.c |
100644 | blob | 1728 | 54fb747f582301c6d46bbe33ede8a2ef127dc999 | hb-ot-tag.h |
100644 | blob | 1348 | 47c92a58e4b7ddc3225e7cb65ce20aafceb3b81a | hb-ot.h |
100644 | blob | 2541 | 827e6c9b4e8f90ba02b24a259ddd10fa8b7f34cb | hb-private.h |
100644 | blob | 3828 | 2164c1a6549afc39d9f3c6e82bb6ca8f0b8f732d | hb-set.h |
100644 | blob | 1417 | 62ff962974ac05946c099ea7d4fb3473bd95f6ba | hb-shape-plan-private.h |
100644 | blob | 14266 | 11f405cdb548fd9ac6aaebda60059202512d5831 | hb-shape-plan.c |
100644 | blob | 2837 | aa5e0c7d6f519b841c4519811f18845cdf92ee77 | hb-shape-plan.h |
100644 | blob | 5057 | 00628cd3079786a1cf9c2534458ceeac98bcc9b6 | hb-shape.c |
100644 | blob | 2170 | 53bb845bf48f40758c69ae31a399054b43690413 | hb-shape.h |
100644 | blob | 1015 | ee80e4526b63481a48b348fe279c15e757363776 | hb-shaper-private.h |
100644 | blob | 2250 | 8073a7cc168f5624424250b6a81f0440243fc015 | hb-shaper.c |
100644 | blob | 1210 | 276c97e391a35215a71ad538b77696c69dd16eb1 | hb-unicode-private.h |
100644 | blob | 7644 | 53862e6db7e90afb058efbc0f0bad27cd25b28c1 | hb-unicode.c |
100644 | blob | 14695 | 33b68aa0d85b666090c2820e46c7a5242992b228 | hb-unicode.h |
100644 | blob | 1391 | 4e4ef9986a62e3df91d1d4ea048ec89d3526498d | hb-uniscribe.h |
100644 | blob | 4990 | 319e112fe2de8d3ccb9249fec39a96971d13f1fc | hb-utf-private.c |
100644 | blob | 1246 | dca4a18b95114b239706d6917a6c74eac87b3279 | hb-utf-private.h |
100644 | blob | 1887 | 0ffd889b278962a33f2b8882e1dba4b41af6b672 | hb-version.h.in |
100644 | blob | 1521 | 7402034f4379372b3a7d0529142e4c87e4b4599d | hb.h |
100644 | blob | 7651 | 65c5ca88a67c30becee01c5a8816d964b03862f9 | license.md |
100755 | blob | 6112 | 017403a7717449e9a432c10a911340b211c5d974 | make |