2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-28 12:57:50 +00:00

Add -R/path/to/libs for Solaris and SVR4. There is a new configure

option, --with-rpath to control this behavior.
This commit is contained in:
Todd C. Miller 2003-03-20 19:40:58 +00:00
parent a41cbc597a
commit 9e6f380620
2 changed files with 76 additions and 32 deletions

12
INSTALL
View File

@ -116,10 +116,14 @@ Special features/options:
Eg: --with-incpath="/usr/local/include /opt/include" Eg: --with-incpath="/usr/local/include /opt/include"
--with-libpath=DIR --with-libpath=DIR
Adds the specified directory (or directories_ to SUDO_LDFLAGS Adds the specified directory (or directories) to LDFLAGS
and VISUDO_LDFLAGS so configure and the compiler will look so configure and the compiler will look there for libraries.
there for libraries. Multiple directories may be specified Multiple directories may be specified as with --with-incpath.
as with --with-incpath.
--with-rpath
Tells configure to use -Rpath in addition to -Lpath when
passing library paths to the loader. This option is on
by default for Solaris and SVR4.
--with-libraries=LIBRARY --with-libraries=LIBRARY
Adds the specified library (or libaries) to SUDO_LIBS and Adds the specified library (or libaries) to SUDO_LIBS and

View File

@ -145,6 +145,15 @@ AC_ARG_WITH(CC, [ --with-CC C compiler to use],
;; ;;
esac]) esac])
AC_ARG_WITH(rpath, [ --with-rpath pass -R flag in addition to -L for lib paths],
[case $with_rpath in
yes) ;;
no) with_rpath=no
;;
*) AC_MSG_ERROR(["--with-rpath does not take an argument."])
;;
esac], [with_rpath=no])
AC_ARG_WITH(incpath, [ --with-incpath additional places to look for include files], AC_ARG_WITH(incpath, [ --with-incpath additional places to look for include files],
[case $with_incpath in [case $with_incpath in
yes) AC_MSG_ERROR(["must give --with-incpath an argument."]) yes) AC_MSG_ERROR(["must give --with-incpath an argument."])
@ -165,9 +174,6 @@ AC_ARG_WITH(libpath, [ --with-libpath additional places to look for li
no) AC_MSG_ERROR(["--without-libpath not supported."]) no) AC_MSG_ERROR(["--without-libpath not supported."])
;; ;;
*) AC_MSG_NOTICE([Adding ${with_libpath} to LDFLAGS]) *) AC_MSG_NOTICE([Adding ${with_libpath} to LDFLAGS])
for i in ${with_libpath}; do
LDFLAGS="${LDFLAGS} -L${i}"
done
;; ;;
esac]) esac])
@ -178,15 +184,6 @@ AC_ARG_WITH(libraries, [ --with-libraries additional libraries to link w
no) AC_MSG_ERROR(["--without-libraries not supported."]) no) AC_MSG_ERROR(["--without-libraries not supported."])
;; ;;
*) AC_MSG_NOTICE([Adding ${with_libraries} to LIBS]) *) AC_MSG_NOTICE([Adding ${with_libraries} to LIBS])
for i in ${with_libraries}; do
case $i in
-l*) ;;
*.a) ;;
*.o) ;;
*) i="-l${i}";;
esac
LIBS="${LIBS} ${i}"
done
;; ;;
esac]) esac])
@ -207,7 +204,7 @@ AC_ARG_WITH(efence, [ --with-efence link with -lefence for malloc() d
yes) AC_MSG_NOTICE([Sudo will link with -lefence (Electric Fence)]) yes) AC_MSG_NOTICE([Sudo will link with -lefence (Electric Fence)])
LIBS="${LIBS} -lefence" LIBS="${LIBS} -lefence"
if test -f /usr/local/lib/libefence.a; then if test -f /usr/local/lib/libefence.a; then
LDFLAGS="${LDFLAGS} -L/usr/local/lib" with_libpath="${with_libpath} /usr/local/lib"
fi fi
;; ;;
no) ;; no) ;;
@ -302,11 +299,6 @@ AC_ARG_WITH(fwtk, [ --with-fwtk[[=DIR]] enable FWTK AuthSRV support],
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
with_passwd=no with_passwd=no
AUTH_OBJS="fwtk.o" AUTH_OBJS="fwtk.o"
if test "$with_fwtk" != "yes"; then
SUDO_LDFLAGS="${SUDO_LDFLAGS} -L${with_fwtk}"
CPPFLAGS="${CPPFLAGS} -I${with_fwtk}"
with_fwtk=yes
fi
;; ;;
esac]) esac])
@ -1210,6 +1202,7 @@ case "$host" in
fi fi
test -n "$mansectsu" || mansectsu=1m test -n "$mansectsu" || mansectsu=1m
test -n "$mansectform" || mansectform=4 test -n "$mansectform" || mansectform=4
test -n "$with_rpath" || with_rpath=yes
;; ;;
*-*-aix*) *-*-aix*)
# To get all prototypes (so we pass -Wall) # To get all prototypes (so we pass -Wall)
@ -1429,17 +1422,20 @@ case "$host" in
fi fi
test -n "$mansectsu" || mansectsu=1m test -n "$mansectsu" || mansectsu=1m
test -n "$mansectform" || mansectform=4 test -n "$mansectform" || mansectform=4
test -n "$with_rpath" || with_rpath=yes
;; ;;
*-ncr-sysv4*|*-ncr-sysvr4*) *-ncr-sysv4*|*-ncr-sysvr4*)
AC_CHECK_LIB(c89, strcasecmp, AC_DEFINE(HAVE_STRCASECMP) [LIBS="${LIBS} -lc89"; ac_cv_func_strcasecmp=yes]) AC_CHECK_LIB(c89, strcasecmp, AC_DEFINE(HAVE_STRCASECMP) [LIBS="${LIBS} -lc89"; ac_cv_func_strcasecmp=yes])
test -n "$mansectsu" || mansectsu=1m test -n "$mansectsu" || mansectsu=1m
test -n "$mansectform" || mansectform=4 test -n "$mansectform" || mansectform=4
test -n "$with_rpath" || with_rpath=yes
;; ;;
*-ccur-sysv4*|*-ccur-sysvr4*) *-ccur-sysv4*|*-ccur-sysvr4*)
LIBS="${LIBS} -lgen" LIBS="${LIBS} -lgen"
SUDO_LIBS="${SUDO_LIBS} -lgen" SUDO_LIBS="${SUDO_LIBS} -lgen"
test -n "$mansectsu" || mansectsu=1m test -n "$mansectsu" || mansectsu=1m
test -n "$mansectform" || mansectform=4 test -n "$mansectform" || mansectform=4
test -n "$with_rpath" || with_rpath=yes
;; ;;
*-*-bsdi*) *-*-bsdi*)
SKIP_SETREUID=yes SKIP_SETREUID=yes
@ -1498,6 +1494,11 @@ case "$host" in
ac_cv_func_lockf=no ac_cv_func_lockf=no
ac_cv_func_flock=yes ac_cv_func_flock=yes
;; ;;
*-*-*sysv4*)
test -n "$mansectsu" || mansectsu=1m
test -n "$mansectform" || mansectform=4
test -n "$with_rpath" || with_rpath=yes
;;
*-*-sysv*) *-*-sysv*)
test -n "$mansectsu" || mansectsu=1m test -n "$mansectsu" || mansectsu=1m
test -n "$mansectform" || mansectform=4 test -n "$mansectform" || mansectform=4
@ -1510,6 +1511,26 @@ dnl
test -n "$mansectsu" || mansectsu=8 test -n "$mansectsu" || mansectsu=8
test -n "$mansectform" || mansectform=5 test -n "$mansectform" || mansectform=5
dnl
dnl Add in any libpaths or libraries specified via configure
dnl
if test -n ${with_libpath}; then
for i in ${with_libpath}; do
SUDO_APPEND_LIBPATH(LDFLAGS, [$i])
done
fi
if test -n ${with_libraries}; then
for i in ${with_libraries}; do
case $i in
-l*) ;;
*.a) ;;
*.o) ;;
*) i="-l${i}";;
esac
LIBS="${LIBS} ${i}"
done
fi
dnl dnl
dnl Check for shadow password routines if we have not already done so. dnl Check for shadow password routines if we have not already done so.
dnl We check for SVR4-style first and then SecureWare-style. dnl We check for SVR4-style first and then SecureWare-style.
@ -1669,8 +1690,8 @@ if test -n "$with_kerb4"; then
done done
test X"$found" = X"no" && CPPFLAGS="$O_CPPFLAGS" test X"$found" = X"no" && CPPFLAGS="$O_CPPFLAGS"
else else
LDFLAGS="$LDFLAGS -L${with_kerb4}/lib" SUDO_APPEND_LIBPATH(LDFLAGS, [${with_kerb4}/lib])
SUDO_LDFLAGS="$SUDO_LDFLAGS -L${with_kerb4}/lib" SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [${with_kerb4}/lib])
CPPFLAGS="$CPPFLAGS -I${with_kerb4}/include" CPPFLAGS="$CPPFLAGS -I${with_kerb4}/include"
AC_CHECK_HEADER([krb.h], [found=yes], [found=no]) AC_CHECK_HEADER([krb.h], [found=yes], [found=no])
fi fi
@ -1716,7 +1737,7 @@ if test -n "$with_kerb5"; then
fi fi
else else
dnl XXX - try to include krb5.h here too dnl XXX - try to include krb5.h here too
SUDO_LDFLAGS="$SUDO_LDFLAGS -L${with_kerb5}/lib" SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [${with_kerb5}/lib])
CPPFLAGS="$CPPFLAGS -I${with_kerb5}/include" CPPFLAGS="$CPPFLAGS -I${with_kerb5}/include"
fi fi
@ -1752,7 +1773,7 @@ if test "$with_AFS" = "yes"; then
AFSLIBDIRS="/usr/lib/afs /usr/afsws/lib /usr/afsws/lib/afs" AFSLIBDIRS="/usr/lib/afs /usr/afsws/lib /usr/afsws/lib/afs"
for i in $AFSLIBDIRS; do for i in $AFSLIBDIRS; do
if test -d ${i}; then if test -d ${i}; then
SUDO_LDFLAGS="${SUDO_LDFLAGS} -L${i}" SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [$i])
FOUND_AFSLIBDIR=true FOUND_AFSLIBDIR=true
fi fi
done done
@ -1806,10 +1827,10 @@ if test "$with_skey" = "yes"; then
: :
elif test -f /usr/local/include/skey.h; then elif test -f /usr/local/include/skey.h; then
CPPFLAGS="${CPPFLAGS} -I/usr/local/include" CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
SUDO_LDFLAGS="${SUDO_LDFLAGS} -L/usr/local/lib" SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [/usr/local/lib])
elif test "$with_csops" = "yes" -a -f /tools/cs/skey/include/skey.h -a -f /tools/cs/skey/lib/libskey.a; then elif test "$with_csops" = "yes" -a -f /tools/cs/skey/include/skey.h -a -f /tools/cs/skey/lib/libskey.a; then
CPPFLAGS="${CPPFLAGS} -I/tools/cs/skey/include" CPPFLAGS="${CPPFLAGS} -I/tools/cs/skey/include"
SUDO_LDFLAGS="${SUDO_LDFLAGS} -L/tools/cs/skey/lib" SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [/tools/cs/skey/lib])
else else
echo 'Unable to locate libskey.a and/or skey.h, you will have to edit the Makefile and add -L/path/to/skey/lib to SUDO_LDFLAGS and/or -I/path/to/skey.h to CPPFLAGS' echo 'Unable to locate libskey.a and/or skey.h, you will have to edit the Makefile and add -L/path/to/skey/lib to SUDO_LDFLAGS and/or -I/path/to/skey.h to CPPFLAGS'
fi fi
@ -1825,7 +1846,7 @@ if test "$with_opie" = "yes"; then
: :
elif test -f /usr/local/include/opie.h; then elif test -f /usr/local/include/opie.h; then
CPPFLAGS="${CPPFLAGS} -I/usr/local/include" CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
SUDO_LDFLAGS="${SUDO_LDFLAGS} -L/usr/local/lib" SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [/usr/local/lib])
else else
echo 'Unable to locate libopie.a and/or opie.h, you will have to edit the Makefile and add -L/path/to/opie/lib to SUDO_LDFLAGS and/or -I/path/to/opie.h to CPPFLAGS' echo 'Unable to locate libopie.a and/or opie.h, you will have to edit the Makefile and add -L/path/to/opie/lib to SUDO_LDFLAGS and/or -I/path/to/opie.h to CPPFLAGS'
fi fi
@ -1844,18 +1865,37 @@ if test -n "$with_SecurID" -a "$with_SecurID" != "no"; then
fi fi
CPPFLAGS="${CPPFLAGS} -I${with_SecurID}" CPPFLAGS="${CPPFLAGS} -I${with_SecurID}"
_LDFLAGS="${LDFLAGS}" _LDFLAGS="${LDFLAGS}"
LDFLAGS="${LDFLAGS} -L${with_SecurID}" SUDO_APPEND_LIBPATH(LDFLAGS, [${with_SecurID}])
# #
# Determine whether to use the new or old SecurID API # Determine whether to use the new or old SecurID API
# #
AC_CHECK_LIB(aceclnt, SD_Init, [AUTH_OBJS="securid5.o"; SUDO_LIBS="${SUDO_LIBS} -laceclnt -lpthread"; SUDO_LDFLAGS="${SUDO_LDFLAGS} -L${with_SecurID}"], [AUTH_OBJS="securid.o"; SUDO_LIBS="${SUDO_LIBS} ${with_SecurID}/sdiclient.a"], [-lpthread]) AC_CHECK_LIB(aceclnt, SD_Init,
[
AUTH_OBJS="securid5.o"
SUDO_LIBS="${SUDO_LIBS} -laceclnt -lpthread"
]
[
SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [${with_SecurID}])
], [
AUTH_OBJS="securid.o"
SUDO_LIBS="${SUDO_LIBS} ${with_SecurID}/sdiclient.a"
],
[
-lpthread
]
)
LDFLAGS="${_LDFLAGS}" LDFLAGS="${_LDFLAGS}"
fi fi
dnl dnl
dnl extra FWTK libs + includes dnl extra FWTK libs + includes
dnl dnl
if test "$with_fwtk" = "yes"; then if test -n "$with_fwtk"; then
if test "$with_fwtk" != "yes"; then
SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [${with_fwtk}])
CPPFLAGS="${CPPFLAGS} -I${with_fwtk}"
with_fwtk=yes
fi
SUDO_LIBS="${SUDO_LIBS} -lauth -lfwall" SUDO_LIBS="${SUDO_LIBS} -lauth -lfwall"
fi fi