summaryrefslogtreecommitdiffstats
path: root/contrib/mingw
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2006-07-21 00:04:20 +0000
committerChris Johns <chrisj@rtems.org>2006-07-21 00:04:20 +0000
commitbe77d1f0c0a066b1af5f5a9926b3a981648f8d60 (patch)
tree2780749704b0aed90bb1e7635a8461a430ddd585 /contrib/mingw
parentUse gcc-core-4.1.1-rtems-20060720.diff. (diff)
downloadrtems-be77d1f0c0a066b1af5f5a9926b3a981648f8d60.tar.bz2
Add NSIS installer support for MinGW.
Diffstat (limited to 'contrib/mingw')
-rwxr-xr-xcontrib/mingw/build-exes.sh204
-rw-r--r--contrib/mingw/rtems-tools.nsi156
-rw-r--r--contrib/mingw/rtems.ini56
-rw-r--r--contrib/mingw/rtems_logo.bmpbin0 -> 143022 bytes
4 files changed, 416 insertions, 0 deletions
diff --git a/contrib/mingw/build-exes.sh b/contrib/mingw/build-exes.sh
new file mode 100755
index 0000000000..e7c4f511cd
--- /dev/null
+++ b/contrib/mingw/build-exes.sh
@@ -0,0 +1,204 @@
+#
+# $Id$
+#
+# RTEMS Build Executable Installers script.
+#
+# This script takes the RPM files built using the crossrpms/build-rpms.sh
+# script.
+#
+
+terminate()
+{
+ echo "error: $*" >&2
+ exit 1
+}
+
+check()
+{
+ if [ $? -ne 0 ]; then
+ terminate
+ fi
+}
+
+version=4.7
+
+target_list="i386 m68k powerpc sparc arm mips"
+
+mingw32_cpu_list="i686"
+
+rpm_topdir=$(rpmbuild --showrc | grep "\?\?\: _topdir" | sed 's/.*:.*_topdir\t*//')
+
+common_label="base"
+local_rpm_database=yes
+targets=$target_list
+run_prefix=
+relocation=
+
+source=$(dirname $0)
+
+if [ "$source" = "." ]; then
+ source=$(pwd)
+fi
+
+while [ $# -gt 0 ];
+do
+ case $1 in
+ -d)
+ set -x
+ ;;
+ -l)
+ shift
+ rpm_prefix=$1-
+ rpm_prefix_arg="--enable-rpmprefix=$rpm_label"
+ ;;
+ -n)
+ run_prefix="echo "
+ ;;
+ -p)
+ shift
+ prefix=$1
+ ;;
+ -R)
+ local_rpm_database=no
+ ;;
+ -r)
+ shift
+ relocation=$1
+ ;;
+ -t)
+ shift
+ targets=$1
+ ;;
+ -v)
+ shift
+ version=$1
+ ;;
+ --help)
+ echo "$0 -??"
+ exit 2
+ ;;
+ *)
+ terminate "error: invalid option (try --help): $1"
+ ;;
+ esac
+ shift
+done
+
+cd=${run_prefix}cd
+cp=${run_prefix}cp
+make=${run_prefix}make
+makensis=${run_prefix}makensis
+mkdir=${run_prefix}mkdir
+rm=${run_prefix}rm
+rpmbuild=${run_prefix}rpmbuild
+rpm=${run_prefix}rpm
+
+if [ -z "$relocation" ]; then
+ terminate "error: a relocation path needs to be specified"
+fi
+
+if [ $local_rpm_database = yes ]; then
+ rpm_database="--dbpath $prefix/var/lib/rpm"
+else
+ rpm_database=
+fi
+
+get_rpm_list()
+{
+ echo $(ls $rpm_topdir/mingw32/RPMS/$1/*.rpm | grep -v "debuginfo" | grep $2)
+}
+
+#
+# Handle each type of host processor.
+#
+for p in $mingw32_cpu_list
+do
+ common_rpms=$(get_rpm_list $p base)
+
+ rpm_options="--ignoreos --force --nodeps --noorder "
+
+ for t in $targets
+ do
+ rpms=$(get_rpm_list $p $t)
+ if [ -n "$rpms" ]; then
+ echo "Clean the relocation directory"
+ $rm -rf $relocation
+
+ for r in $common_rpms $rpms
+ do
+ echo "rpm $rpm_database --relocate $prefix=$relocation $rpm_options -i $r"
+ $rpm $rpm_database --relocate $prefix=$relocation $rpm_options -i $r
+ done
+
+ files=$(find $relocation -type f | sed -e "s/^$(echo ${relocation} | sed 's/\//\\\//g')//" -e "s/^\///" | sort)
+
+ of=$relocation/rtems-files.nsi
+
+ echo "!macro RTEMS_INSTALL_FILES" > $of
+ echo " !ifndef EMPTY_INSTALLER" >> $of
+
+ install_dir=
+
+ for f in $files
+ do
+ d=$(dirname $f)
+ if [ "$install_dir" != "$d" ]; then
+ id=$(echo $d | sed -e 's/\//\\/g' -e 's/\/$//')
+ echo " SetOutPath \"\$INSTDIR\\$id\"" >> $of
+ install_dir=$d
+ fi
+ echo " File \"$relocation/$f\"" >> $of
+ done
+
+ echo " !endif" >> $of
+ echo "!macroend" >> $of
+
+ echo "!macro RTEMS_DELETE_FILES" >> $of
+ echo " !ifndef EMPTY_INSTALLER" >> $of
+
+ remove_dirs=
+ remove_dir=
+
+ for f in $files
+ do
+ d=$(dirname $f)
+ if [ "$remove_dir" != "$d" ]; then
+ remove_dirs="$remove_dirs $d"
+ remove_dir=$d
+ fi
+ rf=$(echo $f | sed -e 's/\//\\/g' -e 's/\/$//')
+ echo " Delete \"\$INSTDIR\\$rf\"" >> $of
+ done
+
+ remove_dirs=$(for r in $remove_dirs; do echo $r; done | sort -r -u)
+
+ for d in $remove_dirs
+ do
+ if [ "$d" = "." ]; then
+ d=
+ fi
+ rd=$(echo $d | sed -e 's/\//\\/g' -e 's/\/$//')
+ echo " RMDir \"\$INSTDIR\\$rd\"" >> $of
+ done
+
+ echo " !endif" >> $of
+ echo "!macroend" >> $of
+
+ of=$relocation/rtems.nsi
+ echo "!define RTEMS_TARGET \"$t\"" > $of
+ echo "!define RTEMS_VERSION \"$version\"" >> $of
+ echo "!define RTEMS_PREFIX \"rtems-tools\"" >> $of
+ echo "!define RTEMS_LOGO \"$source/rtems_logo.bmp\"" >> $of
+ echo "!define RTEMS_BINARY \"$rpm_topdir\"" >> $of
+ echo "!include \"$relocation/rtems-files.nsi\"" >> $of
+ echo "!include \"$source/rtems-tools.nsi\"" >> $of
+
+ echo "cp $source/rtems.ini $relocation/rtems.ini"
+ $cp $source/rtems.ini $relocation/rtems.ini
+
+ echo "makensis $of"
+ $makensis $of
+
+ fi
+ done
+done
diff --git a/contrib/mingw/rtems-tools.nsi b/contrib/mingw/rtems-tools.nsi
new file mode 100644
index 0000000000..14b4672853
--- /dev/null
+++ b/contrib/mingw/rtems-tools.nsi
@@ -0,0 +1,156 @@
+;
+; $Id$
+;
+; RTEMS Tools Installer.
+;
+; Copyright Chris Johns (chrisj@rtems.org)
+;
+
+;!define EMPTY_INSTALLER
+
+!define PRODUCT_NAME "RTEMS Tools"
+!define PRODUCT_VERSION ${RTEMS_VERSION}
+!define PRODUCT_PUBLISHER "RTEM Project Team"
+!define PRODUCT_WEB_SITE "http://www.rtems.org/"
+
+; MUI 1.66 compatible ------
+!include "MUI.nsh"
+
+; MUI Settings
+!define MUI_ABORTWARNING
+!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\win-install.ico"
+!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\win-uninstall.ico"
+
+!define MUI_HEADERIMAGE
+!define MUI_HEADERIMAGE_BITMAP "${RTEMS_LOGO}"
+
+!define MUI_COMPONENTSPAGE_SMALLDESC
+
+; Welcome page
+!insertmacro MUI_PAGE_WELCOME
+; Components page
+; Details of what will happen.
+Page custom RTEMSMessage
+!insertmacro MUI_PAGE_COMPONENTS
+; Directory page
+!insertmacro MUI_PAGE_DIRECTORY
+; Instfiles page
+!insertmacro MUI_PAGE_INSTFILES
+; Finish page
+!insertmacro MUI_PAGE_FINISH
+
+; Uninstaller pages
+!insertmacro MUI_UNPAGE_INSTFILES
+
+; Language files
+!insertmacro MUI_LANGUAGE "English"
+
+; Reserve files
+!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
+
+; MUI end ------
+
+ReserveFile "rtems.ini"
+!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
+
+Name "${PRODUCT_NAME} ${PRODUCT_VERSION} (${RTEMS_TARGET})"
+OutFile "${RTEMS_BINARY}/rtems${PRODUCT_VERSION}-${RTEMS_TARGET}-${RTEMS_VERSION}.exe"
+InstallDir "C:\rtems"
+ShowInstDetails show
+ShowUnInstDetails show
+BrandingText "RTEMS ${RTEMS_TARGET} Tools v${PRODUCT_VERSION}"
+AllowRootDirInstall false
+AutoCloseWindow false
+CRCCheck force
+
+Section "RTEMS ${RTEMS_TARGET} Tools" SecTools
+ !insertmacro RTEMS_INSTALL_FILES
+SectionEnd
+
+Function .onInit
+ ;Extract InstallOptions INI files
+ !insertmacro MUI_INSTALLOPTIONS_EXTRACT "rtems.ini"
+FunctionEnd
+
+Function RTEMSMessage
+
+ !insertmacro MUI_HEADER_TEXT \
+ "RTEMS Tools (${RTEMS_TARGET})" \
+ "A tool set for the RTEMS operating system."
+
+ ;Display the Install Options dialog
+
+ Push $R0
+ Push $R1
+ Push $R2
+
+ InstallOptions::initDialog /NOUNLOAD "$PLUGINSDIR\rtems.ini"
+ Pop $R0
+
+ GetDlgItem $R1 $R0 1200 ;1200 + Field number - 1
+ ;$R1 contains the HWND of the first field
+ CreateFont $R2 "Tahoma" "8" "300"
+ SendMessage $R1 ${WM_SETFONT} $R2 0
+
+ GetDlgItem $R1 $R0 1201 ;1200 + Field number - 1
+ ;$R1 contains the HWND of the first field
+ CreateFont $R2 "Tahoma" "12" "700"
+ SendMessage $R1 ${WM_SETFONT} $R2 0
+
+ GetDlgItem $R1 $R0 1202 ;1200 + Field number - 1
+ ;$R1 contains the HWND of the first field
+ CreateFont $R2 "Tahoma" "9" "550"
+ SendMessage $R1 ${WM_SETFONT} $R2 0
+
+ GetDlgItem $R1 $R0 1203 ;1200 + Field number - 1
+ ;$R1 contains the HWND of the first field
+ CreateFont $R2 "Tahoma" "9" "550"
+ SendMessage $R1 ${WM_SETFONT} $R2 0
+
+ GetDlgItem $R1 $R0 1204 ;1200 + Field number - 1
+ ;$R1 contains the HWND of the first field
+ CreateFont $R2 "Tahoma" "9" "550"
+ SendMessage $R1 ${WM_SETFONT} $R2 0
+
+ GetDlgItem $R1 $R0 1205 ;1200 + Field number - 1
+ ;$R1 contains the HWND of the first field
+ CreateFont $R2 "Tahoma" "9" "550"
+ SendMessage $R1 ${WM_SETFONT} $R2 0
+
+ InstallOptions::show
+ Pop $R0
+
+ Pop $R2
+ Pop $R1
+ Pop $R0
+
+FunctionEnd
+
+Section -Post
+ WriteUninstaller "$INSTDIR\uninst.exe"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
+ "DisplayName" "$(^Name)"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
+ "UninstallString" "$INSTDIR\uninst.exe"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
+ "DisplayVersion" "${PRODUCT_VERSION}"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
+ "URLInfoAbout" "${PRODUCT_WEB_SITE}"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
+ "Publisher" "${PRODUCT_PUBLISHER}"
+SectionEnd
+
+Function un.onInit
+ MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 \
+ "Are you sure you want to uninstall RTEMS Tools?" IDYES +2
+ Abort
+FunctionEnd
+
+Section Uninstall
+ Delete $INSTDIR\Uninst.exe
+ DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
+ DetailPrint "Delete the install directory"
+ !insertmacro RTEMS_DELETE_FILES
+ DetailPrint "All done."
+ SetAutoClose true
+SectionEnd
diff --git a/contrib/mingw/rtems.ini b/contrib/mingw/rtems.ini
new file mode 100644
index 0000000000..52457e9127
--- /dev/null
+++ b/contrib/mingw/rtems.ini
@@ -0,0 +1,56 @@
+;
+; $Id$
+; Ini file generated by the HM NIS Edit IO designer.
+;
+[Settings]
+NumFields=6
+
+[Field 1]
+Type=Label
+Text=RTEMS Tools for Windows is a set of MinGW tools suitable for compiling RTEMS and RTEMS applications. You should install download and install the MinGW runtime and if you wish to build RTEMS or need autoconf or automake support the MSYS packages as well. You can find the MinGW and MSYS installers on the MinGW web site.
+Left=0
+Right=305
+Top=25
+Bottom=108
+
+[Field 2]
+Type=Label
+Text=RTEMS Tools for Windows
+Left=75
+Right=297
+Top=0
+Bottom=12
+
+[Field 3]
+Type=Label
+Text=RTEMS Project Website
+Left=5
+Right=110
+Top=112
+Bottom=120
+
+[Field 4]
+Type=Link
+Text=http://www.rtems.org/
+State=http://www.rtems.org/
+Left=6
+Right=150
+Top=115
+Bottom=155
+
+[Field 5]
+Type=Label
+Text=MinGW Project
+Left=190
+Right=297
+Top=112
+Bottom=120
+
+[Field 6]
+Type=Link
+Text=http://www.mingw.org/
+State=http://www.mingw.org/
+Left=190
+Right=306
+Top=115
+Bottom=155
diff --git a/contrib/mingw/rtems_logo.bmp b/contrib/mingw/rtems_logo.bmp
new file mode 100644
index 0000000000..ee5cd3dbda
--- /dev/null
+++ b/contrib/mingw/rtems_logo.bmp
Binary files differ