Skip to content

Commit ecc395c

Browse files
drafnelgitster
authored andcommitted
Makefile: add NEEDS_LIBGEN to optionally add -lgen to compile arguments
Commit 003b33a 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. Signed-off-by: Brandon Casey <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9398b85 commit ecc395c

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ all::
6161
#
6262
# Define NO_LIBGEN_H if you don't have libgen.h.
6363
#
64+
# Define NEEDS_LIBGEN if your libgen needs -lgen when linking
65+
#
6466
# Define NO_SYS_SELECT_H if you don't have sys/select.h.
6567
#
6668
# Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
@@ -1019,6 +1021,9 @@ ifdef NEEDS_LIBICONV
10191021
endif
10201022
EXTLIBS += $(ICONV_LINK) -liconv
10211023
endif
1024+
ifdef NEEDS_LIBGEN
1025+
EXTLIBS += -lgen
1026+
endif
10221027
ifdef NEEDS_SOCKET
10231028
EXTLIBS += -lsocket
10241029
endif

configure.ac

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,12 @@ AC_CHECK_LIB([resolv], [hstrerror],
485485
AC_SUBST(NEEDS_RESOLV)
486486
test -n "$NEEDS_RESOLV" && LIBS="$LIBS -lresolv"
487487

488+
AC_CHECK_LIB([gen], [basename],
489+
[NEEDS_LIBGEN=],
490+
[NEEDS_LIBGEN=YesPlease])
491+
AC_SUBST(NEEDS_LIBGEN)
492+
test -n "$NEEDS_LIBGEN" && LIBS="$LIBS -lgen"
493+
488494
## Checks for header files.
489495
AC_MSG_NOTICE([CHECKS for header files])
490496
#

0 commit comments

Comments
 (0)