lynx:use untrusted gcc machine code generator (moved to opt)
[nyanlinux.git] / builders / libXau-1.0.11 / contrib / binutils-gcc-glibc.sh
blobcd0ef95d15fc921dd6afb53ae6d3c1b871493a01
1 #!/bin/sh
3 # Look for "unset", you'll find the values you can override in $1 or
4 # $build_dir/local_conf.sh file, that in order to tune the script for your
5 # specific distro/needs.
7 # Usage, drop the script at the top of mesa source tree, create somewhere else
8 # a build directory, cd into it, and call from there this script.
10 # XXX: the defaults are for our custom distro
11 #===================================================================================================
12 # build dir and src dir
13 build_dir=$(realpath .)
14 echo "build_dir=$build_dir"
15 # we are in contrib
16 src_dir=$(realpath $(dirname $0)/..)
17 echo "src_dir=$src_dir"
18 #===================================================================================================
19 # the current configur-able variables may be individually overridden with the
20 # content of the file in $1 or $build_dir/local_conf.sh. Look for "unset"
21 # in those scripts to find what you can override to tune the build.
22 if test -f "$1"; then
23 . "$1"
24 else
25 if test -f $build_dir/local_conf.sh; then
26 . $build_dir/local_conf.sh
29 #===================================================================================================
30 if test "${xorgproto_inc_dir-unset}" = unset; then
31 xorgproto_inc_dir=/nyan/xorgproto/current/include
33 xorgproto_cppflags="-I$xorgproto_inc_dir"
34 #===================================================================================================
35 if test "${cpp-unset}" = unset; then
36 cpp="gcc -E \
37 -isystem /nyan/glibc/current/include \
38 -isystem /nyan/linux-headers/current/include \
41 #===================================================================================================
42 if test "${slib_cc-unset}" = unset; then
43 slib_cc="gcc -c \
44 -isystem /nyan/glibc/current/include \
45 -isystem /nyan/linux-headers/current/include \
46 -std=c11 \
47 -pipe -fPIC -O2 -ftls-model=global-dynamic -fpic \
48 -static-libgcc"
50 #===================================================================================================
51 # we are still using the compiler driver, very bad idea
52 if test "${slib_ccld-unset}" = unset; then
53 slib_ccld="gcc \
54 -shared \
55 -static-libgcc \
56 -B/nyan/glibc/current/lib \
57 -L/nyan/glibc/current/lib \
58 -Wl,-soname=libXau.so.6 \
59 -Wl,--no-undefined \
60 -Wl,-s \
63 #===================================================================================================
64 glibc_cppflags="\
65 -D_GNU_SOURCE \
66 -DHAVE_DLFCN_H=1 \
67 -DHAVE_EXPLICIT_BZERO=1 \
68 -DHAVE_INTTYPES_H=1 \
69 -DHAVE_PATHCONF=1 \
70 -DHAVE_STDINT_H=1 \
71 -DHAVE_STDIO_H=1 \
72 -DHAVE_STDLIB_H=1 \
73 -DHAVE_STRINGS_H=1 \
74 -DHAVE_STRING_H=1 \
75 -DHAVE_SYS_STAT_H=1 \
76 -DHAVE_SYS_TYPES_H=1 \
77 -DHAVE_UNISTD_H=1 \
78 -DHAVE_WCHAR_H=1 \
80 #===================================================================================================
81 src_files="\
82 $src_dir/AuDispose.c \
83 $src_dir/AuFileName.c \
84 $src_dir/AuGetAddr.c \
85 $src_dir/AuGetBest.c \
86 $src_dir/AuLock.c \
87 $src_dir/AuRead.c \
88 $src_dir/AuUnlock.c \
89 $src_dir/AuWrite.c \
91 #===================================================================================================
92 for f in $src_files
94 cpp_file=$(basename $f .c).cpp.c
95 printf "CPP $f -> $build_dir/$cpp_file\n"
96 $cpp -o $build_dir/$cpp_file $f \
97 -DXTHREADS=1 \
98 -DXUSE_MTSAFE_API=1 \
99 -I$src_dir/include \
100 $glibc_cppflags \
101 $xorgproto_cppflags
102 done
103 #===================================================================================================
104 wait
105 #===================================================================================================
107 for f in $src_files
109 cpp_file=$(basename $f .c).cpp.c
110 o_file=$(basename $f .c).o
111 os="$os $o_file"
112 printf "SLIB_CC $build_dir/$cpp_file -> $build_dir/$o_file\n"
113 $slib_cc -o $build_dir/$o_file $build_dir/$cpp_file &
114 done
115 #===================================================================================================
116 wait
117 #===================================================================================================
118 # see $archive/src/Makefile.am for the libtool version
119 printf "SLIB_CCLD $build_dir/libXau.so.6.0.0\n"
120 $slib_ccld -o $build_dir/libXau.so.6.0.0 $os
121 #===================================================================================================
122 wait