{"thread":{"id":"18290","subject":"[PATCH] configure: asciidoc version test cleanup","startedAt":"2009-03-12T19:20:05Z","lastAt":"2009-03-12T19:20:12Z","messageCount":8,"participants":["Ben Walton"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"107871","messageId":"1236885612-22575-1-git-send-email-bwalton@artsci.utoronto.ca","threadId":"18290","inReplyTo":null,"subject":"autoconf changes","fromName":"Ben Walton","fromEmail":"bwalton@artsci.utoronto.ca","sentAt":"2009-03-12T19:20:05Z","receivedAt":"2009-03-12T19:20:05Z","isPatch":false,"sender":{"key":"bdwalton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/396061?v=4"},"body":"\nHi All,\n\nI discovered recently (when building 1.6.2 on solaris 8 sparc) that\nthe autoconf detection for POSIX Threads wasn't quite adequate for my\nneeds.  This is partly due to gcc only warning on invalid flags in\nsome cases (-pthread on solaris 8 sparc) but still exiting cleanly.\n\nWhen I got looking at things, I found several items that I don't think\nare quite right.  For example, any of the --with- options that take a\npath argument didn't actually use the value supplied when testing for\nfeatures in a library.  If the user didn't also set a good\nCPPFLAGS/LDFLAGS (which they should, but that's beside the point),\nthings like the deflateUnbound zlib function might be ignored even\nwhen present.\n\nI decided to dig in and modify the configure.ac file fairly heavily.\nWhat I've put together in the forthcoming patch set does the\nfollowing:\n\n1. Handles user arguments early in the configure script and makes the\n   values that get set in config.mak.autogen available in the rest of\n   the script (I find those names nicer that $with_...).  These\n   settings now make it into config.log too.\n2. Use the values supplied to wrap tests with a modified CPP/LD FLAGS\n   pair when applicable.\n3. Fixed the asciidoc test to better handle python 2.6 (I haven't\n   tested with 2.4, but the change is quite simple and shouldn't be a\n   problem [as someone else mentioned recently: famous last words]).\n4. Allows the user to pass in compiler flags to enable POSIX Threads\n   which will override the default pair of tests.\n5. Tries to maintain the original actions and intents where possible.\n\nI've tested this on solaris 8 and Linux (Ubuntu 9.04) and it seems to\ndo all the things I'd expect.\n\nI hope you'll find these to be useful changes.\n\nThanks\n-Ben\n"},{"id":"107874","messageId":"1236885612-22575-2-git-send-email-bwalton@artsci.utoronto.ca","threadId":"18290","inReplyTo":"1236885612-22575-1-git-send-email-bwalton@artsci.utoronto.ca","subject":"[PATCH] configure: ensure settings from user are also usable in the script","fromName":"Ben Walton","fromEmail":"bwalton@artsci.utoronto.ca","sentAt":"2009-03-12T19:20:06Z","receivedAt":"2009-03-12T19:20:06Z","isPatch":true,"sender":{"key":"bdwalton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/396061?v=4"},"body":"Allow things set by the user (--with-lib, --with-iconv, etc) to set\nvariables for use by other parts of the script.  Display values as\nthey're set.\n\nSigned-off-by: Ben Walton <bwalton@artsci.utoronto.ca>\n---\n configure.ac |   11 +++++++++++\n 1 files changed, 11 insertions(+), 0 deletions(-)\n\ndiff --git a/configure.ac b/configure.ac\nindex 082a03d..0b314d7 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -42,6 +42,8 @@ else \\\n \tif test \"$withval\" = \"yes\"; then \\\n \t\tAC_MSG_WARN([You should provide path for --with-$1=PATH]); \\\n \telse \\\n+\t\tm4_toupper($1)_PATH=$withval; \\\n+\t\tAC_MSG_NOTICE([Setting m4_toupper($1)_PATH to $withval]); \\\n \t\tGIT_CONF_APPEND_LINE(${PROGRAM}_PATH=$withval); \\\n \tfi; \\\n fi; \\\n@@ -61,6 +63,8 @@ elif test \"$withval\" = \"yes\"; then \\\n \tm4_toupper(NO_$1)=; \\\n else \\\n \tm4_toupper(NO_$1)=; \\\n+\tm4_toupper($1)DIR=$withval; \\\n+\tAC_MSG_NOTICE([Setting m4_toupper($1)DIR to $withval]); \\\n \tGIT_CONF_APPEND_LINE(${PACKAGE}DIR=$withval); \\\n fi \\\n ])# GIT_PARSE_WITH\n@@ -86,9 +90,16 @@ AC_ARG_WITH([lib],\n  [if test \"$withval\" = \"no\" || test \"$withval\" = \"yes\"; then \\\n \tAC_MSG_WARN([You should provide name for --with-lib=ARG]); \\\n else \\\n+\tlib=$withval; \\\n+\tAC_MSG_NOTICE([Setting lib to '$lib']); \\\n \tGIT_CONF_APPEND_LINE(lib=$withval); \\\n fi; \\\n ],[])\n+\n+if test -z \"$lib\"; then\n+   AC_MSG_NOTICE([Setting lib to 'lib' (the default)])\n+   lib=lib\n+fi\n #\n # Define SHELL_PATH to provide path to shell.\n GIT_ARG_SET_PATH(shell)\n-- \n1.6.0.5\n"},{"id":"107868","messageId":"1236885612-22575-3-git-send-email-bwalton@artsci.utoronto.ca","threadId":"18290","inReplyTo":"1236885612-22575-2-git-send-email-bwalton@artsci.utoronto.ca","subject":"[PATCH] configure: reorganize flow of argument checks","fromName":"Ben Walton","fromEmail":"bwalton@artsci.utoronto.ca","sentAt":"2009-03-12T19:20:07Z","receivedAt":"2009-03-12T19:20:07Z","isPatch":true,"sender":{"key":"bdwalton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/396061?v=4"},"body":"Move the argument tests from the 'site overrides' so that they are\nahead of any library tests.  This allows for library tests to take\nuser specified paths into account.  The intent here is to avoid things\nlike NO_DEFLATE_BOUND being set due to finding old zlib when the user\nhas specified an alternate location for zlib.  (Ignore the fact that\nproperly set *FLAGS can avoid solve this issue.)\n\nSigned-off-by: Ben Walton <bwalton@artsci.utoronto.ca>\n---\n configure.ac |  174 +++++++++++++++++++++++++++++-----------------------------\n 1 files changed, 87 insertions(+), 87 deletions(-)\n\ndiff --git a/configure.ac b/configure.ac\nindex 0b314d7..0bff480 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -100,6 +100,93 @@ if test -z \"$lib\"; then\n    AC_MSG_NOTICE([Setting lib to 'lib' (the default)])\n    lib=lib\n fi\n+\n+## Site configuration (override autodetection)\n+## --with-PACKAGE[=ARG] and --without-PACKAGE\n+AC_MSG_NOTICE([CHECKS for site configuration])\n+#\n+# Define NO_SVN_TESTS if you want to skip time-consuming SVN interoperability\n+# tests.  These tests take up a significant amount of the total test time\n+# but are not needed unless you plan to talk to SVN repos.\n+#\n+# Define MOZILLA_SHA1 environment variable when running make to make use of\n+# a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast\n+# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default\n+# choice) has very fast version optimized for i586.\n+#\n+# Define PPC_SHA1 environment variable when running make to make use of\n+# a bundled SHA1 routine optimized for PowerPC.\n+#\n+# Define ARM_SHA1 environment variable when running make to make use of\n+# a bundled SHA1 routine optimized for ARM.\n+#\n+# Define NO_OPENSSL environment variable if you do not have OpenSSL.\n+# This also implies MOZILLA_SHA1.\n+#\n+# Define OPENSSLDIR=/foo/bar if your openssl header and library files are in\n+# /foo/bar/include and /foo/bar/lib directories.\n+AC_ARG_WITH(openssl,\n+AS_HELP_STRING([--with-openssl],[use OpenSSL library (default is YES)])\n+AS_HELP_STRING([],              [ARG can be prefix for openssl library and headers]),\\\n+GIT_PARSE_WITH(openssl))\n+#\n+# Define NO_CURL if you do not have curl installed.  git-http-pull and\n+# git-http-push are not built, and you cannot use http:// and https://\n+# transports.\n+#\n+# Define CURLDIR=/foo/bar if your curl header and library files are in\n+# /foo/bar/include and /foo/bar/lib directories.\n+AC_ARG_WITH(curl,\n+AS_HELP_STRING([--with-curl],[support http(s):// transports (default is YES)])\n+AS_HELP_STRING([],           [ARG can be also prefix for curl library and headers]),\n+GIT_PARSE_WITH(curl))\n+#\n+# Define NO_EXPAT if you do not have expat installed.  git-http-push is\n+# not built, and you cannot push using http:// and https:// transports.\n+#\n+# Define EXPATDIR=/foo/bar if your expat header and library files are in\n+# /foo/bar/include and /foo/bar/lib directories.\n+AC_ARG_WITH(expat,\n+AS_HELP_STRING([--with-expat],\n+[support git-push using http:// and https:// transports via WebDAV (default is YES)])\n+AS_HELP_STRING([],            [ARG can be also prefix for expat library and headers]),\n+GIT_PARSE_WITH(expat))\n+#\n+# Define NO_FINK if you are building on Darwin/Mac OS X, have Fink\n+# installed in /sw, but don't want GIT to link against any libraries\n+# installed there.  If defined you may specify your own (or Fink's)\n+# include directories and library directories by defining CFLAGS\n+# and LDFLAGS appropriately.\n+#\n+# Define NO_DARWIN_PORTS if you are building on Darwin/Mac OS X,\n+# have DarwinPorts installed in /opt/local, but don't want GIT to\n+# link against any libraries installed there.  If defined you may\n+# specify your own (or DarwinPort's) include directories and\n+# library directories by defining CFLAGS and LDFLAGS appropriately.\n+#\n+# Define NO_MMAP if you want to avoid mmap.\n+#\n+# Define NO_ICONV if your libc does not properly support iconv.\n+AC_ARG_WITH(iconv,\n+AS_HELP_STRING([--without-iconv],\n+[if your architecture doesn't properly support iconv])\n+AS_HELP_STRING([--with-iconv=PATH],\n+[PATH is prefix for libiconv library and headers])\n+AS_HELP_STRING([],\n+[used only if you need linking with libiconv]),\n+GIT_PARSE_WITH(iconv))\n+\n+## --enable-FEATURE[=ARG] and --disable-FEATURE\n+#\n+# Define USE_NSEC below if you want git to care about sub-second file mtimes\n+# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and\n+# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely\n+# randomly break unless your underlying filesystem supports those sub-second\n+# times (my ext3 doesn't).\n+#\n+# Define USE_STDEV below if you want git to care about the underlying device\n+# change being considered an inode change from the update-index perspective.\n+\n #\n # Define SHELL_PATH to provide path to shell.\n GIT_ARG_SET_PATH(shell)\n@@ -526,93 +613,6 @@ AC_SUBST(PTHREAD_LIBS)\n AC_SUBST(NO_PTHREADS)\n AC_SUBST(THREADED_DELTA_SEARCH)\n \n-## Site configuration (override autodetection)\n-## --with-PACKAGE[=ARG] and --without-PACKAGE\n-AC_MSG_NOTICE([CHECKS for site configuration])\n-#\n-# Define NO_SVN_TESTS if you want to skip time-consuming SVN interoperability\n-# tests.  These tests take up a significant amount of the total test time\n-# but are not needed unless you plan to talk to SVN repos.\n-#\n-# Define MOZILLA_SHA1 environment variable when running make to make use of\n-# a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast\n-# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default\n-# choice) has very fast version optimized for i586.\n-#\n-# Define PPC_SHA1 environment variable when running make to make use of\n-# a bundled SHA1 routine optimized for PowerPC.\n-#\n-# Define ARM_SHA1 environment variable when running make to make use of\n-# a bundled SHA1 routine optimized for ARM.\n-#\n-# Define NO_OPENSSL environment variable if you do not have OpenSSL.\n-# This also implies MOZILLA_SHA1.\n-#\n-# Define OPENSSLDIR=/foo/bar if your openssl header and library files are in\n-# /foo/bar/include and /foo/bar/lib directories.\n-AC_ARG_WITH(openssl,\n-AS_HELP_STRING([--with-openssl],[use OpenSSL library (default is YES)])\n-AS_HELP_STRING([],              [ARG can be prefix for openssl library and headers]),\\\n-GIT_PARSE_WITH(openssl))\n-#\n-# Define NO_CURL if you do not have curl installed.  git-http-pull and\n-# git-http-push are not built, and you cannot use http:// and https://\n-# transports.\n-#\n-# Define CURLDIR=/foo/bar if your curl header and library files are in\n-# /foo/bar/include and /foo/bar/lib directories.\n-AC_ARG_WITH(curl,\n-AS_HELP_STRING([--with-curl],[support http(s):// transports (default is YES)])\n-AS_HELP_STRING([],           [ARG can be also prefix for curl library and headers]),\n-GIT_PARSE_WITH(curl))\n-#\n-# Define NO_EXPAT if you do not have expat installed.  git-http-push is\n-# not built, and you cannot push using http:// and https:// transports.\n-#\n-# Define EXPATDIR=/foo/bar if your expat header and library files are in\n-# /foo/bar/include and /foo/bar/lib directories.\n-AC_ARG_WITH(expat,\n-AS_HELP_STRING([--with-expat],\n-[support git-push using http:// and https:// transports via WebDAV (default is YES)])\n-AS_HELP_STRING([],            [ARG can be also prefix for expat library and headers]),\n-GIT_PARSE_WITH(expat))\n-#\n-# Define NO_FINK if you are building on Darwin/Mac OS X, have Fink\n-# installed in /sw, but don't want GIT to link against any libraries\n-# installed there.  If defined you may specify your own (or Fink's)\n-# include directories and library directories by defining CFLAGS\n-# and LDFLAGS appropriately.\n-#\n-# Define NO_DARWIN_PORTS if you are building on Darwin/Mac OS X,\n-# have DarwinPorts installed in /opt/local, but don't want GIT to\n-# link against any libraries installed there.  If defined you may\n-# specify your own (or DarwinPort's) include directories and\n-# library directories by defining CFLAGS and LDFLAGS appropriately.\n-#\n-# Define NO_MMAP if you want to avoid mmap.\n-#\n-# Define NO_ICONV if your libc does not properly support iconv.\n-AC_ARG_WITH(iconv,\n-AS_HELP_STRING([--without-iconv],\n-[if your architecture doesn't properly support iconv])\n-AS_HELP_STRING([--with-iconv=PATH],\n-[PATH is prefix for libiconv library and headers])\n-AS_HELP_STRING([],\n-[used only if you need linking with libiconv]),\n-GIT_PARSE_WITH(iconv))\n-\n-## --enable-FEATURE[=ARG] and --disable-FEATURE\n-#\n-# Define USE_NSEC below if you want git to care about sub-second file mtimes\n-# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and\n-# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely\n-# randomly break unless your underlying filesystem supports those sub-second\n-# times (my ext3 doesn't).\n-#\n-# Define USE_STDEV below if you want git to care about the underlying device\n-# change being considered an inode change from the update-index perspective.\n-\n-\n ## Output files\n AC_CONFIG_FILES([\"${config_file}\":\"${config_in}\":\"${config_append}\"])\n AC_OUTPUT\n-- \n1.6.0.5\n"},{"id":"107872","messageId":"1236885612-22575-4-git-send-email-bwalton@artsci.utoronto.ca","threadId":"18290","inReplyTo":"1236885612-22575-3-git-send-email-bwalton@artsci.utoronto.ca","subject":"[PATCH] configure: add macros to stash FLAG variables","fromName":"Ben Walton","fromEmail":"bwalton@artsci.utoronto.ca","sentAt":"2009-03-12T19:20:08Z","receivedAt":"2009-03-12T19:20:08Z","isPatch":true,"sender":{"key":"bdwalton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/396061?v=4"},"body":"Allow for quick stash/unstash of CPPFLAGS and LDFLAGS.  Library tests\ncan now be easily bracketted with these macros to allow for values\nset in user/site arguments.\n\nSigned-off-by: Ben Walton <bwalton@artsci.utoronto.ca>\n---\n configure.ac |   26 ++++++++++++++++++++++++++\n 1 files changed, 26 insertions(+), 0 deletions(-)\n\ndiff --git a/configure.ac b/configure.ac\nindex 0bff480..469c9a9 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -80,6 +80,32 @@ AC_DEFUN([GIT_CHECK_FUNC],[AC_CHECK_FUNC([$1],[\n   AC_SEARCH_LIBS([$1],,\n   [$2],[$3])\n ],[$3])])\n+\n+dnl\n+dnl GIT_STASH_FLAGS(BASEPATH_VAR)\n+dnl -----------------------------\n+dnl Allow for easy stashing of LDFLAGS and CPPFLAGS before running\n+dnl tests that may want to take user settings into account.\n+AC_DEFUN([GIT_STASH_FLAGS],[\n+if test -n \"$1\"; then\n+   old_CPPFLAGS=\"$CPPFLAGS\"\n+   old_LDFLAGS=\"$LDFLAGS\"\n+   CPPFLAGS=\"-I$1/include $CPPFLAGS\"\n+   LDFLAGS=\"-L$1/$lib $LDFLAGS\"\n+fi\n+])\n+\n+dnl\n+dnl GIT_UNSTASH_FLAGS(BASEPATH_VAR)\n+dnl -----------------------------\n+dnl Restore the stashed *FLAGS values.\n+AC_DEFUN([GIT_UNSTASH_FLAGS],[\n+if test -n \"$1\"; then\n+   CPPFLAGS=\"$old_CPPFLAGS\"\n+   LDFLAGS=\"$old_LDFLAGS\"\n+fi\n+])\n+\n ## Site configuration related to programs (before tests)\n ## --with-PACKAGE[=ARG] and --without-PACKAGE\n #\n-- \n1.6.0.5\n"},{"id":"107869","messageId":"1236885612-22575-5-git-send-email-bwalton@artsci.utoronto.ca","threadId":"18290","inReplyTo":"1236885612-22575-4-git-send-email-bwalton@artsci.utoronto.ca","subject":"[PATCH] configure: wrap some library tests with GIT_STASH_FLAGS","fromName":"Ben Walton","fromEmail":"bwalton@artsci.utoronto.ca","sentAt":"2009-03-12T19:20:09Z","receivedAt":"2009-03-12T19:20:09Z","isPatch":true,"sender":{"key":"bdwalton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/396061?v=4"},"body":"Libraries that can have user specificed base paths are wrapped with\nGIT_STASH_FLAGS/GIT_UNSTASH_FLAGS to ensure that the proper versions\non the system are tested.  This ensures, for example, that the zlib\ntests for deflateUnbound are done with the version of zlib requested\nby the user.  This is most useful in the absence of good settings for\nCPPFLAGS and/or LDFLAGS.\n\nSigned-off-by: Ben Walton <bwalton@artsci.utoronto.ca>\n---\n configure.ac |   36 +++++++++++++++++++++++++++++++++++-\n 1 files changed, 35 insertions(+), 1 deletions(-)\n\ndiff --git a/configure.ac b/configure.ac\nindex 469c9a9..fe9d7eb 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -315,33 +315,57 @@ AC_MSG_NOTICE([CHECKS for libraries])\n #\n # Define NO_OPENSSL environment variable if you do not have OpenSSL.\n # Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).\n+\n+GIT_STASH_FLAGS($OPENSSLDIR)\n+\n AC_CHECK_LIB([crypto], [SHA1_Init],\n [NEEDS_SSL_WITH_CRYPTO=],\n [AC_CHECK_LIB([ssl], [SHA1_Init],\n  [NEEDS_SSL_WITH_CRYPTO=YesPlease\n   NEEDS_SSL_WITH_CRYPTO=],\n  [NO_OPENSSL=YesPlease])])\n+\n+GIT_UNSTASH_FLAGS($OPENSSLDIR)\n+\n AC_SUBST(NEEDS_SSL_WITH_CRYPTO)\n AC_SUBST(NO_OPENSSL)\n+\n #\n # Define NO_CURL if you do not have libcurl installed.  git-http-pull and\n # git-http-push are not built, and you cannot use http:// and https://\n # transports.\n+\n+GIT_STASH_FLAGS($CURLDIR)\n+\n AC_CHECK_LIB([curl], [curl_global_init],\n [NO_CURL=],\n [NO_CURL=YesPlease])\n+\n+GIT_UNSTASH_FLAGS($CURLDIR)\n+\n AC_SUBST(NO_CURL)\n+\n #\n # Define NO_EXPAT if you do not have expat installed.  git-http-push is\n # not built, and you cannot push using http:// and https:// transports.\n+\n+GIT_STASH_FLAGS($EXPATDIR)\n+\n AC_CHECK_LIB([expat], [XML_ParserCreate],\n [NO_EXPAT=],\n [NO_EXPAT=YesPlease])\n+\n+GIT_UNSTASH_FLAGS($EXPATDIR)\n+\n AC_SUBST(NO_EXPAT)\n+\n #\n # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin and\n # some Solaris installations).\n # Define NO_ICONV if neither libc nor libiconv support iconv.\n+\n+GIT_STASH_FLAGS($ICONVDIR)\n+\n AC_DEFUN([ICONVTEST_SRC], [\n #include <iconv.h>\n \n@@ -365,11 +389,17 @@ AC_LINK_IFELSE(ICONVTEST_SRC,\n \t\t[AC_MSG_RESULT([no])\n \t\tNO_ICONV=YesPlease])\n \tLIBS=\"$old_LIBS\"])\n+\n+GIT_UNSTASH_FLAGS($ICONVDIR)\n+\n AC_SUBST(NEEDS_LIBICONV)\n AC_SUBST(NO_ICONV)\n-test -n \"$NEEDS_LIBICONV\" && LIBS=\"$LIBS -liconv\"\n+\n #\n # Define NO_DEFLATE_BOUND if deflateBound is missing from zlib.\n+\n+GIT_STASH_FLAGS($ZLIB_PATH)\n+\n AC_DEFUN([ZLIBTEST_SRC], [\n #include <zlib.h>\n \n@@ -387,7 +417,11 @@ AC_LINK_IFELSE(ZLIBTEST_SRC,\n \t[AC_MSG_RESULT([no])\n \tNO_DEFLATE_BOUND=yes])\n LIBS=\"$old_LIBS\"\n+\n+GIT_UNSTASH_FLAGS($ZLIB_PATH)\n+\n AC_SUBST(NO_DEFLATE_BOUND)\n+\n #\n # Define NEEDS_SOCKET if linking with libc is not enough (SunOS,\n # Patrick Mauritz).\n-- \n1.6.0.5\n"},{"id":"107867","messageId":"1236885612-22575-6-git-send-email-bwalton@artsci.utoronto.ca","threadId":"18290","inReplyTo":"1236885612-22575-5-git-send-email-bwalton@artsci.utoronto.ca","subject":"[PATCH] configure: asciidoc version test cleanup","fromName":"Ben Walton","fromEmail":"bwalton@artsci.utoronto.ca","sentAt":"2009-03-12T19:20:10Z","receivedAt":"2009-03-12T19:20:10Z","isPatch":true,"sender":{"key":"bdwalton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/396061?v=4"},"body":"Redirect stderr to /dev/null instead of stdout.  This discards warnings\ngenerated by python 2.6 related to the reorganization of functions within\nmodules.  The warnings were causing the version detection to break.\n\nSigned-off-by: Ben Walton <bwalton@artsci.utoronto.ca>\n---\n configure.ac |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/configure.ac b/configure.ac\nindex fe9d7eb..f4b8e49 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -291,7 +291,7 @@ fi\n AC_CHECK_PROGS(ASCIIDOC, [asciidoc])\n if test -n \"$ASCIIDOC\"; then\n \tAC_MSG_CHECKING([for asciidoc version])\n-\tasciidoc_version=`$ASCIIDOC --version 2>&1`\n+\tasciidoc_version=`$ASCIIDOC --version 2>/dev/null`\n \tcase \"${asciidoc_version}\" in\n \tasciidoc' '8*)\n \t\tASCIIDOC8=YesPlease\n-- \n1.6.0.5\n"},{"id":"107870","messageId":"1236885612-22575-7-git-send-email-bwalton@artsci.utoronto.ca","threadId":"18290","inReplyTo":"1236885612-22575-6-git-send-email-bwalton@artsci.utoronto.ca","subject":"[PATCH] configure: make iconv tests aware of user arguments","fromName":"Ben Walton","fromEmail":"bwalton@artsci.utoronto.ca","sentAt":"2009-03-12T19:20:11Z","receivedAt":"2009-03-12T19:20:11Z","isPatch":true,"sender":{"key":"bdwalton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/396061?v=4"},"body":"--with-iconv is now taken into account when doing the tests for iconv.\nIf the user requests alternate handling for libiconv, the -liconv test\nis run before the -lc test.\n\nSigned-off-by: Ben Walton <bwalton@artsci.utoronto.ca>\n---\n configure.ac |   48 ++++++++++++++++++++++++++++++++++--------------\n 1 files changed, 34 insertions(+), 14 deletions(-)\n\ndiff --git a/configure.ac b/configure.ac\nindex f4b8e49..6fe4bfe 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -375,20 +375,35 @@ int main(void)\n \treturn 0;\n }\n ])\n-AC_MSG_CHECKING([for iconv in -lc])\n-AC_LINK_IFELSE(ICONVTEST_SRC,\n+\n+if test -n \"$ICONVDIR\"; then\n+   lib_order=\"-liconv -lc\"\n+else\n+   lib_order=\"-lc -liconv\"\n+fi\n+\n+NO_ICONV=YesPlease\n+\n+for l in $lib_order; do\n+    if test \"$l\" = \"-liconv\"; then\n+       NEEDS_LIBICONV=YesPlease\n+    else\n+       NEEDS_LIBICONV=\n+    fi\n+\n+    old_LIBS=\"$LIBS\"\n+    LIBS=\"$LIBS $l\"\n+    AC_MSG_CHECKING([for iconv in $l])\n+    AC_LINK_IFELSE(ICONVTEST_SRC,\n \t[AC_MSG_RESULT([yes])\n-\tNEEDS_LIBICONV=],\n-\t[AC_MSG_RESULT([no])\n-\told_LIBS=\"$LIBS\"\n-\tLIBS=\"$LIBS -liconv\"\n-\tAC_MSG_CHECKING([for iconv in -liconv])\n-\tAC_LINK_IFELSE(ICONVTEST_SRC,\n-\t\t[AC_MSG_RESULT([yes])\n-\t\tNEEDS_LIBICONV=YesPlease],\n-\t\t[AC_MSG_RESULT([no])\n-\t\tNO_ICONV=YesPlease])\n-\tLIBS=\"$old_LIBS\"])\n+\tNO_ICONV=\n+\tbreak],\n+\t[AC_MSG_RESULT([no])])\n+    LIBS=\"$old_LIBS\"\n+done\n+\n+#in case of break\n+LIBS=\"$old_LIBS\"\n \n GIT_UNSTASH_FLAGS($ICONVDIR)\n \n@@ -455,13 +470,18 @@ int main(void)\n \treturn 0;\n }\n ]])\n+\n+GIT_STASH_FLAGS($ICONVDIR)\n+\n AC_MSG_CHECKING([for old iconv()])\n AC_COMPILE_IFELSE(OLDICONVTEST_SRC,\n \t[AC_MSG_RESULT([no])],\n \t[AC_MSG_RESULT([yes])\n \tOLD_ICONV=UnfortunatelyYes])\n-AC_SUBST(OLD_ICONV)\n \n+GIT_UNSTASH_FLAGS($ICONVDIR)\n+\n+AC_SUBST(OLD_ICONV)\n \n ## Checks for typedefs, structures, and compiler characteristics.\n AC_MSG_NOTICE([CHECKS for typedefs, structures, and compiler characteristics])\n-- \n1.6.0.5\n"},{"id":"107873","messageId":"1236885612-22575-8-git-send-email-bwalton@artsci.utoronto.ca","threadId":"18290","inReplyTo":"1236885612-22575-7-git-send-email-bwalton@artsci.utoronto.ca","subject":"[PATCH] configure: rework pthread handling to allow for user defined flags","fromName":"Ben Walton","fromEmail":"bwalton@artsci.utoronto.ca","sentAt":"2009-03-12T19:20:12Z","receivedAt":"2009-03-12T19:20:12Z","isPatch":true,"sender":{"key":"bdwalton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/396061?v=4"},"body":"The tests for POSIX threads can now be controlled by the user with the\n--enable-pthreads=FLAGS option.  If this is set (to some value other\nthan yes or no), the value is passed to the compiler.  Thread support\nis based solely on the outcome of this test.  The user may specify not\nto use threading at all or to use the default tests (first -pthread\nthen -lpthread) by not specifying FLAGS when passing --enable-pthreads.\n\nSigned-off-by: Ben Walton <bwalton@artsci.utoronto.ca>\n---\n configure.ac |   89 ++++++++++++++++++++++++++++++++++++++++++++++++----------\n 1 files changed, 74 insertions(+), 15 deletions(-)\n\ndiff --git a/configure.ac b/configure.ac\nindex 6fe4bfe..4e728bc 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -127,6 +127,27 @@ if test -z \"$lib\"; then\n    lib=lib\n fi\n \n+AC_ARG_ENABLE([pthreads],\n+ [AS_HELP_STRING([--enable-pthreads=FLAGS],\n+  [FLAGS is the value to pass to the compiler to enable POSIX Threads.]\n+  [The default if FLAGS is not specified is to try first -pthread]\n+  [and then -lpthread.]\n+  [--without-pthreads will disable threading.])],\n+[\n+if test \"x$enableval\" = \"xyes\"; then\n+   AC_MSG_NOTICE([Will try -pthread then -lpthread to enable POSIX Threads])\n+elif test \"x$enableval\" != \"xno\"; then\n+   PTHREAD_CFLAGS=$enableval\n+   AC_MSG_NOTICE([Setting '$PTHREAD_CFLAGS' as the FLAGS to enable POSIX Threads])\n+else\n+   AC_MSG_NOTICE([POSIX Threads will be disabled.])\n+   NO_PTHREADS=YesPlease\n+   USER_NOPTHREAD=1\n+fi],\n+[\n+   AC_MSG_NOTICE([Will try -pthread then -lpthread to enable POSIX Threads.])\n+])\n+\n ## Site configuration (override autodetection)\n ## --with-PACKAGE[=ARG] and --without-PACKAGE\n AC_MSG_NOTICE([CHECKS for site configuration])\n@@ -672,23 +693,61 @@ AC_SUBST(NO_MKDTEMP)\n #\n # Define PTHREAD_LIBS to the linker flag used for Pthread support and define\n # THREADED_DELTA_SEARCH if Pthreads are available.\n-AC_LANG_CONFTEST([AC_LANG_PROGRAM(\n-  [[#include <pthread.h>]],\n-  [[pthread_mutex_t test_mutex;]]\n-)])\n-${CC} -pthread conftest.c -o conftest.o > /dev/null 2>&1\n-if test $? -eq 0;then\n- PTHREAD_LIBS=\"-pthread\"\n- THREADED_DELTA_SEARCH=YesPlease\n+AC_DEFUN([PTHREADTEST_SRC], [\n+#include <pthread.h>\n+\n+int main(void)\n+{\n+\tpthread_mutex_t test_mutex;\n+\treturn (0);\n+}\n+])\n+\n+dnl AC_LANG_CONFTEST([AC_LANG_PROGRAM(\n+dnl   [[#include <pthread.h>]],\n+dnl   [[pthread_mutex_t test_mutex;]]\n+dnl )])\n+\n+NO_PTHREADS=UnfortunatelyYes\n+THREADED_DELTA_SEARCH=\n+PTHREAD_LIBS=\n+\n+if test -n \"$USER_NOPTHREAD\"; then\n+   AC_MSG_NOTICE([Skipping POSIX Threads at user request.])\n+# handle these separately since PTHREAD_CFLAGS could be '-lpthreads\n+# -D_REENTRANT' or some such.\n+elif test -z \"$PTHREAD_CFLAGS\"; then\n+  for opt in -pthread -lpthread; do\n+     old_CFLAGS=\"$CFLAGS\"\n+     CFLAGS=\"$opt $CFLAGS\"\n+     AC_MSG_CHECKING([Checking for POSIX Threads with '$opt'])\n+     AC_LINK_IFELSE(PTHREADTEST_SRC,\n+\t[AC_MSG_RESULT([yes])\n+\t\tNO_PTHREADS=\n+\t\tPTHREAD_LIBS=\"$opt\"\n+\t\tTHREADED_DELTA_SEARCH=YesPlease\n+\t\tbreak\n+\t],\n+\t[AC_MSG_RESULT([no])])\n+      CFLAGS=\"$old_CFLAGS\"\n+  done\n else\n- ${CC} -lpthread conftest.c -o conftest.o > /dev/null 2>&1\n- if test $? -eq 0;then\n-  PTHREAD_LIBS=\"-lpthread\"\n-  THREADED_DELTA_SEARCH=YesPlease\n- else\n-  NO_PTHREADS=UnfortunatelyYes\n- fi\n+  old_CFLAGS=\"$CFLAGS\"\n+  CFLAGS=\"$PTHREAD_CFLAGS $CFLAGS\"\n+  AC_MSG_CHECKING([Checking for POSIX Threads with '$PTHREAD_CFLAGS'])\n+  AC_LINK_IFELSE(PTHREADTEST_SRC,\n+\t[AC_MSG_RESULT([yes])\n+\t\tNO_PTHREADS=\n+\t\tPTHREAD_LIBS=\"$PTHREAD_CFLAGS\"\n+\t\tTHREADED_DELTA_SEARCH=YesPlease\n+\t],\n+\t[AC_MSG_RESULT([no])])\n+\n+  CFLAGS=\"$old_CFLAGS\"\n fi\n+\n+CFLAGS=\"$old_CFLAGS\"\n+\n AC_SUBST(PTHREAD_LIBS)\n AC_SUBST(NO_PTHREADS)\n AC_SUBST(THREADED_DELTA_SEARCH)\n-- \n1.6.0.5\n"}]}