-dnl Check for boolean_t
-AC_MSG_CHECKING([for boolean_t in sys/types.h])
-AC_TRY_COMPILE([#include <sys/types.h>
-void quux() { boolean_t foo; }],,
- AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.)
- AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
-AC_MSG_CHECKING([for boolean_t in pthread.h])
-AC_TRY_COMPILE([#include <pthread.h>
-void quux() { boolean_t foo; }],,
- AC_DEFINE(BOOLEAN_T_IN_PTHREAD_H, 1, Define if <pthread.h> defines boolean_t.)
- AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
-AC_MSG_CHECKING([for boolean_t in cthreads.h])
-AC_TRY_COMPILE([#include <cthreads.h>
-void quux() { boolean_t foo; }],,
- AC_DEFINE(BOOLEAN_T_IN_CTHREADS_H, 1, Define if <cthreads.h> defines boolean_t.)
- AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
-
-dnl Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_TYPE_SIZE_T
-AC_HEADER_TIME
+dnl Check for -fomit-frame-pointer
+AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
+ [ac_cv_c_omit_frame_pointer],
+ [CFLAGS="${save_CFLAGS} -fomit-frame-pointer"
+ AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
+if test x"$ac_cv_c_omit_frame_pointer" != x"no"; then
+ CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
+fi
+
+dnl Check for Darwin plugin linking flags
+AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error],
+ [ac_cv_ld_darwin],
+ [CFLAGS="${save_CFLAGS} -bundle -undefined error"
+ AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
+if test x"$ac_cv_ld_darwin" != x"no"; then
+ PLDFLAGS="${PLDFLAGS} -bundle -undefined error"
+fi
+
+dnl Check for standard plugin linking flags
+AC_CACHE_CHECK([if \$CC accepts -shared],
+ [ac_cv_ld_plugins],
+ [CFLAGS="${save_CFLAGS} -shared"
+ AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
+if test x"$ac_cv_ld_plugins" != x"no"; then
+ PLDFLAGS="${PLDFLAGS} -shared"
+fi
+
+dnl Check for soname setting
+if test x"${SOFLAGS}" = x; then
+ AC_CACHE_CHECK([for soname setting],
+ [ac_cv_ld_soname],
+ [
+ # Standard
+ try_SOFLAGS="-Wl,-soname -Wl,"
+ LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
+ AC_TRY_LINK([],,ac_cv_ld_soname="${try_SOFLAGS}", [
+ # SunOS
+ try_SOFLAGS="-Wl,-h -Wl,"
+ LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
+ AC_TRY_LINK([],,ac_cv_ld_soname="${try_SOFLAGS}",
+ ac_cv_ld_soname=none)
+ ])])
+ if test x"$ac_cv_ld_soname" != x"none"; then
+ SOFLAGS=$ac_cv_ld_soname
+ else
+ echo "
+------------
+Your system doesn't seem to have support for dynamic linking. You may
+have problems using libdvdcss.
+------------
+"
+ fi
+fi