📄 configure.in
字号:
dnl $Id: configure.in,v 1.12 2003/07/26 16:25:59 darren Exp $dnl Copyright (c) 1996-2002, Darren Hiebertdnldnl This source code is released for free distribution under the termsdnl of the GNU General Public License.dnl Process this file with autoconf to produce a configure script.AC_PREREQ(1.12)AC_INIT(ctags.h)AC_CONFIG_HEADER(config.h)dnl Report system infodnl ------------------echo 'Exuberant Ctags, version 5.5.4'uname -mrsv 2>/dev/nulldnl Define convenience macrosdnl -------------------------dnl CHECK_HEADER_DEFINE(LABEL, HEADER [,ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ] ])AC_DEFUN(CHECK_HEADER_DEFINE,[ AC_MSG_CHECKING("if $1 is defined in $2") AC_EGREP_CPP(yes,[#include <$2>#ifdef $1 yes#endif], [ AC_MSG_RESULT(yes) $3], [ AC_MSG_RESULT(no) $4]) ])dnl Checks for configuration optionsdnl --------------------------------AC_ARG_WITH(posix-regex,[ --with-posix-regex use Posix regex interface, if available])AC_ARG_WITH(readlib,[ --with-readlib include readtags library object during install])dnl AC_ARG_WITH(perl-regex,dnl [ --with-perl-regex use Perl pcre interface, if available])AC_ARG_ENABLE(etags,[ --disable-etags disable the installation of links for etags])AC_ARG_ENABLE(extended-format,[ --disable-extended-format disable extension flags; use original ctags file format only], AC_DEFINE(DEFAULT_FILE_FORMAT, 1), AC_DEFINE(DEFAULT_FILE_FORMAT, 2))AC_ARG_ENABLE(external-sort,[ --disable-external-sort use internal sort algorithm instead of sort program])AC_ARG_ENABLE(custom-config,[ --enable-custom-config=FILE enable custom config file for site-wide defaults])AC_ARG_ENABLE(macro-patterns,[ --enable-macro-patterns use patterns as default method to locate macros instead of line numbers])AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode use maintainer makefile])AC_ARG_ENABLE(shell-globbing,[ --enable-shell-globbing=DIR does shell expand wildcards (yes|no)? [yes]])AC_ARG_ENABLE(tmpdir,[ --enable-tmpdir=DIR default directory for temporary files [ARG=/tmp]], tmpdir_specified=yes)dnl Process configuration optionsdnl -----------------------------if test "$enable_maintainer_mode" = yes ; then AC_MSG_RESULT(enabling maintainer mode)fiinstall_targets="install-ctags"AC_MSG_CHECKING(whether to install link to etags)if test no != "$enable_etags"; then AC_MSG_RESULT(yes) install_targets="$install_targets install-etags"else AC_MSG_RESULT(no)fiAC_MSG_CHECKING(whether to install readtags object file)if test yes = "$with_readlib"; then AC_MSG_RESULT(yes) install_targets="$install_targets install-lib"else AC_MSG_RESULT(no)fiAC_SUBST(install_targets)if test "$enable_custom_config" = no -o "$enable_custom_config" = yes ; then AC_MSG_RESULT(no name supplied for custom configuration file)elif test -n "$enable_custom_config" ; then AC_DEFINE_UNQUOTED(CUSTOM_CONFIGURATION_FILE, "$enable_custom_config") AC_MSG_RESULT($enable_custom_config will be used as custom configuration file)fiif test "$enable_macro_patterns" = yes ; then AC_DEFINE(MACROS_USE_PATTERNS) AC_MSG_RESULT(tag file will use patterns for macros by default)fidnl Checks for programsdnl -------------------AC_PROG_CCcase `uname` in HP-UX) AC_MSG_CHECKING("HP-UX native compiler") if test "$CC" = "cc"; then AC_MSG_RESULT(yes; adding compiler options for ANSI support) CFLAGS="$CFLAGS -Aa -D_HPUX_SOURCE" else AC_MSG_RESULT(no) fi ;; SunOS) if uname -r | grep '5\.' >/dev/null 2>&1; then AC_MSG_CHECKING("Solaris native compiler") if test "$CC" = "cc" -a "`which cc`" = "/usr/ucb/cc"; then AC_MSG_RESULT(yes; adding compiler option for ANSI support) CC="$CC -Xa" else AC_MSG_RESULT(no) fi fi ;;esacAC_PROG_LN_SAC_CHECK_PROG(STRIP, strip, strip, :)dnl Checks for operating environmentdnl --------------------------------dnl Check for temporary directoryAC_MSG_CHECKING(directory to use for temporary files)if test -n "$enable_tmpdir"; then tmpdir="$enable_tmpdir"elif test -n "$TMPDIR"; then tmpdir="$TMPDIR"elif test -n "$TMPDIR"; then tmpdir="$TMPDIR"elif test -n "$TMP"; then tmpdir="$TMP"elif test -n "$TEMP"; then tmpdir="$TEMP"elif test -d "c:/"; then tmpdir="c:/"else tmpdir="/tmp"fiif test -d $tmpdir ; then AC_MSG_RESULT($tmpdir) AC_DEFINE_UNQUOTED(TMPDIR, "$tmpdir")else AC_MSG_ERROR($tmpdir does not exist)fidnl Check whether system supports #! scriptsAC_SYS_INTERPRETERif test yes = "$interpval"; then AC_DEFINE(SYS_INTERPRETER)fidnl Test for case-insensitive filenamesAC_MSG_CHECKING("for case-insensitive filenames")touch conftest.cifif test -f CONFTEST.CIF; then AC_MSG_RESULT(yes) AC_DEFINE(CASE_INSENSITIVE_FILENAMES)else AC_MSG_RESULT(no)firm -f conftest.cifAC_MSG_CHECKING(selected sort method)if test no = "$enable_external_sort"; then AC_MSG_RESULT(simple internal algorithm)else AC_MSG_RESULT(external sort utility) enable_external_sort=no AC_CHECK_PROG(sort_found, sort, yes, no) if test "$sort_found" = yes ; then AC_MSG_CHECKING(if sort accepts our command line) touch ${tmpdir}/sort.test sort -u -f -o ${tmpdir}/sort.test ${tmpdir}/sort.test 1>/dev/null 2>&1 if test $? -ne 0 ; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) AC_DEFINE(EXTERNAL_SORT) enable_external_sort=yes fi rm -f ${tmpdir}/sort.test fifiif test "$enable_external_sort" != yes ; then AC_MSG_RESULT(using internal sort algorithm as fallback)fidnl Checks for header filesdnl -----------------------AC_CHECK_HEADERS(dirent.h fcntl.h fnmatch.h stat.h stdlib.h string.h)AC_CHECK_HEADERS(time.h types.h unistd.h)AC_CHECK_HEADERS(sys/dir.h sys/stat.h sys/times.h sys/types.h)dnl Checks for header file macrosdnl -----------------------------CHECK_HEADER_DEFINE(L_tmpnam, stdio.h,, AC_DEFINE(L_tmpnam, 20))CHECK_HEADER_DEFINE(INT_MAX, limits.h,, CHECK_HEADER_DEFINE(MAXINT, limits.h, AC_DEFINE(INT_MAX, MAXINT), AC_DEFINE(INT_MAX, 32767)))dnl Checks for typedefsdnl -------------------AC_TYPE_SIZE_TAC_TYPE_OFF_TAC_MSG_CHECKING("for fpos_t")AC_EGREP_HEADER(fpos_t, stdio.h, AC_MSG_RESULT(yes),[ AC_MSG_RESULT(no) AC_DEFINE(fpos_t, long)])AC_MSG_CHECKING("for clock_t")AC_EGREP_HEADER(clock_t, time.h, AC_MSG_RESULT(yes),[ AC_MSG_RESULT(no) AC_DEFINE(clock_t, long)])dnl Checks for compiler characteristicsdnl -----------------------------------dnl AC_CYGWINdnl AC_MINGW32AC_C_CONSTAC_OBJEXTAC_EXEEXTAC_MSG_CHECKING(if struct stat contains st_ino)AC_TRY_COMPILE([#include <sys/stat.h>], [ struct stat st; stat(".", &st); if (st.st_ino > 0) exit(0);], have_st_ino=yes, have_st_ino=no)AC_MSG_RESULT($have_st_ino)if test yes = "$have_st_ino"; then AC_DEFINE(HAVE_STAT_ST_INO)fidnl Checks for library functionsdnl ----------------------------AC_CHECK_FUNCS(fnmatch)AC_CHECK_FUNCS(strstr)AC_CHECK_FUNCS(strcasecmp stricmp, break)AC_CHECK_FUNCS(strncasecmp strnicmp, break)AC_CHECK_FUNCS(fgetpos, have_fgetpos=yes)dnl SEEK_SET should be in stdio.h, but may be in unistd.h on SunOS 4.1.xif test "$have_fgetpos" != yes ; then CHECK_HEADER_DEFINE(SEEK_SET, stdio.h,, CHECK_HEADER_DEFINE(SEEK_SET, unistd.h,, AC_DEFINE(SEEK_SET, 0)))fiAC_CHECK_FUNCS(mkstemp, have_mkstemp=yes)if test "$have_mkstemp" != yes ; then AC_CHECK_FUNCS(tempnam, have_tempnam=yes)fiif test "$have_mkstemp" != yes -a "$have_tempnam" != yes; then AC_CHECK_FUNCS(chmod) if test "$tmpdir_specified" = yes ; then AC_MSG_RESULT(use of tmpnam overrides temporary directory selection) fifiAC_CHECK_FUNCS(opendir findfirst _findfirst, break)AC_CHECK_FUNCS(strerror)AC_CHECK_FUNCS(clock times, break)AC_CHECK_FUNCS(remove, have_remove=yes, CHECK_HEADER_DEFINE(remove, unistd.h,, AC_DEFINE(remove, unlink)))AC_CHECK_FUNCS(truncate, have_truncate=yes)dnl === Cannot nest AC_CHECK_FUNCS() callsif test "$have_truncate" != yes ; then AC_CHECK_FUNCS(ftruncate, have_ftruncate=yes) if test "$have_ftruncate" != yes ; then AC_CHECK_FUNCS(chsize) fifiAC_CHECK_FUNCS(setenv, have_setenv=yes)dnl === Cannot nest AC_CHECK_FUNCS() callsif test "$have_setenv" != yes ; then AC_CHECK_FUNCS(putenv, have_putenv=yes) if test "$have_putenv" = yes ; then AC_EGREP_HEADER(putenv, stdlib.h, have_putenv_prototype=yes) if test "$have_putenv_prototype" = yes ; then AC_MSG_CHECKING("putenv prototype") AC_EGREP_HEADER([[^A-Za-zo-9_]putenv[ ]*\(.*const.*\)[ ]*;], stdlib.h, AC_MSG_RESULT(correct), [ AC_MSG_RESULT(no const) AC_DEFINE(NON_CONST_PUTENV_PROTOTYPE) ]) fi fifidnldnl if test yes = "$CYGWIN"; then with_posix_regex=no; fiif test no != "$with_posix_regex"; then AC_CHECK_FUNCS(regcomp) AC_MSG_CHECKING(if regcomp works) AC_TRY_RUN([#include <sys/types.h>#include <regex.h>main() { regex_t patbuf; exit (regcomp (&patbuf, "/hello/", 0) != 0);}],regcomp_works=yes,regcomp_works=no,AC_DEFINE(CHECK_REGCOMP)) AC_MSG_RESULT($regcomp_works) if test yes != "$regcomp_works"; then AC_DEFINE(REGCOMP_BROKEN) fifidnl if test yes = "$with_perl_regex"; thendnl AC_MSG_CHECKING(for Perl regex library)dnl pcre_candidates="$with_perl_regex $HOME/local/lib* /usr*/local/lib* /usr/lib*"dnl for lib in $pcre_candidates; dodnl if test -f $lib/libpcreposix.so; thendnl pcre_lib="-L$lib -lpcreposix"dnl breakdnl elif test -f $lib/libpcreposix.a; thendnl pcre_lib="$lib/libpcreposix.a"dnl breakdnl fidnl donednl if test -z "$pcre_lib"; thendnl AC_MSG_RESULT(not found)dnl elsednl AC_MSG_RESULT($lib)dnl AC_DEFINE(HAVE_REGCOMP)dnl LDFLAGS="$LDFLAGS $pcre_lib"dnl have_regex=yesdnl fidnl fidnl Checks for missing prototypesdnl -----------------------------AC_CHECKING("for missing prototypes")AC_DEFUN(CHECK_PROTO, [AC_EGREP_HEADER([[^A-Za-z0-9_]$1([ ]+[A-Za-z0-9_]*)?\(], $2,, AC_DEFINE(patsubst([NEED_PROTO_NAME], [NAME], translit($1, [a-z], [A-Z]))) AC_MSG_RESULT(adding prototype for $1))])if test "$have_remove" = yes ; then CHECK_PROTO(remove, stdio.h)else CHECK_PROTO(unlink, unistd.h)fiCHECK_PROTO(malloc, stdlib.h)CHECK_PROTO(getenv, stdlib.h)CHECK_PROTO(stat, sys/stat.h)CHECK_PROTO(lstat, sys/stat.h)if test "$have_fgetpos" = yes ; then CHECK_PROTO(fgetpos, stdio.h)fiif test "$have_truncate" = yes ; then CHECK_PROTO(truncate, unistd.h)fiif test "$have_ftruncate" = yes ; then CHECK_PROTO(ftruncate, unistd.h)fidnl Output filesdnl ------------rm -f Makefileif test "$enable_maintainer_mode" = yes ; then AC_MSG_RESULT(creating maintainer Makefile) ln -s maintainer.mak Makefile makefile_out=else makefile_out=MakefilefiAC_OUTPUT($makefile_out)dnl vim:ts=4:sw=4:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -