[Box Backup] Adding -lpcre to configure fixes cross-compiling R2461 with i586-mingw32msvc under Ubuntu Hardy

Achim boxbackup@boxbackup.org
Sun, 22 Mar 2009 02:39:05 +0100


Good evening:

I am very happy to report that after researching the regex problem 
mentioned before:

> [LINK]    ../../release/bin/bbackupd/bbackupd.exe
> ../../release/lib/common/common.a(ExcludeList.o): In function
> `~ExcludeList': /usr/src/boxi/trunk/lib/common/ExcludeList.cpp:60:
> undefined reference to `_regfree'
> /usr/src/boxi/trunk/lib/common/ExcludeList.cpp:60: undefined
> reference to `_regfree'
> ../../release/lib/common/common.a(ExcludeList.o):/usr/src/boxi/trunk/lib/common/ExcludeList.cpp:325:
> undefined reference to `_regfree'
> ../../release/lib/common/common.a(ExcludeList.o):/usr/src/boxi/trunk/lib/common/ExcludeList.cpp:375:
> undefined reference to `_regcomp'
> ../../release/lib/common/common.a(ExcludeList.o):/usr/src/boxi/trunk/lib/common/ExcludeList.cpp:198:
> undefined reference to `_regcomp'
> ../../release/lib/common/common.a(ExcludeList.o):/usr/src/boxi/trunk/lib/common/ExcludeList.cpp:203:
> undefined reference to `_regerror'
> ../../release/lib/common/common.a(ExcludeList.o):/usr/src/boxi/trunk/lib/common/ExcludeList.cpp:266:
> undefined reference to `_regexec' collect2: ld returned 1 exit
> status make[1]: *** [../../release/bin/bbackupd/bbackupd.exe] Error
> 1 make[1]: Leaving directory `/usr/src/boxi/trunk/bin/bbackupd' make:
> *** [release/bin/bbackupd/bbackupd.exe] Error 2

I found out that adding -lpcre to the LIBS (before "-lcrypto -lws2_32 
-lgdi32") in the configure command solves the issue and everything 
builds cleanly for trunk R2461

$ rm -r trunk

$ svn co https://www.boxbackup.org/svn/box/trunk/

$ cd trunk

[update path to /usr/local/i586-mingw32msvc/bin/mingwm10.dll in parcels.txt]

$ ./bootstrap
/usr/share/aclocal/libmcrypt.m4:17: warning: underquoted definition of 
AM_PATH_LIBMCRYPT
/usr/share/aclocal/libmcrypt.m4:17:   run info '(automake)Extending aclocal'
/usr/share/aclocal/libmcrypt.m4:17:   or see 
http://sources.redhat.com/automake/automake.html#Extending-aclocal

$ ./configure --host=i586-mingw32msvc \
	CXXFLAGS="-mthreads -I/usr/local/i586-mingw32msvc/include" \
	LDFLAGS=" -mthreads -L/usr/local/i586-mingw32msvc/lib" \
	LIBS="-lpcre -lcrypto -lws2_32 -lgdi32"
[..]
Regular expressions: yes
Large files:         no
Berkeley DB:         no
Readline:            no
Extended attributes: no

$ make
[..]
make[1]: Leaving directory `/usr/src/boxi/trunk/docs'
mkdir -p parcels/boxbackup-trunk_2461M-backup-server-mingw32msvc
cp -p docs/man/raidfile.conf.5.gz 
parcels/boxbackup-trunk_2461M-backup-server-mingw32msvc
test -d parcels/boxbackup-trunk_2461M-backup-server-mingw32msvc || mkdir 
parcels/boxbackup-trunk_2461M-backup-server-mingw32msvc
(cd parcels; tar cf - boxbackup-trunk_2461M-backup-server-mingw32msvc | 
gzip -9 - > boxbackup-trunk_2461M-backup-server-mingw32msvc.tgz )

:-)

$ ls -l parcels
total 11272
drwxr-sr-x 2 root src    4096 2009-03-22 02:17 
boxbackup-trunk_2461M-backup-client-mingw32msvc
-rw-r--r-- 1 root src 6458992 2009-03-22 02:17 
boxbackup-trunk_2461M-backup-client-mingw32msvc.tgz
drwxr-sr-x 2 root src    4096 2009-03-22 02:27 
boxbackup-trunk_2461M-backup-server-mingw32msvc
-rw-r--r-- 1 root src 5043992 2009-03-22 02:27 
boxbackup-trunk_2461M-backup-server-mingw32msvc.tgz
drwxr-sr-x 2 root src    4096 2009-03-22 02:09 scripts


$ make test
fails (of course), even after copying 
/usr/local/i586-mingw32msvc/bin/mingwm10.dll into 
/root/.wine/drive_c/windows/system32/ but I will try to compile and run 
the tests later on a native Windows machine as well:

common: fixme:advapi:DeregisterEventSource (0xcafe4242) stub
crypto: fixme:advapi:DeregisterEventSource (0xcafe4242) stub
compress: fixme:advapi:DeregisterEventSource (0xcafe4242) stub
raidfile: fixme:advapi:DeregisterEventSource (0xcafe4242) stub
basicserver: fixme:advapi:DeregisterEventSource (0xcafe4242) stub
backupstore: make failed
backupstorefix:   kill -l signal            Convert between signal 
numbers and names.
backupstorepatch:   9 0x60028a27 wine_switch_to_stack+0x17() in 
libwine.so.1 (0x00000000)
backupdiff: wine: Call from 0x43e391 to unimplemented function 
msvcrt.dll._gmtime64, aborting
bbackupd: fixme:advapi:DeregisterEventSource (0xcafe4242) stub
httpserver: make failed