# Postfix compilation errors.



## djmasa (Nov 4, 2013)

Hi everyone,

I've scoured everywhere and cannot find solution to my problem. When compiling ANY version of Postfix on FreeBSD 9.1 has yielded me with: 


```
cc -DDEF_CONFIG_DIR=\"/usr/local/etc/postfix\" -DDEF_DAEMON_DIR=\"/usr/local/libexec/postfix\" -DDEF_COMMAND_DIR=\"/usr/local/sbin\" -DDEF_SENDMAIL_PATH=\"/usr/local/sbin/sendmail\" -DDEF_NEWALIAS_PATH=\"/usr/local/bin/newaliases\" -DDEF_MAILQ_PATH=\"/usr/local/bin/mailq\" -DDEF_MANPAGE_DIR=\"/usr/local/man\" -DDEF_README_DIR=\"/usr/local/share/doc/postfix\" -DDEF_HTML_DIR=\"/usr/local/share/doc/postfix\" -DDEF_QUEUE_DIR=\"/var/spool/postfix\" -DDEF_DATA_DIR=\"/var/db/postfix\" -DDEF_MAIL_OWNER=\"postfix\" -DDEF_SGID_GROUP=\"maildrop\" -DHAS_PCRE -I/usr/local/include -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/local/include -I/usr/local/include/sasl -DUSE_TLS -I/usr/local/include -DHAVE_NS_TYPE -DHAS_SPF -I/usr/local/include -I/usr/local/include/db41 -DHAS_MYSQL -I/usr/local/include/mysql  -O2 -pipe -fno-strict-aliasing -I. -DFREEBSD9 -c inet_trigger.c
inet_trigger.c: In function 'inet_trigger_event':
inet_trigger.c:80: error: 'EVENT_TIME' undeclared (first use in this function)
inet_trigger.c:80: error: (Each undeclared identifier is reported only once
inet_trigger.c:80: error: for each function it appears in.)
*** [inet_trigger.o] Error code 1
1 error
*** [update] Error code 1
1 error
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** [do-build] Error code 1

Stop in /usr/ports/mail/postfix28.
*** [/usr/ports/mail/postfix28/work/.build_done.postfix._usr_local] Error code 1

Stop in /usr/ports/mail/postfix28.
*** [build] Error code 1

Stop in /usr/ports/mail/postfix28.

===>>> make failed for mail/postfix28
===>>> Aborting update

===>>> Killing background jobs
Terminated

===>>> You can restart from the point of failure with this command line:
       portmaster <flags> mail/postfix28 

===>>> Exiting
```
If anyone has a solution to this issue, please let me know. I've tried Postfix 2.7, 2.8, 2.9. and 2.10.

The options used are: BDB MYSQL PCRE SASL2 SPF TLS

I've been able to compile it succesfully with BDB and MYSQL options only, but adding any of the other four combinations or by themselves, yield in the above error. 

Thanks for your time.


----------



## youngunix (Nov 6, 2013)

djmasa said:
			
		

> ===> Compilation failed unexpectedly.
> *Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
> the maintainer.*



Did you do what it says?


----------



## djmasa (Nov 6, 2013)

Thanks for your reply. Yes, I did. The output is the same, except that message isn't there. See below, please: 


```
cc -DDEF_CONFIG_DIR=\"/usr/local/etc/postfix\" -DDEF_DAEMON_DIR=\"/usr/local/libexec/postfix\" -DDEF_COMMAND_DIR=\"/usr/local/sbin\" -DDEF_SENDMAIL_PATH=\"/usr/local/sbin/sendmail\" -DDEF_NEWALIAS_PATH=\"/usr/local/bin/newaliases\" -DDEF_MAILQ_PATH=\"/usr/local/bin/mailq\" -DDEF_MANPAGE_DIR=\"/usr/local/man\" -DDEF_README_DIR=\"/usr/local/share/doc/postfix\" -DDEF_HTML_DIR=\"/usr/local/share/doc/postfix\" -DDEF_QUEUE_DIR=\"/var/spool/postfix\" -DDEF_DATA_DIR=\"/var/db/postfix\" -DDEF_MAIL_OWNER=\"postfix\" -DDEF_SGID_GROUP=\"maildrop\" -DHAS_PCRE -I/usr/local/include -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/local/include -I/usr/local/include/sasl -DUSE_TLS -I/usr/local/include -DHAVE_NS_TYPE -DHAS_SPF -I/usr/local/include -I/usr/local/include/db41 -DHAS_MYSQL -I/usr/local/include/mysql  -O2 -pipe -fno-strict-aliasing -I. -DFREEBSD9 -c inet_trigger.c
inet_trigger.c: In function 'inet_trigger_event':
inet_trigger.c:80: error: 'EVENT_TIME' undeclared (first use in this function)
inet_trigger.c:80: error: (Each undeclared identifier is reported only once
inet_trigger.c:80: error: for each function it appears in.)
*** [inet_trigger.o] Error code 1

Stop in /usr/ports/mail/postfix28/work/postfix-2.8.16/src/util.
*** [update] Error code 1

Stop in /usr/ports/mail/postfix28/work/postfix-2.8.16.
*** [do-build] Error code 1

Stop in /usr/ports/mail/postfix28.
*** [/usr/ports/mail/postfix28/work/.build_done.postfix._usr_local] Error code 1

Stop in /usr/ports/mail/postfix28.
*** [build] Error code 1

Stop in /usr/ports/mail/postfix28.

===>>> make failed for mail/postfix28
===>>> Aborting update

===>>> Killing background jobs
Terminated

===>>> You can restart from the point of failure with this command line:
       portmaster <flags> mail/postfix28 

===>>> Exiting
root@sasami:/usr/ports/mail/postfix28 #
```


----------



## gkontos (Nov 6, 2013)

> Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
> the maintainer.



I've had to deal with this a few times. It could be a -j issue. I think this will solve your problem:

`cd /usr/ports/mail/postfix28`
`make deinstall`
`make clean`
`make`
`make install clean`


----------



## djmasa (Nov 7, 2013)

Thanks for your reply, @gkontos. I tried what you suggested and it still did the same thing. In my make.conf I do NOT have any extra -j parameters. I also even tried a `make -j1 install clean` just to make sure, and it still dumped out at the same spot on the same error.


----------



## gkontos (Nov 7, 2013)

Have you tried following the advice of the handbook?

/etc/make.conf


```
FORCE_MAKE_JOBS=yes
```


----------



## djmasa (Nov 8, 2013)

Thanks for your reply. I did try it. It stopped at the same point with the same error. I keep verifying that I am using the latest snapshot from portsnap as well. I didn't have this problem on FreeBSD 8.x, just 9.x. I haven't yet updated to 9.2, so I don't know if that would fix it. It's kind of hard to upgrade this box to 9.2 right now. It is a production server with 24/7 services. I have mail being handled by another box for now.


----------



## djmasa (Nov 26, 2013)

Does anyone else have some ideas on this? Can anyone else running 9.1 test this, please?


----------



## ShelLuser (Nov 27, 2013)

While carefully going over the thread again it suddenly hit me: you're trying to set up mail/postfix28 which is quite dated; even the official Postfix website refers to it as a legacy release. And although I know that the legacy releases are still being maintained (to some extent) I also wonder why you don't use the more current version mail/postfix?

Speaking of which: could you run this command in your ports directory: `# make build-depends-list`? I wonder what ports it's trying to use. The error you showed at first seems to be MySQL related, so now I'm wondering if this could be caused by different versions which aren't playing along too well.

Edit: _fixed tags_


----------



## djmasa (Nov 30, 2013)

Hello,

Thanks for your response. If you read in the beginning, you'll see where I stated I had tried all versions of Postfix, not just 2.8. That was just one used as an example. I ran the command you wanted in the Ports directory, but it didn't like it, and I don't remember that command being there before. See below, please:

```
root@sasami:/usr/ports # make build-depends-list
make: don't know how to make build-depends-list. Stop
root@sasami:/usr/ports #
```


----------



## fonz (Nov 30, 2013)

djmasa said:
			
		

> ```
> root@sasami:/usr/ports # make build-depends-list
> make: don't know how to make build-depends-list. Stop
> root@sasami:/usr/ports #
> ```


No, you need to run that command in a port's own directory. For example, in the case of mail/postfix28 you'd run it in the directory /usr/ports/*mail/postfix28* (adjust for other ports), not in /usr/ports.


----------



## djmasa (Nov 30, 2013)

Woops! Here you go:


```
root@sasami:/usr/ports/mail/postfix # make build-depends-list
/usr/ports/databases/db41
/usr/ports/databases/mysql51-client
/usr/ports/lang/perl5.14
/usr/ports/security/openssl
root@sasami:/usr/ports/mail/postfix #
```


----------

