fi
chmod a+x $l
if [ -n "${freetypedir}" ] && [ -d "${freetypedir}" ] ; then
- sed -e "s%\(.*\)\([[:space:]].*-L.*/freetype-[0-9]\.[0-9]\.[0-9]/lib[[:space:]]\)\(.*\)%\1 -L${freetypedir}/lib \3%g" \
- -e 's%\(.*\)\([[:space:]].*libfreetype.la\)\(.*\)%\1 -lfreetype \3%g' $l > _$l
+ sed -e "s%-L[^[:space:]]*/freetype[^[:space:]]*/lib%-L${freetypedir}/lib%g" \
+ -e "s%[^[:space:]]*/freetype[^[:space:]]*/lib/libfreetype.la%-lfreetype%g" $l > _$l
mv -f _$l $l
fi
chmod a+x $l
cd ${PRODUCT_DIR}/lib
sed -i "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g;" libfreetype.la
+# modify pkgconfig
+if [ -d ${PRODUCT_DIR}/lib/pkgconfig ] ; then
+ cd ${PRODUCT_DIR}/lib/pkgconfig
+ for l in X `find . -name "*.pc"`; do
+ if [ "${l}" != "X" ] ; then
+ sed -i "s%prefix=.*%prefix=${PRODUCT_DIR}%g" ${l}
+ fi
+ done
+fi
+
# to generate environment script for sources
try_preinstalled
}
### modifing la files
cd ${PRODUCT_DIR}/lib
sed -i "s%\(.*\)\([[:space:]].*libfreetype.la\)\(.*\)%\1 -lfreetype\3%g;s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" libftgl.la
-
-tmp=""
-if [ -n "${FREETYPEDIR}" ]; then
- tmp="-L${FREETYPEDIR}/lib"
+sed -i "s%\(.*\)\([[:space:]].*-L.*/freetype-[0-9]\.[0-9]\.[0-9]/lib[[:space:]]\)\(.*\)%\1 -L${FREETYPEDIR}/lib \3%g" libftgl.la
+
+# modify pkgconfig
+if [ -d ${PRODUCT_DIR}/lib/pkgconfig ] ; then
+ cd ${PRODUCT_DIR}/lib/pkgconfig
+ for l in X `find . -name "*.pc"`; do
+ if [ "${l}" != "X" ] ; then
+ sed -i "s%prefix=.*%prefix=${PRODUCT_DIR}%g;s%-L[^[:space:]]*/freetype[^[:space:]]*/lib%-L${FREETYPEDIR}/lib%g;s%-I[^[:space:]]*/freetype[^[:space:]]*/include%-I${FREETYPEDIR}/include%g" ${l}
+ fi
+ done
fi
-sed -i "s%\(.*\)\([[:space:]].*-L.*/freetype-[0-9]\.[0-9]\.[0-9]/lib[[:space:]]\)\(.*\)%\1 $tmp \3%g" libftgl.la
# to generate environment script for sources
try_preinstalled
### modify libhdf5.la file to correct direct path to hdf5 library
### no need to do this for sources installation because 'make install' does it!
cd ${PRODUCT_DIR}/lib
-sed -e "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" libhdf5.la > libhdf5.la.new
-mv -f libhdf5.la.new libhdf5.la
+sed -i "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" libhdf5.la
if [ -e libhdf5_hl.la ] ; then
- sed -e "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" libhdf5_hl.la > libhdf5_hl.la.new
- mv -f libhdf5_hl.la.new libhdf5_hl.la
+ sed -i "s%\(.*\)\([[:space:]].*libhdf5.la\)\(.*\)%\1 ${PRODUCT_DIR}/lib/libhdf5.la\3%g;s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" libhdf5_hl.la
fi
# to generate environment script for sources
fi
chmod a+x libnglib.la
if [ -n "${freeimagedir}" ] && [ -d "${freeimagedir}" ] ; then
- sed -e "s%\(.*\)\([[:space:]].*-L.*/freeimage-[0-9]\.[0-9]\.[0-9]/lib[[:space:]]\)\(.*\)%\1 -L${freeimagedir}/lib \3%g" libnglib.la > _libnglib.la
- mv -f _libnglib.la libnglib.la
-fi
-chmod a+x libnglib.la
-if [ -n "${freeimagedir}" ] && [ -d "${freeimagedir}" ] ; then
- sed -e "s%\(.*\)\([[:space:]].*-L.*/freeimage-[0-9]\.[0-9][0-9]\.[0-9]/lib[[:space:]]\)\(.*\)%\1 -L${freeimagedir}/lib \3%g" libnglib.la > _libnglib.la
+ sed -e "s%\(.*\)\([[:space:]].*-L.*/freeimage[^[:space:]]*/lib[[:space:]]\)\(.*\)%\1 -L${freeimagedir}/lib \3%g" libnglib.la > _libnglib.la
mv -f _libnglib.la libnglib.la
fi
chmod a+x libnglib.la