-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
headless
executable file
·26 lines (19 loc) · 941 Bytes
/
headless
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
#1 remove
cp Makefile mk
#replace common headers that are coming from a script
a="\-DHAVE_STDIO_H=1 \-DHAVE_STDLIB_H=1 \-DHAVE_STRING_H=1 \-DHAVE_INTTYPES_H=1 \-DHAVE_STDINT_H=1 \-DHAVE_STRINGS_H=1 \-DHAVE_SYS_STAT_H=1 \-DHAVE_SYS_TYPES_H=1 \-DHAVE_UNISTD_H=1 \-DSTDC_HEADERS=1"
grep --color "${a}" mk
sed -i "s/${a}//g" mk
grep --color "${a}" mk
#replace our headers
a="\-DHAVE_LIBGEN_H=1 \-DHAVE_FCNTL_H=1 \-DHAVE_NETDB_H=1 \-DHAVE_NETINET_IN_H=1 \-DHAVE_OPENSSL_SSL_H=1 \-DHAVE_PTHREAD_H=1 \-DHAVE_SIGNAL_H=1 \-DHAVE_STDIO_H=1 \-DHAVE_STDLIB_H=1 \-DHAVE_STRING_H=1 \-DHAVE_SYS_SOCKET_H=1 \-DHAVE_SYS_STAT_H=1 \-DHAVE_TIME_H=1 \-DHAVE_UNISTD_H=1 \-DFN_G_MEMDUP2=1 \-DHAVE_GTK_GTK_H=1"
grep --color "${a}" mk
sed -i "s/${a}//g" mk
grep --color "${a}" mk
#replace c only headers
a="\-DHAVE_STDBOOL_H=1 \-DHAVE_STDDEF_H=1"
grep --color "${a}" mk
sed -i "s/${a}//g" mk
grep --color "${a}" mk
make -f mk
if [ -n "${1}" ]; then rm mk; fi