blob: 555b9c4b762790b2241e04ee02d5b084a6365674 (
plain)
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
|
#!/bin/sh --
# config.linux - linux specific configuration for sparforte
# requires gnatprep pkg-config pcre-config
# enables opengl sdl1 postgresql readline pcre
# NOTE
# Essentially by creating this I can limit the amount of dependencies needed
# and other damage sparforte's configure script can do such as calling sudo.
startdir=$PWD
srcdir=$startdir/src
SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH:-$(date +%s)}
CC=gcc
CPUTYPE=${CARCH:-$(uname -m)}
CPUFLAG=-march
PREFIX=/usr
MANPREFIX=/usr/share/man
GMAKETYPE=make
# gnatmake -j0 uses the maximum available cores.
GMAKEJOBS=0
case $CPUTYPE in
x86_64) CPUTYPE=x86-64
esac
cp -v -- "$srcdir"/os_bindings/spar_linux.ads "$srcdir"/spar_os.ads
cp -v -- "$srcdir"/scanner-calendar-latest.ads "$srcdir"/scanner-calendar.ads
cp -v -- "$srcdir"/scanner-calendar-latest.adb "$srcdir"/scanner-calendar.adb
# # sdl1
# SDLLIBS=$(pkg-config --libs sdl)
# SDLINCL=$(pkg-config --cflags sdl)
# SDLLIBSTYPE="$SDLLIBS -lSDL_image"
# SDLINCLTYPE=$SDLINCL
# case $CPUTYPE in
# i686) cp -v -- "$srcdir"/spar_os-sdl-32bit.ads "$srcdir"/spar_os-sdl.ads ;;
# x86-64) cp -v -- "$srcdir"/spar_os-sdl-64bit.ads "$srcdir"/spar_os-sdl.ads
# esac
# # opengl
# MESALIBSTYPE=$(pkg-config --libs gl glu)
# MESAINCLTYPE=$(pkg-config --cflags gl glu)
# gstreamer
# Disabling gstreamer for now:
# ./parser_sound.o: In function `parser_sound__parseplay':
# parser_sound.adb:(.text+0xe08): undefined reference to `play_uri'
# parser_sound.adb:(.text+0xf27): undefined reference to `gst_error'
# ./parser_sound.o: In function `parser_sound__startupsound':
# parser_sound.adb:(.text+0x2528): undefined reference to `startup_gstreamer'
# collect2: error: ld returned 1 exit status
# gnatlink: error when calling /usr/bin/gcc
# GSTREAMERFLAG=-DGSTREAMER
# GSTREAMERLIBS=$(pkg-config --cflags --libs gstreamer-1.0)
GSTREAMERLIBS=
GSTREAMEROBJ=
GSTREAMERFLAG=
# postgresql
# PGLIBSSUB=$(pkg-config --cflags --libs libpq)
# APQMAKESUB='$(MAKE) -C apq-2.1'
# APQLIBSSUB='-L./apq-2.1'
# APQINCLSSUB='-I./apq-2.1'
PGLIBSSUB=
APQMAKESUB=
APQLIBSSUB=
APQINCLSSUB=
# (2019-01-01) disable mysql support (HAVE_MY=0) since it seems to include
# nonsense code:
# apq-mysql.ads:38:24: identifier expected
# apq-mysql.ads:40:23: aggregate may not have single positional component
# apq-mysql.ads:40:24: missing operand
# env -C "$srcdir"/apq-2.1 HAVE_MY=0 ./configure
# XXX Can't remember purpose of touching this file, probably for make.
# Not sure why this file even exists under apq.
# touch "$srcdir"/apq-2.1/c_gstreamer.c
# readline
RLLIBS='-lreadline -lhistory'
RLFLAG=
# pcre
PCRELIBS=$(pcre-config --libs)
PCREOBJ=c_pcre.o
# l10n
L10NLIBS=
L10NLFLAG=
sed "s!=GMAKETYPE!=$GMAKETYPE!
s!=MANPREFIXSUB!=$MANPREFIX!
s!=PREFIXSUB!=$PREFIX!" < "$startdir"/GNUmakefile.orig > "$startdir"/GNUmakefile
sed "s!=CCTYPE!=$CC!
s!=CPUTYPE!=$CPUTYPE!
s!=CPUFLAG!=$CPUFLAG!
s!=MANPREFIXSUB!=$MANPREFIX!
s!=PREFIXSUB!=$PREFIX!
s!=GMAKETYPE!=$GMAKETYPE!
s!=GMAKEJOBSSUB!=$GMAKEJOBS!
s!=SDLLIBSTYPE!=$SDLLIBSTYPE!
s!=SDLINCLTYPE!=$SDLINCLTYPE!
s!=CFLAGSTYPE!=$CFLAGSTYPE!
s!=PGLIBSSUB!=$PGLIBSSUB!
s!=L10NLIBSSUB!=$L10NLIBS!
s!=L10NFLAGSUB!=$L10NLFLAG!
s!=MYSQLLIBSSUB!=$MYSQLLIBSSUB!
s!=APQLIBSSUB!=$APQLIBSSUB!
s!=APQINCLSSUB!=$APQINCLSSUB!
s!=SDLINCLSSUB!=$SDLINCLSSUB!
s!=APQMAKESUB!=$APQMAKESUB!
s!=FASTCGISUB!=$FASTCGISUB!
s!=GSTREAMERLIBSSUB!=$GSTREAMERLIBS!
s!=GSTREAMEROBJSUB!=$GSTREAMEROBJ!
s!=GSTREAMERFLAGSUB!=$GSTREAMERFLAG!
s!=GSTREAMEROUTSUB!=$GSTREAMEROUT!
s!=MESAINCLSUB!=$MESAINCLTYPE!
s!=MESALIBSSUB!=$MESALIBSTYPE!
s!=PCRELIBSSUB!=$PCRELIBS!
s!=PCREOBJSUB!=$PCREOBJ!
s!=BDBSUB!=$BDBLIBS!
s!=BDBINCLSUB!=$BDBINCL!
s!=RLINCLSUB!=$RLINCL!
s!=RLFLAGSUB!=$RLFLAG!
s!=RLLIBSSUB!=$RLLIBS!" < "$srcdir"/GNUmakefile.orig > "$srcdir"/GNUmakefile
cat <<! > "$startdir"/gnatprep.def
configbuildDate := "$(date -d @"$SOURCE_DATE_EPOCH" +%y%m%d)"
configreleased := true
READLINE := true
PCRE := true
APQ := false
POSTGRES := false
L10N := false
OPENGL := false
SDL := false
MYSQL := false
SOUND := false
GCGI := false
BDB := false
!
for orig in "$srcdir"/*.ad[bs].orig; do
if [ -f "$orig" ]; then
adafile=${orig%.orig}
printf '%s: preparing...\n' "${adafile#"$startdir"/}"
gnatprep "$orig" "$adafile" "$startdir"/gnatprep.def
fi
done
|