plug-ins: if --with-sendmail is set with a value, use it.

Assume sendmail has to be installed in the path which was (optionally)
given at build time. If no path is given at build, simply search in the
$PATH.
This commit is contained in:
Jehan 2016-06-02 01:14:15 +02:00
parent ed8a9c97cf
commit 912fcec37f

View file

@ -126,10 +126,19 @@ query (void)
{ GIMP_PDB_INT32, "encapsulation", "ignored" } { GIMP_PDB_INT32, "encapsulation", "ignored" }
}; };
/* check if xdg-email or sendmail is installed /* Check if xdg-email or sendmail is installed.
* TODO: allow setting the location of the executable in preferences * TODO: allow setting the location of the executable in preferences.
*/ */
#ifdef SENDMAIL #ifdef SENDMAIL && SENDMAIL
/* If a directory has been set at build time, we assume that sendmail
* can only be in this directory. */
email_bin = g_build_path (SENDMAIL, "sendmail", NULL);
if (! g_file_test (email_bin, G_FILE_TEST_IS_EXECUTABLE))
{
g_free (email_bin);
email_bin = NULL;
}
#elif defined SENDMAIL
email_bin = g_find_program_in_path ("sendmail"); email_bin = g_find_program_in_path ("sendmail");
#else #else
email_bin = g_find_program_in_path ("xdg-email"); email_bin = g_find_program_in_path ("xdg-email");