# Would you please add fastcgi++, Wt, jwsmtp, CppCMS & DbiXX, SOCI to FreeBSD Ports??



## NuLL3rr0r (Mar 27, 2010)

Hi Folks,


I'm a web-developer and for now I became a fan of web-developing in C++. Since I have difficulties building some of these packages on Freebsd, I was thought to send a request to FreeBSD community for adding these really nice tools to Ports tree.

http://www.nongnu.org/fastcgipp/
http://www.webtoolkit.eu/wt
http://mumbleface.net/jwsmtp
http://cppcms.sourceforge.net/wikipp/en/page/main
http://soci.sourceforge.net/


After fighting for hours and hours and figuring out so many things, I was successfully built some of 'em.

It's really appreciated to see these packages in Rock-Solid Server OS: FreeBSD.





*** Wt ***

This one kills me until built successfully:

There's a wiki on the official website for FreeBSD, But you know.....
Forget about it!! it's just good to start.

http://redmine.webtoolkit.eu/wiki/wt/Installing_Wt_on_FreeBSD



tar xzf wt-3.1.0a.tar.gz
cd wt-3.1.0 && mkdir build && cd build



For single-thread:

```
cmake -DBOOST_DIR=/usr/local -DCONNECTOR_FCGI=ON -DCONNECTOR_HTTP=OFF -DWEBUSER=www -DWEBGROUP=www ../
```



For multi-thread:

   Around line 223-229 of *../cmake/WtFindBoost-vintage.txt*

Change

```
SET(BOOST_WT_LIBRARIES
        ${BOOST_THREAD_LIB}
        ${BOOST_REGEX_LIB}
        ${BOOST_SIGNALS_LIB}
        ${BOOST_SYSTEM_LIB}
        ${BOOST_PO_LIB}
        ${BOOST_DT_LIB})
```
To

```
SET(BOOST_WT_LIBRARIES
        ${BOOST_THREAD_LIB_MT}
        ${BOOST_REGEX_LIB_MT}
        ${BOOST_SIGNALS_LIB_MT}
        ${BOOST_SYSTEM_LIB_MT}
        ${BOOST_PO_LIB_MT}
        ${BOOST_DT_LIB_MT} -pthread)
```

Also change

```
SET(OTHER_LIBS "-lpthread")
```
To

```
SET(OTHER_LIBS "-pthread")
```

That really helps: https://forums.freebsd.org/showthread.php?p=34403


Repeat that for: *../cmake/WtFindBoost-cmake.txt*




```
cmake -DBOOST_DIR=/usr/local -DBOOST_FS_LIB_MT=/usr/local/lib/libboost_filesystem.so 
-DBOOST_THREAD_LIB_MT=/usr/local/lib/libboost_thread.so 
-DBOOST_REGEX_LIB_MT=/usr/local/lib/libboost_regex.so 
-DBOOST_SIGNALS_LIB_MT=/usr/local/lib/libboost_signals.so 
-DBOOST_SYSTEM_LIB_MT=/usr/local/lib/libboost_system.so 
-DBOOST_PO_LIB_MT=/usr/local/lib/libboost_program_options.so 
-DBOOST_DT_LIB_MT=/usr/local/lib/libboost_date_time.so 
-DCONNECTOR_FCGI=ON -DCONNECTOR_HTTP=OFF -DWEBUSER=www -DWEBGROUP=www ../
```


In *CMakeCache.txt*
for each *BOOST_*_LIB_MT* replace
*:UNINITIALIZED=* with *:FILEPATH=*


In some stage everything stops and you got this error:


```
Linking CXX shared library libwtdbosqlite3.so
/usr/bin/ld: cannot find -ldl
*** Error code 1

Stop in /root/wt-3.1.0/build.
*** Error code 1

Stop in /root/wt-3.1.0/build.
*** Error code 1

Stop in /root/wt-3.1.0/build.


/usr/bin/ld: cannot find -ldl
```


Or something like this for gcc44 insted of /usr/bin/ld: cannot find -ldl

```
/usr/local/lib/gcc44/gcc/i386-portbld-freebsd8.0/4.4.4/../../../../../i386-portbld-freebsd8.0/bin/ld: cannot find -ldl
```

Note that I used gcc44 instead of 4.2.1 that ships with standard FreeBSD Installation, this way:

```
cd /usr/local/bin
ln -s g++44 g++
ln -s gcc44 gcc
ln -s c++44 c++
ln -s cpp44 cpp
setenv PATH "/usr/local/bin:$PATH"
```


Hit

```
find .. | xargs grep 'ldl'
```

Remove -ldl from

```
./src/Wt/Dbo/backend/CMakeFiles/wtdbosqlite3.dir/link.txt
./test/CMakeFiles/test.dir/link.txt
./examples/wt-homepage/CMakeFiles/Home.wt.dir/link.txt
./examples/blog/CMakeFiles/blog.wt.dir/link.txt
```



```
make && make install
```


The wiki says:

```
ln -s /usr/local/lib/libwt.so /usr/lib
ln -s /usr/local/lib/libwtfcgi.so /usr/lib
```

But its worked fine, and I never did that.





*** fastcgi++ ***
http://www.nongnu.org/fastcgipp/doc/1.2/

The documentation says:

```
tar -xvjf fastcgi++-1.2.tar.bz2
cd fastcgi++-1.2
make
make install
```


But when you hit make:

```
"Makefile", line 1: Need an operator
"Makefile", line 3: Need an operator
"Makefile", line 5: Need an operator
"Makefile", line 6: warning: duplicate script for target "ifndef" ignored
"Makefile", line 7: Need an operator
"Makefile", line 9: Need an operator
"Makefile", line 11: Need an operator
"Makefile", line 13: Need an operator
"Makefile", line 14: warning: duplicate script for target "ifdef" ignored
"Makefile", line 15: Need an operator
"Makefile", line 17: Need an operator
"Makefile", line 82: Missing dependency operator
"Makefile", line 84: Need an operator
"Makefile", line 88: Missing dependency operator
"Makefile", line 89: warning: duplicate script for target "ifeq" ignored
"Makefile", line 89: warning: duplicate script for target "(,true)" ignored
"Makefile", line 90: Need an operator
"Makefile", line 94: Missing dependency operator
"Makefile", line 95: warning: duplicate script for target "ifeq" ignored
"Makefile", line 95: warning: duplicate script for target "(,true)" ignored
"Makefile", line 96: Need an operator
"Makefile", line 100: Missing dependency operator
"Makefile", line 101: warning: duplicate script for target "ifeq" ignored
"Makefile", line 101: warning: duplicate script for target "(,true)" ignored
"Makefile", line 102: Need an operator
"Makefile", line 113: Missing dependency operator
"Makefile", line 114: warning: duplicate script for target "ifeq" ignored
"Makefile", line 114: warning: duplicate script for target "(,true)" ignored
"Makefile", line 115: Need an operator
"Makefile", line 119: Missing dependency operator
"Makefile", line 120: warning: duplicate script for target "ifeq" ignored
"Makefile", line 120: warning: duplicate script for target "(,true)" ignored
"Makefile", line 121: Need an operator
make: fatal errors encountered -- cannot continue
```

After some hours I figured out you must use gmake instead of make.

And in short time after hitting gmake this error appears on the output:

```
In file included from include/fastcgi++/exceptions.hpp:28,
                 from include/fastcgi++/http.hpp:35,
                 from lib/src/http.cpp:24:
include/fastcgi++/protocol.hpp:27:20: error: endian.h: No such file or directory
gmake: *** [lib/http-static.o] Error 1
```

And after sometime I noticed that you must edit "include/fastcgi++/protocol.hpp"

```
#include <endian.h>
```
to

```
#include <sys/endian.h>
```

Continue the installation process;
Now everything just works fine.



*** jwsmtp ***
http://mumbleface.net/jwsmtp

make stops with an error like this:

```
mailer.cpp: In member function 'void jwsmtp::mailer::operator()()':
mailer.cpp:438: error: 'strcpy' was not declared in this scope
mailer.cpp: In member function 'std::vector<char, std::allocator<char> > jwsmtp::mailer::makesmtpmessage() const':
mailer.cpp:733: warning: deprecated conversion from string constant to 'char*'
*** Error code 1

Stop in /root/jwsmtp-1.32.15/jwsmtp/jwsmtp.
*** Error code 1

Stop in /root/jwsmtp-1.32.15/jwsmtp.
*** Error code 1

Stop in /root/jwsmtp-1.32.15.
*** Error code 1

Stop in /root/jwsmtp-1.32.15.
```


You must add

```
#include <cstring>
```
at the top or near the top of the mailer.h header: "jwsmtp/jwsmtp/mailer.h".
http://sourceforge.net/projects/jwsmtp/forums/forum/167802/topic/2190151



Still didn't have enough time to work on CppCMS & DbiXX and SOCI.


----------



## bertwiley (Jun 5, 2010)

*I 2nd this port request*

I also spent alot of time getting wt and soci working under freebsd 7 and it was tough but worth it. Now i have to do it again since ive made a new system on freebsd 8. I thought it would be in by now, but I still dont see it. If no one can do this im willing to give it a shot. Ive built custom ports on freebsd 5.5 so it wouldnt be to tough.


----------



## graudeejs (Jun 5, 2010)

why won't you port it yourself?
http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/

people who usually port something are interested in using it


----------



## PhenomII (Jun 8, 2010)

Greetings,
@NuLL3rr0r
I'd be willing to take on WT. I've already got a few ports sitting on the shelf, that are finished. But I haven't submitted them yet. I should be able to get WT completed within a 'couple hrs.
Be aware; There is a schedule regarding the availability of ports. They don't immediatly show up on the downloadable CD/DVD distributions of FreeBSD. In fact, they won't show up until the next release, and then, only on the next release CD/DVD. This also assumes that it was submitted early enough prior to that release. Also, it will take some time before any submitted/accepted port gets propagated to any/all of the FreeBSD mirrors.
Please take no offense, if you already figured on this. I just felt I should mention these details, just in case. 

Best wishes.


----------



## NuLL3rr0r (Jun 24, 2010)

@killasmurf86


> why won't you port it yourself?
> http://www.freebsd.org/doc/en_US.ISO...ters-handbook/
> 
> people who usually port something are interested in using it



Once upon a time I played a little bit with Gentoo ebuilds.
Still didn't have time to work on FreeBSD Ports. But I'd love and I've too.
(I'm playing with CMake now.)
tnx for the link It's an excellent starting point.


@bertwiley


> I also spent alot of time getting wt and soci working under freebsd 7 and it was tough but worth it. Now i have to do it again since ive made a new system on freebsd 8. I thought it would be in by now, but I still dont see it. If no one can do this im willing to give it a shot. Ive built custom ports on freebsd 5.5 so it wouldnt be to tough.



@PhenomII


> Greetings,
> @NuLL3rr0r
> I'd be willing to take on WT. I've already got a few ports sitting on the shelf, that are finished. But I haven't submitted them yet. I should be able to get WT completed within a 'couple hrs.
> Be aware; There is a schedule regarding the availability of ports. They don't immediatly show up on the downloadable CD/DVD distributions of FreeBSD. In fact, they won't show up until the next release, and then, only on the next release CD/DVD. This also assumes that it was submitted early enough prior to that release. Also, it will take some time before any submitted/accepted port gets propagated to any/all of the FreeBSD mirrors.
> ...




Thank you so much guys. I'll be appreciated for your efforts to port Wt and SOCI.


----------



## NuLL3rr0r (Aug 14, 2010)

Found something about Wt, and just want to share:


```
Hit
Code:
find .. | xargs grep 'ldl'
Remove -ldl from
Code:
./src/Wt/Dbo/backend/CMakeFiles/wtdbosqlite3.dir/link.txt
./test/CMakeFiles/test.dir/link.txt
./examples/wt-homepage/CMakeFiles/Home.wt.dir/link.txt
./examples/blog/CMakeFiles/blog.wt.dir/link.txt
```


It's not needed anymore. Instead of editing above files, in build directory before hitting:


```
cmake -DBOOST_DIR=/usr/local -DBOOST_FS_LIB_MT=/usr/local/lib/libboost_filesystem.so 
-DBOOST_THREAD_LIB_MT=/usr/local/lib/libboost_thread.so 
-DBOOST_REGEX_LIB_MT=/usr/local/lib/libboost_regex.so 
-DBOOST_SIGNALS_LIB_MT=/usr/local/lib/libboost_signals.so 
-DBOOST_SYSTEM_LIB_MT=/usr/local/lib/libboost_system.so 
-DBOOST_PO_LIB_MT=/usr/local/lib/libboost_program_options.so 
-DBOOST_DT_LIB_MT=/usr/local/lib/libboost_date_time.so 
-DCONNECTOR_FCGI=ON -DCONNECTOR_HTTP=OFF -DWEBUSER=www -DWEBGROUP=www ../
```

Make these changes to ../src/Wt/Dbo/backend/CMakeLists.txt


```
# Comment or remove these lines 
IF(NOT WIN32)
TARGET_LINK_LIBRARIES(wtdbosqlite3 dl)
ENDIF(NOT WIN32)

# Now it looks like
#IF(NOT WIN32)
#TARGET_LINK_LIBRARIES(wtdbosqlite3 dl)
#ENDIF(NOT WIN32)
```

** wt compile error under FreeBSD with sqlite


----------

