102 unset FEATURE_PG |
102 unset FEATURE_PG |
103 fi |
103 fi |
104 done |
104 done |
105 |
105 |
106 # set dir variables |
106 # set dir variables |
107 if [ -z $BINDIR ]; then |
107 if [ -z "$BINDIR" ]; then |
108 BINDIR=$EPREFIX/bin |
108 BINDIR=$EPREFIX/bin |
109 fi |
109 fi |
110 if [ -z $SBINDIR ]; then |
110 if [ -z "$SBINDIR" ]; then |
111 SBINDIR=$EPREFIX/sbin |
111 SBINDIR=$EPREFIX/sbin |
112 fi |
112 fi |
113 if [ -z $LIBDIR ]; then |
113 if [ -z "$LIBDIR" ]; then |
114 LIBDIR=$EPREFIX/lib |
114 LIBDIR=$EPREFIX/lib |
115 fi |
115 fi |
116 if [ -z $LIBEXEC ]; then |
116 if [ -z "$LIBEXEC" ]; then |
117 LIBEXECDIR=$EPREFIX/libexec |
117 LIBEXECDIR=$EPREFIX/libexec |
118 fi |
118 fi |
119 if [ -z $DATADIR ]; then |
119 if [ -z "$DATADIR" ]; then |
120 DATADIR=$PREFIX/share |
120 DATADIR=$PREFIX/share |
121 fi |
121 fi |
122 if [ -z $SYSCONFDIR]; then |
122 if [ -z "$SYSCONFDIR" ]; then |
123 SYSCONFDIR=$PREFIX/etc |
123 SYSCONFDIR=$PREFIX/etc |
124 fi |
124 fi |
125 if [ -z $SHAREDSTATEDIR ]; then |
125 if [ -z "$SHAREDSTATEDIR" ]; then |
126 SHAREDSTATEDIR=$PREFIX/com |
126 SHAREDSTATEDIR=$PREFIX/com |
127 fi |
127 fi |
128 if [ -z $LOCALSTATEDIR ]; then |
128 if [ -z "$LOCALSTATEDIR" ]; then |
129 LOCALSTATEDIR=$PREFIX/var |
129 LOCALSTATEDIR=$PREFIX/var |
130 fi |
130 fi |
131 if [ -z $INCLUDEDIR ]; then |
131 if [ -z "$INCLUDEDIR" ]; then |
132 INCLUDEDIR=$PREFIX/include |
132 INCLUDEDIR=$PREFIX/include |
133 fi |
133 fi |
134 if [ -z $INFODIR ]; then |
134 if [ -z "$INFODIR" ]; then |
135 INFODIR=$PREFIX/info |
135 INFODIR=$PREFIX/info |
136 fi |
136 fi |
137 if [ -z $MANDIR ]; then |
137 if [ -z "$MANDIR" ]; then |
138 MANDIR=$PREFIX/man |
138 MANDIR=$PREFIX/man |
139 fi |
139 fi |
140 |
140 |
141 which pkg-config > /dev/null |
141 which pkg-config > /dev/null |
142 if [ $? -ne 0 ]; then |
142 if [ $? -eq 0 ]; then |
143 PKG_CONFIG=pkg-config |
143 PKG_CONFIG=pkg-config |
144 else |
144 else |
145 PKG_CONFIG=false |
145 PKG_CONFIG=false |
146 fi |
146 fi |
147 |
147 |
224 # this will insert make vars to config.mk |
224 # this will insert make vars to config.mk |
225 source make/toolchain.sh |
225 source make/toolchain.sh |
226 |
226 |
227 # add user specified flags to config.mk |
227 # add user specified flags to config.mk |
228 echo >> $TEMP_DIR/config.mk |
228 echo >> $TEMP_DIR/config.mk |
229 if [[ ! -z ${ENV_CFLAGS} ]]; then |
229 if [ ! -z "${ENV_CFLAGS}" ]; then |
230 echo "CFLAGS += $ENV_CFLAGS" >> $TEMP_DIR/config.mk |
230 echo "CFLAGS += $ENV_CFLAGS" >> $TEMP_DIR/config.mk |
231 fi |
231 fi |
232 if [[ ! -z ${ENV_CXXFLAGS} ]]; then |
232 if [ ! -z "${ENV_CXXFLAGS}" ]; then |
233 echo "CXXFLAGS += $ENV_CXXFLAGS" >> $TEMP_DIR/config.mk |
233 echo "CXXFLAGS += $ENV_CXXFLAGS" >> $TEMP_DIR/config.mk |
234 fi |
234 fi |
235 if [[ ! -z ${ENV_LDFLAGS} ]]; then |
235 if [ ! -z "${ENV_LDFLAGS}" ]; then |
236 echo "LDFLAGS += $ENV_LDFLAGS" >> $TEMP_DIR/config.mk |
236 echo "LDFLAGS += $ENV_LDFLAGS" >> $TEMP_DIR/config.mk |
237 fi |
237 fi |
238 |
238 |
239 # |
239 # |
240 # DEPENDENCIES |
240 # DEPENDENCIES |
286 { |
286 { |
287 printf "checking for libxml2... " |
287 printf "checking for libxml2... " |
288 # dependency libxml2 |
288 # dependency libxml2 |
289 while true |
289 while true |
290 do |
290 do |
291 if [ -z "PKG_CONFIG" ]; then |
291 if [ -z "$PKG_CONFIG" ]; then |
292 break |
292 break |
293 fi |
293 fi |
294 if ! pkg-config libxml-2.0 ; then |
294 if ! $PKG_CONFIG libxml-2.0 ; then |
295 break |
295 break |
296 fi |
296 fi |
297 CFLAGS+=" `pkg-config --cflags libxml-2.0`" |
297 CFLAGS+=" `$PKG_CONFIG --cflags libxml-2.0`" |
298 LDFLAGS+=" `pkg-config --libs libxml-2.0`" |
298 LDFLAGS+=" `$PKG_CONFIG --libs libxml-2.0`" |
299 echo yes |
299 echo yes |
300 return 0 |
300 return 0 |
301 done |
301 done |
302 |
302 |
303 echo no |
303 echo no |
321 break |
321 break |
322 done |
322 done |
323 |
323 |
324 # add general dependency flags to config.mk |
324 # add general dependency flags to config.mk |
325 echo >> $TEMP_DIR/config.mk |
325 echo >> $TEMP_DIR/config.mk |
326 if [[ ! -z ${CFLAGS} ]]; then |
326 if [ ! -z "${CFLAGS}" ]; then |
327 echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk |
327 echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk |
328 fi |
328 fi |
329 if [[ ! -z ${CXXFLAGS} ]]; then |
329 if [ ! -z "${CXXFLAGS}" ]; then |
330 echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk |
330 echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk |
331 fi |
331 fi |
332 if [[ ! -z ${LDFLAGS} ]]; then |
332 if [ ! -z "${LDFLAGS}" ]; then |
333 echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk |
333 echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk |
334 fi |
334 fi |
335 |
335 |
336 # |
336 # |
337 # OPTION VALUES |
337 # OPTION VALUES |
360 ERROR=1 |
360 ERROR=1 |
361 fi |
361 fi |
362 |
362 |
363 |
363 |
364 echo >> $TEMP_DIR/config.mk |
364 echo >> $TEMP_DIR/config.mk |
365 if [[ ! -z ${CFLAGS} ]]; then |
365 if [ ! -z "${CFLAGS}" ]; then |
366 echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk |
366 echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk |
367 fi |
367 fi |
368 if [[ ! -z ${CXXFLAGS} ]]; then |
368 if [ ! -z "${CXXFLAGS}" ]; then |
369 echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk |
369 echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk |
370 fi |
370 fi |
371 if [[ ! -z ${LDFLAGS} ]]; then |
371 if [ ! -z "${LDFLAGS}" ]; then |
372 echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk |
372 echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk |
373 fi |
373 fi |
374 |
374 |
375 if [ $ERROR -ne 0 ]; then |
375 if [ $ERROR -ne 0 ]; then |
376 echo |
376 echo |