-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompileit
More file actions
executable file
·212 lines (170 loc) · 6.35 KB
/
compileit
File metadata and controls
executable file
·212 lines (170 loc) · 6.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
#!/bin/sh
alias cp='busybox cp -a'
alias cut='busybox cut'
alias date='busybox date'
alias du='busybox du'
alias mkdir='busybox mkdir -p'
alias rm='busybox rm -rf'
alias sed='busybox sed'
alias tar='busybox tar'
PROGRAM="fluff"
STARTDIR="$PWD"
PACKAGEDIR="$STARTDIR/package"
PREFIX="/usr/local"
DESTDIR="$PACKAGEDIR/$PREFIX"
SRCDIR="src"
OPTIMIZE="-Os"
SYMBOLS=""
FLTO="-flto"
TOOLCHAIN="compiletc sstrip submitqc"
BUILD_DEPS="fltk-1.4-dev"
PACKAGE_DEPS="fltk-1.4"
GDEBUG="No"
# Uncomment the next line to compile a version that can be run under gdb.
#GDEBUG="Debug"
if [ "$GDEBUG" == "Debug" ]
then
# -flto gets removed because it interferes with gdb being able to display
# code listings.
OPTIMIZE=""
SYMBOLS="-ggdb"
FLTO=""
fi
PROCESSOR_TYPE=`uname -m`
echo "$PROCESSOR_TYPE detected."
case "$PROCESSOR_TYPE" in
i686)
CXXFLAGS="$FLTO -march=i486 -mtune=i686 $OPTIMIZE $SYMBOLS -pipe -Wall -Wextra -fno-exceptions -fno-rtti -Di686"
LDFLAGS="-Wl,-T/usr/local/lib/ldscripts/elf_i386.xbn"
;;
x86_64)
CXXFLAGS="$FLTO -mtune=generic $OPTIMIZE $SYMBOLS -pipe -Wall -Wextra -fno-exceptions -fno-rtti"
LDFLAGS="-Wl,-T/usr/local/lib/ldscripts/elf_x86_64.xbn"
;;
armv*)
CXXFLAGS="$FLTO -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp $OPTIMIZE $SYMBOLS -pipe -Wall -Wextra -fno-exceptions -fno-rtti"
LDFLAGS=""
;;
aarch64)
CXXFLAGS="$FLTO -march=armv8-a+crc -mtune=cortex-a72 $OPTIMIZE $SYMBOLS -pipe -Wall -Wextra -fno-exceptions -fno-rtti"
LDFLAGS=""
;;
*)
echo "$PROCESSOR_TYPE: Unknown processor type. Please add an entry for it in this script."
exit
;;
esac
# Download packages required for compiling, filter out success messages.
#tce-load -w "$TOOLCHAIN $BUILD_DEPS" 2>&1 | grep -v "already downloaded"
# Install packages required for compiling, filter out success messages.
#tce-load -i "$TOOLCHAIN $BUILD_DEPS" 2>&1 | grep -v "already installed"
cd "$STARTDIR/$SRCDIR"
CXXFLAGS="$CXXFLAGS -std=c++03 -Wno-unused-parameter -Wno-missing-field-initializers -c "$PROGRAM".cpp"
echo -e "\nCXXFLAGS=$CXXFLAGS\n"
# Build "$PROGRAM"
g++ $CXXFLAGS
LDFLAGS="$LDFLAGS "$PROGRAM".o -o "$PROGRAM" -L/usr/lib -lfltk -lfltk_images -lfltk_forms -lpng -lstdc++"
echo -e "LDFLAGS=$LDFLAGS\n"
# Link "$PROGRAM"
g++ $LDFLAGS
size "$PROGRAM".o "$PROGRAM"
ls -l "$PROGRAM"
if [ "$GDEBUG" == "No" ]
then
sstrip "$PROGRAM"
fi
ls -l "$PROGRAM"
#exit
cd "$STARTDIR"
# Remove output from previous build.
rm "$PROCESSOR_TYPE"
rm "$PACKAGEDIR"
rm *.tcz*
rm *.gz
rm *.bfe
# Create the destination directories for packaging.
mkdir "$PROCESSOR_TYPE"
mkdir "$DESTDIR/bin"
mkdir "$DESTDIR/share/applications"
mkdir "$DESTDIR/share/doc/$PROGRAM"
mkdir "$DESTDIR/share/pixmaps"
# Copy program files to their final destination.
cp "$STARTDIR/$SRCDIR/$PROGRAM" "$DESTDIR/bin"
cp "$STARTDIR/$SRCDIR/$PROGRAM"_"fc.sh" "$DESTDIR/bin"
cp "$STARTDIR/$SRCDIR/$PROGRAM.desktop" "$DESTDIR/share/applications"
cp "$STARTDIR/$SRCDIR/$PROGRAM"_"help.htm" "$DESTDIR/share/doc/$PROGRAM"
cp "$STARTDIR/$SRCDIR/$PROGRAM.gif" "$DESTDIR/share/doc/$PROGRAM"
cp "$STARTDIR/$SRCDIR/$PROGRAM.png" "$DESTDIR/share/pixmaps"
# Update version number and date in the help file.
DATE=`date '+%b %d, %Y'`
VERSION="`grep "#define APP_VER" $STARTDIR/$SRCDIR/fluff.cpp | cut -d' ' -f3 | tr -d '"'`"
echo "Version is " ${VERSION}
sed -i "s|.*<p>Version.*|<p>Version $VERSION, $DATE</p>|" "$DESTDIR/share/doc/$PROGRAM/$PROGRAM"_"help.htm"
# Create .tcz, .md5,txt, and .list files.
mksquashfs $PACKAGEDIR $PROGRAM.tcz -noappend -quiet -no-progress
md5sum $PROGRAM.tcz > $PROGRAM.tcz.md5.txt
cd "$PACKAGEDIR"
# Find files including their path starting from the current directory,
# cut the leading dot, sort it, and save it to the .list file.
find . -not -type d | cut -c 2- | sort > ../$PROGRAM.tcz.list
cd "$STARTDIR"
# Create dependency file.
for EXT in $PACKAGE_DEPS
do
echo "$EXT".tcz >> "$PROGRAM".tcz.dep
done
# Create .info file
DATE=`date '+%Y/%m/%d'`
SIZE="`du -h $PROGRAM.tcz | cut -f1`"
echo "Title: $PROGRAM.tcz
Description: File Manager
Version: $VERSION
Author: Michael A. Losh
Original-site: http://tinycorelinux.com
Copying-policy: GPLv3
Size: $SIZE
Extension_by: Michael A. Losh
Tags: File Manager fm
Comments: Full Version including icon and
.desktop file, suitable for Tiny Core Linux.
Fluff is a fast, light utility for files. Fluff uses
the FLTK user interface library, which makes it
especially efficient on TinyCore Linux. The source code
of Fluff is released under the GNU license. This file
manager features a directory tree and file details list;
keyboard, menu, and drag-and-drop file manipulations;
automatic configurable program associations; trashbin with
restore; file renaming; file property editing; and more!
Less than 150 KB installed.
Built with:
CFLAGS=$CFLAGS
CXXFLAGS=$CXXFLAGS
LDFLAGS=$LDFLAGS
Change-log: 2011/05/13 (Initial release as extension)
2010/05/13 1.0.0
2014/03/19 v1.0.7 compiled for corepure64-v5.x (coreplayer2)
2020/01/30 v1.0.7 compiled for tc-11.x and fltk-1.3.5 (gnuser)
2020/02/07 updated 1.0.7 -> 1.0.8 (gnuser)
2022/02/28 v1.0.9 addressed some build warnings, reverted some changes (Rich)
2025/04/16 v1.1.6 - Juanito & Michael A. Losh - FLTK 1.4 updates, new nav buttons, string buffer size fixes
Current: $DATE $VERSION see fluff.cpp for more detailed update info
" > $PROGRAM.tcz.info
# Check the newly created extension files for errors.
submitqc --libs 2>&1 > submitqc.txt
# Create archive of the package.
tar -czf "$PROGRAM".tar.gz "$PROGRAM".tc*
# Create archive of the source package.
tar -czf "$PROGRAM"-source-"$VERSION".tar.gz --exclude "*.o" ../"$PROGRAM"/"$SRCDIR" ../"$PROGRAM"/compileit
# Tar the package archive and build script. Include processor type as part of archive name.
tar -czf "$PROGRAM-$PROCESSOR_TYPE".tar.gz --exclude "$PROGRAM-$PROCESSOR_TYPE*" *.tar.gz
# bcrypt the final file with the password tinycore
yes tinycore | bcrypt "$PROGRAM-$PROCESSOR_TYPE".tar.gz
# Save copies in the $PROCESSOR_TYPE directory in case we want
# to compile for another architecture.
cp "$SRCDIR/$PROGRAM" "$PROCESSOR_TYPE"
cp "$PROGRAM".tc* "$PROCESSOR_TYPE"
cp *.tar.gz* "$PROCESSOR_TYPE"
cp submitqc.txt "$PROCESSOR_TYPE"
echo "Check $PACKAGEDIR/submitqc.txt for any errors."
echo "Send $PROGRAM-$PROCESSOR_TYPE.tar.gz.bfe to: tcesubmit@gmail.com"
echo