Merge lp:~mordred/libcpuinfo/add-perl-support into lp:libcpuinfo

Proposed by Monty Taylor
Status: Needs review
Proposed branch: lp:~mordred/libcpuinfo/add-perl-support
Merge into: lp:libcpuinfo
Diff against target: None lines
To merge this branch: bzr merge lp:~mordred/libcpuinfo/add-perl-support
Reviewer Review Type Date Requested Status
libcpuinfo developers Pending
Review via email: mp+11395@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Monty Taylor (mordred) wrote :

Adds Perl, Lua and Python3 support. (ignore the branch name. these are not the droids you are looking for)

Unmerged revisions

13. By Monty Taylor

Added python3 swig support macro call.

12. By Monty Taylor

Added Lua support.

11. By Monty Taylor

Added python3 support

10. By Monty Taylor

Added support for Perl.
Use installed version of pandora-build and don't copy the files in.
Rearranged a few things.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== renamed file 'AUTHORS.txt' => 'AUTHORS'
--- AUTHORS.txt 2009-06-14 10:25:20 +0000
+++ AUTHORS 2009-08-23 00:03:39 +0000
@@ -3,3 +3,5 @@
33
4Robert Collins, 20094Robert Collins, 2009
5Matthew Fuller, 20095Matthew Fuller, 2009
6Monty Taylor, 2009
7Stewart Smith, 2009
68
=== added file 'ChangeLog'
=== modified file 'Makefile.am'
--- Makefile.am 2009-07-14 07:51:56 +0000
+++ Makefile.am 2009-08-23 22:30:03 +0000
@@ -5,9 +5,10 @@
5# licence. Please see COPYING.txt distributed with the source code for5# licence. Please see COPYING.txt distributed with the source code for
6# details.6# details.
77
8ACLOCAL_AMFLAGS = -I acinclude -I m48ACLOCAL_AMFLAGS = -I acinclude
9BUILT_SOURCES=9BUILT_SOURCES=
10CLEANFILES=10CLEANFILES=
11DISTCLEANFILES=
11EXTRA_DIST = libcpuinfo.pc.in AUTHORS.txt COPYING.txt INSTALL.txt interface/cpuinfo.i12EXTRA_DIST = libcpuinfo.pc.in AUTHORS.txt COPYING.txt INSTALL.txt interface/cpuinfo.i
1213
13## install libcpuinfo.pc14## install libcpuinfo.pc
@@ -38,41 +39,120 @@
38pyexec_LTLIBRARIES=39pyexec_LTLIBRARIES=
39python_PYTHON=40python_PYTHON=
40if BUILD_PYTHON41if BUILD_PYTHON
41 BUILT_SOURCES += cpuinfo_python.c cpuinfo.py42 BUILT_SOURCES += python/_cpuinfo.c python/cpuinfo.py python/_cpuinfo.so
42 EXTRA_DIST += cpuinfo_python.c cpuinfo.py43 EXTRA_DIST += python/_cpuinfo.c python/cpuinfo.py
43 CLEANFILES += cpuinfo_python.c cpuinfo.py 44 DISTCLEANFILES += python/_cpuinfo.c python/cpuinfo.py
44 pyexec_LTLIBRARIES += pycpuinfo.la45 pyexec_LTLIBRARIES += python/_cpuinfo.la
45 python_PYTHON += cpuinfo.py46 python_PYTHON += python/cpuinfo.py
4647
47 pycpuinfo_la_CPPFLAGS= ${AM_CPPFLAGS} ${PYTHON_CPPFLAGS}48 python__cpuinfo_la_CPPFLAGS= ${AM_CPPFLAGS} ${PYTHON_CPPFLAGS}
48 pycpuinfo_la_CFLAGS=49 python__cpuinfo_la_CFLAGS=
49 pycpuinfo_la_SOURCES= cpuinfo_python.c50 python__cpuinfo_la_SOURCES= python/_cpuinfo.c
50 pycpuinfo_la_LDFLAGS = -avoid-version -module ${PYTHON_LDFLAGS}51 python__cpuinfo_la_LDFLAGS = -avoid-version -module -disable-static ${PYTHON_LDFLAGS}
51 pycpuinfo_la_LIBADD= libcpuinfo.la52 python__cpuinfo_la_LIBADD= libcpuinfo.la
52endif53endif
5354
54cpuinfo.py: cpuinfo_python.c55python/_cpuinfo.so:
5556 @rm -f python/_cpuinfo.so
56cpuinfo_python.c: interface/cpuinfo.i57 @ln -s .libs/_cpuinfo.so python/_cpuinfo.so
57 ${SWIG} -python -O -interface pycpuinfo -o $@ $<58
5859python/cpuinfo.py: python/_cpuinfo.c
60
61python/_cpuinfo.c: interface/cpuinfo.i
62 ${SWIG} -python -O -outdir python -interface _cpuinfo -o $@ $<
63
64python3dir= ${PYTHON3_SITE_PKG}
65python3_LTLIBRARIES=
66python3_DATA=
67if BUILD_PYTHON3
68 BUILT_SOURCES += python3/_cpuinfo.c python3/cpuinfo.py python3/_cpuinfo.so
69 EXTRA_DIST += python3/_cpuinfo.c python3/cpuinfo.py
70 DISTCLEANFILES += python3/_cpuinfo.c python3/cpuinfo.py
71 python3_LTLIBRARIES += python3/_cpuinfo.la
72 python3_DATA += python3/cpuinfo.py
73
74 python3__cpuinfo_la_CPPFLAGS= ${AM_CPPFLAGS} ${PYTHON3_CPPFLAGS}
75 python3__cpuinfo_la_CFLAGS=
76 python3__cpuinfo_la_SOURCES= python3/_cpuinfo.c
77 python3__cpuinfo_la_LDFLAGS = -avoid-version -module -disable-static ${PYTHON3_LDFLAGS}
78 python3__cpuinfo_la_LIBADD= libcpuinfo.la
79endif
80
81python3/_cpuinfo.so:
82 @rm -f python3/_cpuinfo.so
83 @ln -s .libs/_cpuinfo.so python3/_cpuinfo.so
84
85python3/cpuinfo.py: python3/_cpuinfo.c
86
87python3/_cpuinfo.c: interface/cpuinfo.i
88 ${SWIG} -python -py3 -O -outdir python3 -interface _cpuinfo -o $@ $<
89
90luaarchdir=${LUA_ARCHDIR}
91luaarch_LTLIBRARIES=
92if BUILD_LUA
93 BUILT_SOURCES+= lua/cpuinfo.c lua/cpuinfo.so
94 EXTRA_DIST+= lua/cpuinfo.c
95 DISTCLEANFILES+= lua/cpuinfo.c
96 luaarch_LTLIBRARIES+= lua/cpuinfo.la
97
98 lua_cpuinfo_la_SOURCES= lua/cpuinfo.c
99 lua_cpuinfo_la_CFLAGS= ${LUA_CFLAGS}
100 lua_cpuinfo_la_LDFLAGS= -module -avoid-version -disable-static ${LUA_LDFLAGS}
101 lua_cpuinfo_la_LIBADD= libcpuinfo.la
102endif
103
104lua/cpuinfo.so:
105 @rm -f lua/cpuinfo.so
106 @ln -s .libs/cpuinfo.so lua/cpuinfo.so
107
108lua/cpuinfo.c: interface/cpuinfo.i
109 $(SWIG) -lua -o $@ $<
110
111perldir= ${PERL_ARCHDIR}/auto
112perlpmdir= ${PERL_ARCHDIR}
113perl_LTLIBRARIES=
114if BUILD_PERL
115 BUILT_SOURCES += perl/cpuinfo.c perl/cpuinfo.pm perl/cpuinfo.so
116 EXTRA_DIST += perl/cpuinfo.c perl/cpuinfo.pm
117 DISTCLEANFILES += perl/cpuinfo.c perl/cpuinfo.pm
118 perl_LTLIBRARIES += perl/cpuinfo.la
119 perlpm_DATA = perl/cpuinfo.pm
120
121 perl_cpuinfo_la_CPPFLAGS= ${AM_CPPFLAGS} ${PERL_CPPFLAGS}
122 perl_cpuinfo_la_CFLAGS=
123 perl_cpuinfo_la_SOURCES= perl/cpuinfo.c
124 perl_cpuinfo_la_LDFLAGS= -avoid-version -module -disable-static
125 perl_cpuinfo_la_LIBADD= libcpuinfo.la
126endif
127
128# we need to symlink in to the libtool dir for local testing.
129perl/cpuinfo.so:
130 @rm -f perl/cpuinfo.so
131 @ln -s .libs/cpuinfo.so perl/cpuinfo.so
132
133perl/cpuinfo.c: interface/cpuinfo.i
134 ${SWIG} -perl -o $@ $<
59135
60rubydir= ${RUBY_DIR}136rubydir= ${RUBY_DIR}
61ruby_LTLIBRARIES=137ruby_LTLIBRARIES=
62if BUILD_RUBY138if BUILD_RUBY
63 BUILT_SOURCES += cpuinfo_ruby.c139 BUILT_SOURCES += ruby/cpuinfo.c ruby/cpuinfo.so
64 EXTRA_DIST += cpuinfo_ruby.c140 EXTRA_DIST += ruby/cpuinfo.c
65 CLEANFILES += cpuinfo_ruby.c141 DISTCLEANFILES += ruby/cpuinfo.c
66 ruby_LTLIBRARIES += rubycpuinfo.la142 ruby_LTLIBRARIES += ruby/cpuinfo.la
67 143
68 rubycpuinfo_la_CPPFLAGS= ${AM_CPPFLAGS} ${RUBY_INCLUDES}144 ruby_cpuinfo_la_CPPFLAGS= ${AM_CPPFLAGS} ${RUBY_INCLUDES}
69 rubycpuinfo_la_CFLAGS=145 ruby_cpuinfo_la_CFLAGS=
70 rubycpuinfo_la_SOURCES= cpuinfo_ruby.c146 ruby_cpuinfo_la_SOURCES= ruby/cpuinfo.c
71 rubycpuinfo_la_LDFLAGS = -avoid-version -module ${RUBY_LDFLAGS}147 ruby_cpuinfo_la_LDFLAGS = -avoid-version -module ${RUBY_LDFLAGS}
72 rubycpuinfo_la_LIBADD= libcpuinfo.la148 ruby_cpuinfo_la_LIBADD= libcpuinfo.la
73149
74endif150endif
75151
76cpuinfo_ruby.c: interface/cpuinfo.i152ruby/cpuinfo.so:
77 ${SWIG} -ruby -o $@ $<153 @rm -f ruby/cpuinfo.so
154 @ln -s .libs/cpuinfo.so ruby/cpuinfo.so
155
156ruby/cpuinfo.c: interface/cpuinfo.i
157 ${SWIG} -ruby -autorename -o $@ $<
78158
79159
=== modified file 'README'
--- README 2009-07-14 07:53:26 +0000
+++ README 2009-08-23 00:03:39 +0000
@@ -16,10 +16,16 @@
1616
17Various language bindings bring in their own more complex dependencies.17Various language bindings bring in their own more complex dependencies.
1818
19When building from bzr libtool, autoconf, automake, swig and some macros from19To build libcpuinfo from bzr, libtool, autoconf, automake are needed.
20autoconf-archive are needed. These are not needed when building from a release20Additionally, pandora-build and some macros from autoconf-archive are used.
21(a tar or zip file). The relevant development packages for any languages you21pandora-build can be found at http://launchpad.net/pandora-build.
22want to support are also a build-time dependency.22autoconf-archive can be found either at http://www.nongnu.org/autoconf-archive/
23or in OS packages such as the Ubuntu/Debian package autoconf-archive.
24
25These are not needed when building from a release (a tar or zip file).
26
27The relevant development packages for any languages you want to support are
28also a build-time dependency.
2329
24Design Goals30Design Goals
25************31************
2632
=== modified file 'configure.ac'
--- configure.ac 2009-07-14 07:30:23 +0000
+++ configure.ac 2009-08-24 15:41:57 +0000
@@ -15,38 +15,14 @@
15AC_INIT([libcpuinfo], [CPUINFO_VERSION], [libcpuinfo-dev@lists.launchpad.net])15AC_INIT([libcpuinfo], [CPUINFO_VERSION], [libcpuinfo-dev@lists.launchpad.net])
16AC_CONFIG_SRCDIR([cpuinfo/cpuinfo.h])16AC_CONFIG_SRCDIR([cpuinfo/cpuinfo.h])
17AC_CONFIG_AUX_DIR([autotools])17AC_CONFIG_AUX_DIR([autotools])
18
19# We need to prevent canonical target
20# from injecting -O2 into CFLAGS - but we won't modify anything if we have
21# set CFLAGS on the command line, since that should take ultimate precedence
22AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"],
23 [CFLAGS=""])
24AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],
25 [CXXFLAGS=""])
26
27AC_CANONICAL_TARGET
28AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
29AC_CONFIG_MACRO_DIR([acinclude])18AC_CONFIG_MACRO_DIR([acinclude])
3019
20PANDORA_CANONICAL_TARGET(ignore-shared-ptr warnings-always-on)
21
31AC_DEFINE([CPUINFO_MAJOR_VERSION],LIBCPUINFO_MAJOR_VERSION,[Major version])22AC_DEFINE([CPUINFO_MAJOR_VERSION],LIBCPUINFO_MAJOR_VERSION,[Major version])
32AC_DEFINE([CPUINFO_MINOR_VERSION],LIBCPUINFO_MINOR_VERSION,[Minor version])23AC_DEFINE([CPUINFO_MINOR_VERSION],LIBCPUINFO_MINOR_VERSION,[Minor version])
33AC_DEFINE([CPUINFO_MICRO_VERSION],LIBCPUINFO_MICRO_VERSION,[Micro version])24AC_DEFINE([CPUINFO_MICRO_VERSION],LIBCPUINFO_MICRO_VERSION,[Micro version])
3425
35
36AC_PROG_CC_C99
37AM_PROG_CC_C_O
38
39AC_USE_SYSTEM_EXTENSIONS
40
41# We use libtool
42LT_INIT
43LT_LANG(C)
44LT_LANG(C++)
45
46
47AC_PROG_INSTALL
48AC_PROG_LN_S
49
50# Checks for libraries.26# Checks for libraries.
5127
52# Checks for header files.28# Checks for header files.
@@ -54,10 +30,7 @@
54AC_CHECK_HEADERS([sys/sysctl.h])30AC_CHECK_HEADERS([sys/sysctl.h])
5531
56# Checks for typedefs, structures, and compiler characteristics.32# Checks for typedefs, structures, and compiler characteristics.
57AC_C_CONST
58AC_TYPE_PID_T33AC_TYPE_PID_T
59AC_TYPE_SIZE_T
60AC_HEADER_TIME
61AC_STRUCT_TM34AC_STRUCT_TM
6235
63AC_CHECK_SIZEOF(int, 4)36AC_CHECK_SIZEOF(int, 4)
@@ -65,80 +38,17 @@
65AC_CHECK_SIZEOF(long, 4)38AC_CHECK_SIZEOF(long, 4)
6639
67# Checks for library functions.40# Checks for library functions.
68AC_FUNC_MALLOC
69AC_FUNC_REALLOC
70AC_CHECK_FUNCS(sysctlbyname)41AC_CHECK_FUNCS(sysctlbyname)
7142
7243PANDORA_SWIG
73AC_DEFINE([SWIG_TYPE_TABLE],[cpuinfo],[Type Table name for SWIG symbol table])44PANDORA_SWIG_PYTHON3
7445
75AC_PROG_SWIG(1.3.31)46PANDORA_WITH_LUA
76AC_SUBST(SWIG)47PANDORA_WITH_PERL
7748PANDORA_WITH_PYTHON
78WITH_PYTHON49PANDORA_WITH_PYTHON3
79WITH_RUBY50PANDORA_WITH_RUBY
8051
81SWIG="${SWIG} -I\${top_srcdir} -I\${top_builddir}"
82
83
84dnl We need to inject error into the cflags to test if visibility works or not
85save_CFLAGS="${CFLAGS}"
86CFLAGS="${CFLAGS} -Werror"
87gl_VISIBILITY
88CFLAGS="${save_CFLAGS}"
89
90AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
91
92
93AS_IF([test "$GCC" = "yes"],[
94
95 AM_CPPFLAGS="-ggdb3 ${AM_CPPFLAGS}"
96
97 DEBUG_CFLAGS="-O0"
98 DEBUG_CXXFLAGS="-O0"
99
100 OPTIMIZE_CFLAGS="-O3"
101 OPTIMIZE_CXXFLAGS="-O3"
102])
103AS_IF([test "$SUNCC" = "yes"],[
104 AM_CFLAGS="-g -mt -xstrconst -Xa ${AM_CFLAGS}"
105 AM_CXXFLAGS="-mt -compat=5 -library=stlport4 -template=no%extdef ${AM_CXXFLAGS}"
106
107 DEBUG_CXXFLAGS="-g"
108
109 OPTIMIZE_FLAGS="-xO4 -xlibmil -xdepend -xbuiltin"
110 OPTIMIZE_CFLAGS="${OPTIMIZE_FLAGS}"
111 OPTIMIZE_CXXFLAGS="-g0 ${OPTIMIZE_FLAGS}"
112
113])
114
115AC_ARG_WITH([debug],
116 [AS_HELP_STRING([--with-debug],
117 [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
118 [with_debug=$withval],
119 [with_debug=no])
120AS_IF([test "$with_debug" = "yes"],[
121 # Debugging. No optimization.
122 AM_CFLAGS="${AM_CFLAGS} ${DEBUG_CFLAGS} -DDEBUG"
123 AM_CXXFLAGS="${AM_CXXFLAGS} ${DEBUG_CXXFLAGS} -DDEBUG"
124],[
125 # Optimized version. No debug
126 AM_CFLAGS="${AM_CFLAGS} ${OPTIMIZE_CFLAGS}"
127 AM_CXXFLAGS="${AM_CXXFLAGS} ${OPTIMIZE_CXXFLAGS}"
128])
129
130
131ENABLE_64BIT
132
133AC_HEADER_ASSERT
134
135PANDORA_WARNINGS(warnings-always-on)
136
137AM_CFLAGS="${AM_CFLAGS} ${CC_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
138AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
139
140AC_SUBST([AM_CFLAGS])
141AC_SUBST([AM_CXXFLAGS])
14252
143# Output files53# Output files
144AC_CONFIG_HEADERS([config.h])54AC_CONFIG_HEADERS([config.h])
14555
=== modified file 'interface/cpuinfo.i'
--- interface/cpuinfo.i 2009-07-14 07:30:23 +0000
+++ interface/cpuinfo.i 2009-08-23 00:03:39 +0000
@@ -1,6 +1,6 @@
1/*1/*
2 * libcpuinfo: Information about CPU's present on a machine.2 * libcpuinfo: Information about CPU's present on a machine.
3 * Copyright (C) 2009 The libcpuinfo developers.3 * Copyright (C) 2009 Monty Taylor
4 *4 *
5 * This program is open source and copying is licenced under the BSD5 * This program is open source and copying is licenced under the BSD
6 * licence. Please see COPYING.txt distributed with the source code for6 * licence. Please see COPYING.txt distributed with the source code for
77
=== added directory 'lua'
=== removed directory 'm4'
=== removed file 'm4/64bit.m4'
--- m4/64bit.m4 2009-07-14 07:30:23 +0000
+++ m4/64bit.m4 1970-01-01 00:00:00 +0000
@@ -1,47 +0,0 @@
1dnl ---------------------------------------------------------------------------
2dnl Macro: ENABLE_64BIT
3dnl ---------------------------------------------------------------------------
4AC_DEFUN([ENABLE_64BIT],[
5 AC_ARG_ENABLE([64bit],[
6 AS_HELP_STRING([--disable-64bit],
7 [Build 64 bit binary @<:@default=on@:>@])],
8 [ac_enable_64bit="$enableval"],
9 [ac_enable_64bit="yes"])
10
11 AC_CHECK_PROGS(ISAINFO, [isainfo], [no])
12 AS_IF([test "x$ISAINFO" != "xno"],
13 [isainfo_b=`${ISAINFO} -b`],
14 [isainfo_b="x"])
15
16 AS_IF([test "$isainfo_b" != "x"],[
17
18 isainfo_k=`${ISAINFO} -k`
19 DTRACEFLAGS="${DTRACEFLAGS} -${isainfo_k}"
20
21 AS_IF([test "x${ac_cv_env_CPPFLAGS_set}" = "x"],[
22 CPPFLAGS="-I/usr/local ${CPPFLAGS}"
23 ])
24
25 AS_IF([test "x${ac_cv_env_LDFLAGS_set}" = "x"],[
26 LDFLAGS="-L/usr/local/lib/${isainfo_k} ${LDFLAGS}"
27 ])
28
29 AS_IF([test "x$ac_enable_64bit" = "xyes"],[
30 AS_IF([test "x$libdir" = "x\${exec_prefix}/lib"],[
31 dnl The user hasn't overridden the default libdir, so we'll
32 dnl the dir suffix to match solaris 32/64-bit policy
33 libdir="${libdir}/${isainfo_k}"
34 ])
35
36 CPPFLAGS="-m64 ${CPPFLAGS}"
37 LDFLAGS="-m64 ${LDFLAGS}"
38 AS_IF([test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes"],[
39 AM_CFLAGS="-xmemalign=8s ${AM_CFLAGS}"
40 AM_CXXFLAGS="-xmemalign=8s ${AM_CXXFLAGS}"
41 ])
42 ])
43 ])
44])
45dnl ---------------------------------------------------------------------------
46dnl End Macro: ENABLE_64BIT
47dnl ---------------------------------------------------------------------------
480
=== removed file 'm4/pandora_vc_build.m4'
--- m4/pandora_vc_build.m4 2009-07-14 07:30:23 +0000
+++ m4/pandora_vc_build.m4 1970-01-01 00:00:00 +0000
@@ -1,32 +0,0 @@
1dnl Copyright (C) 2009 Sun Microsystems
2dnl This file is free software; Sun Microsystems
3dnl gives unlimited permission to copy and/or distribute it,
4dnl with or without modifications, as long as this notice is preserved.
5
6AC_DEFUN([PANDORA_BUILDING_FROM_VC],[
7
8 ac_cv_building_from_vc=no
9
10 AS_IF([test -d "${srcdir}/.bzr"],[
11 ac_cv_building_from_bzr=yes
12 ac_cv_building_from_vc=yes
13 ],[
14 ac_cv_building_from_bzr=no
15 ])
16
17 AS_IF([test -d "${srcdir}/.svn"],[
18 ac_cv_building_from_svn=yes
19 ac_cv_building_from_vc=yes
20 ],[
21 ac_cv_building_from_svn=no
22 ])
23
24 AS_IF([test -d "${srcdir}/.hg"],[
25 ac_cv_building_from_hg=yes
26 ac_cv_building_from_vc=yes
27 ],[
28 ac_cv_building_from_hg=no
29 ])
30
31])
32
330
=== removed file 'm4/pandora_warnings.m4'
--- m4/pandora_warnings.m4 2009-07-14 07:30:23 +0000
+++ m4/pandora_warnings.m4 1970-01-01 00:00:00 +0000
@@ -1,251 +0,0 @@
1dnl Copyright (C) 2009 Sun Microsystems
2dnl This file is free software; Sun Microsystems
3dnl gives unlimited permission to copy and/or distribute it,
4dnl with or without modifications, as long as this notice is preserved.
5
6dnl AC_PANDORA_WARNINGS([less-warnings|warnings-always-on])
7dnl less-warnings turn on a limited set of warnings
8dnl warnings-always-on always set warnings=error regardless of tarball/vc
9
10dnl @TODO: remove less-warnings option as soon as Drizzle is clean enough to
11dnl allow it
12
13AC_DEFUN([PANDORA_WARNINGS],[
14 m4_define([PW_LESS_WARNINGS],[no])
15 m4_define([PW_WARN_ALWAYS_ON],[no])
16 ifdef([m4_define],,[define([m4_define], defn([define]))])
17 ifdef([m4_undefine],,[define([m4_undefine], defn([undefine]))])
18 m4_foreach([pw_arg],[$*],[
19 m4_case(pw_arg,
20 [less-warnings],[
21 m4_undefine([PW_LESS_WARNINGS])
22 m4_define([PW_LESS_WARNINGS],[yes])
23 ],
24 [warnings-always-on],[
25 m4_undefine([PW_WARN_ALWAYS_ON])
26 m4_define([PW_WARN_ALWAYS_ON],[yes])
27 ])
28 ])
29
30 AC_REQUIRE([PANDORA_BUILDING_FROM_VC])
31 m4_if(PW_WARN_ALWAYS_ON, [yes],
32 [ac_cv_warnings_as_errors=yes],
33 AS_IF([test "$ac_cv_building_from_vc" = "yes"],
34 [ac_cv_warnings_as_errors=yes],
35 [ac_cv_warnings_as_errors=no]))
36
37 AC_ARG_ENABLE([profiling],
38 [AS_HELP_STRING([--enable-profiling],
39 [Toggle profiling @<:@default=off@:>@])],
40 [ac_profiling="$enableval"],
41 [ac_profiling="no"])
42
43 AC_ARG_ENABLE([coverage],
44 [AS_HELP_STRING([--enable-coverage],
45 [Toggle coverage @<:@default=off@:>@])],
46 [ac_coverage="$enableval"],
47 [ac_coverage="no"])
48
49 AS_IF([test "$GCC" = "yes"],[
50
51 AS_IF([test "$ac_profiling" = "yes"],[
52 CC_PROFILING="-pg"
53 save_LIBS="${LIBS}"
54 LIBS=""
55 AC_CHECK_LIB(c_p, read)
56 LIBC_P="${LIBS}"
57 LIBS="${save_LIBS}"
58 AC_SUBST(LIBC_P)
59 ],[
60 CC_PROFILING=" "
61 ])
62
63 AS_IF([test "$ac_coverage" = "yes"],
64 [CC_COVERAGE="-fprofile-arcs -ftest-coverage"])
65
66 AS_IF([test "$ac_cv_warnings_as_errors" = "yes"],
67 [W_FAIL="-Werror"])
68
69 AC_CACHE_CHECK([whether it is safe to use -fdiagnostics-show-option],
70 [ac_cv_safe_to_use_fdiagnostics_show_option_],
71 [save_CFLAGS="$CFLAGS"
72 CFLAGS="-fdiagnostics-show-option ${AM_CFLAGS} ${CFLAGS}"
73 AC_COMPILE_IFELSE(
74 [AC_LANG_PROGRAM([],[])],
75 [ac_cv_safe_to_use_fdiagnostics_show_option_=yes],
76 [ac_cv_safe_to_use_fdiagnostics_show_option_=no])
77 CFLAGS="$save_CFLAGS"])
78
79 AS_IF([test "$ac_cv_safe_to_use_fdiagnostics_show_option_" = "yes"],
80 [
81 F_DIAGNOSTICS_SHOW_OPTION="-fdiagnostics-show-option"
82 ])
83
84 AC_CACHE_CHECK([whether it is safe to use -Wconversion],
85 [ac_cv_safe_to_use_wconversion_],
86 [save_CFLAGS="$CFLAGS"
87 dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
88 dnl conversion warnings to all the tarball folks
89 CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
90 AC_COMPILE_IFELSE(
91 [AC_LANG_PROGRAM([[
92#include <stdbool.h>
93void foo(bool a)
94{
95 (void)a;
96}
97 ]],[[
98foo(0);
99 ]])],
100 [ac_cv_safe_to_use_wconversion_=yes],
101 [ac_cv_safe_to_use_wconversion_=no])
102 CFLAGS="$save_CFLAGS"])
103
104 AS_IF([test "$ac_cv_safe_to_use_wconversion_" = "yes"],
105 [W_CONVERSION="-Wconversion"
106 AC_CACHE_CHECK([whether it is safe to use -Wconversion with htons],
107 [ac_cv_safe_to_use_Wconversion_],
108 [save_CFLAGS="$CFLAGS"
109 dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
110 dnl conversion warnings to all the tarball folks
111 CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
112 AC_COMPILE_IFELSE(
113 [AC_LANG_PROGRAM(
114 [[
115#include <netinet/in.h>
116 ]],[[
117uint16_t x= htons(80);
118 ]])],
119 [ac_cv_safe_to_use_Wconversion_=yes],
120 [ac_cv_safe_to_use_Wconversion_=no])
121 CFLAGS="$save_CFLAGS"])
122
123 AS_IF([test "$ac_cv_safe_to_use_Wconversion_" = "no"],
124 [NO_CONVERSION="-Wno-conversion"])
125 ])
126
127 NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing"
128 NO_SHADOW="-Wno-shadow"
129
130 m4_if(PW_LESS_WARNINGS,[no],[
131 BASE_WARNINGS_FULL="-Wformat=2 ${W_CONVERSION} -Wstrict-aliasing"
132 CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
133 CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
134 ],[
135 BASE_WARNINGS_FULL="-Wformat ${NO_STRICT_ALIASING}"
136 ])
137
138 AS_IF([test "${ac_cv_assert}" = "no"],
139 [NO_UNUSED="-Wno-unused-variable -Wno-unused-parameter"])
140
141 BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wextra -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${CFLAG_VISIBILITY} ${BASE_WARNINGS_FULL}"
142 CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}"
143 CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}"
144
145 AC_CACHE_CHECK([whether it is safe to use -Wmissing-declarations from C++],
146 [ac_cv_safe_to_use_Wmissing_declarations_],
147 [AC_LANG_PUSH(C++)
148 save_CXXFLAGS="$CXXFLAGS"
149 CXXFLAGS="-Werror -pedantic -Wmissing-declarations ${AM_CXXFLAGS}"
150 AC_COMPILE_IFELSE([
151 AC_LANG_PROGRAM(
152 [[
153#include <stdio.h>
154 ]], [[]])
155 ],
156 [ac_cv_safe_to_use_Wmissing_declarations_=yes],
157 [ac_cv_safe_to_use_Wmissing_declarations_=no])
158 CXXFLAGS="$save_CXXFLAGS"
159 AC_LANG_POP()
160 ])
161 AS_IF([test "$ac_cv_safe_to_use_Wmissing_declarations_" = "yes"],
162 [CXX_WARNINGS="${CXX_WARNINGS} -Wmissing-declarations"])
163
164 AC_CACHE_CHECK([whether it is safe to use -Wlogical-op],
165 [ac_cv_safe_to_use_Wlogical_op_],
166 [save_CFLAGS="$CFLAGS"
167 CFLAGS="${W_FAIL} -pedantic -Wlogical-op ${AM_CFLAGS} ${CFLAGS}"
168 AC_COMPILE_IFELSE([
169 AC_LANG_PROGRAM(
170 [[
171#include <stdio.h>
172 ]], [[]])
173 ],
174 [ac_cv_safe_to_use_Wlogical_op_=yes],
175 [ac_cv_safe_to_use_Wlogical_op_=no])
176 CFLAGS="$save_CFLAGS"])
177 AS_IF([test "$ac_cv_safe_to_use_Wlogical_op_" = "yes"],
178 [CC_WARNINGS="${CC_WARNINGS} -Wlogical-op"])
179
180 AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls from C++],
181 [ac_cv_safe_to_use_Wredundant_decls_],
182 [AC_LANG_PUSH(C++)
183 save_CXXFLAGS="${CXXFLAGS}"
184 CXXFLAGS="${W_FAIL} -pedantic -Wredundant-decls ${AM_CXXFLAGS}"
185 AC_COMPILE_IFELSE(
186 [AC_LANG_PROGRAM([
187template <typename E> struct C { void foo(); };
188template <typename E> void C<E>::foo() { }
189template <> void C<int>::foo();
190 AC_INCLUDES_DEFAULT])],
191 [ac_cv_safe_to_use_Wredundant_decls_=yes],
192 [ac_cv_safe_to_use_Wredundant_decls_=no])
193 CXXFLAGS="${save_CXXFLAGS}"
194 AC_LANG_POP()])
195 AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"],
196 [CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"],
197 [CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"])
198
199 NO_REDUNDANT_DECLS="-Wno-redundant-decls"
200 PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow"
201
202 ])
203
204 AS_IF([test "$SUNCC" = "yes"],[
205
206 AS_IF([test "$ac_profiling" = "yes"],
207 [CC_PROFILING="-xinstrument=datarace"])
208
209 AS_IF([test "$ac_cv_warnings_as_errors" = "yes"],
210 [W_FAIL="-errwarn=%all"])
211
212 AC_CACHE_CHECK([whether E_PASTE_RESULT_NOT_TOKEN is usable],
213 [ac_cv_paste_result],
214 [
215 save_CFLAGS="${CFLAGS}"
216 CFLAGS="-errwarn=%all -erroff=E_PASTE_RESULT_NOT_TOKEN ${CFLAGS}"
217 AC_COMPILE_IFELSE(
218 [AC_LANG_PROGRAM([
219 AC_INCLUDES_DEFAULT
220 ],[
221 int x= 0;])],
222 [ac_cv_paste_result=yes],
223 [ac_cv_paste_result=no])
224 CFLAGS="${save_CFLAGS}"
225 ])
226 AS_IF([test $ac_cv_paste_result = yes],
227 [W_PASTE_RESULT=",E_PASTE_RESULT_NOT_TOKEN"])
228
229
230 m4_if(PW_LESS_WARNINGS, [no],[
231 CC_WARNINGS_FULL="-erroff=E_INTEGER_OVERFLOW_DETECTED${W_PASTE_RESULT}"
232 ],[
233 CC_WARNINGS_FULL="-erroff=E_ATTRIBUTE_NOT_VAR"
234 CXX_WARNINGS_FULL="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint"
235 ])
236
237 CC_WARNINGS="-v -errtags=yes ${W_FAIL} ${CC_WARNINGS_FULL}"
238 CXX_WARNINGS="+w +w2 -xwe -xport64 -errtags=yes ${CXX_WARNINGS_FULL} ${W_FAIL}"
239 PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn"
240 NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
241
242 ])
243
244 AC_SUBST(NO_CONVERSION)
245 AC_SUBST(NO_REDUNDANT_DECLS)
246 AC_SUBST(NO_UNREACHED)
247 AC_SUBST(NO_SHADOW)
248 AC_SUBST(NO_STRICT_ALIASING)
249 AC_SUBST(PROTOSKIP_WARNINGS)
250
251])
2520
=== removed file 'm4/with_python.m4'
--- m4/with_python.m4 2009-07-14 07:30:23 +0000
+++ m4/with_python.m4 1970-01-01 00:00:00 +0000
@@ -1,42 +0,0 @@
1dnl Find python developement
2dnl Copyright (C) 2008 Sun Microsystems, Inc.
3dnl
4dnl This program is free software: you can redistribute it and/or modify it
5dnl under the terms of the GNU General Public License as published by the
6dnl Free Software Foundation, either version 3 of the License, or (at your
7dnl option) any later version.
8dnl
9dnl This program is distributed in the hope that it will be useful, but
10dnl WITHOUT ANY WARRANTY; without even the implied warranty of
11dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
12dnl Public License for more details.
13dnl
14dnl You should have received a copy of the GNU General Public License along
15dnl with this program. If not, see <http://www.gnu.org/licenses/>.
16dnl
17dnl As a special exception, the respective Autoconf Macro's copyright owner
18dnl gives unlimited permission to copy, distribute and modify the configure
19dnl scripts that are the output of Autoconf when processing the Macro. You
20dnl need not follow the terms of the GNU General Public License when using
21dnl or distributing such scripts, even though portions of the text of the
22dnl Macro appear in them. The GNU General Public License (GPL) does govern
23dnl all other use of the material that constitutes the Autoconf Macro.
24
25
26AC_DEFUN([WITH_PYTHON], [
27
28 AC_ARG_WITH([python],
29 [AS_HELP_STRING([--with-python],
30 [Build Python Bindings @<:@default=yes@:>@])],
31 [with_python=$withval],
32 [with_python=yes])
33
34 AS_IF([test "x$with_python" != "xno"],[
35 AS_IF([test "x$with_python" != "xyes"],[PYTHON=$with_python])
36 AM_PATH_PYTHON([2.4],,[with_python="no"])
37 AC_PYTHON_DEVEL()
38 AS_IF([test "x$pythonexists" = "xno"],[with_python="no"])
39 ])
40 AM_CONDITIONAL(BUILD_PYTHON, [test "$with_python" = "yes"])
41
42])
430
=== removed file 'm4/with_ruby.m4'
--- m4/with_ruby.m4 2009-07-14 07:30:23 +0000
+++ m4/with_ruby.m4 1970-01-01 00:00:00 +0000
@@ -1,91 +0,0 @@
1dnl Find ruby developemnt
2dnl Copyright (C) 2008 Sun Microsystems, Inc.
3dnl
4dnl This program is free software: you can redistribute it and/or modify it
5dnl under the terms of the GNU General Public License as published by the
6dnl Free Software Foundation, either version 3 of the License, or (at your
7dnl option) any later version.
8dnl
9dnl This program is distributed in the hope that it will be useful, but
10dnl WITHOUT ANY WARRANTY; without even the implied warranty of
11dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
12dnl Public License for more details.
13dnl
14dnl You should have received a copy of the GNU General Public License along
15dnl with this program. If not, see <http://www.gnu.org/licenses/>.
16dnl
17dnl As a special exception, the respective Autoconf Macro's copyright owner
18dnl gives unlimited permission to copy, distribute and modify the configure
19dnl scripts that are the output of Autoconf when processing the Macro. You
20dnl need not follow the terms of the GNU General Public License when using
21dnl or distributing such scripts, even though portions of the text of the
22dnl Macro appear in them. The GNU General Public License (GPL) does govern
23dnl all other use of the material that constitutes the Autoconf Macro.
24
25AC_DEFUN([WITH_RUBY], [
26
27 AC_ARG_WITH([ruby],
28 [AS_HELP_STRING([--with-ruby],
29 [Build Ruby Bindings @<:@default=yes@:>@])],
30 [with_ruby=$withval],
31 [with_ruby=ruby])
32
33 AS_IF([test "x$with_ruby" != "xno"],[
34 AS_IF([test "x$with_ruby" != "xyes"],
35 [ac_chk_ruby=$with_ruby],
36 [ac_chk_ruby=ruby1.8 ruby])
37 AC_CHECK_PROGS(RUBY,$ac_chk_ruby)
38 ])
39
40 AS_IF([test "x$RUBY" != "x"],[
41
42 AC_MSG_CHECKING(for ruby devel)
43
44 dnl need to change quotes to allow square brackets
45 changequote(<<, >>)dnl
46 ruby_prefix=`$RUBY -rrbconfig -e "print Config::CONFIG['archdir']"`
47 strip_ruby_prefix=`$RUBY -rrbconfig -e "print Config::CONFIG['prefix']" | sed 's/\//./g'`
48
49 RUBY_LIB=`$RUBY -rrbconfig -e "puts Config::CONFIG['ruby_install_name']"`
50 LIBRUBYARG_SHARED=`$RUBY -rrbconfig -e "puts Config::CONFIG['LIBRUBYARG_SHARED']"`
51 RUBY_DIR=`$RUBY -rrbconfig -e "puts Config::CONFIG['archdir']"`
52 RUBY_ARCH_DIR=`echo $RUBY_DIR | sed "s/$strip_ruby_prefix//"`
53 RUBY_LIBDIR=`$RUBY -rrbconfig -e "puts Config::CONFIG['rubylibdir']"`
54 RUBY_INCLUDES="-I$ruby_prefix"
55 changequote([, ])dnl
56
57 ac_save_CFLAGS="$CFLAGS"
58 ac_save_CPPFLAGS="$CPPFLAGS"
59 ac_save_LDFLAGS="$LDFLAGS"
60 CFLAGS="$ac_save_CFLAGS $RUBY_INCLUDES"
61 CPPFLAGS="$ac_save_CPPFLAGS $RUBY_INCLUDES"
62 LDFLAGS="$ac_save_LDFLAGS $LIBRUBYARG_SHARED"
63
64 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ruby.h>]], [[VALUE rb_ac_test = rb_define_module("actest");]])],[with_ruby="yes";AC_MSG_RESULT(found)],[with_ruby="no";AC_MSG_RESULT(missing)])
65
66 CPPFLAGS="$ac_save_CPPFLAGS"
67 CFLAGS="$ac_save_CFLAGS"
68 LDFLAGS="$ac_save_LDFLAGS"
69 ],[
70 # This allows 'make clean' in the ruby directory to work when
71 # ruby isn't available
72 RUBY=
73 RUBY_INCLUDES=
74 LIBRUBYARG_SHARED=
75 RUBY_LIB=
76 RUBY_DIR=
77 RUBY_LIBDIR=
78 RUBY_ARCH_DIR=
79 with_ruby="no"
80 ])
81
82 AC_SUBST(RUBY_INCLUDES)
83 AC_SUBST(LIBRUBYARG_SHARED)
84 AC_SUBST(RUBY_LIB)
85 AC_SUBST(RUBY_DIR)
86 AC_SUBST(RUBY_LIBDIR)
87 AC_SUBST(RUBY_ARCH_DIR)
88
89 AS_IF([test "x$RUBY_DIR" = "x"],[with_ruby="no"])
90 AM_CONDITIONAL(BUILD_RUBY, test "$with_ruby" = "yes")
91])
920
=== added directory 'perl'
=== added directory 'python'
=== added directory 'python3'
=== added directory 'ruby'

Subscribers

People subscribed via source and target branches

to all changes: