Sat, 03 Aug 2019 11:15:03 +0200
add missing source changes
0
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1 | #!/bin/sh |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
2 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
3 | PREFIX=/usr |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
4 | EPREFIX=$PREFIX |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
5 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
6 | BINDIR= |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
7 | SBINDIR= |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
8 | LIBDIR= |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
9 | LIBEXECDIR= |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
10 | DATADIR= |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
11 | SYSCONFDIR= |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
12 | SHAREDSTATEDIR= |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
13 | LOCALSTATEDIR= |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
14 | INCLUDEDIR= |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
15 | INFODIR= |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
16 | MANDIR= |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
17 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
18 | OS=`uname -s` |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
19 | OS_VERSION=`uname -r` |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
20 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
21 | TEMP_DIR=".tmp-`uname -n`" |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
22 | mkdir -p $TEMP_DIR |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
23 | if [ $? -ne 0 ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
24 | echo "Cannot create tmp dir" |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
25 | echo "Abort" |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
26 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
27 | touch $TEMP_DIR/options |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
28 | touch $TEMP_DIR/features |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
29 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
30 | # features |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
31 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
32 | # help text |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
33 | printhelp() |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
34 | { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
35 | echo "Usage: $0 [OPTIONS]..." |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
36 | cat << __EOF__ |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
37 | Installation directories: |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
38 | --prefix=PREFIX path prefix for architecture-independent files |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
39 | [/usr] |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
40 | --exec-prefix=EPREFIX path prefix for architecture-dependent files |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
41 | [PREFIX] |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
42 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
43 | --bindir=DIR user executables [EPREFIX/bin] |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
44 | --sbindir=DIR system admin executables [EPREFIX/sbin] |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
45 | --libexecdir=DIR program executables [EPREFIX/libexec] |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
46 | --sysconfdir=DIR system configuration files [PREFIX/etc] |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
47 | --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
48 | --localstatedir=DIR modifiable single-machine data [PREFIX/var] |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
49 | --libdir=DIR object code libraries [EPREFIX/lib] |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
50 | --includedir=DIR C header files [PREFIX/include] |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
51 | --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
52 | --datadir=DIR read-only architecture-independent data [DATAROOTDIR] |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
53 | --infodir=DIR info documentation [DATAROOTDIR/info] |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
54 | --mandir=DIR man documentation [DATAROOTDIR/man] |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
55 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
56 | Optional Features: |
5
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
57 | --enable-pg |
0
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
58 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
59 | __EOF__ |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
60 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
61 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
62 | # |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
63 | # parse arguments |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
64 | # |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
65 | for ARG in $@ |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
66 | do |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
67 | if [[ $ARG == --prefix=* ]]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
68 | PREFIX=${ARG:9} |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
69 | elif [[ $ARG = --exec-prefix=* ]]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
70 | EPREFIX=${ARG:14} |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
71 | elif [[ $ARG = --bindir=* ]]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
72 | BINDIR=${ARG:9} |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
73 | elif [[ $ARG = --sbindir=* ]]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
74 | SBINDIR=${ARG:10} |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
75 | elif [[ $ARG = --libdir=* ]]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
76 | LIBDIR=${ARG:9} |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
77 | elif [[ $ARG = --libexecdir=* ]]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
78 | LIBEXECDIR=${ARG:13} |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
79 | elif [[ $ARG = --datadir=* ]]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
80 | DATADIR=${ARG:10} |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
81 | elif [[ $ARG = --sysconfdir=* ]]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
82 | SYSCONFDIR=${ARG:13} |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
83 | elif [[ $ARG = --sharedstatedir=* ]]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
84 | SHAREDSTATEDIR=${ARG:17} |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
85 | elif [[ $ARG = --localstatedir=* ]]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
86 | LOCALSTATEDIR=${ARG:16} |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
87 | elif [[ $ARG = --includedir=* ]]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
88 | INCLUDEDIR=${ARG:12} |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
89 | elif [[ $ARG = --infodir=* ]]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
90 | INFODIR=${ARG:10} |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
91 | elif [[ $ARG = --mandir=* ]]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
92 | MANDIR=${ARG:9} |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
93 | elif [ $ARG = "--help" ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
94 | printhelp |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
95 | exit 0 |
5
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
96 | elif [[ $ARG == --enable-pg ]]; then |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
97 | FEATURE_PG=on |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
98 | elif [[ $ARG == --disable-pg ]]; then |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
99 | unset FEATURE_PG |
0
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
100 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
101 | done |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
102 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
103 | # set dir variables |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
104 | if [ -z $BINDIR ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
105 | BINDIR=$EPREFIX/bin |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
106 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
107 | if [ -z $SBINDIR ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
108 | SBINDIR=$EPREFIX/sbin |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
109 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
110 | if [ -z $LIBDIR ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
111 | LIBDIRDIR=$EPREFIX/lib |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
112 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
113 | if [ -z $LIBEXEC ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
114 | LIBExECDIR=$EPREFIX/libexec |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
115 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
116 | if [ -z $DATADIR ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
117 | DATADIR=$PREFIX/share |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
118 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
119 | if [ -z $SYSCONFDIR]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
120 | SYSCONFDIR=$PREFIX/etc |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
121 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
122 | if [ -z $SHAREDSTATEDIR ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
123 | SHAREDSTATEDIR=$PREFIX/com |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
124 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
125 | if [ -z $LOCALSTATEDIR ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
126 | LOCALSTATEDIR=$PREFIX/var |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
127 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
128 | if [ -z $INCLUDEDIR ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
129 | INCLUDEDIR=$PREFIX/include |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
130 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
131 | if [ -z $INFODIR ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
132 | INFODIR=$PREFIX/info |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
133 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
134 | if [ -z $MANDIR ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
135 | MANDIR=$PREFIX/man |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
136 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
137 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
138 | which pkg-config > /dev/null |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
139 | if [ $? -ne 0 ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
140 | PKG_CONFIG=pkg-config |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
141 | else |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
142 | PKG_CONFIG=false |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
143 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
144 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
145 | # Simple uname based platform detection |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
146 | # $PLATFORM is used for platform dependent dependency selection |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
147 | printf "detect platform... " |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
148 | if [ $OS = SunOS ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
149 | PLATFORM="solaris sunos unix svr4" |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
150 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
151 | if [ $OS = Linux ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
152 | PLATFORM="linux unix" |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
153 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
154 | if [ $OS = FreeBSD ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
155 | PLATFORM="freebsd bsd unix" |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
156 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
157 | if [ $OS = Darwin ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
158 | PLATFORM="macos osx bsd unix" |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
159 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
160 | echo $OS | grep "MINGW" > /dev/null |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
161 | if [ $? -eq 0 ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
162 | PLATFORM="windows mingw" |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
163 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
164 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
165 | if [ -z "$PLATFORM" ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
166 | PLATFORM="unix" |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
167 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
168 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
169 | for p in $PLATFORM |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
170 | do |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
171 | PLATFORM_NAME=$p |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
172 | break |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
173 | done |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
174 | echo $PLATFORM_NAME |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
175 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
176 | isplatform() |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
177 | { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
178 | for p in $PLATFORM |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
179 | do |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
180 | if [ $p = $1 ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
181 | return 0 |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
182 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
183 | done |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
184 | return 1 |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
185 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
186 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
187 | # generate config.mk and config.h |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
188 | cat > $TEMP_DIR/config.mk << __EOF__ |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
189 | # |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
190 | # config.mk generated by configure |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
191 | # |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
192 | __EOF__ |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
193 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
194 | echo > $TEMP_DIR/make.mk |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
195 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
196 | ENV_CFLAGS=$CFLAGS |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
197 | ENV_LDFLAGS=$LDFLAGS |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
198 | ENV_CXXFLAGS=$CXXFLAGS |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
199 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
200 | # Toolchain detection |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
201 | # this will insert make vars to config.mk |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
202 | source make/toolchain.sh |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
203 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
204 | # add user specified flags to config.mk |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
205 | echo >> $TEMP_DIR/config.mk |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
206 | if [[ ! -z ${ENV_CFLAGS} ]]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
207 | echo "CFLAGS += $ENV_CFLAGS" >> $TEMP_DIR/config.mk |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
208 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
209 | if [[ ! -z ${ENV_CXXFLAGS} ]]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
210 | echo "CXXFLAGS += $ENV_CXXFLAGS" >> $TEMP_DIR/config.mk |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
211 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
212 | if [[ ! -z ${ENV_LDFLAGS} ]]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
213 | echo "LDFLAGS += $ENV_LDFLAGS" >> $TEMP_DIR/config.mk |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
214 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
215 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
216 | # |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
217 | # DEPENDENCIES |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
218 | # |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
219 | |
5
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
220 | dependency_libpq() |
0
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
221 | { |
5
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
222 | printf "checking for libpq... " |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
223 | # dependency libpq |
0
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
224 | while true |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
225 | do |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
226 | if [ -z "PKG_CONFIG" ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
227 | break |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
228 | fi |
5
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
229 | if ! pkg-config libpq ; then |
0
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
230 | break |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
231 | fi |
5
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
232 | CFLAGS+=" `pkg-config --cflags libpq`" |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
233 | LDFLAGS+=" `pkg-config --libs libpq`" |
3
9d60baefa4ed
add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
234 | echo yes |
9d60baefa4ed
add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
235 | return 0 |
9d60baefa4ed
add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
236 | done |
9d60baefa4ed
add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
237 | |
9d60baefa4ed
add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
238 | echo no |
9d60baefa4ed
add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
239 | return 1 |
9d60baefa4ed
add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
240 | } |
5
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
241 | dependency_openssl() |
3
9d60baefa4ed
add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
242 | { |
5
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
243 | printf "checking for openssl... " |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
244 | # dependency openssl |
0
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
245 | while true |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
246 | do |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
247 | if [ -z "PKG_CONFIG" ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
248 | break |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
249 | fi |
5
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
250 | if ! pkg-config openssl ; then |
0
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
251 | break |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
252 | fi |
5
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
253 | CFLAGS+=" `pkg-config --cflags openssl`" |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
254 | LDFLAGS+=" `pkg-config --libs openssl`" |
4
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
255 | echo yes |
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
256 | return 0 |
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
257 | done |
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
258 | |
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
259 | echo no |
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
260 | return 1 |
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
261 | } |
0
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
262 | dependency_libxml2() |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
263 | { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
264 | printf "checking for libxml2... " |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
265 | # dependency libxml2 |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
266 | while true |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
267 | do |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
268 | if [ -z "PKG_CONFIG" ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
269 | break |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
270 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
271 | if ! pkg-config libxml-2.0 ; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
272 | break |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
273 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
274 | CFLAGS+=" `pkg-config --cflags libxml-2.0`" |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
275 | LDFLAGS+=" `pkg-config --libs libxml-2.0`" |
3
9d60baefa4ed
add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
2
diff
changeset
|
276 | echo yes |
0
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
277 | return 0 |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
278 | done |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
279 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
280 | echo no |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
281 | return 1 |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
282 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
283 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
284 | DEPENDENCIES_FAILED= |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
285 | ERROR=0 |
2
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
286 | # general dependencies |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
287 | CFLAGS= |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
288 | LDFLAGS= |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
289 | while true |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
290 | do |
5
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
291 | if ! isplatform "linux"; then |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
292 | break |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
293 | fi |
2
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
294 | while true |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
295 | do |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
296 | |
5
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
297 | CFLAGS+="-DLINUX" |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
298 | LDFLAGS+="-lpthread -ldl -lm -lldap" |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
299 | |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
300 | break |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
301 | done |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
302 | |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
303 | break |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
304 | done |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
305 | while true |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
306 | do |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
307 | if ! isplatform "bsd"; then |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
308 | break |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
309 | fi |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
310 | if isplatform "macos"; then |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
311 | break |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
312 | fi |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
313 | while true |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
314 | do |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
315 | |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
316 | CFLAGS+="-DBSD" |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
317 | LDFLAGS+="-lpthread -lm -lldap" |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
318 | |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
319 | break |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
320 | done |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
321 | |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
322 | break |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
323 | done |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
324 | while true |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
325 | do |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
326 | if ! isplatform "solaris"; then |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
327 | break |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
328 | fi |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
329 | while true |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
330 | do |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
331 | |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
332 | CFLAGS+="-DSOLARIS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" |
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
333 | LDFLAGS+="-lsocket -lnsl -lsendfile -lposix4 -lpthread -ldl -lm -lmd -lldap" |
2
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
334 | |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
335 | break |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
336 | done |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
337 | |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
338 | break |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
339 | done |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
340 | |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
341 | # add general dependency flags to config.mk |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
342 | echo >> $TEMP_DIR/config.mk |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
343 | if [[ ! -z ${CFLAGS} ]]; then |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
344 | echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
345 | fi |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
346 | if [[ ! -z ${CXXFLAGS} ]]; then |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
347 | echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
348 | fi |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
349 | if [[ ! -z ${LDFLAGS} ]]; then |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
350 | echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk |
14a4b7f0bc74
add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
351 | fi |
0
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
352 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
353 | # |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
354 | # OPTION VALUES |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
355 | # |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
356 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
357 | # |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
358 | # TARGETS |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
359 | # |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
360 | CFLAGS= |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
361 | CXXFLAGS= |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
362 | LDFLAGS= |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
363 | |
5
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
364 | # Target |
0
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
365 | CFLAGS= |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
366 | LDFLAGS= |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
367 | CXXFLAGS= |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
368 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
369 | dependency_libxml2 |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
370 | if [ $? -ne 0 ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
371 | DEPENDENCIES_FAILED+="libxml2 " |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
372 | ERROR=1 |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
373 | fi |
5
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
374 | dependency_openssl |
0
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
375 | if [ $? -ne 0 ]; then |
5
895bf81d3b6e
add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
4
diff
changeset
|
376 | DEPENDENCIES_FAILED+="openssl " |
4
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
377 | ERROR=1 |
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
378 | fi |
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
379 | |
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
380 | |
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
381 | echo >> $TEMP_DIR/config.mk |
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
382 | if [[ ! -z ${CFLAGS} ]]; then |
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
383 | echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk |
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
384 | fi |
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
385 | if [[ ! -z ${CXXFLAGS} ]]; then |
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
386 | echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk |
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
387 | fi |
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
388 | if [[ ! -z ${LDFLAGS} ]]; then |
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
389 | echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk |
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
390 | fi |
6bf4c948d0ba
make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
391 | |
0
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
392 | if [ $ERROR -ne 0 ]; then |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
393 | echo |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
394 | echo "Error: Unresolved dependencies" |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
395 | echo $DEPENCIES_FAILED |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
396 | rm -Rf $TEMP_DIR |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
397 | exit 1 |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
398 | fi |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
399 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
400 | echo "configure finished" |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
401 | echo |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
402 | echo "Build Config:" |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
403 | echo " PREFIX: $PREFIX" |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
404 | echo " TOOLCHAIN: $TOOLCHAIN_NAME" |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
405 | echo |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
406 | cat $TEMP_DIR/config.mk $TEMP_DIR/make.mk > config.mk |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
407 | rm -Rf $TEMP_DIR |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
408 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
409 |