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