Compile apache and postfix in FreeBSD 10.x (from original source code)

1. postfix2.11.x, 3.0.x

I could easily make postfix from original source code in FreeBSD 7.x and 8.x. But I failed this in FreeBSD 10.x system.
First make

$ make Makefile.init makefiles

does not go well. I saw INSTALL and I know that postfix support FreeBSD 8.x 9.x but not 10.x ..
Error messages show error occured in type checking of OS.
On the other hand, I understand FreeBSD 10.x compatible definitions (KERNEL definitions) is only for 4.x 5.x 6.x 7.x not for 8.x and 9.x.
So, I thought in FreeBSD 9.x type below.

$ make Makefile.init makefiles

And make this directory to tar ball. Then take tar ball to FreeBSD 10.x system and spread it and continue to compile. I thoght this must go well.
I tried and I noticed this is OK. But be carefull to use gcc compiler. I use gcc49 in my machine. So I typed below.

$ make CC=gcc49

Conclusion is that
[You do first make (make Makefile.init makefiles) in FreeBSD 9.x and make tar ball.
Take this tar ball to FreeBSD 10.x machine and continue. Be carefull to use gcc compiler.]

The newest version of postfix in april, 2015 is 3.0.1. In this version, postfix recognize FreeBSD 10.x system. But another error has occured. First make was OK.

$ make  Makefile.init  makefiles

This goes well. But next make

$ make  CC=gcc49

does not go well. Error messages says that there are no header and library about unicode. So check pkg (or ports) and find unicode header and library. Let's do below.

$ pkg  install  devel/icu
$ pkg  install  devel/libunicode

Then second make

$ make  CC=gcc49

succeded. Finally type this.

# make  install

That's all.

In postfix 3.0.2 and postfix 3.0.3, procedure is same with 3.0.1

2. apache 2.4.x

I always secceeded to make apache in FreeBSD 7.x and 8.x. But I could'nt make it in FreeBSD 10.x.
First configure does not go well. I find that configure failed because of "iconv".
By checking INTERNET informations, I know that iconv has changed in FreeBSD since ver 10.0. So I thoght that old iconv (from GCC) will go well.
I tried and I made it.(^^)
I show how to below.

# pkg install converters/libiconv
# cd /usr/include
# mv iconv.h iconv-orig.h
# ln -s /usr/local/include/iconv.h /usr/include/iconv.h

(change to apache source directory)

$ ./configure --prefix=HOGEHOGE
$ make
# make install

One more thing. You have to install apr and apr-util before configure and make apache. I show this below.

$ tar xf /hogehoge/httpd-2.4.10.tar.gz
$ cd httpd-2.4.10/srclib
$ tar xf /hogehoge/apr-1.5.1.tar.gz
$ tar xf /hogehoge/apr-util-1.5.3.tar.gz
$ mv apr-1.5.1 apr
$ mv apr-util-1.5.3 apr-util

SUPPLEMENTATION: You can do it in apache 2.4.12, 2.4.16 and 2.4.17

When compile apache-2.4.23 on FreeBSD-10.3, you don't have to use GNU iconv library.
So, just do below. (But, apr libraries are still necessary.)

  $ ./configure --prefix=hogehoge
  $ make
  # make install