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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Brandon Casey <drafnel@xxxxxxxxx>

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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]