[PATCH v2 util/modular] build.sh: Simplify checks for ACLOCAL, PKG_CONFIG_PATH, etc.

Peter Hutterer peter.hutterer at who-t.net
Thu May 13 18:06:18 PDT 2010


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
Changes to previous version:
- incorporated dan's suggestion for the path appendix to avoid appending an
  empty ":" at the end.

 build.sh |   24 ++++++------------------
 1 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/build.sh b/build.sh
index 1ba8bf5..e4137d0 100755
--- a/build.sh
+++ b/build.sh
@@ -781,34 +781,22 @@ $SUDO mkdir -p ${ACLOCAL_LOCALDIR}
 
 # The following is required to make aclocal find our .m4 macros
 if test x"$ACLOCAL" = x; then
-    ACLOCAL="aclocal -I ${ACLOCAL_LOCALDIR}"
-else
-    ACLOCAL="${ACLOCAL} -I ${ACLOCAL_LOCALDIR}"
+    ACLOCAL="aclocal"
 fi
+
+ACLOCAL="${ACLOCAL} -I ${ACLOCAL_LOCALDIR}"
 export ACLOCAL
 
 # The following is required to make pkg-config find our .pc metadata files
-if test x"$PKG_CONFIG_PATH" = x; then
-    PKG_CONFIG_PATH=${DESTDIR}${PREFIX}/share/pkgconfig:${DESTDIR}${PREFIX}/${LIBDIR}/pkgconfig
-else
-    PKG_CONFIG_PATH=${DESTDIR}${PREFIX}/share/pkgconfig:${DESTDIR}${PREFIX}/${LIBDIR}/pkgconfig:${PKG_CONFIG_PATH}
-fi
+PKG_CONFIG_PATH=${DESTDIR}${PREFIX}/share/pkgconfig:${DESTDIR}${PREFIX}/${LIBDIR}/pkgconfig${PKG_CONFIG_PATH+:$PKG_CONFIG_PATH}
 export PKG_CONFIG_PATH
 
 # Set the library path so that locally built libs will be found by apps
-if test x"$LD_LIBRARY_PATH" = x; then
-    LD_LIBRARY_PATH=${DESTDIR}${PREFIX}/${LIBDIR}
-else
-    LD_LIBRARY_PATH=${DESTDIR}${PREFIX}/${LIBDIR}:${LD_LIBRARY_PATH}
-fi
+LD_LIBRARY_PATH=${DESTDIR}${PREFIX}/${LIBDIR}${LD_LIBRARY_PATH+:$PATH}
 export LD_LIBRARY_PATH
 
 # Set the path so that locally built apps will be found and used
-if test x"$PATH" = x; then
-    PATH=${DESTDIR}${PREFIX}/bin
-else
-    PATH=${DESTDIR}${PREFIX}/bin:${PATH}
-fi
+PATH=${DESTDIR}${PREFIX}/bin${PATH+:$PATH}
 export PATH
 
 # Choose which make program to use
-- 
1.7.0.1



More information about the xorg-devel mailing list