{"thread":{"id":"4939","subject":"Makefile checks for DarwinPorts / Fink","startedAt":"2006-07-21T14:58:21Z","lastAt":"2006-07-24T06:43:15Z","messageCount":7,"participants":["Stefan Pfetzing","Junio C Hamano","Shawn Pearce","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"23980","messageId":"f3d7535d0607210758m4410cddfw16329ce473404fd8@mail.gmail.com","threadId":"4939","inReplyTo":null,"subject":"Makefile checks for DarwinPorts / Fink","fromName":"Stefan Pfetzing","fromEmail":"stefan.pfetzing@gmail.com","sentAt":"2006-07-21T14:58:21Z","receivedAt":"2006-07-21T14:58:21Z","isPatch":false,"sender":{"key":"stefan.pfetzing@gmail.com","avatar":null},"body":"Hi,\n\nwhile I was updating the DarwinPorts Portfile for git, I saw some\nreally suspicious lines in the Makefile of Git for DarwinPorts/Fink.\n\n--- snip ---\n        ## fink\n        ifeq ($(shell test -d /sw/lib && echo y),y)\n                ALL_CFLAGS += -I/sw/include\n                ALL_LDFLAGS += -L/sw/lib\n        endif\n        ## darwinports\n        ifeq ($(shell test -d /opt/local/lib && echo y),y)\n                ALL_CFLAGS += -I/opt/local/include\n                ALL_LDFLAGS += -L/opt/local/lib\n        endif\n--- snap ---\n\nIMHO, Git should definetely not include /sw/include and /sw/lib, just\nif it *exists*.\n\nThink of a situation, when somebody has Fink and DarwinPorts installed\non one machine (possible). Then if you would build Git from\nDarwinPorts, the git Makefile would link against Fink libraries! IMHO\nthe DarwinPorts / Fink build process should set LDFLAGS and CFLAGS\naccordingly.\n\nAlso, maybe you want to create a DarwinPorts / Fink independent Mac OS\nX pkg which contains Git and its deps.\n\nI know this just appends to CFLAGS/LDFLAGS, but if for example\nDarwinPorts has broken build-deps, then the Fink stuff would get\nsucked in, and you would not notice. (on a box with both, DP and Fink\ninstalled)\n\nbye\n\nStefan\n\n  --\n       http://www.dreamind.de/\nOroborus and Debian GNU/Linux Developer.\n"},{"id":"23995","messageId":"7vhd19itu2.fsf@assigned-by-dhcp.cox.net","threadId":"4939","inReplyTo":"f3d7535d0607210758m4410cddfw16329ce473404fd8@mail.gmail.com","subject":"Re: Makefile checks for DarwinPorts / Fink","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-07-22T14:43:01Z","receivedAt":"2006-07-22T14:43:01Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Stefan Pfetzing\" <stefan.pfetzing@gmail.com> writes:\n\n> while I was updating the DarwinPorts Portfile for git, I saw some\n> really suspicious lines in the Makefile of Git for DarwinPorts/Fink.\n>\n> --- snip ---\n>        ## fink\n>        ifeq ($(shell test -d /sw/lib && echo y),y)\n>                ALL_CFLAGS += -I/sw/include\n>                ALL_LDFLAGS += -L/sw/lib\n>        endif\n>        ## darwinports\n>        ifeq ($(shell test -d /opt/local/lib && echo y),y)\n>                ALL_CFLAGS += -I/opt/local/include\n>                ALL_LDFLAGS += -L/opt/local/lib\n>        endif\n> --- snap ---\n>\n> IMHO, Git should definetely not include /sw/include and /sw/lib, just\n> if it *exists*.\n\nCould you make a concrete suggestion (I am not on Darwin)?  \n\nIf I am reading you correctly, your suggestion is that\nDarwinPorts and/or Fink build procedure, which drive our\nMakefile from outside, should set up CFLAGS and LDFLAGS to have\nthe correct paths for local libraries and headers.  It is not\nclear to me if having these defaults there makes it hard (or\ncumbersome) to override them in such a setup and you are\nproposing to remove them (or commenting them out), or if you can\nlive with them being there.\n\nThese were made as \"quick relatively sane defaults for help\npeople with simple configuration when people build git\nthemselves\" initially and it may be the case that they now could\nuse improvements.  I dunno (I am not on Darwin).\n\nBut I suspect that the \"official\" portfile (or whatever it is\ncalled in the Darwin world) should be able to override whatever\nis done in there --- otherwise we would need to remove them or\ncomment them out, but I am hoping it does not have to come to\nthat; I think they serve as good hint to help people who are\nbuilding from the source.\n"},{"id":"23996","messageId":"20060722161914.GA10754@spearce.org","threadId":"4939","inReplyTo":"7vhd19itu2.fsf@assigned-by-dhcp.cox.net","subject":"Re: Makefile checks for DarwinPorts / Fink","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-07-22T16:19:14Z","receivedAt":"2006-07-22T16:19:14Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <junkio@cox.net> wrote:\n> \"Stefan Pfetzing\" <stefan.pfetzing@gmail.com> writes:\n> \n> > while I was updating the DarwinPorts Portfile for git, I saw some\n> > really suspicious lines in the Makefile of Git for DarwinPorts/Fink.\n> >\n> > --- snip ---\n> >        ## fink\n> >        ifeq ($(shell test -d /sw/lib && echo y),y)\n> >                ALL_CFLAGS += -I/sw/include\n> >                ALL_LDFLAGS += -L/sw/lib\n> >        endif\n> >        ## darwinports\n> >        ifeq ($(shell test -d /opt/local/lib && echo y),y)\n> >                ALL_CFLAGS += -I/opt/local/include\n> >                ALL_LDFLAGS += -L/opt/local/lib\n> >        endif\n> > --- snap ---\n> >\n> > IMHO, Git should definetely not include /sw/include and /sw/lib, just\n> > if it *exists*.\n[snip]\n> But I suspect that the \"official\" portfile (or whatever it is\n> called in the Darwin world) should be able to override whatever\n> is done in there --- otherwise we would need to remove them or\n> comment them out, but I am hoping it does not have to come to\n> that; I think they serve as good hint to help people who are\n> building from the source.\n\nThe quoted section of the Makefile was mostly my fault.  GIT used\nto build only against Fink but when I switched to DarwinPorts it\nwas first not even looking for them and second when I removed Fink\nthe Mac OS X linker was warning about /sw/lib not existing.\n\nI completely agree that its incorrect to be doing this all of the\ntime as a higher-level build driver (e.g. Portfile) should be able\nto have more direct control CFLAGS and LDFLAGS.  Perhaps something\nlike this?\n\ndiff --git a/Makefile b/Makefile\nindex a1666e2..0a48c32 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -268,14 +268,18 @@ ifeq ($(uname_S),Darwin)\n \tNEEDS_LIBICONV = YesPlease\n \tNO_STRLCPY = YesPlease\n \t## fink\n-\tifeq ($(shell test -d /sw/lib && echo y),y)\n-\t\tBASIC_CFLAGS += -I/sw/include\n-\t\tBASIC_LDFLAGS += -L/sw/lib\n+\tifndef NO_FINK\n+\t\tifeq ($(shell test -d /sw/lib && echo y),y)\n+\t\t\tBASIC_CFLAGS += -I/sw/include\n+\t\t\tBASIC_LDFLAGS += -L/sw/lib\n+\t\tendif\n \tendif\n+\tifndef NO_DARWIN_PORTS\n \t## darwinports\n-\tifeq ($(shell test -d /opt/local/lib && echo y),y)\n-\t\tBASIC_CFLAGS += -I/opt/local/include\n-\t\tBASIC_LDFLAGS += -L/opt/local/lib\n+\t\tifeq ($(shell test -d /opt/local/lib && echo y),y)\n+\t\t\tBASIC_CFLAGS += -I/opt/local/include\n+\t\t\tBASIC_LDFLAGS += -L/opt/local/lib\n+\t\tendif\n \tendif\n endif\n ifeq ($(uname_S),SunOS)\n\n-- \nShawn.\n"},{"id":"24008","messageId":"20060723054531.GA12559@spearce.org","threadId":"4939","inReplyTo":"20060722161914.GA10754@spearce.org","subject":"Re: Makefile checks for DarwinPorts / Fink","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-07-23T05:45:31Z","receivedAt":"2006-07-23T05:45:31Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"This is a slightly cleaner version of my prior patch.  :-)\n\n-->8--\nDisable linking with Fink or DarwinPorts.\n\nIt may be desirable for the compiler to disable linking against Fink\nor DarwinPorts, especially if both are installed on the system and\nthe user wants GIT to be linked specifically to only one of them.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n Makefile |   18 ++++++++++--------\n 1 files changed, 10 insertions(+), 8 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex a1666e2..99a84cc 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -267,15 +267,17 @@ ifeq ($(uname_S),Darwin)\n \tNEEDS_SSL_WITH_CRYPTO = YesPlease\n \tNEEDS_LIBICONV = YesPlease\n \tNO_STRLCPY = YesPlease\n-\t## fink\n-\tifeq ($(shell test -d /sw/lib && echo y),y)\n-\t\tBASIC_CFLAGS += -I/sw/include\n-\t\tBASIC_LDFLAGS += -L/sw/lib\n+\tifndef NO_FINK\n+\t\tifeq ($(shell test -d /sw/lib && echo y),y)\n+\t\t\tBASIC_CFLAGS += -I/sw/include\n+\t\t\tBASIC_LDFLAGS += -L/sw/lib\n+\t\tendif\n \tendif\n-\t## darwinports\n-\tifeq ($(shell test -d /opt/local/lib && echo y),y)\n-\t\tBASIC_CFLAGS += -I/opt/local/include\n-\t\tBASIC_LDFLAGS += -L/opt/local/lib\n+\tifndef NO_DARWIN_PORTS\n+\t\tifeq ($(shell test -d /opt/local/lib && echo y),y)\n+\t\t\tBASIC_CFLAGS += -I/opt/local/include\n+\t\t\tBASIC_LDFLAGS += -L/opt/local/lib\n+\t\tendif\n \tendif\n endif\n ifeq ($(uname_S),SunOS)\n-- \n1.4.2.rc1.ge711\n"},{"id":"24016","messageId":"e9vrsf$foc$1@sea.gmane.org","threadId":"4939","inReplyTo":"20060723054531.GA12559@spearce.org","subject":"Re: Makefile checks for DarwinPorts / Fink","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-07-23T13:00:25Z","receivedAt":"2006-07-23T13:00:25Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Shawn Pearce wrote:\n\n> This is a slightly cleaner version of my prior patch.  :-)\n> \n> -->8--\n> Disable linking with Fink or DarwinPorts.\n> \n> It may be desirable for the compiler to disable linking against Fink\n> or DarwinPorts, especially if both are installed on the system and\n> the user wants GIT to be linked specifically to only one of them.\n> \n> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>\n\nCould you _please_ document this option in commentary part in main Makefile?\nTIA. \n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"24034","messageId":"20060724042828.GB9066@spearce.org","threadId":"4939","inReplyTo":"e9vrsf$foc$1@sea.gmane.org","subject":"Re: Makefile checks for DarwinPorts / Fink","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-07-24T04:28:28Z","receivedAt":"2006-07-24T04:28:28Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> wrote:\n> Could you _please_ document this option in commentary part in main\n> Makefile?\n\nOK.\n\nI left them out originally as it seemed like other platform specific\nitems weren't in the main commentary part, but since these are\nnew defines I guess it makes perfect sense that they should be\ndocumented before they get included into the main Makefile.  :-)\n\nHopefully this is the final version of this patch...\n\n-->8--\nDisable linking with Fink or DarwinPorts.\n\nIt may be desirable for the compiler to disable linking against Fink\nor DarwinPorts, especially if both are installed on the system and\nthe user wants GIT to be linked specifically to only one of them.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n Makefile |   30 ++++++++++++++++++++++--------\n 1 files changed, 22 insertions(+), 8 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex a1666e2..5432636 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -32,6 +32,18 @@ # Define NO_SVN_TESTS if you want to ski\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 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 PPC_SHA1 environment variable when running make to make use of\n # a bundled SHA1 routine optimized for PowerPC.\n #\n@@ -267,15 +279,17 @@ ifeq ($(uname_S),Darwin)\n \tNEEDS_SSL_WITH_CRYPTO = YesPlease\n \tNEEDS_LIBICONV = YesPlease\n \tNO_STRLCPY = YesPlease\n-\t## fink\n-\tifeq ($(shell test -d /sw/lib && echo y),y)\n-\t\tBASIC_CFLAGS += -I/sw/include\n-\t\tBASIC_LDFLAGS += -L/sw/lib\n+\tifndef NO_FINK\n+\t\tifeq ($(shell test -d /sw/lib && echo y),y)\n+\t\t\tBASIC_CFLAGS += -I/sw/include\n+\t\t\tBASIC_LDFLAGS += -L/sw/lib\n+\t\tendif\n \tendif\n-\t## darwinports\n-\tifeq ($(shell test -d /opt/local/lib && echo y),y)\n-\t\tBASIC_CFLAGS += -I/opt/local/include\n-\t\tBASIC_LDFLAGS += -L/opt/local/lib\n+\tifndef NO_DARWIN_PORTS\n+\t\tifeq ($(shell test -d /opt/local/lib && echo y),y)\n+\t\t\tBASIC_CFLAGS += -I/opt/local/include\n+\t\t\tBASIC_LDFLAGS += -L/opt/local/lib\n+\t\tendif\n \tendif\n endif\n ifeq ($(uname_S),SunOS)\n-- \n1.4.2.rc1.ge711\n"},{"id":"24045","messageId":"7vejwbfqpo.fsf@assigned-by-dhcp.cox.net","threadId":"4939","inReplyTo":"20060724042828.GB9066@spearce.org","subject":"Re: Makefile checks for DarwinPorts / Fink","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-07-24T06:43:15Z","receivedAt":"2006-07-24T06:43:15Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks for the fix and doc.\n"}]}