{"thread":{"id":"4658","subject":"[PATCH] Git.pm: Support for perl/ being built by a different compiler","startedAt":"2006-06-25T01:47:03Z","lastAt":"2006-07-01T22:59:06Z","messageCount":19,"participants":["Petr Baudis","Junio C Hamano","Dennis Stosberg","Thomas Glanzmann"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"22498","messageId":"20060625014703.29304.12715.stgit@machine.or.cz","threadId":"4658","inReplyTo":null,"subject":"[PATCH] Git.pm: Support for perl/ being built by a different compiler","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-06-25T01:47:03Z","receivedAt":"2006-06-25T01:47:03Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"dst_ on #git reported that on Solaris 9, Perl was built by Sun CC\nand perl/ is therefore being built with it as well, while the rest\nof Git is built with gcc. The problem (the first one visible, anyway)\nis that we passed perl/ even various gcc-specific options. This\nseparates those to a special variable.\n\nThis is not really meant for an application yet since it's not clear\nif it will alone help anything.\n\nSigned-off-by: Petr Baudis <pasky@suse.cz>\n---\n\n Makefile |   66 ++++++++++++++++++++++++++++++++++++--------------------------\n 1 files changed, 38 insertions(+), 28 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 4f0a501..6755f26 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -115,6 +115,11 @@ SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powe\n \n ### --- END CONFIGURATION SECTION ---\n \n+# Those must not be GNU-specific; they are shared with perl/ which may\n+# be built by a different compiler.\n+BASIC_CFLAGS =\n+BASIC_LDFLAGS =\n+\n SCRIPT_SH = \\\n \tgit-bisect.sh git-branch.sh git-checkout.sh \\\n \tgit-cherry.sh git-clean.sh git-clone.sh git-commit.sh \\\n@@ -249,13 +254,13 @@ ifeq ($(uname_S),Darwin)\n \tNEEDS_LIBICONV = YesPlease\n \t## fink\n \tifeq ($(shell test -d /sw/lib && echo y),y)\n-\t\tALL_CFLAGS += -I/sw/include\n-\t\tALL_LDFLAGS += -L/sw/lib\n+\t\tBASIC_CFLAGS += -I/sw/include\n+\t\tBASIC_LDFLAGS += -L/sw/lib\n \tendif\n \t## darwinports\n \tifeq ($(shell test -d /opt/local/lib && echo y),y)\n-\t\tALL_CFLAGS += -I/opt/local/include\n-\t\tALL_LDFLAGS += -L/opt/local/lib\n+\t\tBASIC_CFLAGS += -I/opt/local/include\n+\t\tBASIC_LDFLAGS += -L/opt/local/lib\n \tendif\n endif\n ifeq ($(uname_S),SunOS)\n@@ -274,7 +279,7 @@ ifeq ($(uname_S),SunOS)\n \tendif\n \tINSTALL = ginstall\n \tTAR = gtar\n-\tALL_CFLAGS += -D__EXTENSIONS__\n+\tBASIC_CFLAGS += -D__EXTENSIONS__\n endif\n ifeq ($(uname_O),Cygwin)\n \tNO_D_TYPE_IN_DIRENT = YesPlease\n@@ -291,21 +296,22 @@ ifeq ($(uname_O),Cygwin)\n endif\n ifeq ($(uname_S),FreeBSD)\n \tNEEDS_LIBICONV = YesPlease\n-\tALL_CFLAGS += -I/usr/local/include\n-\tALL_LDFLAGS += -L/usr/local/lib\n+\tBASIC_CFLAGS += -I/usr/local/include\n+\tBASIC_LDFLAGS += -L/usr/local/lib\n endif\n ifeq ($(uname_S),OpenBSD)\n \tNO_STRCASESTR = YesPlease\n \tNEEDS_LIBICONV = YesPlease\n-\tALL_CFLAGS += -I/usr/local/include\n-\tALL_LDFLAGS += -L/usr/local/lib\n+\tBASIC_CFLAGS += -I/usr/local/include\n+\tBASIC_LDFLAGS += -L/usr/local/lib\n endif\n ifeq ($(uname_S),NetBSD)\n \tifeq ($(shell expr \"$(uname_R)\" : '[01]\\.'),2)\n \t\tNEEDS_LIBICONV = YesPlease\n \tendif\n-\tALL_CFLAGS += -I/usr/pkg/include\n-\tALL_LDFLAGS += -L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib\n+\tBASIC_CFLAGS += -I/usr/pkg/include\n+\tBASIC_LDFLAGS += -L/usr/pkg/lib\n+\tALL_LDFLAGS += -Wl,-rpath,/usr/pkg/lib\n endif\n ifeq ($(uname_S),AIX)\n \tNO_STRCASESTR=YesPlease\n@@ -317,9 +323,9 @@ ifeq ($(uname_S),IRIX64)\n \tNO_STRCASESTR=YesPlease\n \tNO_SOCKADDR_STORAGE=YesPlease\n \tSHELL_PATH=/usr/gnu/bin/bash\n-\tALL_CFLAGS += -DPATH_MAX=1024\n+\tBASIC_CFLAGS += -DPATH_MAX=1024\n \t# for now, build 32-bit version\n-\tALL_LDFLAGS += -L/usr/lib32\n+\tBASIC_LDFLAGS += -L/usr/lib32\n endif\n ifneq (,$(findstring arm,$(uname_M)))\n \tARM_SHA1 = YesPlease\n@@ -340,7 +346,7 @@ endif\n ifndef NO_CURL\n \tifdef CURLDIR\n \t\t# This is still problematic -- gcc does not always want -R.\n-\t\tALL_CFLAGS += -I$(CURLDIR)/include\n+\t\tBASIC_CFLAGS += -I$(CURLDIR)/include\n \t\tCURL_LIBCURL = -L$(CURLDIR)/lib -R$(CURLDIR)/lib -lcurl\n \telse\n \t\tCURL_LIBCURL = -lcurl\n@@ -361,13 +367,13 @@ ifndef NO_OPENSSL\n \tOPENSSL_LIBSSL = -lssl\n \tifdef OPENSSLDIR\n \t\t# Again this may be problematic -- gcc does not always want -R.\n-\t\tALL_CFLAGS += -I$(OPENSSLDIR)/include\n+\t\tBASIC_CFLAGS += -I$(OPENSSLDIR)/include\n \t\tOPENSSL_LINK = -L$(OPENSSLDIR)/lib -R$(OPENSSLDIR)/lib\n \telse\n \t\tOPENSSL_LINK =\n \tendif\n else\n-\tALL_CFLAGS += -DNO_OPENSSL\n+\tBASIC_CFLAGS += -DNO_OPENSSL\n \tMOZILLA_SHA1 = 1\n \tOPENSSL_LIBSSL =\n endif\n@@ -379,7 +385,7 @@ endif\n ifdef NEEDS_LIBICONV\n \tifdef ICONVDIR\n \t\t# Again this may be problematic -- gcc does not always want -R.\n-\t\tALL_CFLAGS += -I$(ICONVDIR)/include\n+\t\tBASIC_CFLAGS += -I$(ICONVDIR)/include\n \t\tICONV_LINK = -L$(ICONVDIR)/lib -R$(ICONVDIR)/lib\n \telse\n \t\tICONV_LINK =\n@@ -395,13 +401,13 @@ ifdef NEEDS_NSL\n \tSIMPLE_LIB += -lnsl\n endif\n ifdef NO_D_TYPE_IN_DIRENT\n-\tALL_CFLAGS += -DNO_D_TYPE_IN_DIRENT\n+\tBASIC_CFLAGS += -DNO_D_TYPE_IN_DIRENT\n endif\n ifdef NO_D_INO_IN_DIRENT\n-\tALL_CFLAGS += -DNO_D_INO_IN_DIRENT\n+\tBASIC_CFLAGS += -DNO_D_INO_IN_DIRENT\n endif\n ifdef NO_SYMLINK_HEAD\n-\tALL_CFLAGS += -DNO_SYMLINK_HEAD\n+\tBASIC_CFLAGS += -DNO_SYMLINK_HEAD\n endif\n ifdef NO_STRCASESTR\n \tCOMPAT_CFLAGS += -DNO_STRCASESTR\n@@ -420,13 +426,13 @@ ifdef NO_MMAP\n \tCOMPAT_OBJS += compat/mmap.o\n endif\n ifdef NO_IPV6\n-\tALL_CFLAGS += -DNO_IPV6\n+\tBASIC_CFLAGS += -DNO_IPV6\n endif\n ifdef NO_SOCKADDR_STORAGE\n ifdef NO_IPV6\n-\tALL_CFLAGS += -Dsockaddr_storage=sockaddr_in\n+\tBASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in\n else\n-\tALL_CFLAGS += -Dsockaddr_storage=sockaddr_in6\n+\tBASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in6\n endif\n endif\n ifdef NO_INET_NTOP\n@@ -434,7 +440,7 @@ ifdef NO_INET_NTOP\n endif\n \n ifdef NO_ICONV\n-\tALL_CFLAGS += -DNO_ICONV\n+\tBASIC_CFLAGS += -DNO_ICONV\n endif\n \n ifdef PPC_SHA1\n@@ -458,7 +464,7 @@ ifdef USE_PIC\n \tALL_CFLAGS += -fPIC\n endif\n ifdef NO_ACCURATE_DIFF\n-\tALL_CFLAGS += -DNO_ACCURATE_DIFF\n+\tBASIC_CFLAGS += -DNO_ACCURATE_DIFF\n endif\n \n # Shell quote (do not use $(call) to accomodate ancient setups);\n@@ -478,8 +484,12 @@ GIT_PYTHON_DIR_SQ = $(subst ','\\'',$(GIT\n \n LIBS = $(GITLIBS) $(EXTLIBS)\n \n-ALL_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' $(COMPAT_CFLAGS)\n+BASIC_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' $(COMPAT_CFLAGS)\n LIB_OBJS += $(COMPAT_OBJS)\n+\n+ALL_CFLAGS += $(BASIC_CFLAGS)\n+ALL_LDFLAGS += $(BASIC_LDFLAGS)\n+\n export prefix TAR INSTALL DESTDIR SHELL_PATH template_dir\n \n \n@@ -608,9 +618,9 @@ XDIFF_OBJS=xdiff/xdiffi.o xdiff/xprepare\n \trm -f $@ && $(AR) rcs $@ $(XDIFF_OBJS)\n \n \n-PERL_DEFINE = $(ALL_CFLAGS) -DGIT_VERSION='\"$(GIT_VERSION)\"'\n+PERL_DEFINE = $(BASIC_CFLAGS) -DGIT_VERSION='\"$(GIT_VERSION)\"'\n PERL_DEFINE_SQ = $(subst ','\\'',$(PERL_DEFINE))\n-PERL_LIBS = $(EXTLIBS)\n+PERL_LIBS = $(BASIC_LDFLAGS) $(EXTLIBS)\n PERL_LIBS_SQ = $(subst ','\\'',$(PERL_LIBS))\n perl/Makefile:\tperl/Git.pm perl/Makefile.PL GIT-CFLAGS\n \t(cd perl && $(PERL_PATH) Makefile.PL \\\n"},{"id":"22516","messageId":"7vk676orjy.fsf@assigned-by-dhcp.cox.net","threadId":"4658","inReplyTo":"20060625014703.29304.12715.stgit@machine.or.cz","subject":"Re: [PATCH] Git.pm: Support for perl/ being built by a different compiler","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-25T03:14:09Z","receivedAt":"2006-06-25T03:14:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n> dst_ on #git reported that on Solaris 9, Perl was built by Sun CC\n> and perl/ is therefore being built with it as well, while the rest\n> of Git is built with gcc. The problem (the first one visible, anyway)\n> is that we passed perl/ even various gcc-specific options. This\n> separates those to a special variable.\n>\n> This is not really meant for an application yet since it's not clear\n> if it will alone help anything.\n\nDo things link and work fine if we do not have the GCC specific\noptions?\n\nI would question why the rest of git is not built with Sun CC as\nwell if that is the case.\n"},{"id":"22565","messageId":"20060625152727.GH21864@pasky.or.cz","threadId":"4658","inReplyTo":"7vk676orjy.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Git.pm: Support for perl/ being built by a different compiler","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-06-25T15:27:27Z","receivedAt":"2006-06-25T15:27:27Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Sun, Jun 25, 2006 at 05:14:09AM CEST, I got a letter\nwhere Junio C Hamano <junkio@cox.net> said that...\n> Petr Baudis <pasky@suse.cz> writes:\n> > This is not really meant for an application yet since it's not clear\n> > if it will alone help anything.\n\nIt appears that it did have helped and all went well, according to dst_.\n\n> I would question why the rest of git is not built with Sun CC as\n> well if that is the case.\n\n< dst_> Three points: (1) Gcc comes along with solaris, sun cc not.\n< dst_> (2) Git used a lot of GCC'isms whan I last checked a few weeks ago\n< dst_> (3) a lot of other software will not ompile out of the box with suncc, so gcc is usually the safer choice\n\nOf course (1) is troublesome since this means you can't build Git on\nSolaris without installing Sun CC - I have no other answer to this than\nthat Solaris is horribly broken. :-( Perhaps ExtUtils::MakeMaker could\nbe convinced to build with gcc, I'm not sure.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nA person is just about as big as the things that make them angry.\n"},{"id":"22592","messageId":"20060626082428.G52c9608e@leonov.stosberg.net","threadId":"4658","inReplyTo":"7vk676orjy.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Git.pm: Support for perl/ being built by a different compiler","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-06-26T08:24:29Z","receivedAt":"2006-06-26T08:24:29Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"Junio C Hamano wrote:\n\n> Do things link and work fine if we do not have the GCC specific\n> options?\n\nYes, with this patch I can compile Git with GCC while the Perl module\ngets built with Sun CC.  The result even works.\n\nIf the git commands written in Perl will be converted to use Git.pm,\nSun CC will become a new dependency for Git on Solaris, unless\npeople build a separate Perl with GCC or manually edit the generated\nMakefile in the perl subdir to build the module with GCC.\n\n> I would question why the rest of git is not built with Sun CC as\n> well if that is the case.\n\nWell, GCC comes along with Solaris on the CDs while Sun CC is a\nseparate product.  And usually it's easier to build free software\nwith GCC, because many projects use GCC extensions.  Often GCC is\nthe only compiler installed on Solaris machines.\n\nUntil the patch series from Florian Forster removed a lot of GCC'isms\na few days ago it was not possible to build Git with Sun CC.\n\nYesterday I could build the next branch with Sun CC 5.8 with a few\ntrivial changes.  I will send four patches in reply to this mail.\n\nJunio, please consider the first two patches for inclusion into the\nnext branch.  The third patch is on top of Pasky's changes in the pu\nbranch.  The fourth patch is a strange workaround for a strange\nproblem of which I think it is an error in Sun's compiler.  That one\nshould not make its way into Git, but maybe someone on the list has\nan idea about the problem.\n\nRegards,\nDennis\n"},{"id":"22594","messageId":"20060626082613.G7dd5c243@leonov.stosberg.net","threadId":"4658","inReplyTo":"20060626082428.G52c9608e@leonov.stosberg.net","subject":"[PATCH] Solaris needs inclusion of signal.h for signal()","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-06-26T08:26:13Z","receivedAt":"2006-06-26T08:26:13Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"Currently the compilation fails in connect.c and merge-index.c\n---\n\n connect.c     |    1 +\n merge-index.c |    1 +\n 2 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/connect.c b/connect.c\nindex db7342e..66e78a2 100644\n--- a/connect.c\n+++ b/connect.c\n@@ -8,6 +8,7 @@ #include <sys/socket.h>\n #include <netinet/in.h>\n #include <arpa/inet.h>\n #include <netdb.h>\n+#include <signal.h>\n \n static char *server_capabilities = NULL;\n \ndiff --git a/merge-index.c b/merge-index.c\nindex 190e12f..0498a6f 100644\n--- a/merge-index.c\n+++ b/merge-index.c\n@@ -1,5 +1,6 @@\n #include <sys/types.h>\n #include <sys/wait.h>\n+#include <signal.h>\n \n #include \"cache.h\"\n \n-- \n1.4.0.g64e8\n"},{"id":"22595","messageId":"20060626082707.G1c426a74@leonov.stosberg.net","threadId":"4658","inReplyTo":"20060626082428.G52c9608e@leonov.stosberg.net","subject":"[PATCH] Fix pkt-line.h to compile with a non-GCC compiler","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-06-26T08:27:07Z","receivedAt":"2006-06-26T08:27:07Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"pkt-line.h uses GCC's __attribute__ extension but does not include\ngit-compat-util.h.  So it will not compile with a compiler that does\nnot support this extension.\n---\n pkt-line.h |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/pkt-line.h b/pkt-line.h\nindex 9abef24..9df653f 100644\n--- a/pkt-line.h\n+++ b/pkt-line.h\n@@ -1,6 +1,8 @@\n #ifndef PKTLINE_H\n #define PKTLINE_H\n \n+#include \"git-compat-util.h\"\n+\n /*\n  * Silly packetized line writing interface\n  */\n-- \n1.4.0.g64e8\n"},{"id":"22596","messageId":"20060626082754.G6ec0a61e@leonov.stosberg.net","threadId":"4658","inReplyTo":"20060626082428.G52c9608e@leonov.stosberg.net","subject":"[PATCH] \"test\" in Solaris' /bin/sh does not support -e","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-06-26T08:27:54Z","receivedAt":"2006-06-26T08:27:54Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"Running \"make clean\" currently fails:\n  [ ! -e perl/Makefile ] || make -C perl/ clean\n  /bin/sh: test: argument expected\n  make: *** [clean] Error 1\n---\n\nPasky said in #git that a simple -f test would suffice.\n\n Makefile |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 3dc54fe..d41d224 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -761,7 +761,7 @@ clean:\n \trm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz\n \trm -f $(htmldocs).tar.gz $(manpages).tar.gz\n \t$(MAKE) -C Documentation/ clean\n-\t[ ! -e perl/Makefile ] || $(MAKE) -C perl/ clean || $(MAKE) -C perl/ clean\n+\t[ ! -f perl/Makefile ] || $(MAKE) -C perl/ clean || $(MAKE) -C perl/ clean\n \t$(MAKE) -C templates/ clean\n \t$(MAKE) -C t/ clean\n \trm -f GIT-VERSION-FILE GIT-CFLAGS\n--\n1.4.0\n"},{"id":"22597","messageId":"20060626082939.G215d3ce6@leonov.stosberg.net","threadId":"4658","inReplyTo":"20060626082428.G52c9608e@leonov.stosberg.net","subject":"Re: [PATCH] Git.pm: Support for perl/ being built by a different compiler","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-06-26T08:29:39Z","receivedAt":"2006-06-26T08:29:39Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"Sun CC 5.8 fails with a strange error compiling diff-delta.c that\nlooks like an error in Sun's compiler to me:\n\n$ cc -V\ncc: Sun C 5.8 Patch 121015-02 2006/03/29\n\n$ cc -o diff-delta.o -c -I/opt/gnu/include -D__EXTENSIONS__ \\\n-DSHA1_HEADER='<openssl/sha.h>' -DNO_STRCASESTR -DNO_STRLCPY \\\n-DNO_SETENV -DNO_UNSETENV diff-delta.c\n\"diff-delta.c\", line 251: identifier redeclared: create_delta\n        current : function(pointer to const struct delta_index \\\n{pointer to const void src_buf, unsigned long src_size, \\\nunsigned int hash_mask, array[-1] of pointer to struct index_entry {..} hash},\\\npointer to const void, unsigned long, pointer to unsigned long, \\\nunsigned long) returning pointer to void\n        previous: function(pointer to const struct delta_index \\\n{pointer to const void src_buf, unsigned long src_size, \\\nunsigned int hash_mask, array[-1] of pointer to struct index_entry {..} hash},\\\npointer to const void, unsigned long, pointer to unsigned long, \\\nunsigned long) returning pointer to void : \"delta.h\", line 37\ncc: acomp failed for diff-delta.c\nmake: *** [diff-delta.o] Error 2\n\nYes, the two prototypes are identical.  Seems like the compiler has\nproblems with the opaque struct.  When I played around with it, I\nwas surprised when I found that Sun CC actually compiled this file\nafter I removed the const qualifier from the first parameter of the\ncreate_delta() function.  Does anybody have a better explanation\nthan an error in the compiler?\n\nRegards,\nDennis\n\n\ndiff --git a/delta.h b/delta.h\nindex 7b3f86d..ec9147c 100644\n--- a/delta.h\n+++ b/delta.h\n@@ -34,11 +34,12 @@ extern void free_delta_index(struct delt\n  * must be freed by the caller.\n  */\n extern void *\n-create_delta(const struct delta_index *index,\n+create_delta(struct delta_index *index,\n             const void *buf, unsigned long bufsize,\n             unsigned long *delta_size, unsigned long max_delta_size);\n\n-/*\n+/*l\n+\n  * diff_delta: create a delta from source buffer to target buffer\n  *\n  * If max_delta_size is non-zero and the resulting delta is to be larger\ndiff --git a/diff-delta.c b/diff-delta.c\nindex 8b9172a..802be76 100644\n--- a/diff-delta.c\n+++ b/diff-delta.c\n@@ -245,7 +245,7 @@ void free_delta_index(struct delta_index\n #define MAX_OP_SIZE    (5 + 5 + 1 + RABIN_WINDOW + 7)\n\n void *\n-create_delta(const struct delta_index *index,\n+create_delta(struct delta_index *index,\n             const void *trg_buf, unsigned long trg_size,\n             unsigned long *delta_size, unsigned long max_size)\n {\n"},{"id":"22598","messageId":"20060626085110.GD9248@cip.informatik.uni-erlangen.de","threadId":"4658","inReplyTo":"20060626082939.G215d3ce6@leonov.stosberg.net","subject":"Re: [PATCH] Git.pm: Support for perl/ being built by a different compiler","fromName":"Thomas Glanzmann","fromEmail":"sithglan@stud.uni-erlangen.de","sentAt":"2006-06-26T08:51:10Z","receivedAt":"2006-06-26T08:51:10Z","isPatch":true,"sender":{"key":"sithglan@stud.uni-erlangen.de","avatar":null},"body":"Hello,\n\n> -/*\n> +/*l\n> +\n\nthis looks like a typo in your patch.\n\n        Thomas\n"},{"id":"22600","messageId":"7vwtb4i89d.fsf@assigned-by-dhcp.cox.net","threadId":"4658","inReplyTo":"20060626082754.G6ec0a61e@leonov.stosberg.net","subject":"Re: [PATCH] \"test\" in Solaris' /bin/sh does not support -e","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-26T09:19:42Z","receivedAt":"2006-06-26T09:19:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dennis Stosberg <dennis@stosberg.net> writes:\n\n> Running \"make clean\" currently fails:\n>   [ ! -e perl/Makefile ] || make -C perl/ clean\n>   /bin/sh: test: argument expected\n>   make: *** [clean] Error 1\n\nAh, _BAD_.  We seem to have the same in git-branch, git-checkout,\ngit-clone and git-tag.  You would probably need this on top of\n\"master\".\n\n-- >8 --\nshell scripts: Avoid non-portable \"test -e\" where possible.\n\n---\ndiff --git a/git-branch.sh b/git-branch.sh\nindex e0501ec..76971be 100755\n--- a/git-branch.sh\n+++ b/git-branch.sh\n@@ -112,7 +112,7 @@ rev=$(git-rev-parse --verify \"$head\") ||\n git-check-ref-format \"heads/$branchname\" ||\n \tdie \"we do not like '$branchname' as a branch name.\"\n \n-if [ -e \"$GIT_DIR/refs/heads/$branchname\" ]\n+if test -f \"$GIT_DIR/refs/heads/$branchname\"\n then\n \tif test '' = \"$force\"\n \tthen\n@@ -124,7 +124,7 @@ then\n fi\n if test \"$create_log\" = 'yes'\n then\n-\tmkdir -p $(dirname \"$GIT_DIR/logs/refs/heads/$branchname\")\n+\tmkdir -p \"$(dirname \"$GIT_DIR/logs/refs/heads/$branchname\")\"\n \ttouch \"$GIT_DIR/logs/refs/heads/$branchname\"\n fi\n git update-ref -m \"branch: Created from $head\" \"refs/heads/$branchname\" $rev\ndiff --git a/git-checkout.sh b/git-checkout.sh\nindex 77c2593..bfc2640 100755\n--- a/git-checkout.sh\n+++ b/git-checkout.sh\n@@ -22,7 +22,7 @@ while [ \"$#\" != \"0\" ]; do\n \t\tshift\n \t\t[ -z \"$newbranch\" ] &&\n \t\t\tdie \"git checkout: -b needs a branch name\"\n-\t\t[ -e \"$GIT_DIR/refs/heads/$newbranch\" ] &&\n+\t\t[ -f \"$GIT_DIR/refs/heads/$newbranch\" ] &&\n \t\t\tdie \"git checkout: branch $newbranch already exists\"\n \t\tgit-check-ref-format \"heads/$newbranch\" ||\n \t\t\tdie \"git checkout: we do not like '$newbranch' as a branch name.\"\ndiff --git a/git-clone.sh b/git-clone.sh\nindex 6fa0daa..b355441 100755\n--- a/git-clone.sh\n+++ b/git-clone.sh\n@@ -202,7 +202,7 @@ fi\n dir=\"$2\"\n # Try using \"humanish\" part of source repo if user didn't specify one\n [ -z \"$dir\" ] && dir=$(echo \"$repo\" | sed -e 's|/$||' -e 's|:*/*\\.git$||' -e 's|.*[/:]||g')\n-[ -e \"$dir\" ] && echo \"$dir already exists.\" && usage\n+[ -d \"$dir\" ] && echo \"$dir already exists.\" && usage\n mkdir -p \"$dir\" &&\n D=$(cd \"$dir\" && pwd) &&\n trap 'err=$?; cd ..; rm -r \"$D\"; exit $err' 0\ndiff --git a/git-tag.sh b/git-tag.sh\nindex a0afa25..6118b00 100755\n--- a/git-tag.sh\n+++ b/git-tag.sh\n@@ -63,7 +63,7 @@ done\n \n name=\"$1\"\n [ \"$name\" ] || usage\n-if [ -e \"$GIT_DIR/refs/tags/$name\" -a -z \"$force\" ]; then\n+if [ -f \"$GIT_DIR/refs/tags/$name\" -a -z \"$force\" ]; then\n     die \"tag '$name' already exists\"\n fi\n shift\n"},{"id":"22602","messageId":"7vmzc0i7xo.fsf@assigned-by-dhcp.cox.net","threadId":"4658","inReplyTo":"20060626082428.G52c9608e@leonov.stosberg.net","subject":"Re: [PATCH] Git.pm: Support for perl/ being built by a different compiler","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-26T09:26:43Z","receivedAt":"2006-06-26T09:26:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dennis Stosberg <dennis@stosberg.net> writes:\n\n> Yesterday I could build the next branch with Sun CC 5.8 with a few\n> trivial changes.  I will send four patches in reply to this mail.\n\nThanks.  Next time around please sign off your patches.\n"},{"id":"22603","messageId":"20060626093214.G4d831c9c@leonov.stosberg.net","threadId":"4658","inReplyTo":"7vmzc0i7xo.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Git.pm: Support for perl/ being built by a different compiler","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-06-26T09:32:14Z","receivedAt":"2006-06-26T09:32:14Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"Junio C Hamano wrote:\n\n> Dennis Stosberg <dennis@stosberg.net> writes:\n> \n> > Yesterday I could build the next branch with Sun CC 5.8 with a few\n> > trivial changes.  I will send four patches in reply to this mail.\n> \n> Thanks.  Next time around please sign off your patches.\n\nSorry, I forgot and will do next time.  Please assume the Signed-Off\nis present on the first three patches.\n\nRegards,\nDennis\n"},{"id":"22604","messageId":"20060626094211.G3b49c5c3@leonov.stosberg.net","threadId":"4658","inReplyTo":"7vwtb4i89d.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] \"test\" in Solaris' /bin/sh does not support -e","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-06-26T09:42:12Z","receivedAt":"2006-06-26T09:42:12Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"Junio C Hamano wrote:\n\n> Dennis Stosberg <dennis@stosberg.net> writes:\n> \n> > Running \"make clean\" currently fails:\n> >   [ ! -e perl/Makefile ] || make -C perl/ clean\n> >   /bin/sh: test: argument expected\n> >   make: *** [clean] Error 1\n> \n> Ah, _BAD_.  We seem to have the same in git-branch, git-checkout,\n> git-clone and git-tag.  You would probably need this on top of\n> \"master\".\n\nThe SHELL_PATH in the Makefile is being set to \"/bin/bash\" on\nSolaris, so there is currently no problem with those.\n\nA lot of bashisms have been removed from the shell scripts since\nthat SHELL_PATH override was added in September 2005; I will have a\nlook whether it's still necessary.\n\nRegards,\nDennis\n"},{"id":"22605","messageId":"20060626100402.G5761a3ea@leonov.stosberg.net","threadId":"4658","inReplyTo":"20060626094211.G3b49c5c3@leonov.stosberg.net","subject":"Re: [PATCH] \"test\" in Solaris' /bin/sh does not support -e","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-06-26T10:04:03Z","receivedAt":"2006-06-26T10:04:03Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"Dennis Stosberg wrote:\n\n> A lot of bashisms have been removed from the shell scripts since\n> that SHELL_PATH override was added in September 2005; I will have a\n> look whether it's still necessary.\n\nSolaris is really horrible sometimes.  \"/bin/sh\" is linked to\n\"/usr/bin/sh\".  The manual sh(1) reads:\n\n     The /usr/bin/sh utility is a  command  programming  language\n     that executes commands read from a terminal or a file.\n\n     The /usr/xpg4/bin/sh utility is a standards compliant shell.\n\nArgh!  Why don't they put their \"standards compliant\" shell to\n/bin/sh?  The current one doesn't even support the $( )-style command\nsubstitution, so making the scripts run with that shell would be\n_really_ ugly.\n\nRegards,\nDennis\n"},{"id":"22610","messageId":"7vd5cvj1d0.fsf@assigned-by-dhcp.cox.net","threadId":"4658","inReplyTo":"20060626100402.G5761a3ea@leonov.stosberg.net","subject":"Re: [PATCH] \"test\" in Solaris' /bin/sh does not support -e","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-26T17:03:23Z","receivedAt":"2006-06-26T17:03:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dennis Stosberg <dennis@stosberg.net> writes:\n\n> Argh!  Why don't they put their \"standards compliant\" shell to\n> /bin/sh?  The current one doesn't even support the $( )-style command\n> substitution, so making the scripts run with that shell would be\n> _really_ ugly.\n\nWhich means this in pb/gitpm topic needs further changes,\nperhaps.\n\n$ git grep -n '\\$\\$(' pb/gitpm:Makefile\npb/gitpm:Makefile:537:\tINSTLIBDIR=$$(make -s -C perl instlibdir) && \\\n"},{"id":"22614","messageId":"20060626222107.G1b760b67@leonov.stosberg.net","threadId":"4658","inReplyTo":"7vd5cvj1d0.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] Makefile fix for Solaris","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-06-26T22:21:07Z","receivedAt":"2006-06-26T22:21:07Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"Solaris' /bin/sh does not support $( )-style command substitution\n\nSigned-off-by: Dennis Stosberg <dennis@stosberg.net>\n---\n Makefile |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex a326f6e..f44fbd3 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -544,7 +544,7 @@ common-cmds.h: Documentation/git-*.txt\n $(patsubst %.perl,%,$(SCRIPT_PERL)): perl/Makefile\n $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl\n \trm -f $@ $@+\n-\tINSTLIBDIR=$$(make -s -C perl instlibdir) && \\\n+\tINSTLIBDIR=`make -s -C perl instlibdir` && \\\n \tsed -e '1s|#!.*perl\\(.*\\)|#!$(PERL_PATH_SQ)\\1|' \\\n \t    -e 's|@@INSTLIBDIR@@|'\"$$INSTLIBDIR\"'|g' \\\n \t    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \\\n-- \n1.4.1.rc1.g80bff-dirty\n"},{"id":"22615","messageId":"20060626222308.G71066338@leonov.stosberg.net","threadId":"4658","inReplyTo":"7vd5cvj1d0.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] Add possibility to pass CFLAGS and LDFLAGS specific to the perl subdir","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-06-26T22:23:08Z","receivedAt":"2006-06-26T22:23:08Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"Signed-off-by: Dennis Stosberg <dennis@stosberg.net>\n---\n Makefile |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex f44fbd3..306025d 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -94,6 +94,8 @@ CFLAGS = -g -O2 -Wall\n LDFLAGS =\n ALL_CFLAGS = $(CFLAGS)\n ALL_LDFLAGS = $(LDFLAGS)\n+PERL_CFLAGS =\n+PERL_LDFLAGS =\n STRIP ?= strip\n \n prefix = $(HOME)\n@@ -119,8 +121,8 @@ ### --- END CONFIGURATION SECTION ---\n \n # Those must not be GNU-specific; they are shared with perl/ which may\n # be built by a different compiler.\n-BASIC_CFLAGS =\n-BASIC_LDFLAGS =\n+BASIC_CFLAGS = $(PERL_CFLAGS)\n+BASIC_LDFLAGS = $(PERL_LDFLAGS)\n \n SCRIPT_SH = \\\n \tgit-bisect.sh git-branch.sh git-checkout.sh \\\n-- \n1.4.1.rc1.g80bff-dirty\n"},{"id":"22617","messageId":"20060626222552.G4c7c6c98@leonov.stosberg.net","threadId":"4658","inReplyTo":"7vd5cvj1d0.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] \"test\" in Solaris' /bin/sh does not support -e","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-06-26T22:25:52Z","receivedAt":"2006-06-26T22:25:52Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"Junio C Hamano wrote:\n\n> Which means this in pb/gitpm topic needs further changes,\n> perhaps.\n\nIndeed.\n\nThe second patch makes it possible to give additional CFLAGS and\nLDFLAGS for compiling the perl module.  Otherwise the compiler may\nnot be able to find headers and libraries for curl, expat and\nopenssl.  This is needed on Solaris where these libraries will\nusually be in paths like /usr/local or /opt/gnu.\n\nWith the patch Pasky started this thread with, the four patches I\nsent earlier and these last two patches the pu branch compiles,\ntests and installs cleanly on Solaris 9, both with Sun CC 5.8 and\nGCC 4.1.1.\n\nRegards,\nDennis\n"},{"id":"23002","messageId":"20060701225906.GC29115@pasky.or.cz","threadId":"4658","inReplyTo":"20060626222308.G71066338@leonov.stosberg.net","subject":"Re: [PATCH] Add possibility to pass CFLAGS and LDFLAGS specific to the perl subdir","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-07-01T22:59:06Z","receivedAt":"2006-07-01T22:59:06Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Tue, Jun 27, 2006 at 12:23:08AM CEST, I got a letter\nwhere Dennis Stosberg <dennis@stosberg.net> said that...\n> Signed-off-by: Dennis Stosberg <dennis@stosberg.net>\n> ---\n>  Makefile |    6 ++++--\n>  1 files changed, 4 insertions(+), 2 deletions(-)\n> \n> diff --git a/Makefile b/Makefile\n> index f44fbd3..306025d 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -94,6 +94,8 @@ CFLAGS = -g -O2 -Wall\n>  LDFLAGS =\n>  ALL_CFLAGS = $(CFLAGS)\n>  ALL_LDFLAGS = $(LDFLAGS)\n> +PERL_CFLAGS =\n> +PERL_LDFLAGS =\n>  STRIP ?= strip\n>  \n>  prefix = $(HOME)\n\nJust an annotation:\n\n\tALL_* means \"use these flags for compilation of all the stuff\n\t\t\texcept perly stuff\"\n\tPERL_* means \"use these flags for compilation of really all the\n\t\t\tstuff\"\n\nSo \"all\" might not mean what you think and Perl is stonger than\neverything.\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"}]}