Re: Issues creating makefile - lines commented out

2023-02-25 Thread Wietse Venema
James Brown:
> > On 25 Feb 2023, at 12:09 pm, Wietse Venema  wrote:
> > 
> > James Brown:
> >> Now it just has one error:
> >> 
> >> dict_mysql.c:171:10: fatal error: 'mysql.h' file not found
> >> #include 
> >> ^
> >> 1 error generated.
> >> make: *** [dict_mysql.o] Error 1
> >> make: *** [update] Error 1
> >> 
> >> % locate mysql.h
> >> /opt/homebrew/Cellar/mysql/8.0.32/include/mysql/mysql.h
> >> 
> >> Thanks so much for your help again.
> > 
> > I suspect a missing -I directive in CCARGS.
> > 
> > Wietse
> 
> Thanks Wietse.
> 
> Not sure how to do that. I do feel very stupid with all this. 
> 
> Added ?mysql? to end of path for DHAS_MYSQL which seemed to help, got to an 
> error saying it couldn?t find mysqlclient. Put ?-L/opt/homebrew/lib? in 
> AUXLIBS:
> 
>  % make -f Makefile.init makefiles CCARGS="-DUSE_TLS -DUSE_SASL_AUTH \
> -DDEF_SERVER_SASL_TYPE="dovecot" \

Plase, count to three. Three backslashes, not four.

Wietse


Re: Issues creating makefile - lines commented out

2023-02-24 Thread James Brown


> On 25 Feb 2023, at 4:10 pm, Viktor Dukhovni  
> wrote:
> 
> On Sat, Feb 25, 2023 at 03:54:05PM +1100, James Brown wrote:
> 
>> % make -f Makefile.init makefiles CCARGS="-DUSE_TLS -DUSE_SASL_AUTH \
>> -DDEF_SERVER_SASL_TYPE="dovecot" \
> 
> Those should be 3-backslashes not 4.

That was it! Thanks Victor - works OK now!

Successfully got to the install questions.
> 
>> -DDEF_COMMAND_DIR=\\\"/usr/local/sbin\\\" \
>> -DDEF_CONFIG_DIR=\\\"/usr/local/etc/postfix\\\" \
>> -DDEF_DAEMON_DIR=\\\"/usr/local/libexec/postfix\\\" \
>> -DHAS_PCRE -I/opt/homebrew/include \
>> -DHAS_SSL -I/opt/homebrew/Cellar/openssl@3/3.0.8/include/ \
>> -DHAS_MYSQL -I/opt/homebrew/Cellar/mysql/8.0.32/include/mysql/ " \
>> AUXLIBS_MYSQL='-I/opt/homebrew/Cellar/mysql/8.0.32/include/mysql 
>> -lmysqlclient -lz -lm' \
>> AUXLIBS='-L/usr/local/lib -lpcre -L/opt/homebrew/opt/openssl@3/lib 
>> -L/opt/homebrew/lib -lssl -lcrypto'  sendmail_path=/usr/local/sbin/sendmail 
>> newaliases_path=/usr/local/bin/newaliases mailq_path=/usr/local/bin/mailq 
> 
> You have made the masochist choice (double quotes and multiple layers of
> escaping).  I tried to discourage this...  You'll probably get it
> working, but it will still remain a bad idea.
> 
> Because I run a custom dev version of OpenSSL, my build script is:
> 
>OSSLPATH=/usr/local/siteexec
>OSSLINC="-I${OSSLPATH}/include "
>OSSLLIB="-L${OSSLPATH}/lib "
>OSSLSHLIB="-Wl,-rpath,${OSSLPATH}/lib "
> 
>make -f Makefile.init dynamicmaps=yes shared=yes pie=yes \
>'CCARGS=-DDEF_MAIL_OWNER=\"postfix\" -DDEF_SGID_GROUP=\"maildrop\" 
> -DHAS_EAI -DUSE_SASL_AUTH '"$OSSLINC"'-I/usr/local/include -DHAS_PCRE=2 
> -DUSE_CYRUS_SASL -I/usr/local/include/sasl -DUSE_TLS -I/usr/local/include/db5 
> -DHAS_CDB -DHAS_LMDB' \
>"AUXLIBS=${OSSLLIB}${OSSLSHLIB}"'-L/usr/local/lib -lsasl2 -lpam 
> -lcrypt -Wl,-rpath,/usr/local/lib -fstack-protector-strong  -lssl -lcrypto 
> -L/usr/local/lib/db5 -ldb-5.3' \
>'AUXLIBS_CDB=-L/usr/local/lib -Wl,-R,/usr/local/lib -lcdb' \
>'AUXLIBS_PCRE=-L/usr/local/lib -Wl,-R/usr/local/lib -lpcre2-8' \
>'AUXLIBS_LMDB=-L/usr/local/lib -Wl,-R/usr/local/lib -llmdb' \
>command_directory=/usr/local/sbin \
>config_directory=/usr/local/etc/postfix \
>daemon_directory=/usr/local/libexec/postfix \
>data_directory=/var/db/postfix \
>mailq_path=/usr/local/bin/mailq \
>newaliases_path=/usr/local/bin/newaliases \
>queue_directory=/var/spool/postfix \
>sendmail_path=/usr/local/sbin/sendmail \
>shlib_directory=/usr/local/lib/postfix-MAIL_VERSION \
>html_directory=/usr/local/share/doc/postfix \
>manpage_directory=/usr/local/man \
>readme_directory=/usr/local/share/doc/postfix \
>makefiles
> 
> The "long lines" for each of CCARGS and AUXLIBS are not a problem.
> 
> -- 
>Viktor.

Yes, I can seen the variables make things a bit easier.


Thanks again everyone for your help.

James.
PS. Is there a place to go to support/donate to Postfix, or buymeacoffee.com 
link?



Re: Issues creating makefile - lines commented out

2023-02-24 Thread Viktor Dukhovni
On Sat, Feb 25, 2023 at 03:54:05PM +1100, James Brown wrote:

>  % make -f Makefile.init makefiles CCARGS="-DUSE_TLS -DUSE_SASL_AUTH \
> -DDEF_SERVER_SASL_TYPE="dovecot" \

Those should be 3-backslashes not 4.

> -DDEF_COMMAND_DIR=\\\"/usr/local/sbin\\\" \
> -DDEF_CONFIG_DIR=\\\"/usr/local/etc/postfix\\\" \
> -DDEF_DAEMON_DIR=\\\"/usr/local/libexec/postfix\\\" \
> -DHAS_PCRE -I/opt/homebrew/include \
> -DHAS_SSL -I/opt/homebrew/Cellar/openssl@3/3.0.8/include/ \
> -DHAS_MYSQL -I/opt/homebrew/Cellar/mysql/8.0.32/include/mysql/ " \
> AUXLIBS_MYSQL='-I/opt/homebrew/Cellar/mysql/8.0.32/include/mysql 
> -lmysqlclient -lz -lm' \
> AUXLIBS='-L/usr/local/lib -lpcre -L/opt/homebrew/opt/openssl@3/lib 
> -L/opt/homebrew/lib -lssl -lcrypto'  sendmail_path=/usr/local/sbin/sendmail 
> newaliases_path=/usr/local/bin/newaliases mailq_path=/usr/local/bin/mailq 

You have made the masochist choice (double quotes and multiple layers of
escaping).  I tried to discourage this...  You'll probably get it
working, but it will still remain a bad idea.

Because I run a custom dev version of OpenSSL, my build script is:

OSSLPATH=/usr/local/siteexec
OSSLINC="-I${OSSLPATH}/include "
OSSLLIB="-L${OSSLPATH}/lib "
OSSLSHLIB="-Wl,-rpath,${OSSLPATH}/lib "

make -f Makefile.init dynamicmaps=yes shared=yes pie=yes \
'CCARGS=-DDEF_MAIL_OWNER=\"postfix\" -DDEF_SGID_GROUP=\"maildrop\" 
-DHAS_EAI -DUSE_SASL_AUTH '"$OSSLINC"'-I/usr/local/include -DHAS_PCRE=2 
-DUSE_CYRUS_SASL -I/usr/local/include/sasl -DUSE_TLS -I/usr/local/include/db5 
-DHAS_CDB -DHAS_LMDB' \
"AUXLIBS=${OSSLLIB}${OSSLSHLIB}"'-L/usr/local/lib -lsasl2 -lpam -lcrypt 
-Wl,-rpath,/usr/local/lib -fstack-protector-strong  -lssl -lcrypto 
-L/usr/local/lib/db5 -ldb-5.3' \
'AUXLIBS_CDB=-L/usr/local/lib -Wl,-R,/usr/local/lib -lcdb' \
'AUXLIBS_PCRE=-L/usr/local/lib -Wl,-R/usr/local/lib -lpcre2-8' \
'AUXLIBS_LMDB=-L/usr/local/lib -Wl,-R/usr/local/lib -llmdb' \
command_directory=/usr/local/sbin \
config_directory=/usr/local/etc/postfix \
daemon_directory=/usr/local/libexec/postfix \
data_directory=/var/db/postfix \
mailq_path=/usr/local/bin/mailq \
newaliases_path=/usr/local/bin/newaliases \
queue_directory=/var/spool/postfix \
sendmail_path=/usr/local/sbin/sendmail \
shlib_directory=/usr/local/lib/postfix-MAIL_VERSION \
html_directory=/usr/local/share/doc/postfix \
manpage_directory=/usr/local/man \
readme_directory=/usr/local/share/doc/postfix \
makefiles

The "long lines" for each of CCARGS and AUXLIBS are not a problem.

-- 
Viktor.


Re: Issues creating makefile - lines commented out

2023-02-24 Thread James Brown
> On 25 Feb 2023, at 12:09 pm, Wietse Venema  wrote:
> 
> James Brown:
>> Now it just has one error:
>> 
>> dict_mysql.c:171:10: fatal error: 'mysql.h' file not found
>> #include 
>> ^
>> 1 error generated.
>> make: *** [dict_mysql.o] Error 1
>> make: *** [update] Error 1
>> 
>> % locate mysql.h
>> /opt/homebrew/Cellar/mysql/8.0.32/include/mysql/mysql.h
>> 
>> Thanks so much for your help again.
> 
> I suspect a missing -I directive in CCARGS.
> 
>   Wietse

Thanks Wietse.

Not sure how to do that. I do feel very stupid with all this. 

Added ‘mysql’ to end of path for DHAS_MYSQL which seemed to help, got to an 
error saying it couldn’t find mysqlclient. Put ‘-L/opt/homebrew/lib’ in AUXLIBS:

 % make -f Makefile.init makefiles CCARGS="-DUSE_TLS -DUSE_SASL_AUTH \
-DDEF_SERVER_SASL_TYPE="dovecot" \
-DDEF_COMMAND_DIR=\\\"/usr/local/sbin\\\" \
-DDEF_CONFIG_DIR=\\\"/usr/local/etc/postfix\\\" \
-DDEF_DAEMON_DIR=\\\"/usr/local/libexec/postfix\\\" \
-DHAS_PCRE -I/opt/homebrew/include \
-DHAS_SSL -I/opt/homebrew/Cellar/openssl@3/3.0.8/include/ \
-DHAS_MYSQL -I/opt/homebrew/Cellar/mysql/8.0.32/include/mysql/ " \
AUXLIBS_MYSQL='-I/opt/homebrew/Cellar/mysql/8.0.32/include/mysql -lmysqlclient 
-lz -lm' \
AUXLIBS='-L/usr/local/lib -lpcre -L/opt/homebrew/opt/openssl@3/lib 
-L/opt/homebrew/lib -lssl -lcrypto'  sendmail_path=/usr/local/sbin/sendmail 
newaliases_path=/usr/local/bin/newaliases mailq_path=/usr/local/bin/mailq 

Now it gets to:

cp cleanup ../../libexec
[src/smtpd]
cc -I. -I../../include -DUSE_TLS -DUSE_SASL_AUTH 
-DDEF_SERVER_SASL_TYPE=\\dovecot\\ -DDEF_COMMAND_DIR=\"/usr/local/sbin\" 
-DDEF_CONFIG_DIR=\"/usr/local/etc/postfix\" 
-DDEF_DAEMON_DIR=\"/usr/local/libexec/postfix\" -DHAS_PCRE 
-I/opt/homebrew/include -DHAS_SSL 
-I/opt/homebrew/Cellar/openssl@3/3.0.8/include/ -DHAS_MYSQL 
-I/opt/homebrew/Cellar/mysql/8.0.32/include/mysql/ -DBIND_8_COMPAT -DNO_NETINFO 
-DRESOLVE_H_NEEDS_ARPA_NAMESER_COMPAT_H -DNO_EAI -DDEF_SMTPUTF8_ENABLE=\"no\" 
-DHAS_DEV_URANDOM -DDEF_MAILQ_PATH=\"/usr/local/bin/mailq\" 
-DDEF_NEWALIAS_PATH=\"/usr/local/bin/newaliases\" 
-DDEF_SENDMAIL_PATH=\"/usr/local/sbin/sendmail\" -UUSE_DYNAMIC_LIBS 
-DDEF_SHLIB_DIR=\"no\" -UUSE_DYNAMIC_MAPS -Wmissing-prototypes -Wformat 
-Wno-comment -fno-common -g -O -I. -I../../include -DMACOSX -c smtpd.c
smtpd.c:6562:23: error: expected expression
VAR_SMTPD_SASL_TYPE, DEF_SMTPD_SASL_TYPE, _smtpd_sasl_type, 1, 0,
 ^
../../include/mail_params.h:1700:29: note: expanded from macro 
'DEF_SMTPD_SASL_TYPE'
#define DEF_SMTPD_SASL_TYPE DEF_SERVER_SASL_TYPE
^
:3:30: note: expanded from here
#define DEF_SERVER_SASL_TYPE \dovecot\\
 ^
1 error generated.
make: *** [smtpd.o] Error 1
make: *** [update] Error 1

Definitely have to buy to few beers or bottles of wine when we get this working!

Thanks, James.

Re: Issues creating makefile - lines commented out

2023-02-24 Thread Wietse Venema
James Brown:
> Now it just has one error:
> 
> dict_mysql.c:171:10: fatal error: 'mysql.h' file not found
> #include 
>  ^
> 1 error generated.
> make: *** [dict_mysql.o] Error 1
> make: *** [update] Error 1
> 
>  % locate mysql.h
> /opt/homebrew/Cellar/mysql/8.0.32/include/mysql/mysql.h
> 
> Thanks so much for your help again.

I suspect a missing -I directive in CCARGS.

Wietse


Re: Issues creating makefile - lines commented out

2023-02-24 Thread Peter

On 25/02/23 12:48, Peter wrote:

On 25/02/23 01:57, Wietse Venema wrote:

James Brown:
Sorry if this is a bit of a basic question, but I?m trying to compile 
from source on macOS 13.21.1 but the makefile has lines commented out.


I'm trying:

make -f Makefile.init makefiles \
CCARGS='-DUSE_TLS -DUSE_SASL_AUTH \

 ...

-DHAS_MYSQL -I/opt/homebrew/Cellar/mysql/8.0.32/include/' \

 ...

Try using " instead of '

Someone has "improved"(*) the shell and broke command examples that
I wrote 20+ years ago.


Single quoting should be fine, but he's missing the opening 
single-quote, so there's just one on the end, which as you can probably 
imagine, really messes things up.


Actually he's starting the quote at the beginning of one line and ending 
it way below.  It would probably work fine if he got rid of the 
intervening backslashes.



Peter


Re: Issues creating makefile - lines commented out

2023-02-24 Thread Peter

On 25/02/23 01:57, Wietse Venema wrote:

James Brown:

Sorry if this is a bit of a basic question, but I?m trying to compile from 
source on macOS 13.21.1 but the makefile has lines commented out.

I'm trying:

make -f Makefile.init makefiles \
CCARGS='-DUSE_TLS -DUSE_SASL_AUTH \

 ...

-DHAS_MYSQL -I/opt/homebrew/Cellar/mysql/8.0.32/include/' \

 ...

Try using " instead of '

Someone has "improved"(*) the shell and broke command examples that
I wrote 20+ years ago.


Single quoting should be fine, but he's missing the opening 
single-quote, so there's just one on the end, which as you can probably 
imagine, really messes things up.



Peter


Re: Issues creating makefile - lines commented out

2023-02-24 Thread James Brown
> On 25 Feb 2023, at 2:41 am, Wietse Venema  wrote:
> 
> Wietse Venema:
>> James Brown:
 On 24 Feb 2023, at 11:57 pm, Wietse Venema  wrote:
 
 James Brown:
> Sorry if this is a bit of a basic question, but I?m trying to compile 
> from source on macOS 13.21.1 but the makefile has lines commented out.
> 
> I'm trying:
> 
> make -f Makefile.init makefiles \
> CCARGS='-DUSE_TLS -DUSE_SASL_AUTH \
   ...
> -DHAS_MYSQL -I/opt/homebrew/Cellar/mysql/8.0.32/include/' \
   ...
 
 Try using " instead of '
 
 Someone has "improved"(*) the shell and broke command examples that
 I wrote 20+ years ago.
 
Wietse
 
 (*) Or worse, some standard committee "improved" the spec.
 
>>> 
>>> Thanks for your help Wietse. (The shell is zsh)
>>> 
>>> % make -f Makefile.init makefiles CCARGS="-DUSE_TLS -DUSE_SASL_AUTH \
>>> -DDEF_SERVER_SASL_TYPE=\"dovecot\" \
>> 
>> Try:
>> 
>>make -f Makefile.init makefiles CCARGS="-DUSE_TLS -DUSE_SASL_AUTH \
>>  -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\" \
>>  ...
>> 
>> That's three backslashes where there was one.
> 
> I have to retract my comment aobut changes to shells. The behavior
> of backslash-newline inside 'string' (single quotes) is to preserve
> the backslash and the newline i.e. the backslash is mot special and
> that has not changed in the past 10+ years.
> 
> Thus, the form
> 
>make -f Makefile.init makefiles CCARGS="ccargs stuff \
>   more ccargs stuff" \
>   other stuff \
>   more other stuff
> 
> Is the form to use when CCARGS spans multiple lines, and you need
> \\\ to protect " quotes inside CCARGS.
> 
>   Wietse

Thanks Wietse, Viktor and Norton.

Looks like three backslashes instead of one was the answer:

% make -f Makefile.init makefiles CCARGS="-DUSE_TLS -DUSE_SASL_AUTH \
-DDEF_SERVER_SASL_TYPE="dovecot" \
-DDEF_COMMAND_DIR=\\\"/usr/local/sbin\\\" \
-DDEF_CONFIG_DIR=\\\"/usr/local/etc/postfix\\\" \
-DDEF_DAEMON_DIR=\\\"/usr/local/libexec/postfix\\\" \
-DHAS_PCRE -I/opt/homebrew/include \
-DHAS_SSL -I/opt/homebrew/Cellar/openssl@3/3.0.8/include/ \
-DHAS_MYSQL -I/opt/homebrew/Cellar/mysql/8.0.32/include/" \
AUXLIBS_MYSQL='-I/opt/homebrew/Cellar/mysql/8.0.32/include/mysql -lmysqlclient 
-lz -lm' \
AUXLIBS='-L/usr/local/lib -lpcre -L/opt/homebrew/opt/openssl@3/lib -lssl 
-lcrypto'  sendmail_path=/usr/local/sbin/sendmail 
newaliases_path=/usr/local/bin/newaliases mailq_path=/usr/local/bin/mailq

And start of makefile:

# Do not edit -- this file documents how Postfix was built for your machine.
#
# Start of summary of user-configurable 'make makefiles' options.
# CCARGS=-DUSE_TLS -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\dovecot\ 
-DDEF_COMMAND_DIR=\"/usr/local/sbin\" 
-DDEF_CONFIG_DIR=\"/usr/local/etc/postfix\" 
-DDEF_DAEMON_DIR=\"/usr/local/libexec/postfix\" -DHAS_PCRE 
-I/opt/homebrew/include -DHAS_SSL 
-I/opt/homebrew/Cellar/openssl@3/3.0.8/include/ -DHAS_MYSQL 
-I/opt/homebrew/Cellar/mysql/8.0.32/include/
# AUXLIBS=-L/usr/local/lib -lpcre -L/opt/homebrew/opt/openssl@3/lib -lssl 
-lcrypto
# AUXLIBS_MYSQL=-I/opt/homebrew/Cellar/mysql/8.0.32/include/mysql -lmysqlclient 
-lz -lm
# shared=
# dynamicmaps=
# pie=
# mailq_path=/usr/local/bin/mailq
# newaliases_path=/usr/local/bin/newaliases
# sendmail_path=/usr/local/sbin/sendmail
# End of summary of user-configurable 'make makefiles' options.
#--
# System-dependent settings and compiler/linker overrides.

Now it just has one error:

dict_mysql.c:171:10: fatal error: 'mysql.h' file not found
#include 
 ^
1 error generated.
make: *** [dict_mysql.o] Error 1
make: *** [update] Error 1

 % locate mysql.h
/opt/homebrew/Cellar/mysql/8.0.32/include/mysql/mysql.h


Thanks so much for your help again.

James.



Re: Issues creating makefile - lines commented out

2023-02-24 Thread Wietse Venema
Viktor Dukhovni:
> On Fri, Feb 24, 2023 at 10:41:01AM -0500, Wietse Venema wrote:
> 
> > I have to retract my comment aobut changes to shells. The behavior
> > of backslash-newline inside 'string' (single quotes) is to preserve
> > the backslash and the newline i.e. the backslash is mot special and
> > that has not changed in the past 10+ years.
> > 
> > Thus, the form
> > 
> > make -f Makefile.init makefiles CCARGS="ccargs stuff \
> > more ccargs stuff" \
> > other stuff \
> > more other stuff
> > 
> > Is the form to use when CCARGS spans multiple lines, and you need
> > \\\ to protect " quotes inside CCARGS.
> 
> FWIW, by far the simpler solution is to avoid the multiple lines, not
> change to a much more complicated quoting regiment.
> 
> To build variables incrementally, initialise a shell variable with
> some of the data, and then grow it:
> 
> FOO="${BEFORE_FOO}$FOO${AFTER_FOO}"
> 
> if your shell (e.g. "bash") supports array variables, you can also
> incrementally build arrays.
> 
> declare -a foo
> foo+=(arg1)
> foo+=("arg2 has a space")
> foo+=('arg3 contains
> a new line')
> ...
> 
> i=1; for arg in "${foo[@]}"; do printf "%d: %s\n" $i "$arg"; i=$((i+1));
> done
> 1: arg1
> 2: arg2 has a space
> 3: arg3 contains
> a new line
> 
> or whatever meets your needs at the time, but keep the Postfix "CCARGS", ...
> newline free.

I use incremental CCARGS etc. in my own files, but I think that
this would make the README examples noisier than they already are.

Having to use FOO=\\\"bar\\\" rarely is not the end of the world.
It allows humans to read the examples from left to right without
having to mentally juggle a chain of before-after assignments.

Wietse


Re: Issues creating makefile - lines commented out

2023-02-24 Thread Viktor Dukhovni
On Fri, Feb 24, 2023 at 10:41:01AM -0500, Wietse Venema wrote:

> I have to retract my comment aobut changes to shells. The behavior
> of backslash-newline inside 'string' (single quotes) is to preserve
> the backslash and the newline i.e. the backslash is mot special and
> that has not changed in the past 10+ years.
> 
> Thus, the form
> 
> make -f Makefile.init makefiles CCARGS="ccargs stuff \
>   more ccargs stuff" \
>   other stuff \
>   more other stuff
> 
> Is the form to use when CCARGS spans multiple lines, and you need
> \\\ to protect " quotes inside CCARGS.

FWIW, by far the simpler solution is to avoid the multiple lines, not
change to a much more complicated quoting regiment.

To build variables incrementally, initialise a shell variable with
some of the data, and then grow it:

FOO="${BEFORE_FOO}$FOO${AFTER_FOO}"

if your shell (e.g. "bash") supports array variables, you can also
incrementally build arrays.

declare -a foo
foo+=(arg1)
foo+=("arg2 has a space")
foo+=('arg3 contains
a new line')
...

i=1; for arg in "${foo[@]}"; do printf "%d: %s\n" $i "$arg"; i=$((i+1));
done
1: arg1
2: arg2 has a space
3: arg3 contains
a new line

or whatever meets your needs at the time, but keep the Postfix "CCARGS", ...
newline free.

-- 
Viktor.


Re: Issues creating makefile - lines commented out

2023-02-24 Thread Wietse Venema
Norton Allen:
> On 2/24/2023 12:27 AM, James Brown wrote:
> > Sorry if this is a bit of a basic question, but I?m trying to compile from 
> > source on macOS 13.21.1 but the makefile has lines commented out.
> >
> > I?m trying:
> >
> > make -f Makefile.init makefiles \
> > CCARGS='-DUSE_TLS -DUSE_SASL_AUTH \
> > -DDEF_SERVER_SASL_TYPE=\"dovecot\" \
...
> > # Do not edit -- this file documents how Postfix was built for your machine.
> > #
> > # Start of summary of user-configurable 'make makefiles' options.
> > # CCARGS=-DUSE_TLS -DUSE_SASL_AUTH \
> > -DDEF_SERVER_SASL_TYPE=\"dovecot\" \
> > -DDEF_COMMAND_DIR=\"/usr/local/sbin\" \
...
> Are you sure you aren't simply looking at the "summary" of your 
> selections? That's what it says right before the stuff that's commented 
> out. Do these settings get encoded for real elsewhere in the Makefile?

Indeed, but this was just one symptom of the problem. The summary
should be formatted as:

# Text without backslash-newline

The problem alsr broke the OS specific test programs runs in the
makedefs script.

I have updated the on-line webpages, and that should propagate in
the next 24 hours.

Wietse


Re: Issues creating makefile - lines commented out

2023-02-24 Thread Norton Allen

On 2/24/2023 12:27 AM, James Brown wrote:

Sorry if this is a bit of a basic question, but I’m trying to compile from 
source on macOS 13.21.1 but the makefile has lines commented out.

I’m trying:

make -f Makefile.init makefiles \
CCARGS='-DUSE_TLS -DUSE_SASL_AUTH \
-DDEF_SERVER_SASL_TYPE=\"dovecot\" \
-DDEF_COMMAND_DIR=\"/usr/local/sbin\" \
-DDEF_CONFIG_DIR=\"/usr/local/etc/postfix\" \
-DDEF_DAEMON_DIR=\"/usr/local/libexec/postfix\" \
-DHAS_PCRE -I/opt/homebrew//include \
-DHAS_SSL -I/opt/homebrew/Cellar/openssl@3/3.0.8/include/ \
-DHAS_MYSQL -I/opt/homebrew/Cellar/mysql/8.0.32/include/' \
AUXLIBS_MYSQL='-I/opt/homebrew/Cellar/mysql/8.0.32/include/mysql -lmysqlclient 
-lz -lm'\
AUXLIBS='-L/usr/local/lib -lpcre -L/opt/homebrew/opt/openssl@3/lib -lssl 
-lcrypto'  sendmail_path=/usr/local/sbin/sendmail 
newaliases_path=/usr/local/bin/newaliases mailq_path=/usr/local/bin/mailq

The makefile that gets created starts =:

# Do not edit -- this file documents how Postfix was built for your machine.
#
# Start of summary of user-configurable 'make makefiles' options.
# CCARGS=-DUSE_TLS -DUSE_SASL_AUTH \
-DDEF_SERVER_SASL_TYPE=\"dovecot\" \
-DDEF_COMMAND_DIR=\"/usr/local/sbin\" \
-DDEF_CONFIG_DIR=\"/usr/local/etc/postfix\" \
-DDEF_DAEMON_DIR=\"/usr/local/libexec/postfix\" \
-DHAS_PCRE -I/opt/homebrew//include \
-DHAS_SSL -I/opt/homebrew/Cellar/openssl@3/3.0.8/include/ \
-DHAS_MYSQL -I/opt/homebrew/Cellar/mysql/8.0.32/include/
# AUXLIBS=
# AUXLIBS_MYSQL=-I/opt/homebrew/Cellar/mysql/8.0.32/include/mysql -lmysqlclient 
-lz -lmAUXLIBS=-L/usr/local/lib -lpcre -L/opt/homebrew/opt/openssl@3/lib -lssl 
-lcrypto
# shared=
# dynamicmaps=
# pie=
# mailq_path=/usr/local/bin/mailq
# newaliases_path=/usr/local/bin/newaliases
# sendmail_path=/usr/local/sbin/sendmail
# End of summary of user-configurable 'make makefiles' options.
#--
# System-dependent settings and compiler/linker overrides.

I’m sure it something simple, but why are the CCARGS, AUXLIBS and AUXLIBS_MYSQL 
being commented out?

Are you sure you aren't simply looking at the "summary" of your 
selections? That's what it says right before the stuff that's commented 
out. Do these settings get encoded for real elsewhere in the Makefile?


Re: Issues creating makefile - lines commented out

2023-02-24 Thread Wietse Venema
Wietse Venema:
> James Brown:
> > > On 24 Feb 2023, at 11:57 pm, Wietse Venema  wrote:
> > > 
> > > James Brown:
> > >> Sorry if this is a bit of a basic question, but I?m trying to compile 
> > >> from source on macOS 13.21.1 but the makefile has lines commented out.
> > >> 
> > >> I'm trying:
> > >> 
> > >> make -f Makefile.init makefiles \
> > >> CCARGS='-DUSE_TLS -DUSE_SASL_AUTH \
> > >...
> > >> -DHAS_MYSQL -I/opt/homebrew/Cellar/mysql/8.0.32/include/' \
> > >...
> > > 
> > > Try using " instead of '
> > > 
> > > Someone has "improved"(*) the shell and broke command examples that
> > > I wrote 20+ years ago.
> > > 
> > >   Wietse
> > > 
> > > (*) Or worse, some standard committee "improved" the spec.
> > > 
> > 
> > Thanks for your help Wietse. (The shell is zsh)
> > 
> > % make -f Makefile.init makefiles CCARGS="-DUSE_TLS -DUSE_SASL_AUTH \
> > -DDEF_SERVER_SASL_TYPE=\"dovecot\" \
> 
> Try:
> 
> make -f Makefile.init makefiles CCARGS="-DUSE_TLS -DUSE_SASL_AUTH \
>   -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\" \
>   ...
> 
> That's three backslashes where there was one.

I have to retract my comment aobut changes to shells. The behavior
of backslash-newline inside 'string' (single quotes) is to preserve
the backslash and the newline i.e. the backslash is mot special and
that has not changed in the past 10+ years.

Thus, the form

make -f Makefile.init makefiles CCARGS="ccargs stuff \
more ccargs stuff" \
other stuff \
more other stuff

Is the form to use when CCARGS spans multiple lines, and you need
\\\ to protect " quotes inside CCARGS.

Wietse


Re: Issues creating makefile - lines commented out

2023-02-24 Thread Wietse Venema
James Brown:
> > On 24 Feb 2023, at 11:57 pm, Wietse Venema  wrote:
> > 
> > James Brown:
> >> Sorry if this is a bit of a basic question, but I?m trying to compile from 
> >> source on macOS 13.21.1 but the makefile has lines commented out.
> >> 
> >> I'm trying:
> >> 
> >> make -f Makefile.init makefiles \
> >> CCARGS='-DUSE_TLS -DUSE_SASL_AUTH \
> >...
> >> -DHAS_MYSQL -I/opt/homebrew/Cellar/mysql/8.0.32/include/' \
> >...
> > 
> > Try using " instead of '
> > 
> > Someone has "improved"(*) the shell and broke command examples that
> > I wrote 20+ years ago.
> > 
> > Wietse
> > 
> > (*) Or worse, some standard committee "improved" the spec.
> > 
> 
> Thanks for your help Wietse. (The shell is zsh)
> 
> % make -f Makefile.init makefiles CCARGS="-DUSE_TLS -DUSE_SASL_AUTH \
> -DDEF_SERVER_SASL_TYPE=\"dovecot\" \

Try:

make -f Makefile.init makefiles CCARGS="-DUSE_TLS -DUSE_SASL_AUTH \
-DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\" \
...

That's three backslashes where there was one.

Wietse


Re: Issues creating makefile - lines commented out

2023-02-24 Thread Wietse Venema
James Brown:
> Sorry if this is a bit of a basic question, but I?m trying to compile from 
> source on macOS 13.21.1 but the makefile has lines commented out.
> 
> I'm trying:
> 
> make -f Makefile.init makefiles \
> CCARGS='-DUSE_TLS -DUSE_SASL_AUTH \
...
> -DHAS_MYSQL -I/opt/homebrew/Cellar/mysql/8.0.32/include/' \
...

Try using " instead of '

Someone has "improved"(*) the shell and broke command examples that
I wrote 20+ years ago.

Wietse

(*) Or worse, some standard committee "improved" the spec.