📄 configure.ac
字号:
AC_INIT(rdesktop, 1.6.0)AC_CONFIG_SRCDIR([rdesktop.c])AC_PROG_CCif test "$GCC" = yes; then CFLAGS="$CFLAGS -Wall"fiAC_PROG_INSTALLAC_LANG_CAC_HEADER_STDCAC_C_BIGENDIAN([AC_DEFINE(B_ENDIAN)], [AC_DEFINE(L_ENDIAN)])AC_PATH_XTRAif test "$no_x" = "yes"; then echo echo "ERROR: Could not find X Window System headers/libraries." if test -f /etc/debian_version; then echo "Probably you need to install the libx11-dev package." elif test -f /etc/redhat-release; then echo "Probably you need to install the libX11-devel package." fi echo "To specify paths manually, use the options --x-includes and --x-libraries." echo exit 1fi AC_PATH_PROG(PKG_CONFIG, pkg-config)AC_SEARCH_LIBS(socket, socket)AC_SEARCH_LIBS(inet_aton, resolv)AC_CHECK_HEADER(sys/select.h, AC_DEFINE(HAVE_SYS_SELECT_H))AC_CHECK_HEADER(sys/modem.h, AC_DEFINE(HAVE_SYS_MODEM_H))AC_CHECK_HEADER(sys/filio.h, AC_DEFINE(HAVE_SYS_FILIO_H))AC_CHECK_HEADER(sys/strtio.h, AC_DEFINE(HAVE_SYS_STRTIO_H))AC_CHECK_HEADER(locale.h, AC_DEFINE(HAVE_LOCALE_H))AC_CHECK_HEADER(langinfo.h, AC_DEFINE(HAVE_LANGINFO_H))AC_CHECK_TOOL(STRIP, strip, :)dnl Don't depend on pkg-configm4_ifdef([PKG_CHECK_MODULES], [], [ m4_errprint([warning: pkg-config checks are not available]) m4_defun([PKG_CHECK_MODULES], [ AC_MSG_WARN([pkg-config not available, cannot check for $2]) $4 ])])rpath=""## OpenSSL detection borrowed from stunnel#checkssldir() { : if test -f "$1/include/openssl/ssl.h"; then ssldir="$1" return 0 fi return 1}AC_MSG_CHECKING([for OpenSSL directory])AC_ARG_WITH(openssl, [ --with-openssl=DIR look for OpenSSL at DIR/include, DIR/lib], [ dnl Check the specified location only checkssldir "$withval" ], [ dnl Search default locations of OpenSSL library for maindir in /usr/local /usr/lib /usr/pkg /usr /var/ssl /opt; do for dir in $maindir $maindir/openssl $maindir/ssl; do checkssldir $dir && break 2 done done ])if test -z "$ssldir"; then AC_MSG_RESULT([Not found]) echo echo "ERROR: Could not find OpenSSL headers/libraries." if test -f /etc/debian_version; then echo "Probably you need to install the libssl-dev package." elif test -f /etc/redhat-release; then echo "Probably you need to install the openssl-devel package." fi echo "To specify a path manually, use the --with-openssl option." echo exit 1fiAC_MSG_RESULT([$ssldir])AC_SUBST(ssldir)AC_DEFINE_UNQUOTED(ssldir, "$ssldir")dnl Add OpenSSL includes and librariesCFLAGS="$CFLAGS -I$ssldir/include"AC_ARG_ENABLE(static-openssl, [ --enable-static-openssl link OpenSSL statically], [ LIBS="$LIBS $ssldir/lib/libcrypto.a" ], [ LIBS="$LIBS -L$ssldir/lib -lcrypto" rpath="$rpath:$ssldir/lib" ])AC_ARG_ENABLE(smartcard, [ --enable-smartcard Enables smart-card support. ], [ case "$OSTYPE" in darwin*) AC_CHECK_HEADER(PCSC/pcsclite.h, [WITH_SCARD=1], [WITH_SCARD=0]) PCSCLITE_CFLAGS="" PCSCLITE_LIBS="-framework PCSC" ;; *) if test -n "$PKG_CONFIG"; then PKG_CHECK_MODULES(PCSCLITE, libpcsclite, [WITH_SCARD=1], [WITH_SCARD=0]) fi ;; esac if test x"$WITH_SCARD" = "x1"; then SCARDOBJ="scard.o" CFLAGS="$CFLAGS $PCSCLITE_CFLAGS" LIBS="$LIBS $PCSCLITE_LIBS" AC_DEFINE(WITH_SCARD) fi AC_MSG_CHECKING([for old version of PCSC]) AC_TRY_LINK([ #include <stdlib.h> #ifdef __APPLE__ #include <PCSC/wintypes.h> #include <PCSC/winscard.h> #else #include <winscard.h> #endif ], [SCardControl(NULL, NULL, 0, NULL, NULL);], [AC_MSG_RESULT(yes) AC_DEFINE(WITH_PCSC120, 1, [old version of PCSC])], [AC_MSG_RESULT(no)] ) ])AC_SUBST(SCARDOBJ)## Alignment#AC_MSG_CHECKING([if architecture needs alignment])AC_TRY_RUN([#include <stdlib.h>#include <signal.h>int main(int argc, char **argv){ unsigned char test[8] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88 }; signal(SIGBUS, exit); signal(SIGABRT, exit); signal(SIGSEGV, exit); if (*((unsigned int *)(test + 1)) != 0x55443322 && *((unsigned int *)(test + 1)) != 0x22334455) { return 1; } return 0;}], [AC_MSG_RESULT(no)], [AC_MSG_RESULT(yes) AC_DEFINE(NEED_ALIGN)], [AC_MSG_RESULT(assuming yes) AC_DEFINE(NEED_ALIGN)])## EGD#AC_ARG_WITH(egd-socket, [ --with-egd-socket=PATH look for Entropy Gathering Daemon socket at PATH], [EGD_SOCKET="$withval"], [EGD_SOCKET="/var/run/egd-pool"])AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")## rdp2vnc#vncserverconfig=libvncserver-configAC_ARG_WITH(libvncserver-config, [ --with-libvncserver-config=CMD use CMD as libvncserver-config], [vncserverconfig="$withval"])AC_ARG_WITH(libvncserver, [ --with-libvncserver make rdp2vnc], [ VNCINC=`$vncserverconfig --cflags` AC_SUBST(VNCINC) LDVNC=`$vncserverconfig --libs` AC_SUBST(LDVNC) VNCLINK=`$vncserverconfig --link` AC_SUBST(VNCLINK) RDP2VNCTARGET="rdp2vnc" AC_SUBST(RDP2VNCTARGET) ])## sound#sound="yes"AC_ARG_WITH(sound, [ --with-sound select sound system ("oss", "sgi", "sun", "alsa" or "libao") ], [ sound="$withval" ])AC_CHECK_HEADER(sys/soundcard.h, [HAVE_OSS=1], [HAVE_OSS=0])AC_CHECK_HEADER(dmedia/audio.h, [HAVE_SGI=1], [HAVE_SGI=0])AC_CHECK_HEADER(sys/audioio.h, [HAVE_SUN=1], [HAVE_SUN=0])AC_ARG_ENABLE(static-libsamplerate, [ --enable-static-libsamplerate link libsamplerate statically], [static_libsamplerate=yes], [static_libsamplerate=no])if test -n "$PKG_CONFIG"; then PKG_CHECK_MODULES(LIBAO, ao, [HAVE_LIBAO=1], [HAVE_LIBAO=0]) PKG_CHECK_MODULES(ALSA, alsa, [HAVE_ALSA=1], [HAVE_ALSA=0]) PKG_CHECK_MODULES(LIBSAMPLERATE, samplerate, [HAVE_LIBSAMPLERATE=1], [HAVE_LIBSAMPLERATE=0]) if test x"$HAVE_LIBSAMPLERATE" = "x1"; then AC_DEFINE(HAVE_LIBSAMPLERATE) if test x"$static_libsamplerate" = "xyes"; then _libsamplerate_libdir=`$PKG_CONFIG --errors-to-stdout --variable=libdir samplerate` LIBSAMPLERATE_LIBS="$_libsamplerate_libdir""/libsamplerate.a" fi LIBSAMPLERATE_LIBS="$LIBSAMPLERATE_LIBS -lm" fifiif test "$sound" != "no"; then SOUNDOBJ="$SOUNDOBJ rdpsnd.o rdpsnd_dsp.o" CFLAGS="$CFLAGS $LIBSAMPLERATE_CFLAGS" LIBS="$LIBS $LIBSAMPLERATE_LIBS" AC_DEFINE(WITH_RDPSND)ficase $sound in yes) if test x"$HAVE_OSS" = "x1"; then SOUNDOBJ="$SOUNDOBJ rdpsnd_oss.o" AC_DEFINE(RDPSND_OSS) fi if test x"$HAVE_SGI" = "x1"; then SOUNDOBJ="$SOUNDOBJ rdpsnd_sgi.o" LIBS="$LIBS -laudio" AC_DEFINE(RDPSND_SGI) fi if test x"$HAVE_SUN" = "x1"; then SOUNDOBJ="$SOUNDOBJ rdpsnd_sun.o" AC_DEFINE(RDPSND_SUN) fi if test x"$HAVE_ALSA" = "x1"; then SOUNDOBJ="$SOUNDOBJ rdpsnd_alsa.o" CFLAGS="$CFLAGS $ALSA_CFLAGS" LIBS="$LIBS $ALSA_LIBS" AC_DEFINE(RDPSND_ALSA) fi if test x"$HAVE_LIBAO" = "x1"; then SOUNDOBJ="$SOUNDOBJ rdpsnd_libao.o" CFLAGS="$CFLAGS $LIBAO_CFLAGS" LIBS="$LIBS $LIBAO_LIBS" AC_DEFINE(RDPSND_LIBAO) fi ;; oss) if test x"$HAVE_OSS" = "x1"; then SOUNDOBJ="$SOUNDOBJ rdpsnd_oss.o" AC_DEFINE(RDPSND_OSS) else AC_MSG_ERROR([Selected sound system is not available.]) fi ;; sgi) if test x"$HAVE_SGI" = "x1"; then SOUNDOBJ="$SOUNDOBJ rdpsnd_sgi.o" LIBS="$LIBS -laudio" AC_DEFINE(RDPSND_SGI) else AC_MSG_ERROR([Selected sound system is not available.]) fi ;; sun) if test x"$HAVE_SUN" = "x1"; then SOUNDOBJ="$SOUNDOBJ rdpsnd_sun.o" AC_DEFINE(RDPSND_SUN) else AC_MSG_ERROR([Selected sound system is not available.]) fi ;; alsa) if test x"$HAVE_ALSA" = "x1"; then SOUNDOBJ="$SOUNDOBJ rdpsnd_alsa.o" CFLAGS="$CFLAGS $ALSA_CFLAGS" LIBS="$LIBS $ALSA_LIBS" AC_DEFINE(RDPSND_ALSA) else AC_MSG_ERROR([Selected sound system is not available.]) fi ;; libao) if test x"$HAVE_LIBAO" = "x1"; then SOUNDOBJ="$SOUNDOBJ rdpsnd_libao.o" CFLAGS="$CFLAGS $LIBAO_CFLAGS" LIBS="$LIBS $LIBAO_LIBS" AC_DEFINE(RDPSND_LIBAO) else AC_MSG_ERROR([Selected sound system is not available.]) fi ;; no) ;; *) AC_MSG_WARN([sound support disabled]) AC_MSG_WARN([Currently supported systems are Open Sound System (oss), SGI AL (sgi), Sun/BSD (sun), ALSA (alsa) and libao]) ;;esacAC_SUBST(SOUNDOBJ)## dirfd#dnl Find out how to get the file descriptor associated with an open DIR*.dnl From Jim MeyeringAC_DEFUN([UTILS_FUNC_DIRFD],[ AC_HEADER_DIRENT dirfd_headers='#if HAVE_DIRENT_H# include <dirent.h>#else /* not HAVE_DIRENT_H */# define dirent direct# if HAVE_SYS_NDIR_H# include <sys/ndir.h># endif /* HAVE_SYS_NDIR_H */# if HAVE_SYS_DIR_H# include <sys/dir.h># endif /* HAVE_SYS_DIR_H */# if HAVE_NDIR_H# include <ndir.h># endif /* HAVE_NDIR_H */#endif /* HAVE_DIRENT_H */' AC_CHECK_FUNCS(dirfd) AC_CHECK_DECLS([dirfd], , , $dirfd_headers) AC_CACHE_CHECK([whether dirfd is a macro], jm_cv_func_dirfd_macro, [AC_EGREP_CPP([dirent_header_defines_dirfd], [$dirfd_headers#ifdef dirfd dirent_header_defines_dirfd#endif], jm_cv_func_dirfd_macro=yes, jm_cv_func_dirfd_macro=no)]) # Use the replacement only if we have no function, macro, # or declaration with that name. if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$jm_cv_func_dirfd_macro \ = no,no,no; then AC_REPLACE_FUNCS([dirfd]) AC_CACHE_CHECK( [how to get the file descriptor associated with an open DIR*], gl_cv_sys_dir_fd_member_name, [ dirfd_save_CFLAGS=$CFLAGS for ac_expr in d_fd dd_fd; do CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr" AC_TRY_COMPILE( [$dirfd_headers ], [DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;], dir_fd_found=yes ) CFLAGS=$dirfd_save_CFLAGS test "$dir_fd_found" = yes && break done test "$dir_fd_found" = yes || ac_expr=no_such_member gl_cv_sys_dir_fd_member_name=$ac_expr ] ) if test $gl_cv_sys_dir_fd_member_name != no_such_member; then AC_DEFINE_UNQUOTED(DIR_FD_MEMBER_NAME, $gl_cv_sys_dir_fd_member_name, [the name of the file descriptor member of DIR]) fi AH_VERBATIM(DIR_TO_FD, [#ifdef DIR_FD_MEMBER_NAME# define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME)#else# define DIR_TO_FD(Dir_p) -1#endif] ) fi])UTILS_FUNC_DIRFD## iconv#dnl This macros shamelessly stolen fromdnl http://gcc.gnu.org/ml/gcc-bugs/2001-06/msg01398.html.dnl Written by Bruno Haible.AC_DEFUN([UTILS_FUNC_ICONV],[ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_ARG_WITH([libiconv-prefix],[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [ for dir in `echo "$withval" | tr : ' '`; do if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi done ]) AC_CHECK_HEADER(iconv.h, AC_DEFINE(HAVE_ICONV_H)) AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include <stdlib.h>#include <iconv.h>], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_func_iconv=yes)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -