Skip to content

Commit

Permalink
Makefile: add NEEDS_LIBGEN to optionally add -lgen to compile arguments
Browse files Browse the repository at this point in the history
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 <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Brandon Casey authored and Junio C Hamano committed Jul 11, 2009
1 parent 9398b85 commit ecc395c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])
#
Expand Down

0 comments on commit ecc395c

Please sign in to comment.