unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: justinpopo6@gmail.com
To: libc-alpha@sourceware.org
Cc: f.fainelli@gmail.com, code@mmayer.net, fw@deneb.enyo.de,
	Justin Chen <justinpopo6@gmail.com>
Subject: [PATCH v2] configure.ac: option for user-defined-trusted-dirs
Date: Thu,  2 Jan 2020 15:25:10 -0800	[thread overview]
Message-ID: <1578007510-24831-1-git-send-email-justinpopo6@gmail.com> (raw)

From: Justin Chen <justinpopo6@gmail.com>

User-defined-trusted-dirs is a variable used for adding additional
default library search dirs for the dynamic loader. Add the ability
to allow users to set it from the configure script.
---
 INSTALL             |  4 ++++
 configure           | 34 ++++++++++++++++++++++++++++++++--
 configure.ac        | 12 ++++++++++++
 manual/install.texi |  5 +++++
 4 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/INSTALL b/INSTALL
index 392537c..1062f53 100644
--- a/INSTALL
+++ b/INSTALL
@@ -282,6 +282,10 @@ if 'CFLAGS' is specified it must enable optimization.  For example:
      the GNU C Library.  The default value refers to the main
      bug-reporting information for the GNU C Library.
 
+'--with-user-defined-trusted-dirs=LIB-FOLDERS'
+     Specify additional trustworthy directories to look for shared
+     libraries.  This is in addition to the default ld library path.
+
    To build the library and related programs, type 'make'.  This will
 produce a lot of output, some of which may look like errors from 'make'
 but aren't.  Look for error messages from 'make' containing '***'.
diff --git a/configure b/configure
index b959d2d..2bb5534 100755
--- a/configure
+++ b/configure
@@ -733,6 +733,7 @@ infodir
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -795,6 +796,7 @@ enable_tunables
 enable_mathvec
 enable_cet
 with_cpu
+with_user_defined_trusted_dirs
 '
       ac_precious_vars='build_alias
 host_alias
@@ -846,6 +848,7 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1098,6 +1101,15 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1235,7 +1247,7 @@ fi
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
+		libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1388,6 +1400,7 @@ Fine tuning of the installation directories:
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -1488,6 +1501,8 @@ Optional Packages:
   --with-nonshared-cflags=CFLAGS
                           build nonshared libraries with additional CFLAGS
   --with-cpu=CPU          select code for CPU variant
+  --with-user-defined-trusted-dirs=DIRS
+                          Additional default ld search dirs
 
 Some influential environment variables:
   CC          C compiler command
@@ -3785,7 +3800,7 @@ main ()
 {
 
 #ifndef __CET__
-#error no CET compiler support
+# error no CET compiler support
 #endif
   ;
   return 0;
@@ -3839,6 +3854,21 @@ if test "${with_cpu+set}" = set; then :
 fi
 
 
+user_defined_trusted_dirs=
+
+# Check whether --with-user-defined-trusted-dirs was given.
+if test "${with_user_defined_trusted_dirs+set}" = set; then :
+  withval=$with_user_defined_trusted_dirs;   case "$withval" in
+  yes|'') as_fn_error $? "--with-user-defined-trusted-dirs requires an argument" "$LINENO" 5 ;;
+  no) ;;
+  *) user_defined_trusted_dirs="$withval" ;;
+  esac
+
+fi
+
+config_vars="$config_vars
+user-defined-trusted-dirs = $user_defined_trusted_dirs"
+
 # An preconfigure script can set this when it wants to disable the sanity
 # check below.
 libc_config_ok=no
diff --git a/configure.ac b/configure.ac
index 49b900c..a46532d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -517,6 +517,18 @@ AC_ARG_WITH([cpu],
   esac
 ])
 
+user_defined_trusted_dirs=
+AC_ARG_WITH([user-defined-trusted-dirs],
+	    AS_HELP_STRING([--with-user-defined-trusted-dirs=DIRS], [Additional default ld search dirs]),
+	    [dnl
+  case "$withval" in
+  yes|'') AC_MSG_ERROR([--with-user-defined-trusted-dirs requires an argument]) ;;
+  no) ;;
+  *) user_defined_trusted_dirs="$withval" ;;
+  esac
+])
+LIBC_CONFIG_VAR([user-defined-trusted-dirs], [$user_defined_trusted_dirs])
+
 # An preconfigure script can set this when it wants to disable the sanity
 # check below.
 libc_config_ok=no
diff --git a/manual/install.texi b/manual/install.texi
index b2d569a..31ea4c1 100644
--- a/manual/install.texi
+++ b/manual/install.texi
@@ -312,6 +312,11 @@ Specify the URL that users should visit if they wish to report a bug,
 to be included in @option{--help} output from programs installed with
 @theglibc{}.  The default value refers to the main bug-reporting
 information for @theglibc{}.
+
+@item --with-user-defined-trusted-dirs=@var{lib-folders}
+Specify additional trustworthy directories to look for shared libraries.
+This is in addition to the default ld library path.
+
 @end table
 
 To build the library and related programs, type @code{make}.  This will
-- 
2.7.4


             reply	other threads:[~2020-01-02 23:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-02 23:25 justinpopo6 [this message]
2020-12-21  4:17 ` [PATCH v2] configure.ac: option for user-defined-trusted-dirs Siddhesh Poyarekar
2020-12-21 18:48   ` Justin Chen via Libc-alpha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1578007510-24831-1-git-send-email-justinpopo6@gmail.com \
    --to=justinpopo6@gmail.com \
    --cc=code@mmayer.net \
    --cc=f.fainelli@gmail.com \
    --cc=fw@deneb.enyo.de \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).