{"thread":{"id":"4756","subject":"[PATCH] Add a custom ./configure script","startedAt":"2006-07-04T00:40:12Z","lastAt":"2006-07-05T16:46:43Z","messageCount":4,"participants":["Petr Baudis","Jakub Narebski","Alex Riesen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"23158","messageId":"20060704004012.22639.44317.stgit@machine.or.cz","threadId":"4756","inReplyTo":null,"subject":"[PATCH] Add a custom ./configure script","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-07-04T00:40:12Z","receivedAt":"2006-07-04T00:40:12Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"This patch adds a custom hand-made and supposedly easy to debug ./configure\nscript. It is originally based on mplayer's ./configure script but heavily\nmodified and of course stripped of all the mplayer-specific tests, as well\nas many other tests we won't probably need (but we might reintroduce some\nof them later). I kept the CPU checks since they might come handy to decide\nwhich assembler SHA1 implementation to choose.\n\nAlso, I'm an autogeneration freak so compared to the mplayer's script\nthis one has a bit different design wrt. the configuration variables; instead\nof adding random bits of code at various places you just insert one function\ncall near the top and your test near the bottom, everything else is taken\ncare of automagically. Also, the heavy machinery is split to a separate library\nconfig-lib.sh.\n\nIt's a shame that we have to carry something like this around. Wouldn't the\nworld be much happier place if there would be something like autoconf but\ninstead of mucking with M4 you would just write a shell script while calling\nvarious predefined functions? :/\n\nThe patch is on top of pu, that is Jakub Narebski's autoconf patch, because\nit reuses most of its infrastructure and just replaces the configure script.\n\nSigned-off-by: Petr Baudis <pasky@suse.cz>\n---\n\n .gitignore    |    6 -\n INSTALL       |    1 \n config-lib.sh |  449 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n config.mak.in |   18 --\n configure     |   78 ++++++++++\n configure.ac  |   14 --\n 6 files changed, 528 insertions(+), 38 deletions(-)\n\ndiff --git a/.gitignore b/.gitignore\nindex 616aa98..8950a9e 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -136,10 +136,6 @@ git-core.spec\n *.[ao]\n *.py[co]\n config.mak\n-autom4te.cache\n-config.log\n-config.status\n-config.mak.in\n config.mak.autogen\n-configure\n+config.log\n git-blame\ndiff --git a/INSTALL b/INSTALL\nindex 6c8fd09..bff6aa6 100644\n--- a/INSTALL\n+++ b/INSTALL\n@@ -16,7 +16,6 @@ install\" would not work.\n Alternatively you can use autoconf generated ./configure script to\n set up install paths (via config.mak.autogen), so you can write instead\n \n-\t$ autoconf ;# as yourself if ./configure doesn't exist yet\n \t$ ./configure --prefix=/usr ;# as yourself\n \t$ make all doc ;# as yourself\n \t# make install install-doc ;# as root\ndiff --git a/config-lib.sh b/config-lib.sh\nnew file mode 100755\nindex 0000000..68fecc5\n--- /dev/null\n+++ b/config-lib.sh\n@@ -0,0 +1,449 @@\n+# This script provides a wannabe-generic library for compile-time package\n+# autoconfiguration\n+# Copyright (c) Petr Baudis, 2006\n+#\n+#\n+# Some design traits and large chunks of this script come from mplayer:\n+#\n+# Original version (C) 2000 Pontscho/fresh!mindworkz\n+#                      pontscho@makacs.poliod.hu\n+#\n+# History / Contributors: check the cvs log !\n+#\n+# Cleanups all over the place (c) 2001 pl\n+#\n+#\n+# This configure script is *not* autoconf-based and has different semantics.\n+# It attempts to autodetect all settings and options where possible. It is\n+# possible to override autodetection with the --enable-option/--disable-option\n+# command line parameters.  --enable-option forces the option on skipping\n+# autodetection. Yes, this means that compilation may fail and yes, this is not\n+# how autoconf-based configure scripts behave.\n+#\n+# configure generates config.mak.autogen, then included in the Makefile.\n+#\n+#############################################################################\n+\n+# Prevent locale nonsense from breaking basic text processing utils\n+LC_ALL=C\n+export LC_ALL\n+\n+# These macros only return an error code - NO display is done\n+\n+compile_check() {\n+{\n+\techo\n+\tcat \"$1\"\n+\techo\n+\techo \"$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra -o $TMPO $@\"\n+\trm -f \"$TMPO\"\n+\t$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra -o \"$TMPO\" \"$@\" || return $?\n+\techo\n+\techo \"ldd $TMPO\"\n+\t$_ldd \"$TMPO\" || return $?\n+\techo\n+} >>\"$TMPLOG\" 2>&1\n+}\n+\n+cc_check() {\n+\tcompile_check $TMPC $@\n+}\n+\n+# Try to run the compiled file\n+tmp_run() {\n+\t\"$TMPO\" >> \"$TMPLOG\" 2>&1\n+}\n+\n+# Display error message, flushes tempfile, exit\n+die () {\n+\techo\n+\techo \"Error: $@\" >&2\n+\techo >&2\n+\trm -f \"$TMPO\" \"$TMPC\" \"$TMPS\" \"$TMPCPP\"\n+\techo \"Check \\\"$TMPLOG\\\" if you do not understand why it failed.\" >&2\n+\texit 1\n+}\n+\n+# OS test booleans functions\n+issystem() {\n+\ttest \"`echo $system_name | tr A-Z a-z`\" = \"`echo $1 | tr A-Z a-z`\"\n+}\n+linux()   { issystem \"Linux\"   ; return \"$?\" ; }\n+sunos()   { issystem \"SunOS\"   ; return \"$?\" ; }\n+hpux()    { issystem \"HP-UX\"   ; return \"$?\" ; }\n+irix()    { issystem \"IRIX\"    ; return \"$?\" ; }\n+aix()     { issystem \"AIX\"     ; return \"$?\" ; }\n+cygwin()  { issystem \"CYGWIN\"  ; return \"$?\" ; }\n+freebsd() { issystem \"FreeBSD\" ; return \"$?\" ; }\n+netbsd()  { issystem \"NetBSD\"  ; return \"$?\" ; }\n+bsdos()   { issystem \"BSD/OS\"  ; return \"$?\" ; }\n+openbsd() { issystem \"OpenBSD\" ; return \"$?\" ; }\n+bsd()     { freebsd || netbsd || bsdos || openbsd ; return \"$?\" ; }\n+qnx()     { issystem \"QNX\"     ; return \"$?\" ; }\n+darwin()  { issystem \"Darwin\"  ; return \"$?\" ; }\n+gnu()     { issystem \"GNU\"     ; return \"$?\" ; }\n+mingw32() { issystem \"MINGW32\" ; return \"$?\" ; }\n+morphos() { issystem \"MorphOS\" ; return \"$?\" ; }\n+win32()   { cygwin || mingw32  ; return \"$?\" ; }\n+beos()    { issystem \"BEOS\"    ; return \"$?\" ; }\n+\n+# arch test boolean functions\n+# x86/x86pc is used by QNX\n+x86() {\n+\tcase \"$host_arch\" in\n+\t\ti[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;\n+\t\t*) return 1 ;;\n+\tesac\n+}\n+\n+x86_64() {\n+\tcase \"$host_arch\" in\n+\t\tx86_64|amd64) return 0 ;;\n+\t\t*) return 1 ;;\n+\tesac\n+}\n+\n+ppc() {\n+\tcase \"$host_arch\" in\n+\t\tppc) return 0;;\n+\t\t*) return 1;;\n+\tesac\n+}\n+\n+alpha() {\n+\tcase \"$host_arch\" in\n+\t\talpha) return 0;;\n+\t\t*) return 1;;\n+\tesac\n+}\n+\n+# not boolean test: implement the posix shell \"!\" operator for a\n+# non-posix /bin/sh.\n+#   usage:  not {command}\n+# returns exit status \"success\" when the execution of \"command\"\n+# fails.\n+not() {\n+\teval \"$@\"\n+\ttest $? -ne 0\n+}\n+\n+# Use this before starting a check\n+# The second optional parameter is name of the feature variable;\n+# it is preset to an empty string so that it can be dropped into\n+# config.mak.autogen seamlessly; use echores_yesno() for reporting.\n+echocheck() {\n+\techo \"============ Checking $@ ============\" >> \"$TMPLOG\"\n+\techo ${_echo_n} \"Checking $@... ${_echo_c}\"\n+}\n+\n+# Use this to echo the results of a check\n+echores() {\n+\tif test \"$_res_comment\" ; then\n+\t\t_res_comment=\"($_res_comment)\"\n+\tfi\n+\techo \"Result is: $@ $_res_comment\" >> \"$TMPLOG\"\n+\techo \"##########################################\" >> \"$TMPLOG\"\n+\techo \"\" >> \"$TMPLOG\"\n+\techo \"$@ $_res_comment\"\n+\t_res_comment=\"\"\n+}\n+\n+# Use this to introduce a regular feature with a commandline switch\n+# @name is the variable name\n+# @switch is the commandline switch\n+# @mkvar is the Makefile variable name; prefix with a space to say that it's negated (ow)\n+# @desc is a line to insert to the --help output\n+# @default is the default value (yes/no/auto)\n+add_library() { # --with\n+\tname=\"$1\"; shift; switch=\"$1\"; shift; mkvar=\"$1\"; shift; default=\"$1\"; shift; desc=\"$1\"; shift\n+\tcase $default in\n+\t\tyes) hdefault=with;;\n+\t\tno) hdefault=without;;\n+\t\tauto) hdefault=autodetect;;\n+\tesac\n+\n+\tlib_help=\"$lib_help\n+$desc [$hdefault]\"\n+\tswitches=\"$switches switch_lib \\\"$name\\\" \\\"$switch\\\" \\\"\\$ac_option\\\" || \"\n+\tmkvars=\"$mkvars mkvar \\\"\\$$name\\\" \\\"$mkvar\\\";\"\n+\teval \"$name=$default\"\n+}\n+\n+add_feature() { # --enable\n+\tname=\"$1\"; shift; switch=\"$1\"; shift; mkvar=\"$1\"; shift; default=\"$1\"; shift; desc=\"$1\"; shift\n+\tcase $default in\n+\t\tyes) hdefault=enable;;\n+\t\tno) hdefault=disable;;\n+\t\tauto) hdefault=autodetect;;\n+\tesac\n+\n+\tfeature_help=\"$feature_help\n+$desc [$hdefault]\"\n+\tswitches=\"$switches switch_feature \\\"$name\\\" \\\"$switch\\\" \\\"\\$ac_option\\\" || \"\n+\tmkvars=\"$mkvars mkvar \\\"\\$$name\\\" \\\"$mkvar\\\";\"\n+\teval \"$name=$default\"\n+}\n+\n+lib_help=\n+feature_help=\n+switches=\n+mkvars=\n+\n+\n+switch_lib() {\n+\tname=\"$1\"; shift; switch=\"$1\"; shift; option=\"$1\"; shift\n+\tcase $option in\n+\t\t--with-$switch) eval \"$name=yes\";;\n+\t\t--without-$switch) eval \"$name=no\";;\n+\t\t*) return 1\n+\tesac\n+\treturn 0\n+}\n+\n+switch_feature() {\n+\tname=\"$1\"; shift; switch=\"$1\"; shift; option=\"$1\"; shift\n+\tcase $option in\n+\t\t--enable-$switch) eval \"$name=yes\";;\n+\t\t--disable-$switch) eval \"$name=no\";;\n+\t\t*) return 1\n+\tesac\n+\treturn 0\n+}\n+\n+mkvar() {\n+\tvalue=\"$1\"; shift; mkvar=\"$1\"; shift\n+\tnoval=\"\"; yesval=\"ConfigureYesPlease\"\n+\tcase $mkvar in\n+\t\t\\ *) swap=\"$noval\"; noval=\"$yesval\"; yesval=\"$swap\";;\n+\tesac\n+\tcase $value in\n+\t\tauto) die \"$mkvar autodetection failed\";;\n+\t\tno) echo \"$mkvar = $noval\";;\n+\t\tyes) echo \"$mkvar = $yesval\";;\n+\t\t*) die \"$mkvar got invalid value ''$value''\";;\n+\tesac\n+}\n+\n+\n+#############################################################################\n+\n+\n+# Check how echo works in this /bin/sh\n+case `echo -n` in\n+\t-n)\t_echo_n=\t_echo_c='\\c'\t;;\t# SysV echo\n+\t*)\t_echo_n='-n '\t_echo_c=\t;;\t# BSD echo\n+esac\n+\n+\n+process_params() {\n+\t_install=install\n+\t_cc=cc\n+\ttest \"$CC\" && _cc=\"$CC\"\n+\n+\tfor ac_option do\n+\t\tcase \"$ac_option\" in\n+\t\t--help|-help|-h)\n+\t\t\tcat << EOF\n+Usage: $0 [OPTIONS]...\n+\n+Configuration:\n+  -h, --help             display this help and exit\n+\n+Installation directories:\n+  --prefix=DIR           use this prefix for installing git [HOME]\n+  --bindir=DIR           use this prefix for installing git binary\n+                         [PREFIX/bin]\n+  --gitexecdir=DIR       use this prefix for installing individual git command\n+                         binaries [BINDIR]\n+  --mandir=DIR           use this prefix for installing manpages [PREFIX/man]\n+  --templatedir=DIR      use this prefix for installing configuration file\n+                         templates [PREFIX/share/git-core/templates]\n+  --gitpythondir=DIR     use this prefix for python libraries [PREFIX/share/git-core/python]\n+\n+Miscellaneous options:\n+  --cc=COMPILER          use this C compiler to build MPlayer [gcc]\n+  --target=PLATFORM      target platform (i386-linux, arm-linux, etc)\n+  --with-install=PATH    use a custom install program (useful if your OS uses\n+                         a GNU-incompatible install utility by default and\n+                         you want to use GNU version)\n+\n+For the options below, see the top of the Makefile for more detailed\n+description.\n+\n+Optional features:$feature_help\n+\n+Optional libraries:$lib_help\n+\n+This configure script is NOT autoconf-based, even though its output is similar.\n+It will try to autodetect all configuration options. If you --enable an option\n+it will be forcefully turned on, skipping autodetection. This can break\n+compilation, so you need to know what you are doing.\n+EOF\n+\t\t\texit 0 ;;\n+\n+\t\t--prefix=*)\n+\t\t\t_prefix=`echo $ac_option | cut -d '=' -f 2` ;;\n+\t\t--bindir=*)\n+\t\t\t_bindir=`echo $ac_option | cut -d '=' -f 2` ;;\n+\t\t--gitexecdir=*)\n+\t\t\t_gitexecdir=`echo $ac_option | cut -d '=' -f 2` ;;\n+\t\t--mandir=*)\n+\t\t\t_mandir=`echo $ac_option | cut -d '=' -f 2` ;;\n+\t\t--templatedir=*)\n+\t\t\t_templatedir=`echo $ac_option | cut -d '=' -f 2` ;;\n+\t\t--gitpythondir=*)\n+\t\t\t_gitpythondir=`echo $ac_option | cut -d '=' -f 2` ;;\n+\n+\t\t--cc=*)\n+\t\t\t_cc=`echo $ac_option | cut -d '=' -f 2` ;;\n+\t\t--target=*)\n+\t\t\t_target=`echo $ac_option | cut -d '=' -f 2` ;;\n+\t\t--with-install=*)\n+\t\t\t_install=`echo $ac_option | cut -d '=' -f 2 ` ;;\n+\n+\t\t*)\n+\t\t\t# $switches is the real bulk\n+\t\t\teval \"$switches { echo \\\"Unknown parameter: $ac_option\\\"; exit 1; }\" || exit 1 ;;\n+\t\tesac\n+\tdone\n+\n+\t# Determine our OS name and CPU architecture\n+\tif test -z \"$_target\" ; then\n+\t\t# OS name\n+\t\tsystem_name=`uname -s 2>&1`\n+\t\tcase \"$system_name\" in\n+\t\tLinux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS|AIX)\n+\t\t\t;;\n+\t\tIRIX*)\n+\t\t\tsystem_name=IRIX ;;\n+\t\tHP-UX*)\n+\t\t\tsystem_name=HP-UX ;;\n+\t\t[cC][yY][gG][wW][iI][nN]*)\n+\t\t\tsystem_name=CYGWIN ;;\n+\t\tMINGW32*)\n+\t\t\tsystem_name=MINGW32 ;;\n+\t\t*)\n+\t\t\tsystem_name=\"$system_name-UNKNOWN\" ;;\n+\t\tesac\n+\n+\n+\t\t# host's CPU/instruction set\n+\t\thost_arch=`uname -p 2>&1`\n+\t\tcase \"$host_arch\" in\n+\t\ti386|sparc|ppc|alpha|arm|mips|vax)\n+\t\t\t;;\n+\t\tpowerpc) # Darwin returns 'powerpc'\n+\t\t\thost_arch=ppc ;;\n+\t\t*)\t# uname -p on Linux returns 'unknown' for the processor type,\n+\t\t\t# OpenBSD returns 'Intel Pentium/MMX (\"Genuine Intel\" 586-class)'\n+\n+\t\t\t# Maybe uname -m (machine hardware name) returns something we\n+\t\t\t# recognize.\n+\n+\t\t\t# x86/x86pc is used by QNX\n+\t\t\tcase \"`uname -m 2>&1`\" in\n+\t\t\t\ti[3-9]86*|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686|BePC) host_arch=i386 ;;\n+\t\t\t\tia64) host_arch=ia64 ;;\n+\t\t\t\tx86_64|amd64)\n+\t\t\t\tif [ -n \"`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`\" -a \\\n+\t\t\t\t\t-z \"`echo $CFLAGS | grep -- -m32`\"  ]; then\n+\t\t\t\t\thost_arch=x86_64\n+\t\t\t\telse\n+\t\t\t\t\thost_arch=i386\n+\t\t\t\tfi\n+\t\t\t\t;;\n+\t\t\t\tmacppc|ppc|ppc64) host_arch=ppc ;;\n+\t\t\t\talpha) host_arch=alpha ;;\n+\t\t\t\tsparc) host_arch=sparc ;;\n+\t\t\t\tsparc64) host_arch=sparc64 ;;\n+\t\t\t\tparisc*|hppa*|9000*) host_arch=hppa ;;\n+\t\t\t\tarm*|zaurus|cats) host_arch=arm ;;\n+\t\t\t\ts390) host_arch=s390 ;;\n+\t\t\t\ts390x) host_arch=s390x ;;\n+\t\t\t\tmips*) host_arch=mips ;;\n+\t\t\t\tvax) host_arch=vax ;;\n+\t\t\t\t*) host_arch=UNKNOWN ;;\n+\t\t\tesac\n+\t\t\t;;\n+\t\tesac\n+\telse # if test -z \"$_target\"\n+\t\tsystem_name=`echo $_target | cut -d '-' -f 2`\n+\t\tcase \"`echo $system_name | tr A-Z a-z`\" in\n+\t\t\tlinux) system_name=Linux ;;\n+\t\t\tfreebsd) system_name=FreeBSD ;;\n+\t\t\tnetbsd) system_name=NetBSD ;;\n+\t\t\tbsd/os) system_name=BSD/OS ;;\n+\t\t\topenbsd) system_name=OpenBSD ;;\n+\t\t\tsunos) system_name=SunOS ;;\n+\t\t\tqnx) system_name=QNX ;;\n+\t\t\tmorphos) system_name=MorphOS ;;\n+\t\t\tmingw32msvc) system_name=MINGW32 ;;\n+\t\tesac\n+\t\t# We need to convert underscores so that values like k6-2 and pentium-mmx can be passed\n+\t\thost_arch=`echo $_target | cut -d '-' -f 1 | tr '_' '-'`\n+\tfi\n+\n+\techo \"Detected operating system: $system_name\"\n+\techo \"Detected host architecture: $host_arch\"\n+}\n+\n+\n+test_setup() {\n+\t# LGB: temporary files\n+\t# FIXME: Use mktemp -d?\n+\tfor I in \"$TMPDIR\" \"$TEMPDIR\" \"/tmp\" ; do\n+\t\ttest \"$I\" && break\n+\tdone\n+\n+\tTMPLOG=\"config.log\"\n+\trm -f \"$TMPLOG\"\n+\tTMPC=\"$I/git-conf-$RANDOM-$$.c\"\n+\tTMPO=\"$I/git-conf-$RANDOM-$$.o\"\n+\tTMPS=\"$I/git-conf-$RANDOM-$$.S\"\n+}\n+\n+basic_tests() {\n+\techocheck \"if your build environment is sane\"\n+\tcat > $TMPC <<EOF\n+int main(void) { return 0; }\n+EOF\n+\t{ cc_check && tmp_run; } || die \"unusable compiler or produced binary\"\n+\techores yes\n+}\n+\n+\n+write_config() {\n+\techo \"Creating config.mak.autogen\"\n+\n+\t{\n+\t\tcat << EOF\n+# -------- Generated by configure -----------\n+\n+CC = $_cc\n+INSTALL = $_install\n+\n+EOF\n+\t\ttest -z $_prefix || echo \"prefix = $_prefix\"\n+\t\ttest -z $_bindir || echo \"bindir = $_bindir\"\n+\t\ttest -z $_gitexecdir || echo \"gitexecdir = $_gitexecdir\"\n+\t\ttest -z $_mandir || ( echo \"mandir = $_mandir\" && echo \"export mandir\" )\n+\t\ttest -z $_templatedir || echo \"template_dir = $_templatedir\"\n+\t\ttest -z $_gitpythondir || echo \"GIT_PYTHON_DIR = $_gitpythondir\"\n+\t\techo\n+\t\teval \"$mkvars\"\n+\t} > config.mak.autogen\n+\n+\tcat << EOF\n+\n+Config files successfully generated by ./configure.\n+You can inspect the results in \\`\\`./config.mak.autogen''.\n+EOF\n+}\n+\n+\n+finish() {\n+\t# Last move:\n+\trm -f \"$TMPO\" \"$TMPC\" \"$TMPS\" \"$TMPCPP\"\n+}\n+\n+trap finish 0\ndiff --git a/config.mak.in b/config.mak.in\ndeleted file mode 100644\nindex 82c9781..0000000\n--- a/config.mak.in\n+++ /dev/null\n@@ -1,18 +0,0 @@\n-# git Makefile configuration, included in main Makefile\n-# @configure_input@\n-\n-prefix = @prefix@\n-exec_prefix = @exec_prefix@\n-bindir = @bindir@\n-#gitexecdir = @libexecdir@/git-core/\n-template_dir = @datadir@/git-core/templates/\n-GIT_PYTHON_DIR = @datadir@/git-core/python\n-\n-mandir=@mandir@\n-\n-srcdir = @srcdir@\n-VPATH = @srcdir@\n-\n-export exec_prefix mandir\n-export srcdir VPATH\n-\ndiff --git a/configure b/configure\nnew file mode 100755\nindex 0000000..2604aa3\n--- /dev/null\n+++ b/configure\n@@ -0,0 +1,78 @@\n+#! /bin/sh\n+#\n+# This configure script is *not* autoconf-based and has different semantics.\n+# It attempts to autodetect all settings and options where possible. It is\n+# possible to override autodetection with the --enable-option/--disable-option\n+# command line parameters.  --enable-option forces the option on skipping\n+# autodetection. Yes, this means that compilation may fail and yes, this is not\n+# how autoconf-based configure scripts behave.\n+#\n+# configure generates config.mak.autogen, then included in the Makefile.\n+#\n+# If you want to add a new check for $feature, add it at two places - to the\n+# variable list and to the checks section. You will find both below.\n+#\n+#############################################################################\n+\n+[ -f ./config-lib.sh ] || {\n+\techo \"config-lib.sh not found; please run ./configure from the source tree\" >&2\n+\texit 1\n+}\n+. ./config-lib.sh\n+\n+\n+\n+#############################################################################\n+\n+# List variables for features and libraries here:\n+\n+add_feature \"_no_symlink_head\" \"no-symlink-head\" \"NO_SYMLINK_HEAD\" \"auto\" \\\n+\"  --enable-no-symlink-head  Never have .git/HEAD as a symbolic link\"\n+\n+add_feature \"_nsec\" \"nsec\" \"USE_NSEC\" \"no\" \\\n+\"  --enable-nsec          Use sub-second resolution when checking mtimes\"\n+\n+add_library \"_expat\" \"expat\" \" NO_EXPAT\" \"auto\" \\\n+\"  --without-expat        Disable libexpat support (disables git-http-push)\"\n+\n+\n+#############################################################################\n+\n+\n+process_params \"$@\"\n+test_setup\n+basic_tests\n+\n+\n+#############################################################################\n+\n+\n+echocheck \"whether to prohibit usage of symlinked HEAD\"\n+if test \"$_no_symlink_head\" = auto ; then\n+\tif win32; then\n+\t\t_no_symlink_head=yes\n+\telse\n+\t\t_no_symlink_head=no\n+\tfi\n+fi\n+echores \"$_no_symlink_head\"\n+\n+\n+echocheck \"for expat\"\n+if test \"$_expat\" = auto ; then\n+\tcat > $TMPC <<EOF\n+#include <expat.h>\n+int main(void) { return 0; }\n+EOF\n+\t_expat=no\n+\tcc_check -lexpat && _expat=yes\n+fi\n+echores \"$_expat\"\n+\n+\n+# Insert tests for features and libraries here.\n+\n+#############################################################################\n+\n+\n+write_config\ndiff --git a/configure.ac b/configure.ac\ndeleted file mode 100644\nindex a0374d4..0000000\n--- a/configure.ac\n+++ /dev/null\n@@ -1,14 +0,0 @@\n-#                                               -*- Autoconf -*-\n-# Process this file with autoconf to produce a configure script.\n-\n-AC_PREREQ(2.59)\n-AC_INIT([git], [1.4.1], [git@vger.kernel.org])\n-\n-AC_CONFIG_SRCDIR([git.c])\n-\n-config_file=config.mak.autogen\n-config_in=config.mak.in\n-\n-# Output files\n-AC_CONFIG_FILES([\"${config_file}\":\"${config_in}\"])\n-AC_OUTPUT\n"},{"id":"23226","messageId":"e8drmq$8ec$1@sea.gmane.org","threadId":"4756","inReplyTo":"20060704004012.22639.44317.stgit@machine.or.cz","subject":"Re: [PATCH] Add a custom ./configure script","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-07-04T13:50:16Z","receivedAt":"2006-07-04T13:50:16Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Petr Baudis wrote:\n\n> The patch is on top of pu, that is Jakub Narebski's autoconf patch, because\n> it reuses most of its infrastructure and just replaces the configure script.\n\nIf you named it for example configure.sh, then autoconf generated version, \nand your by hand created version could coexist.\n\nFor now I think it would be best to move autoconf related files (configure.ac,\nconfig.mak.in) to the contrib/autoconf/ area. Then one would be able to \ncompare config.mak.autogen generated by ./configure from autoconf, and\nyour ./configure script.\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"23249","messageId":"20060704215747.GQ29115@pasky.or.cz","threadId":"4756","inReplyTo":"e8drmq$8ec$1@sea.gmane.org","subject":"Re: [PATCH] Add a custom ./configure script","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-07-04T21:57:47Z","receivedAt":"2006-07-04T21:57:47Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Tue, Jul 04, 2006 at 03:50:16PM CEST, I got a letter\nwhere Jakub Narebski <jnareb@gmail.com> said that...\n> Petr Baudis wrote:\n> \n> > The patch is on top of pu, that is Jakub Narebski's autoconf patch, because\n> > it reuses most of its infrastructure and just replaces the configure script.\n> \n> If you named it for example configure.sh, then autoconf generated version, \n> and your by hand created version could coexist.\n\nI'm not opposed to it per se, but I'm just not sure if it makes any\nsense to support them both in parallel, since then you have parallel\ninfrastructure doing the exactly same thing, or worse yet - performing\na subtly different set of tests. The benefit is unclear to me.\n\nAnother thing is that it's named *everywhere* ./configure and if I use a\ndifferent name now then it will be hard to rename.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nSnow falling on Perl. White noise covering line noise.\nHides all the bugs too. -- J. Putnam\n"},{"id":"23283","messageId":"81b0412b0607050946y34bf28d5gca30264375fb7957@mail.gmail.com","threadId":"4756","inReplyTo":"20060704215747.GQ29115@pasky.or.cz","subject":"Re: [PATCH] Add a custom ./configure script","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2006-07-05T16:46:43Z","receivedAt":"2006-07-05T16:46:43Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 7/4/06, Petr Baudis <pasky@suse.cz> wrote:\n> >\n> > If you named it for example configure.sh, then autoconf generated version,\n> > and your by hand created version could coexist.\n>\n> I'm not opposed to it per se, but I'm just not sure if it makes any\n> sense to support them both in parallel, since then you have parallel\n> infrastructure doing the exactly same thing, or worse yet - performing\n> a subtly different set of tests. The benefit is unclear to me.\n\nThe benefit is on user side: he'll take what works for him, without waiting\nfor you or Jakub to fix it for him.\n\n> Another thing is that it's named *everywhere* ./configure and if I use a\n> different name now then it will be hard to rename.\n\nbut it not the same configure as \"everywhere\". It's your very own script.\n\nThat said, I like your script better than the autoconf thing.\n"}]}