{"thread":{"id":"25782","subject":"git build failure with libssl (OpenSSL) in custom directory","startedAt":"2010-11-18T17:37:09Z","lastAt":"2010-11-18T18:24:47Z","messageCount":4,"participants":["Lars Buitinck","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"156118","messageId":"AANLkTikQC9hncPZkeScWi7OsWw+Optbvxaygyn1p7_sN@mail.gmail.com","threadId":"25782","inReplyTo":null,"subject":"git build failure with libssl (OpenSSL) in custom directory","fromName":"Lars Buitinck","fromEmail":"larsmans@gmail.com","sentAt":"2010-11-18T17:37:09Z","receivedAt":"2010-11-18T17:37:09Z","isPatch":false,"sender":{"key":"larsmans@gmail.com","avatar":null},"body":"Hi all,\n\nI've built Git on a Debian Linux box where I don't have root rights. I\nfirst built OpenSSL 1.0.0b and Curl successfully, installing both in\n$HOME/apps. I tried to do the same for Git, using\n\n  CPPFLAGS=-I$HOME/apps/include LDFLAGS=-L$HOME/apps/lib make\nprefix=$HOME/apps all doc info\n\nbut the build failed with the error\n\n      LINK git-fast-import\n  /usr/bin/ld: cannot find -lcrypto\n  collect2: ld returned 1 exit status\n  make: *** [git-fast-import] Error 1\n\nI checked the Makefile, and found\n\n  # CFLAGS and LDFLAGS are for the users to override from the command line.\n\n  CFLAGS = -g -O2 -Wall\n  LDFLAGS =\n\nI'm not a Makefile expert, but it seems to me that the last line\ncontradicts the comment. In any case, changing it to\n\n  LDFLAGS = -L$(HOME)/apps/lib -lssl -lcrypto -ldl\n\nworked, but only after also building and installing a shared library\nversion of OpenSSL.\n\nI've got a working Git now, but I thought I'd let you know. I haven't\nchecked out the development version yet.\n\nRegards,\nLars\n\n\nPS.: I'm not a member of this list, but git-scm.com suggested I send\nmy question to you.\n"},{"id":"156121","messageId":"20101118174921.GD16610@burratino","threadId":"25782","inReplyTo":"AANLkTikQC9hncPZkeScWi7OsWw+Optbvxaygyn1p7_sN@mail.gmail.com","subject":"Re: git build failure with libssl (OpenSSL) in custom directory","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-11-18T17:49:21Z","receivedAt":"2010-11-18T17:49:21Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Lars,\n\nLars Buitinck wrote:\n\n>   CPPFLAGS=-I$HOME/apps/include LDFLAGS=-L$HOME/apps/lib make\n> prefix=$HOME/apps all doc info\n\nHow about\n\n\tprefix=$HOME/apps\n\tmake CPPFLAGS=-I$prefix/include LDFLAGS=-L$prefix/lib prefix=$prefix \\\n\t\tall doc info\n\n?\n"},{"id":"156125","messageId":"AANLkTikZBcmbFoCmqT-eorGm3R0YYjkzotc414w_PHyd@mail.gmail.com","threadId":"25782","inReplyTo":"20101118174921.GD16610@burratino","subject":"Re: git build failure with libssl (OpenSSL) in custom directory","fromName":"Lars Buitinck","fromEmail":"larsmans@gmail.com","sentAt":"2010-11-18T18:04:00Z","receivedAt":"2010-11-18T18:04:00Z","isPatch":false,"sender":{"key":"larsmans@gmail.com","avatar":null},"body":"Yes, that works fine with LDFLAGS= in the Makefile. Is this just a\nlack of Makefile-fu on my part?\n\n2010/11/18 Jonathan Nieder <jrnieder@gmail.com>:\n> Hi Lars,\n>\n> Lars Buitinck wrote:\n>\n>>   CPPFLAGS=-I$HOME/apps/include LDFLAGS=-L$HOME/apps/lib make\n>> prefix=$HOME/apps all doc info\n>\n> How about\n>\n>        prefix=$HOME/apps\n>        make CPPFLAGS=-I$prefix/include LDFLAGS=-L$prefix/lib prefix=$prefix \\\n>                all doc info\n>\n> ?\n>\n"},{"id":"156128","messageId":"20101118182447.GF16610@burratino","threadId":"25782","inReplyTo":"AANLkTikZBcmbFoCmqT-eorGm3R0YYjkzotc414w_PHyd@mail.gmail.com","subject":"Re: git build failure with libssl (OpenSSL) in custom directory","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-11-18T18:24:47Z","receivedAt":"2010-11-18T18:24:47Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Lars Buitinck wrote:\n\n> Yes, that works fine with LDFLAGS= in the Makefile. Is this just a\n> lack of Makefile-fu on my part?\n\nIn general, \"make\" likes to get its variable assignments on the\ncommand line rather than from the environment.  This way, Makefile\nauthors do not have to worry about keeping variable names in a\ntightly reined namespace.\n\nOn the other hand, it can be convenient to set up the environment\nwith flags that would be used for multiple builds.  Different\nprojects deal with that differently:\n\n./configure takes certain values (including LDFLAGS) from the\nenvironment in autotools-using projects.  ./configure --help=short\nlists them.\n\nThe Linux kernel build system has a separate (namespaced) set of\nvariables it reads from the environment.  Example: exporting\nKBUILD_OUTPUT=$HOME/.cache/linux-2.6 in .profile would save me from\ntyping \"make O=$HOME/.cache/linux-2.6\" every time I build the kernel.\nThey are documented in Documentation/kbuild/kbuild.txt.\n\nGit reads settings from a config.mak file in the toplevel of the\ngit source tree.  So one can set\n\n\tLDFLAGS = -L$(HOME)/opt/git/lib\n\nthere and it will be used for all builds.\n"}]}