libXinerama:update and moved to /usr/lib
[nyanlinux.git] / builders / libXinerama-1.1.5 / contrib / binutils-gcc-glibc.sh
blob75b7d449446e888e2863e3bcd6220c496036c3b0
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 "${libx11_inc_dir-unset}" = unset; then
36 libx11_inc_dir=/nyan/libX11/current/include
38 libx11_cppflags="-I$libx11_inc_dir"
39 #---------------------------------------------------------------------------------------------------
40 if test "${libx11_lib_dir-unset}" = unset; then
41 libx11_lib_dir=/nyan/libX11/current/lib
43 libx11_ldflags="-L$libx11_lib_dir -lX11"
44 #===================================================================================================
45 if test "${libxext_inc_dir-unset}" = unset; then
46 libxext_inc_dir=/nyan/libXext/current/include
48 libxext_cppflags="-I$libxext_inc_dir"
49 #---------------------------------------------------------------------------------------------------
50 if test "${libxext_lib_dir-unset}" = unset; then
51 libxext_lib_dir=/nyan/libXext/current/lib
53 libxext_ldflags="-L$libxext_lib_dir -lXext"
54 #===================================================================================================
55 if test "${cpp-unset}" = unset; then
56 cpp="gcc -E \
57 -isystem /nyan/glibc/current/include \
58 -isystem /nyan/linux-headers/current/include \
61 #===================================================================================================
62 if test "${slib_cc-unset}" = unset; then
63 slib_cc="gcc -c \
64 -isystem /nyan/glibc/current/include \
65 -isystem /nyan/linux-headers/current/include \
66 -std=c11 \
67 -pipe -fPIC -O2 -ftls-model=global-dynamic -fpic \
68 -static-libgcc"
70 #===================================================================================================
71 # we are still using the compiler driver, very bad idea
72 if test "${slib_ccld-unset}" = unset; then
73 slib_ccld="gcc \
74 -shared \
75 -static-libgcc \
76 -B/nyan/glibc/current/lib \
77 -L/nyan/glibc/current/lib \
78 -Wl,-soname=libXinerama.so.1 \
79 -Wl,--no-undefined \
80 -Wl,-s \
83 #===================================================================================================
84 glibc_cppflags="\
85 -D_GNU_SOURCE \
86 -DHAVE_DLFCN_H=1 \
87 -DHAVE_INTTYPES_H=1 \
88 -DHAVE_STDINT_H=1 \
89 -DHAVE_STDIO_H=1 \
90 -DHAVE_STDLIB_H=1 \
91 -DHAVE_STRINGS_H=1 \
92 -DHAVE_STRING_H=1 \
93 -DHAVE_SYS_STAT_H=1 \
94 -DHAVE_SYS_TYPES_H=1 \
95 -DHAVE_UNISTD_H=1 \
97 #===================================================================================================
98 src_files="\
99 $src_dir/src/Xinerama.c
101 #===================================================================================================
102 for f in $src_files
104 cpp_file=$(basename $f .c).cpp.c
105 printf "CPP $f -> $build_dir/$cpp_file\n"
106 $cpp -o $build_dir/$cpp_file $f \
107 -I$src_dir/include \
108 $glibc_cppflags \
109 $xorgproto_cppflags \
110 $libx11_cppflags \
111 $libxext_cppflags
112 done
113 #===================================================================================================
114 wait
115 #===================================================================================================
117 for f in $src_files
119 cpp_file=$(basename $f .c).cpp.c
120 o_file=$(basename $f .c).o
121 os="$os $o_file"
122 printf "SLIB_CC $build_dir/$cpp_file -> $build_dir/$o_file\n"
123 $slib_cc -o $build_dir/$o_file $build_dir/$cpp_file &
124 done
125 #===================================================================================================
126 wait
127 #===================================================================================================
128 # see $archive/src/Makefile.am for the libtool version
129 printf "SLIB_CCLD $build_dir/libXinerama.so.1.0.0\n"
130 $slib_ccld -o $build_dir/libXinerama.so.1.0.0 $os \
131 $libxext_ldflags \
132 $libx11_ldflags
133 #===================================================================================================
134 wait