aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorHeikki Lindholm <holin@iki.fi>2008-06-26 08:43:08 +0000
committerHeikki Lindholm <holin@iki.fi>2008-06-26 08:43:08 +0000
commit29f839a7455f8ecd43076c97991daea1d0c8e875 (patch)
treeffe9d5566a0b3b6be29547f4f03ddb334cc4b53f /contrib
parentba165155209794fd51be63e7a79799b945092a9d (diff)
downloadlibextractor-29f839a7455f8ecd43076c97991daea1d0c8e875.tar.gz
libextractor-29f839a7455f8ecd43076c97991daea1d0c8e875.zip
clean-ups, better error checking
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/macosx/build-osx-framework.sh123
1 files changed, 56 insertions, 67 deletions
diff --git a/contrib/macosx/build-osx-framework.sh b/contrib/macosx/build-osx-framework.sh
index 838ec75..5e6301a 100755
--- a/contrib/macosx/build-osx-framework.sh
+++ b/contrib/macosx/build-osx-framework.sh
@@ -71,7 +71,6 @@ fetch_package()
71 71
72fetch_all_packages() 72fetch_all_packages()
73{ 73{
74# fetch_package "${LIBTOOL_NAME}" "${LIBTOOL_URL}"
75 fetch_package "${GNUMAKE_NAME}" "${GNUMAKE_URL}" 74 fetch_package "${GNUMAKE_NAME}" "${GNUMAKE_URL}"
76 fetch_package "${GETTEXT_NAME}" "${GETTEXT_URL}" 75 fetch_package "${GETTEXT_NAME}" "${GETTEXT_URL}"
77 fetch_package "${LIBOGG_NAME}" "${LIBOGG_URL}" 76 fetch_package "${LIBOGG_NAME}" "${LIBOGG_URL}"
@@ -80,6 +79,37 @@ fetch_all_packages()
80 fetch_package "${LIBMPEG2_NAME}" "${LIBMPEG2_URL}" 79 fetch_package "${LIBMPEG2_NAME}" "${LIBMPEG2_URL}"
81} 80}
82 81
82# $1 = package name
83# $2 = configure options
84build_toolchain_package()
85{
86 local build_retval=0
87 echo "building toolchain: $1..."
88 if ! cd contrib
89 then
90 echo "missing 'contrib' dir"
91 exit 1
92 fi
93 if ! ( tar xzf "$1.tar.gz" )
94 then
95 echo "error extracting $1"
96 exit 1
97 fi
98 if ! ( cd $1 && ./configure --prefix="${BUILD_DIR}/toolchain" \
99 $2 && \
100 make install )
101 then
102 echo "error building $1 for ${ARCH_NAME}"
103 build_retval=1
104 fi
105 rm -rf "$1"
106 cd ..
107 if [ $build_retval -eq 1 ]
108 then
109 exit 1
110 fi
111}
112
83# 113#
84# build native tools needed for building other packages 114# build native tools needed for building other packages
85# 115#
@@ -88,71 +118,33 @@ build_toolchain()
88 118
89 if [ ! -e "${BUILD_DIR}/toolchain/bin/make" ] 119 if [ ! -e "${BUILD_DIR}/toolchain/bin/make" ]
90 then 120 then
91 echo "building toolchain: ${GNUMAKE_NAME}..." 121 build_toolchain_package ${GNUMAKE_NAME} ""
92 cd contrib
93
94 tar xzf "${GNUMAKE_NAME}.tar.gz"
95 cd "${GNUMAKE_NAME}"
96 ./configure --prefix="${BUILD_DIR}/toolchain"
97 make install
98 cd ..
99 rm -rf "${GNUMAKE_NAME}"
100
101 cd ..
102 fi 122 fi
103 123
104 if [ ! -e "${BUILD_DIR}/toolchain/bin/msgfmt" ] 124 if [ ! -e "${BUILD_DIR}/toolchain/bin/msgfmt" ]
105 then 125 then
106 echo "building toolchain: ${GETTEXT_NAME}..." 126 build_toolchain_package "${GETTEXT_NAME}" \
107 cd contrib 127 "--disable-java \
108 128 --disable-native-java \
109 tar xzf "${GETTEXT_NAME}.tar.gz" 129 --without-emacs"
110 cd "${GETTEXT_NAME}"
111 ./configure --prefix="${BUILD_DIR}/toolchain" \
112 --disable-java \
113 --disable-native-java \
114 --without-emacs
115 make install
116 cd ..
117 rm -rf "${GETTEXT_NAME}"
118
119 cd ..
120 fi 130 fi
121 131
122 if [ ! -e "${BUILD_DIR}/toolchain/bin/dictionary-builder" ] 132 if [ ! -e "${BUILD_DIR}/toolchain/bin/dictionary-builder" ]
123 then 133 then
124 echo "building toolchain: dictionary-builder..." 134 echo "building toolchain: dictionary-builder..."
125 make clean 135 if ! ( make clean && \
126 ./configure --prefix="${BUILD_DIR}/toolchain" \ 136 ./configure --prefix="${BUILD_DIR}/toolchain" \
127 --disable-gsf \ 137 --disable-gsf \
128 --disable-gnome \ 138 --disable-gnome \
129 --disable-exiv2 \ 139 --disable-exiv2 \
130 --enable-printable 140 --enable-printable && \
131 make install 141 make install &&
132 cp src/plugins/printable/dictionary-builder \ 142 cp src/plugins/printable/dictionary-builder \
133 "${BUILD_DIR}/toolchain/bin" 143 "${BUILD_DIR}/toolchain/bin" )
144 then
145 exit 1
146 fi
134 fi 147 fi
135
136# if [ ! -e "${BUILD_DIR}/toolchain/bin/libtool" ]
137# then
138# cd contrib
139
140# tar xzf "${LIBTOOL_NAME}.tar.gz"
141# cd "${LIBTOOL_NAME}"
142 # Make libfool unable to find ANY .la files, because they
143 # invariably cause linking havoc with sysroot although
144 # they really shouldn't
145# cp libltdl/config/ltmain.sh libltdl/config/ltmain.sh.orig
146 # ugh, for the love of...
147# chmod +w libltdl/config/ltmain.sh
148 # XXX works for the tested version only
149# cat libltdl/config/ltmain.sh.orig | \
150# sed "s/found=yes/found=no/g" > libltdl/config/ltmain.sh
151# ./configure --prefix="${BUILD_DIR}/toolchain"
152# make install
153# cd ..
154# rm -rf "${LIBTOOL_NAME}"
155# fi
156} 148}
157 149
158# 150#
@@ -211,7 +203,7 @@ prepare_package()
211 for patchfile in $( ls $1-patch-* 2> /dev/null | sort ) 203 for patchfile in $( ls $1-patch-* 2> /dev/null | sort )
212 do 204 do
213 echo "applying $patchfile..." 205 echo "applying $patchfile..."
214 if ! ( cd $1 && cat "../$patchfile" | patch -p0 && cd .. ) 206 if ! ( cd $1 && cat "../$patchfile" | patch -p0 )
215 then 207 then
216 echo "error patching $1" 208 echo "error patching $1"
217 prepare_retval=1 209 prepare_retval=1
@@ -234,9 +226,9 @@ build_package()
234 if [ ! -e "${BUILD_DIR}/built-$1-${ARCH_NAME}" ] 226 if [ ! -e "${BUILD_DIR}/built-$1-${ARCH_NAME}" ]
235 then 227 then
236 echo "building $1 for ${ARCH_NAME}..." 228 echo "building $1 for ${ARCH_NAME}..."
237 if ! cd contrib/"$1" 229 if ! cd contrib
238 then 230 then
239 echo "missing \'contrib/$1\' dir" 231 echo "missing 'contrib' dir"
240 exit 1 232 exit 1
241 fi 233 fi
242 CC="${ARCH_CC}" 234 CC="${ARCH_CC}"
@@ -245,7 +237,7 @@ build_package()
245 CFLAGS="${OPT_FLAGS} -no-cpp-precomp ${ARCH_CFLAGS}" 237 CFLAGS="${OPT_FLAGS} -no-cpp-precomp ${ARCH_CFLAGS}"
246 CXXFLAGS="${CFLAGS}" 238 CXXFLAGS="${CFLAGS}"
247 LDFLAGS="${ARCH_LDFLAGS}" 239 LDFLAGS="${ARCH_LDFLAGS}"
248 if ! ( ./configure CC="${CC}" \ 240 if ! ( cd "$1" && ./configure CC="${CC}" \
249 CXX="${CXX}" \ 241 CXX="${CXX}" \
250 CPPFLAGS="${CPPFLAGS}" \ 242 CPPFLAGS="${CPPFLAGS}" \
251 CFLAGS="${CFLAGS}" \ 243 CFLAGS="${CFLAGS}" \
@@ -258,7 +250,6 @@ build_package()
258 echo "error building $1 for ${ARCH_NAME}" 250 echo "error building $1 for ${ARCH_NAME}"
259 build_retval=1 251 build_retval=1
260 fi 252 fi
261 cd ..
262 rm -rf "$1" 253 rm -rf "$1"
263 rm -v `find "${SDK_PATH}" -name "*.la"` 254 rm -v `find "${SDK_PATH}" -name "*.la"`
264 unset CC 255 unset CC
@@ -369,7 +360,8 @@ fi|g" > ./libtool
369 # use native dictionary-builder instead of the cross-built one 360 # use native dictionary-builder instead of the cross-built one
370 find ./ -type f -name "Makefile" | \ 361 find ./ -type f -name "Makefile" | \
371 xargs perl -pi -w -e "s#./dictionary-builder #${BUILD_DIR}/toolchain/bin/dictionary-builder #g;" 362 xargs perl -pi -w -e "s#./dictionary-builder #${BUILD_DIR}/toolchain/bin/dictionary-builder #g;"
372 if ! ( make DESTDIR="${SDK_PATH}" install && \ 363 if ! ( test $build_retval = 0 && \
364 make DESTDIR="${SDK_PATH}" install && \
373 touch "${BUILD_DIR}/built-Extractor-${ARCH_NAME}" ) 365 touch "${BUILD_DIR}/built-Extractor-${ARCH_NAME}" )
374 then 366 then
375 build_retval=1 367 build_retval=1
@@ -519,9 +511,8 @@ make_framework_link()
519{ 511{
520 local link_target="$1" 512 local link_target="$1"
521 local link_name="$2" 513 local link_name="$2"
522 local orig_dir=$(pwd)
523 echo "LN $link_name" 514 echo "LN $link_name"
524 if ! ( cd "${FINAL_FW_DIR}" && ln -sf "$link_target" "$link_name" && cd "${orig_dir}" ) 515 if ! ( cd "${FINAL_FW_DIR}" && ln -sf "$link_target" "$link_name" )
525 then 516 then
526 echo "error creating link" 517 echo "error creating link"
527 exit 1 518 exit 1
@@ -530,15 +521,13 @@ make_framework_link()
530 521
531make_framework_version_links() 522make_framework_version_links()
532{ 523{
533 orig_dir=$(pwd)
534 if ! ( cd "${FINAL_FW_BASE_DIR}/Versions" && \ 524 if ! ( cd "${FINAL_FW_BASE_DIR}/Versions" && \
535 ln -sf "${FW_VERSION}" "Current" && \ 525 ln -sf "${FW_VERSION}" "Current" && \
536 cd "${FINAL_FW_BASE_DIR}" && \ 526 cd "${FINAL_FW_BASE_DIR}" && \
537 ln -sf "Versions/Current/Headers" "Headers" && \ 527 ln -sf "Versions/Current/Headers" "Headers" && \
538 ln -sf "Versions/Current/Extractor" "Extractor" && \ 528 ln -sf "Versions/Current/Extractor" "Extractor" && \
539 ln -sf "Versions/Current/PlugIns" "PlugIns" && \ 529 ln -sf "Versions/Current/PlugIns" "PlugIns" && \
540 ln -sf "Versions/Current/Resources" "Resources" && \ 530 ln -sf "Versions/Current/Resources" "Resources" )
541 cd "${orig_dir}" )
542 then 531 then
543 echo "error creating standard framework links" 532 echo "error creating standard framework links"
544 exit 1 533 exit 1