git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH FYI 3/5] Makefile: add NEEDS_LIBGEN to optionally add -lgen to compile arguments

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Jul 10, 2009, 17:10 UTC
Message-ID
<39niBtmtFs5Sy_fjtaztVs0m0Z6eHu_U8OSsTLFxj4rzNA1wRn0zCZA2fZ7PNTjvs9tczSQBvpc@cipher.nrlssc.navy.mil>
In-Reply-To
<39niBtmtFs5Sy_fjtaztVioF-DSUgPaeb2z2kLxvo9ZK1x9ZQKe11vCjlSyOtjKf_tm_u4WsJQY@cipher.nrlssc.navy.mil>
From: Brandon Casey <drafnel@gmail.com>

Commit 003b33a8 recently added a call to basename(). On IRIX 6.5, this function resides in libgen and -lgen is required for the linker.

Update configure.ac too. ---

configure.ac changes are untested.
-brandon
 Makefile     |    5 +++++
 configure.ac |    6 ++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index 311ce7d..faaab5e 100644
--- a/Makefile
+++ b/Makefile
@@ -61,6 +61,8 @@ all::
 #
 # Define NO_LIBGEN_H if you don't have libgen.h.
 #
+# Define NEEDS_LIBGEN if your libgen needs -lgen when linking
+#
 # Define NO_SYS_SELECT_H if you don't have sys/select.h.
 #
 # Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
@@ -1019,6 +1021,9 @@ ifdef NEEDS_LIBICONV
 	endif
 	EXTLIBS += $(ICONV_LINK) -liconv
 endif
+ifdef NEEDS_LIBGEN
+	EXTLIBS += -lgen
+endif
 ifdef NEEDS_SOCKET
 	EXTLIBS += -lsocket
 endif
diff --git a/configure.ac b/configure.ac
index 1885674..74d0af5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -485,6 +485,12 @@ AC_CHECK_LIB([resolv], [hstrerror],
 AC_SUBST(NEEDS_RESOLV)
 test -n "$NEEDS_RESOLV" && LIBS="$LIBS -lresolv"
 
+AC_CHECK_LIB([gen], [basename],
+[NEEDS_LIBGEN=],
+[NEEDS_LIBGEN=YesPlease])
+AC_SUBST(NEEDS_LIBGEN)
+test -n "$NEEDS_LIBGEN" && LIBS="$LIBS -lgen"
+
 ## Checks for header files.
 AC_MSG_NOTICE([CHECKS for header files])
 #
-- 
1.6.4.rc0.5.g76f7cf
Previous: Brandon CaseyNext: Brandon Casey
Message 4 of 8 in “How I compile on IRIX 6.5 with the MIPSpro compiler and ksh”
  1. 0/5 How I compile on IRIX 6.5 with the MIPSpro compiler and kshBrandon Casey, Jul 10, 2009
  2. 1/5 unpack-trees.c: work around run-time array initialization flaw on IRIX 6.5Brandon Casey, Jul 10, 2009
  3. 2/5 git-compat-util.h: adjust for SGI IRIX 6.5Brandon Casey, Jul 10, 2009
  4. 3/5 Makefile: add NEEDS_LIBGEN to optionally add -lgen to compile argumentsBrandon Casey, Jul 10, 2009
  5. 4/5 Makefile: add section for SGI IRIX 6.5Brandon Casey, Jul 10, 2009
  6. 5/5 test-lib.sh: work around ksh's trap shortcomingsBrandon Casey, Jul 10, 2009
  7. 6/5 Makefile: update IRIX64 sectionBrandon Casey, Jul 10, 2009
  8. Junio C HamanoJul 11, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.