From dde6aaf8b903c6b73e773f44cdbf2a62dd77cdde Mon Sep 17 00:00:00 2001 From: Jean-Paul Saman Date: Mon, 14 May 2007 12:07:35 +0000 Subject: [PATCH] Make it possible to force a distro.mak to use. This is helpfull in cross-compile situations to distinquish for a known target. --- extras/contrib/bootstrap | 57 ++++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/extras/contrib/bootstrap b/extras/contrib/bootstrap index 7fe6bf7a14..3ae923a6d8 100755 --- a/extras/contrib/bootstrap +++ b/extras/contrib/bootstrap @@ -24,9 +24,9 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. # *************************************************************************** -if test "$#" -gt "1"; then - echo "Usage: $0 " >&2 - echo " Prepare config.mak file." >&2 +if test "$#" -gt "2"; then + echo "Usage: $0 [distro]" >&2 + echo " Prepare config.mak and distro.mak file." >&2 exit 1 fi @@ -42,6 +42,13 @@ else HOST="$BUILD" fi +DISTRO= +if test "$#" = "2"; then + echo "Forcing distro.mak to use $2.mak" + DISTRO="$2" + HOST="$1" +fi + rm -f config.mak { echo "# Automatically generated by bootstrap." @@ -83,7 +90,7 @@ case $HOST in EXTRA_CFLAGS=" -D\${ENVP} -isysroot \${MACOSX_SDK} -mmacosx-version-min=\${SDK_TARGET}" EXTRA_LDFLAGS=" -isysroot \${MACOSX_SDK} -Wl,-syslibroot,\${MACOSX_SDK}" echo "PATH = /bin:/usr/bin:/usr/local/bin" >> config.mak - cat src/Distributions/darwin.mak >> distro.mak + cat src/Distributions/darwin.mak >> distro.mak ;; i686-apple-darwin8) SDK_TARGET=10.4 @@ -96,7 +103,7 @@ case $HOST in EXTRA_CFLAGS=" -D\${ENVP} -isysroot \${MACOSX_SDK} -mmacosx-version-min=\${SDK_TARGET}" EXTRA_LDFLAGS=" -isysroot \${MACOSX_SDK} -Wl,-syslibroot,\${MACOSX_SDK}" echo "PATH = /bin:/usr/bin:/usr/local/bin" >> config.mak - cat src/Distributions/darwin.mak >> distro.mak + cat src/Distributions/darwin.mak >> distro.mak ;; powerpc-apple-darwin9) SDK_TARGET=10.4 @@ -108,7 +115,7 @@ case $HOST in # EXTRA_CFLAGS=" -D\${ENVP} -isysroot \${MACOSX_SDK} -mmacosx-version-min=\${SDK_TARGET}" # EXTRA_LDFLAGS=" -isysroot \${MACOSX_SDK} -Wl,-syslibroot,\${MACOSX_SDK}" echo "PATH = /bin:/usr/bin:/usr/local/bin" >> config.mak - cat src/Distributions/darwin.mak >> distro.mak + cat src/Distributions/darwin.mak >> distro.mak ;; i686-apple-darwin9) SDK_TARGET=10.4 @@ -121,7 +128,7 @@ case $HOST in # EXTRA_CFLAGS=" -D\${ENVP} -isysroot \${MACOSX_SDK} -mmacosx-version-min=\${SDK_TARGET}" # EXTRA_LDFLAGS=" -isysroot \${MACOSX_SDK} -Wl,-syslibroot,\${MACOSX_SDK}" echo "PATH = /bin:/usr/bin:/usr/local/bin" >> config.mak - cat src/Distributions/darwin.mak >> distro.mak + cat src/Distributions/darwin.mak >> distro.mak ;; i586-pc-beos) echo "HAVE_BEOS = 1" >> config.mak @@ -173,21 +180,27 @@ case $HOST in ;; *) if test "$HOST" = "$BUILD"; then - if test -d "/usr/lib/pkgconfig"; then - if test -z "$PKG_CONFIG_PATH"; then - echo "PKG_CONFIG_PATH = /usr/lib/pkgconfig" >> config.mak - fi - if test -z "$PKG_CONFIG_LIBDIR"; then - echo "PKG_CONFIG_LIBDIR = /usr/lib/pkgconfig" >> config.mak - fi - fi - fi - # Try to match distribution - if test -f /etc/fedora-release; then - cat src/Distributions/fedora.mak >> distro.mak - else - # Default Unix-like systems - cat src/Distributions/unix.mak >> distro.mak + if test -d "/usr/lib/pkgconfig"; then + if test -z "$PKG_CONFIG_PATH"; then + echo "PKG_CONFIG_PATH = /usr/lib/pkgconfig" >> config.mak + fi + if test -z "$PKG_CONFIG_LIBDIR"; then + echo "PKG_CONFIG_LIBDIR = /usr/lib/pkgconfig" >> config.mak + fi + fi + # Try to match distribution + if test -f /etc/fedora-release; then + cat src/Distributions/fedora.mak >> distro.mak + else + # Default Unix-like systems + cat src/Distributions/unix.mak >> distro.mak + fi + else # unknown distro + if test ! -z "${DISTRO}"; then + cat src/Distributions/${DISTRO}.mak >> distro.mak + else + cat src/Distributions/unix.mak >> distro.mak + fi fi ;; esac -- 2.20.1