Skip to content

Commit

Permalink
Fixes: MB#4014 - prefix of pc files are statically set to /usr
Browse files Browse the repository at this point in the history
By: Halton Huo
RevBy: Tomas Junnonen
Details: The configure script now substitutes the paths in the pc
files according the specified prefix.
  • Loading branch information
Tomas Junnonen committed Jul 26, 2010
1 parent ac1039f commit 6961d43
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -43,3 +43,4 @@ build-i386
build-armel
.qmake.cache
mmoc/mmoc
*.pc
23 changes: 23 additions & 0 deletions configure
Expand Up @@ -635,6 +635,29 @@ else
mv -f "$MEEGOTOUCH_DEFINES_PRF.tmp" "$MEEGOTOUCH_DEFINES_PRF"
fi

# substitute prefix in .pc files
MEEGOTOUCH_PC_DIR="$outpath/src/data"
MEEGOTOUCH_PC_FILES="meegotouch
meegotouchcore
meegotouchsettings
"

for i in $MEEGOTOUCH_PC_FILES
do
pc_file="$MEEGOTOUCH_PC_DIR/$i.pc"
cat "$pc_file.in" \
| sed -e "s,@@M_UNIX_INSTALL_PREFIX@@,$M_INSTALL_PREFIX,g" \
> "$pc_file.tmp"

# replace meegotouch_defines.prf if it differs from the newly created temp file
if cmp -s "$pc_file.tmp" "$pc_file"; then
rm -f "$pc_file.tmp"
else
mv -f "$pc_file.tmp" "$pc_file"
fi

done

#-------------------------------------------------------------------------------
# build makefiles based on the configuration
#-------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion projects.pro
Expand Up @@ -93,7 +93,7 @@ include(doc/doc.pri)
# note: proper way to clean up extradata would be running pkgdata --clean...
# but listing *.a & *.o is easier with qmake
QMAKE_CLEAN += lib/libmeegotouch* build-stamp configure-stamp tests/*/*.log.xml tests/*/*.log *.log.xml *.log **/*.gcda extradata/*.o extradata/*.a
QMAKE_DISTCLEAN += lib/libmeegotouch* build-stamp configure-stamp tests/*/*.log.xml tests/*/*.log *.log.xml *.log **/*.gcda extradata/*.o extradata/*.a mkspecs/meegotouchconfig.pri
QMAKE_DISTCLEAN += lib/libmeegotouch* build-stamp configure-stamp tests/*/*.log.xml tests/*/*.log *.log.xml *.log **/*.gcda extradata/*.o extradata/*.a mkspecs/meegotouchconfig.pri src/data/*.pc

check.target = check
check.CONFIG = recursive
Expand Down
2 changes: 1 addition & 1 deletion src/data/meegotouch.pc → src/data/meegotouch.pc.in
@@ -1,4 +1,4 @@
prefix=/usr
prefix=@@M_UNIX_INSTALL_PREFIX@@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include/meegotouch
Expand Down
@@ -1,4 +1,4 @@
prefix=/usr
prefix=@@M_UNIX_INSTALL_PREFIX@@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include/meegotouch
Expand Down
@@ -1,4 +1,4 @@
prefix=/usr
prefix=@@M_UNIX_INSTALL_PREFIX@@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include/meegotouch
Expand Down

0 comments on commit 6961d43

Please sign in to comment.