]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
configure: Add --enable-gpl option
authorMicah Elizabeth Scott <beth@torproject.org>
Wed, 8 Mar 2023 17:08:23 +0000 (09:08 -0800)
committerMicah Elizabeth Scott <beth@torproject.org>
Wed, 10 May 2023 14:38:28 +0000 (07:38 -0700)
This change on its own doesn't use the option for anything, but
it includes support for configure and a message in 'tor --version'

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
configure.ac
src/app/config/config.c

index babc65fa8ff928c919f4cced4840556a559dfe97..a9ea85361156d659b4c24eec6b0e490386e8f40d 100644 (file)
@@ -53,6 +53,19 @@ if test "x$PKG_CONFIG_PATH" = "x" && test "x$prefix" != "xNONE" && test "$host"
    AC_MSG_NOTICE([set PKG_CONFIG_PATH=$PKG_CONFIG_PATH to support cross-compiling])
 fi
 
+# License options
+
+AC_ARG_ENABLE(gpl,
+  AS_HELP_STRING(--enable-gpl, [allow the inclusion of GPL-licensed code, building a version of tor and libtor covered by the GPL rather than its usual 3-clause BSD license]))
+license_option=BSD
+AS_IF([test "x$enable_gpl" = xyes],
+  [
+    AC_DEFINE(ENABLE_GPL, 1, [Defined if tor is building in GPL-licensed mode.])
+    license_option=GPL
+  ])
+
+# Optional features
+
 AC_ARG_ENABLE(openbsd-malloc,
    AS_HELP_STRING(--enable-openbsd-malloc, [use malloc code from OpenBSD.  Linux only. Deprecated: see --with-malloc]))
 AC_ARG_ENABLE(static-openssl,
@@ -2651,6 +2664,7 @@ PPRINT_SUBTITLE([Build Features])
 
 PPRINT_PROP_STRING([Compiler], [$CC])
 PPRINT_PROP_STRING([Host OS], [$host_os])
+PPRINT_PROP_STRING([License Option], [$license_option])
 AS_ECHO
 
 test "x$enable_fatal_warnings" = "xyes" && value=1 || value=0
index 0618622db91645273c61bc2a09fedba993438825..cb71d0fb6deadf16a831af44071b879942746069 100644 (file)
@@ -4476,6 +4476,10 @@ options_init_from_torrc(int argc, char **argv)
 
   if (config_line_find(cmdline_only_options, "--version")) {
     printf("Tor version %s.\n",get_version());
+#ifdef ENABLE_GPL
+    printf("This build of Tor is covered by the GNU General Public License "
+            "(https://www.gnu.org/licenses/gpl-3.0.en.html)\n");
+#endif
     printf("Tor is running on %s with Libevent %s, "
             "%s %s, Zlib %s, Liblzma %s, Libzstd %s and %s %s as libc.\n",
             get_uname(),