X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=configure.ac;h=56731c35c9d1b5e2d2c82cdff51ab496dcbac7f5;hb=99f55ebc6757ec8777627142e7f8e1dc50f68d2c;hp=914ae5759f6932c28ee39afec1e36d80c8e63cd9;hpb=28bf4ba014c9b41679f41580fa9e1cc294b240d9;p=git.git diff --git a/configure.ac b/configure.ac index 914ae5759..56731c35c 100644 --- a/configure.ac +++ b/configure.ac @@ -179,6 +179,26 @@ fi], AC_MSG_NOTICE([Will try -pthread then -lpthread to enable POSIX Threads.]) ]) +# Define option to enable JavaScript minification +AC_ARG_ENABLE([jsmin], +[AS_HELP_STRING([--enable-jsmin=PATH], + [PATH is the name of a JavaScript minifier or the absolute path to one.])], +[ + JSMIN=$enableval; + AC_MSG_NOTICE([Setting JSMIN to '$JSMIN' to enable JavaScript minifying]) + GIT_CONF_APPEND_LINE(JSMIN=$enableval); +]) + +# Define option to enable CSS minification +AC_ARG_ENABLE([cssmin], +[AS_HELP_STRING([--enable-cssmin=PATH], + [PATH is the name of a CSS minifier or the absolute path to one.])], +[ + CSSMIN=$enableval; + AC_MSG_NOTICE([Setting CSSMIN to '$CSSMIN' to enable CSS minifying]) + GIT_CONF_APPEND_LINE(CSSMIN=$enableval); +]) + ## Site configuration (override autodetection) ## --with-PACKAGE[=ARG] and --without-PACKAGE AC_MSG_NOTICE([CHECKS for site configuration]) @@ -307,6 +327,12 @@ GIT_PARSE_WITH(tcltk)) AC_MSG_NOTICE([CHECKS for programs]) # AC_PROG_CC([cc gcc]) +AC_C_INLINE +case $ac_cv_c_inline in + inline | yes | no) ;; + *) AC_SUBST([INLINE], [$ac_cv_c_inline]) ;; +esac + # which switch to pass runtime path to dynamic libraries to the linker AC_CACHE_CHECK([if linker supports -R], git_cv_ld_dashr, [ SAVE_LDFLAGS="${LDFLAGS}" @@ -342,6 +368,7 @@ fi #AC_PROG_INSTALL # needs install-sh or install.sh in sources AC_CHECK_TOOLS(AR, [gar ar], :) AC_CHECK_PROGS(TAR, [gtar tar]) +AC_CHECK_PROGS(DIFF, [gnudiff gdiff diff]) # TCLTK_PATH will be set to some value if we want Tcl/Tk # or will be empty otherwise. if test -z "$NO_TCLTK"; then @@ -524,13 +551,47 @@ AC_SUBST(NEEDS_SOCKET) test -n "$NEEDS_SOCKET" && LIBS="$LIBS -lsocket" # -# Define NEEDS_RESOLV if linking with -lnsl and/or -lsocket is not enough. -# Notably on Solaris hstrerror resides in libresolv and on Solaris 7 -# inet_ntop and inet_pton additionally reside there. -AC_CHECK_LIB([c], [hstrerror], -[NEEDS_RESOLV=], -[NEEDS_RESOLV=YesPlease]) +# The next few tests will define NEEDS_RESOLV if linking with +# libresolv provides some of the functions we would normally get +# from libc. +NEEDS_RESOLV= AC_SUBST(NEEDS_RESOLV) +# +# Define NO_INET_NTOP if linking with -lresolv is not enough. +# Solaris 2.7 in particular hos inet_ntop in -lresolv. +NO_INET_NTOP= +AC_SUBST(NO_INET_NTOP) +AC_CHECK_FUNC([inet_ntop], + [], + [AC_CHECK_LIB([resolv], [inet_ntop], + [NEEDS_RESOLV=YesPlease], + [NO_INET_NTOP=YesPlease]) +]) +# +# Define NO_INET_PTON if linking with -lresolv is not enough. +# Solaris 2.7 in particular hos inet_pton in -lresolv. +NO_INET_PTON= +AC_SUBST(NO_INET_PTON) +AC_CHECK_FUNC([inet_pton], + [], + [AC_CHECK_LIB([resolv], [inet_pton], + [NEEDS_RESOLV=YesPlease], + [NO_INET_PTON=YesPlease]) +]) +# +# Define NO_HSTRERROR if linking with -lresolv is not enough. +# Solaris 2.6 in particular has no hstrerror, even in -lresolv. +NO_HSTRERROR= +AC_CHECK_FUNC([hstrerror], + [], + [AC_CHECK_LIB([resolv], [hstrerror], + [NEEDS_RESOLV=YesPlease], + [NO_HSTRERROR=YesPlease]) +]) +AC_SUBST(NO_HSTRERROR) +# +# If any of the above tests determined that -lresolv is needed at +# build-time, also set it here for remaining configure-time checks. test -n "$NEEDS_RESOLV" && LIBS="$LIBS -lresolv" AC_CHECK_LIB([c], [basename], @@ -578,6 +639,12 @@ AC_SUBST(OLD_ICONV) ## Checks for typedefs, structures, and compiler characteristics. AC_MSG_NOTICE([CHECKS for typedefs, structures, and compiler characteristics]) # +TYPE_SOCKLEN_T +case $ac_cv_type_socklen_t in + yes) ;; + *) AC_SUBST([SOCKLEN_T], [$git_cv_socklen_t_equiv]) ;; +esac + # Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent. AC_CHECK_MEMBER(struct dirent.d_ino, [NO_D_INO_IN_DIRENT=], @@ -639,6 +706,27 @@ else fi AC_SUBST(NO_C99_FORMAT) # +# Define NO_REGEX if you have no or inferior regex support in your C library. +AC_CACHE_CHECK([whether the platform regex can handle null bytes], + [ac_cv_c_excellent_regex], [ +AC_EGREP_CPP(yippeeyeswehaveit, + AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT +#include +], +[#ifdef REG_STARTEND +yippeeyeswehaveit +#endif +]), + [ac_cv_c_excellent_regex=yes], + [ac_cv_c_excellent_regex=no]) +]) +if test $ac_cv_c_excellent_regex = yes; then + NO_REGEX= +else + NO_REGEX=YesPlease +fi +AC_SUBST(NO_REGEX) +# # Define FREAD_READS_DIRECTORIES if your are on a system which succeeds # when attempting to read from an fopen'ed directory. AC_CACHE_CHECK([whether system succeeds to read fopen'ed directory], @@ -704,12 +792,24 @@ AC_CHECK_HEADER([libgen.h], [NO_LIBGEN_H=YesPlease]) AC_SUBST(NO_LIBGEN_H) # +# Define HAVE_PATHS_H if you have paths.h. +AC_CHECK_HEADER([paths.h], +[HAVE_PATHS_H=YesPlease], +[HAVE_PATHS_H=]) +AC_SUBST(HAVE_PATHS_H) +# # Define NO_STRCASESTR if you don't have strcasestr. GIT_CHECK_FUNC(strcasestr, [NO_STRCASESTR=], [NO_STRCASESTR=YesPlease]) AC_SUBST(NO_STRCASESTR) # +# Define NO_STRTOK_R if you don't have strtok_r +GIT_CHECK_FUNC(strtok_r, +[NO_STRTOK_R=], +[NO_STRTOK_R=YesPlease]) +AC_SUBST(NO_STRTOK_R) +# # Define NO_MEMMEM if you don't have memmem. GIT_CHECK_FUNC(memmem, [NO_MEMMEM=], @@ -782,7 +882,11 @@ AC_DEFUN([PTHREADTEST_SRC], [ int main(void) { pthread_mutex_t test_mutex; - return (0); + int retcode = 0; + retcode |= pthread_mutex_init(&test_mutex,(void *)0); + retcode |= pthread_mutex_lock(&test_mutex); + retcode |= pthread_mutex_unlock(&test_mutex); + return retcode; } ]) @@ -799,7 +903,8 @@ if test -n "$USER_NOPTHREAD"; then # handle these separately since PTHREAD_CFLAGS could be '-lpthreads # -D_REENTRANT' or some such. elif test -z "$PTHREAD_CFLAGS"; then - for opt in -pthread -lpthread; do + threads_found=no + for opt in -mt -pthread -lpthread; do old_CFLAGS="$CFLAGS" CFLAGS="$opt $CFLAGS" AC_MSG_CHECKING([Checking for POSIX Threads with '$opt']) @@ -807,11 +912,18 @@ elif test -z "$PTHREAD_CFLAGS"; then [AC_MSG_RESULT([yes]) NO_PTHREADS= PTHREAD_LIBS="$opt" + PTHREAD_CFLAGS="$opt" + threads_found=yes break ], [AC_MSG_RESULT([no])]) CFLAGS="$old_CFLAGS" done + if test $threads_found != yes; then + AC_CHECK_LIB([pthread], [pthread_create], + [PTHREAD_LIBS="-lpthread"], + [NO_PTHREADS=UnfortunatelyYes]) + fi else old_CFLAGS="$CFLAGS" CFLAGS="$PTHREAD_CFLAGS $CFLAGS" @@ -828,6 +940,7 @@ fi CFLAGS="$old_CFLAGS" +AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_LIBS) AC_SUBST(NO_PTHREADS)