summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: fa9185c4eefe75e59ec8470838370c6197c16f24 (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
159
160
161
162
163
164
165
166

TOP = $(shell readlink -f .)
ARCH	= x86-linux64

JOBS = 2

LOCAL_BUILD_PATH = $(TOP)/build.$(ARCH)
LOCAL_INST_PATH = $(TOP)/install.$(ARCH)

VERSION_SHORT=5.13
VERSION_RELEASE=1
VERSION=$(VERSION_SHORT).$(VERSION_RELEASE)

SSL_VERSION=1.0.2r
SSL_ARCHIVE=openssl-$(SSL_VERSION).tar.gz

PACKAGE_NAME = qt-$(VERSION)

GCC_PATH	?= /opt/dev-tools/gcc-suite/1.3.0/x86-linux64/gcc-8.2.0

CC	?= $(GCC_PATH)/bin/gcc 
CXX	?= $(GCC_PATH)/bin/g++ 

#CC_LDFLAGS	= "-m64 -shared -fpic -static-libgcc"
#CXX_LDFLAGS	= "-m64 -shared -fpic -static-libgcc -static-libstdc++"

QT_STATIC_FLAGS = -static -static-runtime -no-shared

all: download qt

qt: ssl.$(ARCH) qt.$(ARCH) 

download:
	$(MAKE) -C $(TOP)/SOURCE

ssl.$(ARCH):
	# static
	rm -Rf $(LOCAL_BUILD_PATH)/openssl-$(SSL_VERSION)
	mkdir -p $(LOCAL_BUILD_PATH)/
	cd $(LOCAL_BUILD_PATH) && \
		tar -xzf $(TOP)/SOURCE/$(SSL_ARCHIVE)
	cd $(LOCAL_BUILD_PATH)/openssl-$(SSL_VERSION) && \
	    export CFLAGS=  && \
	    export LDFLAGS="-static-libgcc -static-libstdc++" && \
	    export PATH=$(GCC_PATH)/bin:$(PATH) && \
	    export LD_LIBRARY_PATH=$(GCC_PATH)/lib64:$(LD_LIBRARY_PATH) && \
	    ./Configure -static-libgcc -static-libstdc++ --prefix=$(LOCAL_INST_PATH)/openssl linux-generic64 && \
	    pwd && \
	    make clean && \
	    make -j$(JOBS) && \
	    make install
	# shared
	rm -Rf $(LOCAL_BUILD_PATH)/openssl-$(SSL_VERSION)
	mkdir -p $(LOCAL_BUILD_PATH)/
	cd $(LOCAL_BUILD_PATH) && \
		tar -xzf $(TOP)/SOURCE/$(SSL_ARCHIVE)
	cd $(LOCAL_BUILD_PATH)/openssl-$(SSL_VERSION) && \
	    export CFLAGS=-fpic && \
	    export LDFLAGS="-static-libgcc -static-libstdc++" && \
	    export PATH=$(GCC_PATH)/bin:$(PATH) && \
	    export LD_LIBRARY_PATH=$(GCC_PATH)/lib64:$(LD_LIBRARY_PATH) && \
	    ./Configure -static-libgcc -static-libstdc++ shared --prefix=$(LOCAL_INST_PATH)/openssl linux-generic64 && \
	    pwd && \
	    make clean && \
	    make -j$(JOBS) && \
	    make install

qt.x86-linux64: qt.x86-linux64.shared qt.x86-linux64.static merge

qt.x86-linux64.shared:
	# shared
	mkdir -p $(LOCAL_BUILD_PATH)
	rm -Rf $(LOCAL_BUILD_PATH)/qt-everywhere-src-$(VERSION)
	cd $(LOCAL_BUILD_PATH) && \
		tar -xJf $(TOP)/SOURCE/qt-everywhere-src-$(VERSION).tar.xz
	cd $(LOCAL_BUILD_PATH)/qt-everywhere-src-$(VERSION) && \
	    patch -p1 < $(TOP)/SOURCE/qt-5.12.3-linux-static-gcc-libs.patch && \
	    rm -f config.cache && \
	export LDFLAGS=$(CXX_LDFLAGS) && \
        export PATH=$(GCC_PATH)/bin:$(PATH) && \
        export LD_LIBRARY_PATH=$(GCC_PATH)/lib64:$(LD_LIBRARY_PATH) && \
	gcc --version && \
	bash ./configure \
		-recheck-all \
		-shared \
		-prefix $(LOCAL_INST_PATH)/qt-$(VERSION)-shared \
		-release \
		-opensource \
		-strip \
		-ssl \
		-openssl \
		-I$(LOCAL_INST_PATH)/openssl/include \
		-L$(LOCAL_INST_PATH)/openssl/lib \
		-L$(GCC_PATH)/lib64 \
		-nomake examples \
		-nomake tests \
		-skip qtwebengine \
		-qt-zlib \
		-qt-libjpeg \
		-qt-libpng \
		-qt-pcre \
		-qt-xcb \
		-fontconfig \
		-system-freetype \
		-confirm-license && \
	make -j$(JOBS) && \
	make -j$(JOBS) install
	cp -f $(TOP)/qt.conf $(LOCAL_INST_PATH)/qt-$(VERSION)-shared/bin/
	cd  $(LOCAL_INST_PATH)/qt-$(VERSION)-shared && \
	    tar -zcf $(TOP)/qt-$(VERSION)-shared-$(ARCH).tgz ./

qt.x86-linux64.static:
	# static
	mkdir -p $(LOCAL_BUILD_PATH)
	rm -Rf $(LOCAL_BUILD_PATH)/qt-everywhere-src-$(VERSION)
	cd $(LOCAL_BUILD_PATH) && \
		tar -xJf $(TOP)/SOURCE/qt-everywhere-src-$(VERSION).tar.xz
	cd $(LOCAL_BUILD_PATH)/qt-everywhere-src-$(VERSION) && \
	    patch -p1 < $(TOP)/SOURCE/qt-5.12.3-linux-static-gcc-libs.patch && \
	    rm -f config.cache && \
        export PATH=$(GCC_PATH)/bin:$(PATH) && \
        export LD_LIBRARY_PATH=$(GCC_PATH)/lib64:$(LD_LIBRARY_PATH) && \
	gcc --version && \
	./configure \
		-recheck-all \
		-prefix $(LOCAL_INST_PATH)/qt-$(VERSION)-static \
		-static \
		-release \
		-opensource \
		-strip \
		-ssl \
		-openssl \
		-I$(LOCAL_INST_PATH)/openssl/include \
		-L$(LOCAL_INST_PATH)/opensll/lib \
		-L$(GCC_PATH)/lib64 \
		-nomake examples \
		-nomake tests \
		-skip qtwebengine \
		-qt-xcb \
		-qt-zlib \
		-qt-libjpeg \
		-qt-libpng \
		-qt-pcre \
		-fontconfig \
		-system-freetype \
		-confirm-license && \
	make -j$(JOBS) && \
	make -j$(JOBS) install
	cp -f $(TOP)/qt.conf $(LOCAL_INST_PATH)/qt-$(VERSION)-static/bin/
	cd  $(LOCAL_INST_PATH)/qt-$(VERSION)-static && \
	    tar -zcf $(TOP)/qt-$(VERSION)-static-$(ARCH).tgz ./
merge:
	cp -nr $(LOCAL_INST_PATH)/qt-$(VERSION)-static/lib/* $(LOCAL_INST_PATH)/qt-$(VERSION)-shared/lib/
	cp -nr $(LOCAL_INST_PATH)/qt-$(VERSION)-static/plugins/* $(LOCAL_INST_PATH)/qt-$(VERSION)-shared/plugins/
	cp -nr $(LOCAL_INST_PATH)/qt-$(VERSION)-static/qml/* $(LOCAL_INST_PATH)/qt-$(VERSION)-shared/qml/
	cd  $(LOCAL_INST_PATH)/qt-$(VERSION)-shared && \
	    tar -zcf $(TOP)/qt-$(VERSION)-$(ARCH).tgz ./

clean:
	rm -Rf build.$(ARCH)
	rm -Rf install.$(ARCH)

dll2a:
	for d in $(DLL_DIR)/*.dll; do \
		$(GCC_PATH)/bin/$(XPREFIX)dll2a $$d -l $(LIBDIR) ; \
	done;