📄 configure.in
字号:
dnl Process this file with autoconf to produce a configure script.AC_INIT(editor/cooledit.c)dnl Identify target.AC_CANONICAL_SYSTEMAC_DEFINE_UNQUOTED(TARGET_MACHINE, "${target_cpu}-${target_vendor}-${target_os}")AM_INIT_AUTOMAKE(cooledit, 3.17.5)AM_CONFIG_HEADER(config.h)dnl Define package and version.dnl PACKAGE=cooleditdnl AC_SUBST(PACKAGE)dnl AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE}")dnl VERSION=3.17.5dnl AC_SUBST(VERSION)dnl AC_DEFINE_UNQUOTED(VERSION, "${VERSION}")echoecho "Now configuring $PACKAGE-$VERSION"echoif test -n "`echo ${target_os} | grep sunos`" ; thenAC_DEFINE(CRASHES_ON_STARTUP,1)fiif test -n "`echo ${target_os} | grep 'powerpc.*linux'`" ; thenAC_DEFINE(CRASHES_ON_STARTUP,1)fidnl For shared librariesAM_PROG_LIBTOOLdnl Checks for programs.AC_PROG_MAKE_SETAC_PROG_CCAC_PROG_RANLIBAC_AIXAC_ISC_POSIXdnl Does man accept -a?echo $ac_n "checking whether man accepts -a... "man -a man 1>/dev/null 2>conftestmanif test -n "`cat conftestman | grep '[[Uu]]sage'`" -o \ -n "`cat conftestman | grep '[[Ee]]rror'`" -o \ -n "`cat conftestman | grep '[[Ii]]llegal'`" ; then MAN_CMD="man %m" ; echo "no" ;else MAN_CMD="man -a %m" ; echo "yes" ;firm -f conftestmanAC_DEFINE_UNQUOTED(MAN_CMD, "${MAN_CMD}")dnl Do you have rxvt?echo $ac_n "checking for rxvt... "if rxvt -help 2>&1 | grep geom >/dev/null ; then XTERM_CMD="rxvt -fn %F -bg Navy -fg White " ; echo "yes" ;else XTERM_CMD="xterm" ; echo "no" ;firm -f conftestrxvtAC_DEFINE_UNQUOTED(XTERM_CMD, "${XTERM_CMD}")dnl Send target name.AC_ARG_ENABLE(mail-author, [--disable-mail-author Don't automatically mail me on first run],[ AC_DEFINE(DISABLE_AUTO_MAIL,1)])dnl Set of available languages.ALL_LINGUAS="cs da de es fi fr it ja ko nl no pl pt ru sl sv"AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)dnl Checks for C compiler flags that X needs and the X linker flagsAC_PATH_XTRACFLAGS="$CFLAGS $X_CFLAGS"LDFLAGS="$LDFLAGS $X_LIBS"AC_SUBST(LDFLAGS)dnl python stuffPYLIB=python1.5LIBPY=python1.5have_python_config=nohave_python_include=noAC_MSG_CHECKING(for python version 1.5)EPATH=`echo $PATH | sed -e 's+/bin:+ +g' -e 's+:+ +g'`dnl this should about cover everything :-) :-(for i in / /opt /usr /usr/local /usr/ccs /usr/ucb /home $EPATH ; do for j in . gnu local python ; do for k in . gnu local python ; do for l in lib . ; do if test -f $i/$j/$k/$l/$PYLIB/config/lib${LIBPY}.a ; then PYTHON_LIBDIR=$i/$j/$k/$l/$PYLIB/config/ have_python_config=yes fi done if test -f $i/$j/$k/include/$PYLIB/Python.h ; then PYTHON_INCLUDEDIR=$i/$j/$k/include/$PYLIB/ have_python_include=yes fi done donedoneif test x$have_python_config = xyes && test x$have_python_include = xyes ; then have_python=yes AC_MSG_RESULT(yes) AC_DEFINE(HAVE_PYTHON,1) AC_CHECK_LIB(dl, dlopen,EXTRA_PYTHON_LIBS=-ldl ) AC_CHECK_LIB(dld, shl_load,EXTRA_PYTHON_LIBS=-ldld ) AC_MSG_CHECKING(python threads) PT="" if $NM ${PYTHON_LIBDIR}/lib${LIBPY}.a | grep PyThread_init_thread 2>&5 > /dev/null ; then AC_MSG_RESULT(yes) AC_CHECK_HEADER(mach/cthreads.h,, [ AC_CHECK_LIB(pthreads, pthread_create, [ PT="-lpthreads" ], [ AC_CHECK_LIB(pthread, pthread_create, [ PT="-lpthread" ], [ AC_CHECK_LIB(c_r, pthread_create, [ PT="-lc_r" ], [ AC_CHECK_LIB(thread, __d6_pthread_create, [ PT="-lthread" ]) ])])])]) AC_CHECK_LIB(mpc, usconfig, [ PT="$PT -lmpc" ]) AC_CHECK_LIB(thread, thr_create, [ PT="$PT -lthread" ]) else AC_MSG_RESULT(no) fi PYTHON_LIBS="-L$PYTHON_LIBDIR -l$LIBPY $EXTRA_PYTHON_LIBS $PT -lm" PYTHON_INCLUDES="-I$PYTHON_INCLUDEDIR"else AC_MSG_RESULT(no) PYTHON_LIBS="" PYTHON_INCLUDES=""fiAC_SUBST(PYTHON_LIBS)AC_SUBST(PYTHON_INCLUDES)dnl python stuff donednl Checks for header files.AC_HEADER_DIRENTAC_HEADER_STDCAC_HEADER_SYS_WAITSET_CC_WARNINGSAC_PROG_INSTALLAC_CHECK_HEADERS(assert.h fcntl.h sys/fcntl.h sys/ioctl.h sys/time.h unistd.h)AC_CHECK_HEADERS(grp.h libc.h lastlog.h sys/byteorder.h sys/sockio.h)AC_CHECK_HEADERS(sys/select.h sys/errno.h alloca.h grp.h pwd.h sys/wait.h)AC_CHECK_HEADERS(string.h strings.h stdarg.h stdlib.h stdio.h termios.h select.h sys/stat.h)AC_CHECK_HEADERS(sys/ioctl.h ioctl.h termios.h sys/termios.h sys/timeb.h types.h sys/types.h)AC_CHECK_HEADERS(wchar.h langinfo.h)dnl Checks for typedefs, structures, and compiler characteristics.AC_C_CONSTAC_C_INLINEAC_TYPE_MODE_TAC_TYPE_PID_TAC_TYPE_UID_TAC_TYPE_SIZE_TAC_HEADER_TIMEAC_STRUCT_TMdnl all from rxvt-2.6.1AC_CHECK_SIZEOF(char, 1)AC_CHECK_SIZEOF(short, 2)AC_CHECK_SIZEOF(int, 4)AC_CHECK_SIZEOF(long, 4)AC_CHECK_SIZEOF(long long, 8)AC_CHECK_SIZEOF(int *, 4)dnl# uglyif test x$cross_compiling = xyes; then AC_MSG_WARN(Define typedefs in src/rsizes.h manually if necessary)fidnl# see usage belowAC_DEFUN(RXVT_CHECK_SIZE, [AC_CACHE_CHECK([for $2], $1, [AC_TRY_COMPILE([#include <sys/types.h>], $2 dummy;, [$1=yes], [if test $ac_cv_sizeof_char -ge $3; then $1="$4 char" else if test $ac_cv_sizeof_short -ge $3; then $1="$4 short" else if test $ac_cv_sizeof_int -ge $3; then $1="$4 int" else if test $ac_cv_sizeof_long -ge $3; then $1="$4 long" else if test $ac_cv_sizeof_long_long -ge $3; then $1="$4 long long" else $1="$4 long" # we _must_ have a (possibly wrong) default fi fi fi fi fi ]) ]) ] if test x"$$1" != xyes; then $5="typedef $$1 $2;" fi )dnl#dnl# Look for types the system may know about anyway.dnl#RXVT_CHECK_SIZE(rxvt_cv_int16_t, int16_t, 2, , rxvt_int16_typedef)AC_SUBST(rxvt_int16_typedef)RXVT_CHECK_SIZE(rxvt_cv_u_int16_t, u_int16_t, 2, unsigned, rxvt_u_int16_typedef)AC_SUBST(rxvt_u_int16_typedef)RXVT_CHECK_SIZE(rxvt_cv_int32_t, int32_t, 4, , rxvt_int32_typedef)AC_SUBST(rxvt_int32_typedef)RXVT_CHECK_SIZE(rxvt_cv_u_int32_t, u_int32_t, 4, unsigned, rxvt_u_int32_typedef)AC_SUBST(rxvt_u_int32_typedef)RXVT_CHECK_SIZE(rxvt_cv_int64_t, int64_t, 8, , rxvt_int64_typedef)AC_SUBST(rxvt_int64_typedef)RXVT_CHECK_SIZE(rxvt_cv_u_int64_t, u_int64_t, 8, unsigned, rxvt_u_int64_typedef)AC_SUBST(rxvt_u_int64_typedef)dnl#dnl# Now look for another we usednl#if test $ac_cv_sizeof_int_p -eq 8; then rxvt_intp_define="#define intp_t int64_t" rxvt_u_intp_define="#define u_intp_t u_int64_t"else if test $ac_cv_sizeof_int_p -eq 4; then rxvt_intp_define="#define intp_t int32_t" rxvt_u_intp_define="#define u_intp_t u_int32_t" else if test $ac_cv_sizeof_int_p -eq 2; then rxvt_intp_define="#define intp_t int16_t" rxvt_u_intp_define="#define u_intp_t u_int16_t" else rxvt_intp_define="#error set intp_t" rxvt_u_intp_define="#error set u_intp_t" fi fifiAC_SUBST(rxvt_intp_define)AC_SUBST(rxvt_u_intp_define)AC_CHECK_LIB(intl, tolower)dnl Checks for library functions.AC_FUNC_ALLOCAAC_TYPE_SIGNALAC_FUNC_VPRINTFdnldnl autoscan wants to check for a select function. How can the piping work without select?dnlAC_CHECK_FUNCS(atexit unsetenv setutent seteuid _getpty grantpt unlockpt)AC_CHECK_FUNCS(strerror getcwd re_comp regcomp strdup strspn strstr strcspn)AC_CHECK_FUNCS(strchr strrchr memmove memcpy memset memchr memcmp)AC_CHECK_FUNCS(strcasecmp strncasecmp strftime alloca tcgetattr setsid)AC_CHECK_FUNCS(setpgrp tcsetpgrp nl_langinfo)dnl for solarisAC_CHECK_LIB(socket, gethostbyname)AC_CHECK_LIB(nsl, gethostbyname)dnl mmmmmmmmmhAC_CACHE_CHECK([for XPointer], rxvt_cv_xpointer,[AC_TRY_COMPILE([#include <X11/Xlib.h>], [XPointer dummy;],rxvt_cv_xpointer=yes, rxvt_cv_xpointer=no)])if test x$rxvt_cv_xpointer = xyes; then AC_DEFINE(HAVE_XPOINTER)fidnl all the pty stuffAC_CACHE_CHECK(for getpt, rxvt_cv_func_getpt,[AC_TRY_LINK([#define _GNU_SOURCE#ifdef HAVE_STDLIB_H# include <stdlib.h>#endif], [(void)getpt();], rxvt_cv_func_getpt=yes, rxvt_cv_func_getpt=no)])if test x${rxvt_cv_func_getpt} = xyes; then AC_DEFINE(HAVE_GETPT)fi# if we don't guess right then it's up to the userAC_CACHE_CHECK(for tty/pty type, rxvt_cv_ptys,[AC_TRY_RUN([#include <stdio.h>#ifdef HAVE_STDLIB_H# ifdef HAVE_GETPT# define _GNU_SOURCE# endif# include <stdlib.h>#endif#ifdef HAVE_FCNTL_H# include <fcntl.h>#endif#include <sys/stat.h>#include <errno.h>main(){ int pty, checkerror; FILE *a, *f=fopen("conftestval", "w"); struct stat statbuf; extern int errno; if (!f) exit(1);/* presume that S_IXOTH is required for people to access devices */ if (stat("/dev", &statbuf) < 0) checkerror = 0; else checkerror = ((statbuf.st_mode & S_IXOTH) == S_IXOTH) ? 1 : 0;#if defined(__sgi) || defined(sgi) || defined(__sgi__) if (stat("/dev/ptc", &statbuf) >= 0)# ifdef HAVE__GETPTY fprintf(f, "SGI4");# else fprintf(f, "SGI3");# endif else fprintf(f, "SGI4"); exit(0);#endif#ifdef _SCO_DS if (stat("/dev/ttyp20", &statbuf) == 0) { fprintf(f, "SCO"); exit(0); }#endif/* HPUX: before ptmx */ pty = open("/dev/ptym/clone", O_RDWR); if (pty >= 0 || (checkerror && errno == EACCES)) { fprintf(f, "HPUX"); exit(0); }#if defined(HAVE_GRANTPT) && defined(HAVE_UNLOCKPT)# ifdef HAVE_GETPT pty = getpt(); if (pty >= 0 || errno == EACCES) { fprintf(f, "GLIBC"); exit(0); }# endif if (stat("/dev/ptmx", &statbuf) >= 0 && ((statbuf.st_mode & S_IFCHR) == S_IFCHR)) if (stat("/dev/pts/0", &statbuf) >= 0 && ((statbuf.st_mode & S_IFCHR) == S_IFCHR) && ((pty = open("/dev/ptmx", O_RDWR)) >= 0 || (checkerror && errno == EACCES))) { fprintf(f, "USG"); exit(0); }#endif if (stat("/dev/ttyp20", &statbuf) == 0) { fprintf(f, "SCO"); exit(0); } fprintf(f, "BSD"); exit(0);}], rxvt_cv_ptys=`cat conftestval`, rxvt_cv_ptys=UNKNOWN, dnl AC_MSG_WARN([Define/undefine PTYS_ARE_* in config.h manually]))])if test x${rxvt_cv_ptys} = xSCO; then AC_DEFINE(PTYS_ARE_NUMERIC) AC_SUBST(PTYS_ARE_NUMERIC)fiif test x${rxvt_cv_ptys} = xUSG; then AC_DEFINE(PTYS_ARE_PTMX) AC_SUBST(PTYS_ARE_PTMX) AC_DEFINE(PTYS_ARE_SEARCHED) AC_SUBST(PTYS_ARE_SEARCHED)fiif test x${rxvt_cv_ptys} = xSGI3; then AC_DEFINE(PTYS_ARE_PTC) AC_SUBST(PTYS_ARE_PTC)fiif test x${rxvt_cv_ptys} = xSGI4; then AC_DEFINE(PTYS_ARE__GETPTY) AC_SUBST(PTYS_ARE__GETPTY)fiif test x${rxvt_cv_ptys} = xCONVEX; then AC_DEFINE(PTYS_ARE_GETPTY) AC_SUBST(PTYS_ARE_GETPTY)fiif test x${rxvt_cv_ptys} = xGLIBC; then AC_DEFINE(PTYS_ARE_GETPT) AC_SUBST(PTYS_ARE_GETPT) AC_DEFINE(PTYS_ARE_SEARCHED) AC_SUBST(PTYS_ARE_SEARCHED)fiif test x${rxvt_cv_ptys} = xHPUX; then AC_DEFINE(PTYS_ARE_CLONE) AC_SUBST(PTYS_ARE_CLONE) AC_DEFINE(PTYS_ARE_SEARCHED) AC_SUBST(PTYS_ARE_SEARCHED)fiif test x${rxvt_cv_ptys} = xBSD; then AC_DEFINE(PTYS_ARE_SEARCHED) AC_SUBST(PTYS_ARE_SEARCHED)fidnl# FreeBSD needs to link libxpg4AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"])AC_SUBST(DEBUG)AC_SUBST(DLIB)AC_SUBST(DINCLUDE)AC_SUBST(CFLAGS)AC_SUBST(CPPFLAGS)AC_SUBST(LDFLAGS)AC_SUBST(LIBS)AC_SUBST(X_CFLAGS)AC_SUBST(X_LIBS)AC_SUBST(X_EXTRA_LIBS)have_forkpty=noAC_CHECK_FUNCS(forkpty, have_forkpty=yes)for lib in bsd util; do got_lib=no if test $have_forkpty = no ; then AC_CHECK_LIB($lib, forkpty, [ if test x$got_lib = xno ; then LIBS="$LIBS -l$lib" fi have_forkpty=yes got_lib=yes AC_DEFINE(HAVE_FORKPTY) ]) fidonednl check for `struct winsize'AC_MSG_CHECKING(for struct winsize)AC_TRY_COMPILE([#include "widget/pipe-headers.h"], [struct winsize w; ioctl(0, 1234, &w); ], [ioctl_get_winsize_works=yes], [ioctl_get_winsize_works=no])if test x$ioctl_get_winsize_works = xno; thenAC_DEFINE(NEED_WINSIZE)AC_MSG_RESULT(no)elseAC_MSG_RESULT(yes)fiAC_MSG_CHECKING(for --with-libs)AC_ARG_WITH(libs, [ --with-libs='lib1 ...' link against additional libs], [AC_MSG_RESULT($withval)LIBS="$withval $LIBS"], AC_MSG_RESULT(no))AC_ARG_PROGRAMdnl Enable NeXT look of widgets.AC_ARG_ENABLE(NeXT_look, [ --enable-NeXT-look NeXT ish look of the coolwidgets [no] ],enable_NeXT=$enableval,enable_NeXT="no")if test "x$enable_NeXT" = "xyes"; then AC_DEFINE(NEXT_LOOK)fidnl internationalization macrosPACKAGE_FORCE_USE_INCLUDED_GETTEXT=yesAM_GNU_GETTEXTAC_OUTPUT([Makefile rxvt/Makefile widget/Makefile editor/Makefile Makefile icon/Makefile intl/Makefile \ po/Makefile.in pixmap/Makefile lib/Makefile syntax/Makefile man/Makefile \ intl/intlh.inst], \ [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])if test x$have_python != xyes ; then echo "" echo "" echo "The Python.h header file or lib$LIBPY.a library file could not be found." echo "This could mean that Python is not installed on your system." echo "The complete Python sources can be downloaded from http://www.python.org/" echo "Cooledit will work without Python, but will not be custom programmable." echo "and will lack any features coded in Python." echo ""fiecho ""echo "Configuration done."echo "Type 'make' to compile $PACKAGE-$VERSION"echo ""
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -