Merge lp:~trond-norbye/gearmand/configure into lp:gearmand/1.0

Proposed by Trond Norbye
Status: Merged
Merged at revision: not available
Proposed branch: lp:~trond-norbye/gearmand/configure
Merge into: lp:gearmand/1.0
Diff against target: None lines
To merge this branch: bzr merge lp:~trond-norbye/gearmand/configure
Reviewer Review Type Date Requested Status
Gearman-developers Pending
Review via email: mp+7405@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Trond Norbye (trond-norbye) wrote :

Allow a user to build a 32 bit version of Gearman on a 64-bit Solaris system. This is needed so that a build server can provide the packages for a 32 and 64 bit installation of Gearman (in addition there is nothing more annoying than if you want to build a program that requires a certain shared lib, and it is not provided in the memory model that your application use...)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2009-06-11 19:27:28 +0000
3+++ configure.ac 2009-06-13 08:54:34 +0000
4@@ -94,30 +94,15 @@
5 CFLAGS="-ggdb3 -std=gnu99 ${CFLAGS}"
6 DEBUG_CFLAGS="-O0"
7 OPTMIIZE_CFLAGS="-O3"
8-fi
9-if test "$SUNCC" = "yes"
10+elif test "x$SUNCC" = "xyes"
11 then
12- isainfo_k=`isainfo -k`
13- if test "$target_cpu" = "sparc"
14- then
15- MEMALIGN_FLAGS="-xmemalign=8s"
16- IS_64="-m64"
17- LDFLAGS="${LDFLAGS} -L/usr/lib/${isainfo_k} -L/usr/local/lib/${isainfo_k}"
18- else
19- if test "$isainfo_k" = "amd64"
20- then
21- IS_64="-m64"
22- LDFLAGS="${LDFLAGS} -L/usr/lib/${isainfo_k} -L/usr/local/lib/${isainfo_k}"
23- fi
24- fi
25- CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
26-
27- CFLAGS="-g -mt -xc99=all ${IS_64} ${MEMALIGN_FLAGS} ${CFLAGS}"
28- CXXFLAGS="-g -xlang=c99 ${IS_64} ${CXXFLAGS}"
29- DEBUG_CFLAGS="-xO0"
30- OPTIMIZE_CFLAGS="-xO4 -xlibmil -xdepend -Xa -mt -xstrconst"
31+ CFLAGS="-mt -xc99=all -Xa -xstrconst $CFLAGS"
32+ CXXFLAGS="-mt -xlang=c99 $CXXFLAGS"
33+ DEBUG_CFLAGS="-g"
34+ OPTIMIZE_CFLAGS="-xO4 -xdepend"
35 fi
36
37+sinclude(m4/64bit.m4)
38
39 AC_HEADER_TIME
40 AC_CHECK_HEADERS(assert.h errno.h fcntl.h getopt.h netinet/tcp.h pwd.h signal.h)
41@@ -259,7 +244,7 @@
42 CFLAGS="${DEBUG_CFLAGS} -DDEBUG ${CFLAGS}"
43 else
44 # Optimized version. No debug
45- CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS}"
46+ CFLAGS="${OPTIMIZE_CFLAGS} -DNDEBUG ${CFLAGS}"
47 fi
48
49
50@@ -410,7 +395,7 @@
51 echo " * Host CPU: $host_cpu"
52 echo " * C Compiler: $CC_VERSION"
53 echo " * Assertions enabled: $ac_cv_assert"
54-echo " * Debug enabled: $ac_enable_debug"
55+echo " * Debug enabled: $with_debug"
56 echo " * Warnings as failure: $ac_warn_fail"
57 echo ""
58 echo "---"
59
60=== added file 'm4/64bit.m4'
61--- m4/64bit.m4 1970-01-01 00:00:00 +0000
62+++ m4/64bit.m4 2009-06-13 08:54:34 +0000
63@@ -0,0 +1,31 @@
64+dnl ---------------------------------------------------------------------------
65+dnl Macro: 64BIT
66+dnl ---------------------------------------------------------------------------
67+AC_CHECK_PROGS(ISAINFO, [isainfo], [no])
68+if test "x$ISAINFO" != "xno"
69+then
70+ isainfo_b=`isainfo -b`
71+ spro_common_flags="-mt"
72+ if test "x$isainfo_b" = "x64"
73+ then
74+ AC_ARG_ENABLE([64bit],
75+ [AS_HELP_STRING([--disable-64bit],
76+ [Build 64 bit binary @<:@default=on@:>@])],
77+ [ac_enable_64bit="$enableval"],
78+ [ac_enable_64bit="yes"])
79+
80+ if test "x$ac_enable_64bit" = "xyes"
81+ then
82+ CFLAGS="-m64 $CFLAGS"
83+ CXXFLAGS="-m64 $CXXFLAGS"
84+ if test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes"
85+ then
86+ CFLAGS="-xmemalign=8s $CFLAGS"
87+ CXXFLAGS="-xmemalign=8s $CXXFLAGS"
88+ fi
89+ fi
90+ fi
91+fi
92+dnl ---------------------------------------------------------------------------
93+dnl End Macro: 64BIT
94+dnl ---------------------------------------------------------------------------
95
96=== modified file 'm4/lib-prefix.m4'
97--- m4/lib-prefix.m4 2009-01-29 20:00:56 +0000
98+++ m4/lib-prefix.m4 2009-06-13 08:54:34 +0000
99@@ -183,13 +183,18 @@
100 dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
101 dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
102 dnl symlink is missing, so we set acl_libdirstem2 too.
103- AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
104- [AC_EGREP_CPP([sixtyfour bits], [
105-#ifdef _LP64
106-sixtyfour bits
107-#endif
108- ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
109- ])
110+ AC_MSG_CHECKING([if buildling 64-bit app])
111+ AC_RUN_IFELSE([
112+ AC_LANG_PROGRAM([
113+ ], [
114+ return sizeof(void*) == 8 ? 0 : 1;
115+ ])
116+ ], [
117+ gl_cv_solaris_64bit=yes
118+ ], [
119+ gl_cv_solaris_64bit=no
120+ ])
121+ AC_MSG_RESULT([$gl_cv_solaris_64bit])
122 if test $gl_cv_solaris_64bit = yes; then
123 acl_libdirstem=lib/64
124 case "$host_cpu" in

Subscribers

People subscribed via source and target branches