google-code-export / serf

Automatically exported from code.google.com/p/serf
Apache License 2.0
1 stars 1 forks source link

[PATCH] autotools build system - rewrite #82

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
[PATCH 0/4] Serf autotool build system
[PATCH 1/4] Serf autotool build system - Remove current files
[PATCH 2/4] Serf autotool build system - Remove current files
[PATCH 3/4] Serf autotool build system - Handle different builddir
[PATCH 4/4] Serf autotool build system - pedantic mode errors

Rewrite autotools build system for serf, without changing sources.

It does not mean that the SCons build system should not be used.
It can be used in parallel.

Autoconf build system has less dependencies, much more compatible
to all kinds of setups, and well integrated into distro package
management.

At start autotools seems very complex, and none flexible, but once
you understand their "spirit", it turns out to be the most flexible
build system available.

This patchset offers the best practices I learned of handling autotools,
so it is very easy to maintain.

I will be happy to work with you in order to finalize it.

This also has the ability to be used to compile Windows binaries,
but let's start with POSIX.

Standard autotools management:

Generate at developer workstation:
$ autoreconf -ivf

Building:
$ ./configure
$ make install

Testing:
$ make check
$ make distcheck

Distributing:
$ make dist

Original issue reported on code.google.com by alon.barlev@gmail.com on 5 Oct 2011 at 4:11

Attachments:

GoogleCodeExporter commented 9 years ago
Patches are against trunk.

Original comment by alon.barlev@gmail.com on 5 Oct 2011 at 4:11

GoogleCodeExporter commented 9 years ago
APR 2 should be supported. (APR-Util has been merged into APR 2. Separate 
APR-Util is needed only when APR 1 is used.)

Setting have_openssl="yes" when apr-util-1.pc has been found seems wrong.

Original comment by Arfrever...@gmail.com on 5 Oct 2011 at 9:26

GoogleCodeExporter commented 9 years ago
> Setting have_openssl="yes" when apr-util-1.pc has been found seems wrong.

Right.
Already found fixed. This should be just empty...

If we go this route I fix whatever needed... Even Gentoo does not have apr-2 
yet :)
Will check.

Original comment by alon.barlev@gmail.com on 5 Oct 2011 at 9:29

GoogleCodeExporter commented 9 years ago
[PATCH 1/1] Fixups for autotools

Original comment by alon.barlev@gmail.com on 5 Oct 2011 at 9:40

Attachments:

GoogleCodeExporter commented 9 years ago
[PATCH] autotools - add windows cross compile support

Add resource file and proper libtool definitions.

The def file enables developers to use the lib utility
and even link using Microsoft compilers.

Tested using i686-w64-mingw32
Also x86_64-w64-mingw32, however there is a problem in apr/aprutil to produce
dlls, solvable.

The attached serf-cross.sh shows the process.

Original comment by alon.barlev@gmail.com on 5 Oct 2011 at 9:59

Attachments:

GoogleCodeExporter commented 9 years ago
> APR 2 should be supported. (APR-Util has been merged into APR 2.
> Separate APR-Util is needed only when APR 1 is used.)

Are you sure it was released?

Original comment by alon.barlev@gmail.com on 5 Oct 2011 at 10:08

GoogleCodeExporter commented 9 years ago
[PATCH] Add SSPI support to build system

We can now compile SSPI using cross compiler for Windows as well.

Original comment by alon.barlev@gmail.com on 5 Oct 2011 at 11:52

Attachments:

GoogleCodeExporter commented 9 years ago
Forgot to mention that you get for free package customization, dependency 
tracking, none-gnu compilers support, none-gnu make support and more.

Original comment by alon.barlev@gmail.com on 7 Oct 2011 at 12:16

GoogleCodeExporter commented 9 years ago
Part of build sanity - test working cross compile.

Attached script passes sanity for:
#CHOST="i686-pc-linux-gnu"
#CHOST="x86_64-pc-linux-gnu"
#CHOST="powerpc-ibm-linux-gnu"
#CHOST="powerpc32-ibm-linux-gnu"
#CHOST="s390-ibm-linux-gnu"
#CHOST="x86_64-w64-mingw32"
#CHOST="i686-w64-mingw32"

Original comment by alon.barlev@gmail.com on 7 Oct 2011 at 12:18

Attachments:

GoogleCodeExporter commented 9 years ago
To ease people to test, attach is the output of "make dist".
Standard ./configure is available within.

If you want to help:

$ ./configure
$ make check

Original comment by alon.barlev@gmail.com on 7 Oct 2011 at 12:20

Attachments:

GoogleCodeExporter commented 9 years ago
aix-6.1 test results.

All passed except test_ssl:

Program received signal SIGABRT, Aborted.
[Switching to Thread 1]
0xd04f24e0 in pthread_kill () from /usr/lib/libpthread.a(shr_xpg5.o)
(gdb) bt
#0  0xd04f24e0 in pthread_kill () from /usr/lib/libpthread.a(shr_xpg5.o)
#1  0xd04f194c in _p_raise () from /usr/lib/libpthread.a(shr_xpg5.o)
#2  0xd013b104 in raise () from /usr/lib/libc.a(shr.o)
#3  0xd01c2c68 in abort () from /usr/lib/libc.a(shr.o)
#4  0xd2987cb4 in mutex_hash (mem=0xf0dee2c8) at atomic/unix/mutex.c:81
#5  0xd29880dc in apr_atomic_xchg32 (mem=0xf0dee2c8, val=1) at 
atomic/unix/mutex.c:167
#6  0xd29c32c4 in init_ssl_libraries () at ssl_buckets.c:803
#7  0xd29c3478 in ssl_init_context () at ssl_buckets.c:1018
#8  0xd29c371c in serf_bucket_ssl_create (ssl_ctx=0x0, allocator=0x202b48a0, 
type=0xf0dee8c0)
    at ssl_buckets.c:1102
#9  0xd29c39e8 in serf_bucket_ssl_decrypt_create (stream=0x202e0a48, 
ssl_ctx=0x0, 
    allocator=0x202b48a0) at ssl_buckets.c:1175
#10 0x1002e72c in test_ssl_init (tc=0x2006ffa8) at test_ssl.c:44
#11 0x1002b284 in CuTestRun (tc=0x2006ffa8) at CuTest.c:171
#12 0x1002bc6c in CuSuiteRun (testSuite=0x20070308) at CuTest.c:317
#13 0x10000790 in main (argc=1, argv=0x2ff22bb4) at test_all.c:90
(gdb) The program is running.  Exit anyway? (y or n) y

Original comment by alon.barlev@gmail.com on 8 Oct 2011 at 6:14

GoogleCodeExporter commented 9 years ago
Forgot to mention: AIX test is using IBM Xlc compiler.

Original comment by alon.barlev@gmail.com on 8 Oct 2011 at 6:32

GoogleCodeExporter commented 9 years ago
solaris-10-sparc + sun studio C compiler - passed

Note: apr links with iconv if available but does not put it in apr-1.pc, this 
is apr bug.

Original comment by alon.barlev@gmail.com on 8 Oct 2011 at 6:57

GoogleCodeExporter commented 9 years ago
[PATCH] Add mising crypto in case of none pkg-config openssl detection

Original comment by alon.barlev@gmail.com on 8 Oct 2011 at 7:01

Attachments:

GoogleCodeExporter commented 9 years ago
Updated serf-cross.sh

Original comment by alon.barlev@gmail.com on 8 Oct 2011 at 7:02

Attachments:

GoogleCodeExporter commented 9 years ago
[PATCH] Windows - Remove redundant lines

Original comment by alon.barlev@gmail.com on 8 Oct 2011 at 7:12

Attachments:

GoogleCodeExporter commented 9 years ago
As this sadly got rejected [1].
At least put all in one message.
If even this raises again, so it will be easier to resume.

I think that 0002, 0003, 0004 need to go to source anyway.
0002 - trivial error.
0003 - separate builddir by parameter of environment is also required for scons.
0004 - libraries should explicit export symbols, not blindly export all, this 
also help producing windows dlls, as you don't need to mess up with symbols.

[1] 
http://groups.google.com/group/serf-dev/browse_thread/thread/7c475c3991dc7eaa

Original comment by alon.barlev@gmail.com on 9 Oct 2011 at 4:58

Attachments:

GoogleCodeExporter commented 9 years ago
I've applied patches #2 and #3. Thanks!

For the export symbols, serf uses build/gen_def.py. That locates all the 
symbols that need to be exported, including the bucket type variables (missed 
in your list). Since the function naming is highly regular, and the style in 
the header files is also very regular, it is quite easy to machine-generate the 
list. Thus, the list will never be out of sync with the code (use of gen_def.py 
should be in dist.sh, but moving to scons, we'll just run the code directly at 
build time). As you noticed with the APU tweaks, trying to do it with source 
code is also a pain in the butt. The generated system is used by serf and svn.

Thanks, Alon!

Original comment by gstein on 9 Oct 2011 at 5:41

GoogleCodeExporter commented 9 years ago
For the exports - I did not miss it, C only DLL in windows should not export 
symbols, I did not think you are using this.

And again, requiring python for build is something I would like to avoid. No 
problem to have a python to generate a file and commit...

Anyway irrelevant now.

Original comment by alon.barlev@gmail.com on 9 Oct 2011 at 6:00