Merge branch 'jc/cc-ld-dynpath'
* jc/cc-ld-dynpath: configure: auto detect dynamic library path switches Makefile: Allow CC_LD_DYNPATH to be overriden Conflicts: Makefile config.mak.in
This commit is contained in:
commit
cd50988ae0
17
Makefile
17
Makefile
@ -697,8 +697,7 @@ ifeq ($(uname_S),NetBSD)
|
|||||||
NEEDS_LIBICONV = YesPlease
|
NEEDS_LIBICONV = YesPlease
|
||||||
endif
|
endif
|
||||||
BASIC_CFLAGS += -I/usr/pkg/include
|
BASIC_CFLAGS += -I/usr/pkg/include
|
||||||
BASIC_LDFLAGS += -L/usr/pkg/lib
|
BASIC_LDFLAGS += -L/usr/pkg/lib $(CC_LD_DYNPATH)/usr/pkg/lib
|
||||||
ALL_LDFLAGS += -Wl,-rpath,/usr/pkg/lib
|
|
||||||
THREADED_DELTA_SEARCH = YesPlease
|
THREADED_DELTA_SEARCH = YesPlease
|
||||||
endif
|
endif
|
||||||
ifeq ($(uname_S),AIX)
|
ifeq ($(uname_S),AIX)
|
||||||
@ -793,12 +792,14 @@ ifeq ($(uname_S),Darwin)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef NO_R_TO_GCC_LINKER
|
ifndef CC_LD_DYNPATH
|
||||||
# Some gcc does not accept and pass -R to the linker to specify
|
ifdef NO_R_TO_GCC_LINKER
|
||||||
# the runtime dynamic library path.
|
# Some gcc does not accept and pass -R to the linker to specify
|
||||||
CC_LD_DYNPATH = -Wl,-rpath=
|
# the runtime dynamic library path.
|
||||||
else
|
CC_LD_DYNPATH = -Wl,-rpath,
|
||||||
CC_LD_DYNPATH = -R
|
else
|
||||||
|
CC_LD_DYNPATH = -R
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef NO_CURL
|
ifdef NO_CURL
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
CC = @CC@
|
CC = @CC@
|
||||||
CFLAGS = @CFLAGS@
|
CFLAGS = @CFLAGS@
|
||||||
LDFLAGS = @LDFLAGS@
|
LDFLAGS = @LDFLAGS@
|
||||||
|
CC_LD_DYNPATH = @CC_LD_DYNPATH@
|
||||||
AR = @AR@
|
AR = @AR@
|
||||||
TAR = @TAR@
|
TAR = @TAR@
|
||||||
#INSTALL = @INSTALL@ # needs install-sh or install.sh in sources
|
#INSTALL = @INSTALL@ # needs install-sh or install.sh in sources
|
||||||
|
32
configure.ac
32
configure.ac
@ -103,6 +103,38 @@ GIT_PARSE_WITH(tcltk))
|
|||||||
AC_MSG_NOTICE([CHECKS for programs])
|
AC_MSG_NOTICE([CHECKS for programs])
|
||||||
#
|
#
|
||||||
AC_PROG_CC([cc gcc])
|
AC_PROG_CC([cc gcc])
|
||||||
|
# which switch to pass runtime path to dynamic libraries to the linker
|
||||||
|
AC_CACHE_CHECK([if linker supports -R], ld_dashr, [
|
||||||
|
SAVE_LDFLAGS="${LDFLAGS}"
|
||||||
|
LDFLAGS="${SAVE_LDFLAGS} -R /"
|
||||||
|
AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [ld_dashr=yes], [ld_dashr=no])
|
||||||
|
LDFLAGS="${SAVE_LDFLAGS}"
|
||||||
|
])
|
||||||
|
if test "$ld_dashr" = "yes"; then
|
||||||
|
AC_SUBST(CC_LD_DYNPATH, [-R])
|
||||||
|
else
|
||||||
|
AC_CACHE_CHECK([if linker supports -Wl,-rpath,], ld_wl_rpath, [
|
||||||
|
SAVE_LDFLAGS="${LDFLAGS}"
|
||||||
|
LDFLAGS="${SAVE_LDFLAGS} -Wl,-rpath,/"
|
||||||
|
AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [ld_wl_rpath=yes], [ld_wl_rpath=no])
|
||||||
|
LDFLAGS="${SAVE_LD_FLAGS}"
|
||||||
|
])
|
||||||
|
if test "$ld_wl_rpath" = "yes"; then
|
||||||
|
AC_SUBST(CC_LD_DYNPATH, [-Wl,-rpath,])
|
||||||
|
else
|
||||||
|
AC_CACHE_CHECK([if linker supports -rpath], ld_rpath, [
|
||||||
|
SAVE_LDFLAGS="${LDFLAGS}"
|
||||||
|
LDFLAGS="${SAVE_LDFLAGS} -rpath /"
|
||||||
|
AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [ld_rpath=yes], [ld_rpath=no])
|
||||||
|
LDFLAGS="${SAVE_LD_FLAGS}"
|
||||||
|
])
|
||||||
|
if test "$ld_rpath" = "yes"; then
|
||||||
|
AC_SUBST(CC_LD_DYNPATH, [-rpath])
|
||||||
|
else
|
||||||
|
AC_MSG_WARN([linker does not support runtime path to dynamic libraries])
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
#AC_PROG_INSTALL # needs install-sh or install.sh in sources
|
#AC_PROG_INSTALL # needs install-sh or install.sh in sources
|
||||||
AC_CHECK_TOOLS(AR, [gar ar], :)
|
AC_CHECK_TOOLS(AR, [gar ar], :)
|
||||||
AC_CHECK_PROGS(TAR, [gtar tar])
|
AC_CHECK_PROGS(TAR, [gtar tar])
|
||||||
|
Loading…
Reference in New Issue
Block a user