SConstruct:
export env after we've set CC/CXX
ext/libelf/SConscript:
pull in the CC/CXX variables from env. Use gm4 if it exists
ext/libelf/elf_begin.c:
ext/libelf/libelf_allocate.c:
include errno.h instead of sys/errno.h
ext/libelf/elf_common.h:
use the more standard uintX_t
ext/libelf/elf_strptr.c:
ext/libelf/elf_update.c:
include sysmacros.h on Solaris for roundup()
--HG--
extra : convert_revision :
ea1aab834029399c445dfa4c9f78febf2c3d8f0c
env = Environment(ENV = os.environ, # inherit user's environment vars
ROOT = ROOT,
SRCDIR = SRCDIR)
-Export('env')
#Parse CC/CXX early so that we use the correct compiler for
# to test for dependencies/versions/libraries/includes
if ARGUMENTS.get('CXX', None):
env['CXX'] = ARGUMENTS.get('CXX')
+Export('env')
+
env.SConsignFile(joinpath(build_root,"sconsign"))
# Default duplicate option is to use hard links, but this messes up
#
# Authors: Nathan Binkert
-import os
+import os, subprocess
Import('env')
ElfFile('libelf_msize.c')
m4env = Environment(ENV=os.environ)
+if env.get('CC'):
+ m4env['CC'] = env['CC']
+if env.get('CXX'):
+ m4env['CXX'] = env['CXX']
+# If we have gm4 use it
+if subprocess.Popen("gm4 --version", shell=True, stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT, close_fds=True).communicate()[0].find('GNU') >= 0:
+ m4env['M4'] = 'gm4'
+
m4env.Append(M4FLAGS='-DSRCDIR=%s' % Dir('.').path)
m4env['M4COM'] = '$M4 $M4FLAGS $SOURCES > $TARGET'
m4env.M4(target=File('libelf_convert.c'),
env.Append(CPPPATH=Dir('.'))
env.Append(LIBS=['elf'])
env.Append(LIBPATH=[Dir('.')])
+
#include <sys/types.h>
-#include <sys/errno.h>
+#include <errno.h>
#include <sys/mman.h>
#include <sys/stat.h>
*/
typedef struct {
- u_int32_t n_namesz; /* Length of name. */
- u_int32_t n_descsz; /* Length of descriptor. */
- u_int32_t n_type; /* Type of this note. */
+ uint32_t n_namesz; /* Length of name. */
+ uint32_t n_descsz; /* Length of descriptor. */
+ uint32_t n_type; /* Type of this note. */
} Elf_Note;
/* Indexes into the e_ident array. Keep synced with
#include <sys/param.h>
+#ifdef __sun
+#include <sys/sysmacros.h>
+#endif
#include <assert.h>
#include "gelf.h"
#include <sys/mman.h>
#include <sys/param.h>
+#ifdef __sun
+#include <sys/sysmacros.h>
+#endif
#include <assert.h>
#include <errno.h>
* Internal APIs
*/
-#include <sys/errno.h>
+#include <errno.h>
#include <assert.h>
#include "libelf.h"