3 # Familiar Build Setup Script
5 # Copyright (C) 2006 Rene Wagner <rw@handhelds.org>
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 BASE_TITLE="Familiar Build Setup:"
23 FAMILIAR_RELEASE="0.8.4"
31 zenity --error --text="$1"
35 zenity --info --text="Setup aborted."
39 which zenity > /dev/null || fatal "You must have zenity installed."
42 while [ ! -d ${BASE_DIR}/org.handhelds.familiar ]; do
43 BASE_DIR=`zenity --file-selection --directory --filename=${BASE_DIR} --title="${BASE_TITLE} Select Build Tree Base Directory"`
46 if [ ! -d ${BASE_DIR}/org.handhelds.familiar ]; then
47 error "Does not look like a Familiar build tree: ${BASE_DIR}"
57 DL_DIR="${BASE_DIR}/downloads"
58 DL_DIR=`zenity --entry \
59 --title="${BASE_TITLE} Downloads Directory" \
60 --text="Where do you want downloaded files to be stored?" \
61 --entry-text="${DL_DIR}"`
69 while [ -z "$MACHINE" ]; do
70 MACHINE=`zenity --list \
72 --title="${BASE_TITLE} Target Machine" \
73 --text="Select a target machine type from the list below:" \
74 --column="Name" --column="Description" \
75 "h3600" "HP iPAQ h36xx/h37xx/h38xx Series" \
76 "h3900" "HP iPAQ h39xx/h51xx/h54xx/h55xx Series" \
77 "h2200" "HP iPAQ h22xx Series" \
78 "ipaq-pxa270" "HP iPAQ hx4700 Series" \
79 "h6300" "HP iPAQ h63xx Series"`
82 if [ -z "$MACHINE" ]; then
83 error "Please select a target machine."
93 while [ -z "$GRAPHICAL_ENV" ]; do
94 GRAPHICAL_ENV=`zenity --list \
96 --title="${BASE_TITLE} Primary Graphical Environment" \
97 --text="Select the graphical environment you want to build for from the list below:" \
98 --column="Name" --column="Description" \
99 "gpe" "The GPE Palmtop Environment. X11 based." \
100 "opie" "The Open Palmtop Integrated Environment. Qt/Embedded based." \
101 "any" "No preference. This may break certain things."`
104 if [ -z "$GRAPHICAL_ENV" ]; then
105 error "Please select a graphical environment."
115 BUILD_DIR="${BASE_DIR}/build-${MACHINE}-${GRAPHICAL_ENV}"
117 BUILD_DIR=`zenity --entry \
118 --title="${BASE_TITLE} Build Directory" \
119 --text="A build directory will be created for the configuration you selected at the following location:" \
120 --entry-text="${BUILD_DIR}"`
127 if [ -z ${BUILD_DIR} ]; then
128 error "Please specify a build directory."
131 if [ -d ${BUILD_DIR} ]; then
132 error "${BUILD_DIR} exists."
139 mkdir -p ${BUILD_DIR}/conf
140 CONFFILE="${BUILD_DIR}/conf/auto.conf"
141 cat > ${CONFFILE} <<EOF
142 # Auto-generated Familiar Build Configuration
144 DISTRO="familiar-${FAMILIAR_RELEASE}"
146 # where to store downloaded files
149 # list of .bb files as a shell glob
150 BBFILES = "${BASE_DIR}/org.handhelds.familiar/packages/*/*bb"
152 # top level build directory for this configuration
153 TOPDIR = "${BUILD_DIR}"
156 MACHINE = "${MACHINE}"
160 if [ "${GRAPHICAL_ENV}" == "gpe" ]; then
161 cat >> ${CONFFILE} <<EOF
162 # X11 specific settings
163 PREFERRED_PROVIDERS += " virtual/libsdl:libsdl-x11"
166 elif [ "${GRAPHICAL_ENV}" == "opie" ]; then
167 cat >> ${CONFFILE} <<EOF
168 # Opie specific settings
169 PREFERRED_PROVIDERS += " virtual/libsdl:libsdl-qpe"
174 ENVSCRIPT="${BUILD_DIR}/conf/env.sh"
175 cat > ${ENVSCRIPT} <<EOF
176 PATH="${BASE_DIR}/bitbake/bin:${PATH}"
177 BBPATH="${BUILD_DIR}:${BASE_DIR}/org.handhelds.familiar"
183 --title="${BASE_TITLE} Setup Complete" \
184 --text="Your configuration was written to ${CONFFILE}. It will be displayed after this dialog. Please verify that all settings are correct. To re-start the setup please delete the build directory and re-run the setup tool."
187 --width=600 --height=400 \
188 --title="${BASE_TITLE} Configuration Written to ${CONFFILE}" \
189 --filename="${CONFFILE}"
192 --title="${BASE_TITLE} Running a Build" \
193 --text="Please run the following command before attempting to run a build: \"$ source ${ENVSCRIPT}\". It will configure the environment so you can run bitbake."