exit 0
}
- quotes='""'
+if test -t 1 && which tput >/dev/null 2>&1; then
+ ncolors=$(tput colors)
+ if test -n "$ncolors" && test $ncolors -ge 8; then
+ bold_color=$(tput bold)
+ warn_color=$(tput setaf 3)
+ error_color=$(tput setaf 1)
+ reset_color=$(tput sgr0)
+ fi
+ # 72 used instead of 80 since that's the default of pr
+ ncols=$(tput cols)
+fi
+: ${ncols:=72}
+
log(){
echo "$@" >> $logfile
}
eval "export $e"
done
+if disabled autodetect; then
+
+ # Unless iconv is explicitely disabled by the user, we still want to probe
+ # for the iconv from the libc.
+ disabled iconv || enable libc_iconv
+
+ disable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
+ disable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
+fi
+# Mark specifically enabled, but normally autodetected libraries as requested.
+for lib in $AUTODETECT_LIBS; do
+ enabled $lib && request $lib
+done
+#TODO: switch to $AUTODETECT_LIBS when $THREADS_LIST is supported the same way
+enable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
+enable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
+
disabled logging && logfile=/dev/null
+ # command line configuration sanity checks
+
# we need to build at least one lib type
if ! enabled_any static shared; then
cat <<EOF
;;
sunos)
SHFLAGS='-shared -Wl,-h,$$(@F)'
- enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
+ enabled x86 && append SHFLAGS -mimpure-text
network_extralibs="-lsocket -lnsl"
+ add_cppflags -D__EXTENSIONS__
# When using suncc to build, the Solaris linker will mark
# an executable with each instruction set encountered by
# the Solaris assembler. As our libraries contain their own
# check for some common methods of building with pthread support
# do this before the optional library checks as some of them require pthreads
-if ! disabled pthreads && ! enabled w32threads; then
- if check_lib pthreads pthread.h pthread_join -pthread; then
+if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
+ if check_lib pthreads pthread.h pthread_join -pthread &&
+ check_lib pthreads pthread.h pthread_create -pthread; then
add_cflags -pthread
- elif check_lib pthreads pthread.h pthread_join -pthreads; then
+ elif check_lib pthreads pthread.h pthread_join -pthreads &&
+ check_lib pthreads pthread.h pthread_create -pthreads; then
add_cflags -pthreads
- elif check_lib pthreads pthread.h pthread_join -lpthreadGC2; then
+ elif check_lib pthreads pthread.h pthread_join -ldl -pthread &&
+ check_lib pthreads pthread.h pthread_create -ldl -pthread; then
+ add_cflags -ldl -pthread
+ elif check_lib pthreads pthread.h pthread_join -lpthreadGC2 &&
+ check_lib pthreads pthread.h pthread_create -lpthreadGC2; then
:
- elif check_lib pthreads pthread.h pthread_join -lpthread; then
+ elif check_lib pthreads pthread.h pthread_join -lpthread &&
+ check_lib pthreads pthread.h pthread_create -lpthread; then
:
- elif check_func pthread_join; then
+ elif check_func pthread_join && check_func pthread_create; then
enable pthreads
fi
- enabled pthreads &&
+ check_code cc "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER" || disable pthreads
- fi
+
-
- if enabled pthreads; then
- check_func pthread_cancel $pthreads_extralibs
++ if enabled pthreads; then
+ check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" $pthreads_extralibs
++ check_func pthread_cancel $pthreads_extralibs
++ fi
fi
- enabled pthreads &&
- check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" $pthreads_extralibs
-
-disabled zlib || check_lib zlib zlib.h zlibVersion -lz
-disabled bzlib || check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2
+enabled zlib && check_lib zlib zlib.h zlibVersion -lz
+enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2
+enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma
# On some systems dynamic loading requires no extra linker flags
-check_lib libdl dlfcn.h dlopen || check_lib libdl dlfcn.h dlopen -ldl
+check_lib libdl dlfcn.h "dlopen dlsym" || check_lib libdl dlfcn.h "dlopen dlsym" -ldl
check_lib libm math.h sin -lm