Comparison

configure @ 3352:770e27bf11ea

configure: Make it possible to override ostype presets with values specified later on the command-line
author Matthew Wild <mwild1@gmail.com>
date Tue, 13 Jul 2010 08:59:00 +0100
parent 3351:9d38d2bef187
child 3762:f02bac902a1e
comparison
equal deleted inserted replaced
3351:9d38d2bef187 3352:770e27bf11ea
83 SYSCONFDIR_SET=yes 83 SYSCONFDIR_SET=yes
84 ;; 84 ;;
85 --ostype=*) 85 --ostype=*)
86 OSTYPE="$value" 86 OSTYPE="$value"
87 OSTYPE_SET=yes 87 OSTYPE_SET=yes
88 ;; 88 if [ "$OSTYPE" = "debian" ]
89 --datadir=*) 89 then LUA_SUFFIX="5.1";
90 DATADIR="$value"
91 DATADIR_SET=yes
92 ;;
93 --require-config)
94 REQUIRE_CONFIG=yes
95 ;;
96 --lua-suffix=*)
97 LUA_SUFFIX="$value"
98 LUA_SUFFIX_SET=yes
99 ;;
100 --with-lua=*)
101 LUA_DIR="$value"
102 LUA_DIR_SET=yes
103 ;;
104 --with-lua-include=*)
105 LUA_INCDIR="$value"
106 LUA_INCDIR_SET=yes
107 ;;
108 --with-lua-lib=*)
109 LUA_LIBDIR="$value" LUA_LIBDIR_SET=yes
110 ;;
111 --with-idn=*)
112 IDN_LIB="$value"
113 ;;
114 --with-ssl=*)
115 OPENSSL_LIB="$value"
116 ;;
117 --cflags=*)
118 CFLAGS="$value"
119 ;;
120 --ldflags=*)
121 LDFLAGS="$value"
122 ;;
123 --c-compiler=*)
124 CC="$value"
125 ;;
126 --linker=*)
127 LD="$value"
128 ;;
129 *)
130 echo "Error: Unknown flag: $1"
131 exit 1
132 ;;
133 esac
134 shift
135 done
136
137 if [ "$OSTYPE_SET" = "yes" ]
138 then
139 if [ "$OSTYPE" = "debian" ]
140 then LUA_SUFFIX="5.1";
141 LUA_SUFFIX_SET=yes 90 LUA_SUFFIX_SET=yes
142 LUA_INCDIR=/usr/include/lua5.1; 91 LUA_INCDIR=/usr/include/lua5.1;
143 LUA_INCDIR_SET=yes 92 LUA_INCDIR_SET=yes
144 fi 93 fi
145 if [ "$OSTYPE" = "macosx" ] 94 if [ "$OSTYPE" = "macosx" ]
166 LUA_SUFFIX="-5.1" 115 LUA_SUFFIX="-5.1"
167 LUA_SUFFIX_SET=yes 116 LUA_SUFFIX_SET=yes
168 LUA_DIR=/usr/local 117 LUA_DIR=/usr/local
169 LUA_DIR_SET=yes 118 LUA_DIR_SET=yes
170 fi 119 fi
171 fi 120 ;;
121 --datadir=*)
122 DATADIR="$value"
123 DATADIR_SET=yes
124 ;;
125 --require-config)
126 REQUIRE_CONFIG=yes
127 ;;
128 --lua-suffix=*)
129 LUA_SUFFIX="$value"
130 LUA_SUFFIX_SET=yes
131 ;;
132 --with-lua=*)
133 LUA_DIR="$value"
134 LUA_DIR_SET=yes
135 ;;
136 --with-lua-include=*)
137 LUA_INCDIR="$value"
138 LUA_INCDIR_SET=yes
139 ;;
140 --with-lua-lib=*)
141 LUA_LIBDIR="$value" LUA_LIBDIR_SET=yes
142 ;;
143 --with-idn=*)
144 IDN_LIB="$value"
145 ;;
146 --with-ssl=*)
147 OPENSSL_LIB="$value"
148 ;;
149 --cflags=*)
150 CFLAGS="$value"
151 ;;
152 --ldflags=*)
153 LDFLAGS="$value"
154 ;;
155 --c-compiler=*)
156 CC="$value"
157 ;;
158 --linker=*)
159 LD="$value"
160 ;;
161 *)
162 echo "Error: Unknown flag: $1"
163 exit 1
164 ;;
165 esac
166 shift
167 done
172 168
173 if [ "$PREFIX_SET" = "yes" -a ! "$SYSCONFDIR_SET" = "yes" ] 169 if [ "$PREFIX_SET" = "yes" -a ! "$SYSCONFDIR_SET" = "yes" ]
174 then 170 then
175 if [ "$PREFIX" = "/usr" ] 171 if [ "$PREFIX" = "/usr" ]
176 then SYSCONFDIR=/etc/prosody 172 then SYSCONFDIR=/etc/prosody