Comparison

configure @ 9419:78c58a1089ea

configure: Rename OSTYPE variable due to conflict with magic variable with same name on some shells/platforms
author Matthew Wild <mwild1@gmail.com>
date Mon, 01 Oct 2018 15:30:49 +0100
parent 9418:44a2609d1535
child 9420:3b8c4b2c6ba1
comparison
equal deleted inserted replaced
9418:44a2609d1535 9419:78c58a1089ea
148 SYSCONFDIR="$value" 148 SYSCONFDIR="$value"
149 SYSCONFDIR_SET=yes 149 SYSCONFDIR_SET=yes
150 ;; 150 ;;
151 --ostype) 151 --ostype)
152 # TODO make this a switch? 152 # TODO make this a switch?
153 OSTYPE="$value" 153 OSPRESET="$value"
154 OSTYPE_SET=yes 154 if [ "$OSPRESET" = "debian" ]; then
155 if [ "$OSTYPE" = "debian" ]; then
156 if [ "$LUA_SUFFIX_SET" != "yes" ]; then 155 if [ "$LUA_SUFFIX_SET" != "yes" ]; then
157 LUA_SUFFIX="5.1"; 156 LUA_SUFFIX="5.1";
158 LUA_SUFFIX_SET=yes 157 LUA_SUFFIX_SET=yes
159 fi 158 fi
160 if [ "$RUNWITH_SET" != "yes" ]; then 159 if [ "$RUNWITH_SET" != "yes" ]; then
163 fi 162 fi
164 LUA_INCDIR="/usr/include/lua$LUA_SUFFIX" 163 LUA_INCDIR="/usr/include/lua$LUA_SUFFIX"
165 LUA_INCDIR_SET=yes 164 LUA_INCDIR_SET=yes
166 CFLAGS="$CFLAGS -ggdb" 165 CFLAGS="$CFLAGS -ggdb"
167 fi 166 fi
168 if [ "$OSTYPE" = "macosx" ]; then 167 if [ "$OSPRESET" = "macosx" ]; then
169 LUA_INCDIR=/usr/local/include; 168 LUA_INCDIR=/usr/local/include;
170 LUA_INCDIR_SET=yes 169 LUA_INCDIR_SET=yes
171 LUA_LIBDIR=/usr/local/lib 170 LUA_LIBDIR=/usr/local/lib
172 LUA_LIBDIR_SET=yes 171 LUA_LIBDIR_SET=yes
173 CFLAGS="$CFLAGS -mmacosx-version-min=10.3" 172 CFLAGS="$CFLAGS -mmacosx-version-min=10.3"
174 LDFLAGS="-bundle -undefined dynamic_lookup" 173 LDFLAGS="-bundle -undefined dynamic_lookup"
175 fi 174 fi
176 if [ "$OSTYPE" = "linux" ]; then 175 if [ "$OSPRESET" = "linux" ]; then
177 LUA_INCDIR=/usr/local/include; 176 LUA_INCDIR=/usr/local/include;
178 LUA_INCDIR_SET=yes 177 LUA_INCDIR_SET=yes
179 LUA_LIBDIR=/usr/local/lib 178 LUA_LIBDIR=/usr/local/lib
180 LUA_LIBDIR_SET=yes 179 LUA_LIBDIR_SET=yes
181 CFLAGS="$CFLAGS -ggdb" 180 CFLAGS="$CFLAGS -ggdb"
182 fi 181 fi
183 if [ "$OSTYPE" = "freebsd" -o "$OSTYPE" = "openbsd" ]; then 182 if [ "$OSPRESET" = "freebsd" -o "$OSPRESET" = "openbsd" ]; then
184 LUA_INCDIR="/usr/local/include/lua51" 183 LUA_INCDIR="/usr/local/include/lua51"
185 LUA_INCDIR_SET=yes 184 LUA_INCDIR_SET=yes
186 CFLAGS="-Wall -fPIC -I/usr/local/include" 185 CFLAGS="-Wall -fPIC -I/usr/local/include"
187 LDFLAGS="-I/usr/local/include -L/usr/local/lib -shared" 186 LDFLAGS="-I/usr/local/include -L/usr/local/lib -shared"
188 LUA_SUFFIX="51" 187 LUA_SUFFIX="51"
190 LUA_DIR=/usr/local 189 LUA_DIR=/usr/local
191 LUA_DIR_SET=yes 190 LUA_DIR_SET=yes
192 CC=cc 191 CC=cc
193 LD=ld 192 LD=ld
194 fi 193 fi
195 if [ "$OSTYPE" = "openbsd" ]; then 194 if [ "$OSPRESET" = "openbsd" ]; then
196 LUA_INCDIR="/usr/local/include"; 195 LUA_INCDIR="/usr/local/include";
197 LUA_INCDIR_SET="yes" 196 LUA_INCDIR_SET="yes"
198 fi 197 fi
199 if [ "$OSTYPE" = "netbsd" ]; then 198 if [ "$OSPRESET" = "netbsd" ]; then
200 LUA_INCDIR="/usr/pkg/include/lua-5.1" 199 LUA_INCDIR="/usr/pkg/include/lua-5.1"
201 LUA_INCDIR_SET=yes 200 LUA_INCDIR_SET=yes
202 LUA_LIBDIR="/usr/pkg/lib/lua/5.1" 201 LUA_LIBDIR="/usr/pkg/lib/lua/5.1"
203 LUA_LIBDIR_SET=yes 202 LUA_LIBDIR_SET=yes
204 CFLAGS="-Wall -fPIC -I/usr/pkg/include" 203 CFLAGS="-Wall -fPIC -I/usr/pkg/include"
205 LDFLAGS="-L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib -shared" 204 LDFLAGS="-L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib -shared"
206 fi 205 fi
207 if [ "$OSTYPE" = "pkg-config" ]; then 206 if [ "$OSPRESET" = "pkg-config" ]; then
208 if [ "$LUA_SUFFIX_SET" != "yes" ]; then 207 if [ "$LUA_SUFFIX_SET" != "yes" ]; then
209 LUA_SUFFIX="5.1"; 208 LUA_SUFFIX="5.1";
210 LUA_SUFFIX_SET=yes 209 LUA_SUFFIX_SET=yes
211 fi 210 fi
212 LUA_CF="$(pkg-config --cflags-only-I lua$LUA_SUFFIX)" 211 LUA_CF="$(pkg-config --cflags-only-I lua$LUA_SUFFIX)"