{"thread":{"id":"52139","subject":"COMMENTS: building git on AIX","startedAt":"2019-10-28T14:27:09Z","lastAt":"2019-10-28T21:44:02Z","messageCount":2,"participants":["Michael Felt","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"384996","messageId":"1200106e-b75d-5b15-0608-427cd923578a@felt.demon.nl","threadId":"52139","inReplyTo":null,"subject":"COMMENTS: building git on AIX","fromName":"Michael Felt","fromEmail":"aixtools@felt.demon.nl","sentAt":"2019-10-28T14:00:29Z","receivedAt":"2019-10-28T14:27:09Z","isPatch":false,"sender":{"key":"aixtools@felt.demon.nl","avatar":null},"body":"I have, a couple of time, successfully built git for AIX. However, my\nprior attempt (version 2.18) - I never got around to finishing and today\nwith version 2.23.0 - I am unsure how to proceed without a lot of hacking.\n\nJust some comments - long long way from calling anything a bug - just\nnot as portable as I would have hoped.\n\nThe simple issues:\n\n1. The \"Makefile\" is surprising. I expect to run ./configure (or better,\nout-of tree, e.g., ../src/git-2.23.0/configure). Just running OOT\nconfigure does not result in a \"Makefile\". So, copy source tree to dest\nand try again.\n\n2. Makefile assumes gmake. Standard make does not support :: syntax\n(fix: install cmake)\n\n3. The default CFLAGS contains -Wall. Not all compilers support -Wall.\n\"Fixed\" by adding CFLAGS=\"-g -O2\". I am also undecided on having -g as a\ndefault flag.\n\n4. Must have gettext installed, which needs GNU libiconv - sad to have\nthese libraries as additional dependencies. e.g., bash 4.4 finally\nremoved the gettext and iconv gnu dependencies. -- FYI!\n\n5. Another \"gcc\"? dependency: \"git-compat-util.h\", line 361.1: 1506-277\n(S) Syntax error: possible missing ';'\nFIX: add 'CC=xlc_r' to get language extensions\n\n6. Needs curl (libcurl and curl.h), but does not check until much later:\nFIX install curl; FIX2 add -I flag to find $prefix/include to CFLAGS\n(.e.g., CFLAGS=\"-g -O2 -I/opt/include\") - FYI GNU autotools also fail to\ninclude $prefix/include\n\n7. More stuck here. libssh2 is built by curl, but as a static library. I\ncould \"hack\" the libssh2.o file into the linkage, but unclear how well\nthat will work. Also wonder if libssh2 is \"required\" or optional. For\ncurl it has been optional (and I think it still is).\n\nCurrent status:\n\nxlc_r   -g -O2 -I/opt/include -I. -D_LARGE_FILES\n-DGIT_HOST_CPU=\"\\\"00C291F54C00\\\"\" -DUSE_CURL_FOR_IMAP_SEND -DNO_NSEC\n-DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES\n-DSHA1DC_INIT_SAFE_HASH_DEFAULT=0\n-DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"\\\"cache.h\\\"\"\n-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"\\\"git-compat-util.h\\\"\"\n-DSHA256_BLK   -DFREAD_READS_DIRECTORIES -DNO_STRCASESTR -DNO_STRLCPY\n-DNO_MKDTEMP -DNO_MEMMEM -DINTERNAL_QSORT -Icompat/regex\n-DFILENO_IS_A_MACRO -DNEED_ACCESS_ROOT_HANDLER -DDEFAULT_PAGER='\"more\"'\n-DSHELL_PATH='\"/bin/sh\"' -DPAGER_ENV='\"LESS=FRX LV=-c\"' -o\ngit-imap-send   imap-send.o http.o common-main.o \\\n          -L/opt/lib -lcurl -lssh2 -lssh2 -lssl -lcrypto -lldap -llber\n-lssl -lcrypto -lz  -lssl  -lcrypto libgit.a xdiff/lib.a  -lz  -liconv\n-lintl -lpthread\nld: 0706-006 Cannot find or open library file: -l ssh2\n        ld:open(): A file or directory in the path name does not exist.\nld: 0706-006 Cannot find or open library file: -l ssh2\n        ld:open(): A file or directory in the path name does not exist.\nld: 0706-006 Cannot find or open library file: -l ldap\n        ld:open(): A file or directory in the path name does not exist.\nld: 0706-006 Cannot find or open library file: -l lber\n        ld:open(): A file or directory in the path name does not exist.\n\nThis will need, at the least an additional LDFLAGS added to the make\ncommand ('LDFLAGS=\"-L/opt/lib\"'), but I still have to find where the\n-lssh2 is generated.\n\nNot sure - if I can help - but do hope this already helps in a (small) way.\n\nRegards,\n\nMichael\n\n"},{"id":"385016","messageId":"20191028214357.GB12487@google.com","threadId":"52139","inReplyTo":"1200106e-b75d-5b15-0608-427cd923578a@felt.demon.nl","subject":"Re: COMMENTS: building git on AIX","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2019-10-28T21:43:57Z","receivedAt":"2019-10-28T21:44:02Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nMichael Felt wrote:\n\n> I have, a couple of time, successfully built git for AIX. However, my\n> prior attempt (version 2.18) - I never got around to finishing and today\n> with version 2.23.0 - I am unsure how to proceed without a lot of hacking.\n>\n> Just some comments - long long way from calling anything a bug - just\n> not as portable as I would have hoped.\n>\n> The simple issues:\n>\n> 1. The \"Makefile\" is surprising. I expect to run ./configure (or better,\n> out-of tree, e.g., ../src/git-2.23.0/configure). Just running OOT\n> configure does not result in a \"Makefile\". So, copy source tree to dest\n> and try again.\n\nSee INSTALL:\n\n [...]\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\nso the output of the configure script is a config.mak.autogen file.\nKeep in mind that most of Git's developers don't use the configure\nscript, mostly because it's slow.\n\nI like the idea of teaching the configure script to set up a VPATH\nbuild.  Would you be interested in working on that?\n\n> 2. Makefile assumes gmake. Standard make does not support :: syntax\n> (fix: install cmake)\n\nI assume that by cmake you mean gmake here.\n\n> 3. The default CFLAGS contains -Wall. Not all compilers support -Wall.\n> \"Fixed\" by adding CFLAGS=\"-g -O2\". I am also undecided on having -g as a\n> default flag.\n\nInteresting!  That doesn't feel like a recent change:\n\n $ git log -GWall -- Makefile\n[...]\n commit b05701c5b4c7983ef04d8c286c65089596553bd6\n Author: Pavel Roskin <proski@gnu.org>\n Date:   Sat Aug 6 01:36:15 2005 -0400\n\n     Make CFLAGS overridable from make command line.\n[...]\n commit 19b2860cba5742ab31fd682b80fefefac19be141\n Author: Linus Torvalds <torvalds@linux-foundation.org>\n Date:   Fri Apr 8 09:59:28 2005 -0700\n\n     Use \"-Wall -O2\" for the compiler to get more warnings.\n\nIt seems worth calling out in the INSTALL file (and autodetecting in\nthe configure script).\n\n> 4. Must have gettext installed, which needs GNU libiconv - sad to have\n> these libraries as additional dependencies. e.g., bash 4.4 finally\n> removed the gettext and iconv gnu dependencies. -- FYI!\n\nSee INSTALL:\n\n Set NO_GETTEXT to disable localization support and make Git only\n use English. Under autoconf the configure script will do this\n automatically if it can't find libintl on the system.\n\nDid the part of the configure script that does this break?\n\n> 5. Another \"gcc\"? dependency: \"git-compat-util.h\", line 361.1: 1506-277\n> (S) Syntax error: possible missing ';'\n> FIX: add 'CC=xlc_r' to get language extensions\n\nThat's\n\n static inline int noop_core_config(const char *var, const char *value, void *cb)\n\nDoes AIX cc have trouble with \"static inline\"?\n\n> 6. Needs curl (libcurl and curl.h), but does not check until much later:\n> FIX install curl; FIX2 add -I flag to find $prefix/include to CFLAGS\n> (.e.g., CFLAGS=\"-g -O2 -I/opt/include\") - FYI GNU autotools also fail to\n> include $prefix/include\n\nFrom INSTALL:\n\n  \"libcurl\" library is used by git-http-fetch, git-fetch, and, if\n  the curl version >= 7.34.0, for git-imap-send.  You might also\n  want the \"curl\" executable for debugging purposes. If you do not\n  use http:// or https:// repositories, and do not want to put\n  patches into an IMAP mailbox, you do not have to have them\n  (use NO_CURL).\n\nWould you be interested in improving the configure script's detection\nof this?\n\n> 7. More stuck here. libssh2 is built by curl, but as a static library. I\n> could \"hack\" the libssh2.o file into the linkage, but unclear how well\n> that will work. Also wonder if libssh2 is \"required\" or optional. For\n> curl it has been optional (and I think it still is).\n[...]\n> git-imap-send   imap-send.o http.o common-main.o \\\n>           -L/opt/lib -lcurl -lssh2 -lssh2 -lssl -lcrypto -lldap -llber\n> -lssl -lcrypto -lz  -lssl  -lcrypto libgit.a xdiff/lib.a  -lz  -liconv\n> -lintl -lpthread\n> ld: 0706-006 Cannot find or open library file: -l ssh2\n\nThe \"-lssh2\" comes from \"curl-config --libs\" output.  It sounds like\nyour copy of $(which curl-config) should have CURLLIBDIR set but\ndoesn't.  Should we use \"curl-config --static-libs\" on AIX instead?\n\nIf you know what flags to use to link to curl, you can use\nCURL_LDFLAGS to set that instead.\n\n> Not sure - if I can help - but do hope this already helps in a (small) way.\n\nThanks for working to keep Git portable.\n\nHope that helps,\nJonathan\n"}]}