more buildsys tinkering -- default compiler args, unicode escapes, swab() detection, setting autoconf language to c++ early on
This commit is contained in:
parent
7eac9533b8
commit
7fa7d01f7c
|
@ -218,7 +218,6 @@ CC = @CC@
|
|||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CORE_CRYPT_O = @CORE_CRYPT_O@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
|
|
22
config.h.in
22
config.h.in
|
@ -39,6 +39,9 @@
|
|||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
|
||||
#undef HAVE_FSEEKO
|
||||
|
||||
/* Uses the GNU gcc compiler */
|
||||
#undef HAVE_GCC
|
||||
|
||||
|
@ -54,6 +57,9 @@
|
|||
/* Uses the gxlc++ compiler */
|
||||
#undef HAVE_IBM_GXLC
|
||||
|
||||
/* Uses the IBM XL C++ compiler */
|
||||
#undef HAVE_IBM_XLC
|
||||
|
||||
/* Define to 1 if you have the <iconv.h> header file. */
|
||||
#undef HAVE_ICONV_H
|
||||
|
||||
|
@ -180,7 +186,7 @@
|
|||
/* Is a unix type platform */
|
||||
#undef IS_UNIX
|
||||
|
||||
/* don't generate debuging code */
|
||||
/* Compile without debug code */
|
||||
#undef NDEBUG
|
||||
|
||||
/* Name of package */
|
||||
|
@ -252,6 +258,20 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
/* Enable large inode numbers on Mac OS X 10.5. */
|
||||
#ifndef _DARWIN_USE_64_BIT_INODE
|
||||
# define _DARWIN_USE_64_BIT_INODE 1
|
||||
#endif
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
#undef _FILE_OFFSET_BITS
|
||||
|
||||
/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
|
||||
#undef _LARGEFILE_SOURCE
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
#undef _LARGE_FILES
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
|
||||
|
|
48
configure.ac
48
configure.ac
|
@ -11,8 +11,11 @@ AM_CONFIG_HEADER(config.h)
|
|||
AC_COPYRIGHT([The developer of the original code and/or files is Tripwire, Inc. Portions created by Tripwire, Inc. are copyright 2000-2019 Tripwire, Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights reserved.])
|
||||
AC_REVISION([$Revision: 2.4.3.8 $])
|
||||
|
||||
dnl AC_LANG_CPLUSPLUS wants to set CXXFLAGS to include '-g -O2', but we probably don't want to
|
||||
dnl include debug symbols by default, so save off the previous value & restore it afterward
|
||||
tmp_cxxflags=${CXXFLAGS}
|
||||
AC_LANG_CPLUSPLUS
|
||||
|
||||
CXXFLAGS=${tmp_cxxflags}
|
||||
|
||||
dnl ###################
|
||||
dnl Checks for programs
|
||||
|
@ -38,8 +41,8 @@ dnl #########################################
|
|||
if test "x${GXX}" != "x"; then
|
||||
AC_DEFINE(HAVE_GCC, 1, [Uses the GNU gcc compiler])
|
||||
|
||||
CFLAGS=${CFLAGS:-"-O -pipe -Wall"}
|
||||
CXXFLAGS=${CXXFLAGS:-"-O -pipe -Wall"}
|
||||
CFLAGS=${CFLAGS:-"-O -pipe"}
|
||||
CXXFLAGS=${CXXFLAGS:-"-O -pipe"}
|
||||
else
|
||||
AC_DEFINE(HAVE_GCC, 0, [Uses the GNU gcc compiler])
|
||||
fi
|
||||
|
@ -47,30 +50,32 @@ fi
|
|||
if test "x${CXX}" = "xclang++"; then
|
||||
AC_DEFINE(HAVE_CLANG, 1, [Uses the Clang compiler])
|
||||
|
||||
CFLAGS=${CFLAGS:-"-O -pipe -Wall"}
|
||||
CXXFLAGS=${CXXFLAGS:-"-O -pipe -Wall"}
|
||||
CFLAGS=${CFLAGS:-"-O -pipe"}
|
||||
CXXFLAGS=${CXXFLAGS:-"-O -pipe"}
|
||||
else
|
||||
AC_DEFINE(HAVE_CLANG, 0, [Uses the Clang compiler])
|
||||
fi
|
||||
|
||||
if test "x${CXX}" = "xgxlc++"; then
|
||||
AC_DEFINE(HAVE_IBM_GXLC, 1, [Uses the gxlc++ compiler])
|
||||
|
||||
CFLAGS=${CFLAGS:-"-O -pipe"}
|
||||
CXXFLAGS=${CXXFLAGS:-"-O -pipe"}
|
||||
else
|
||||
AC_DEFINE(HAVE_IBM_GXLC, 0, [Uses the gxlc++ compiler])
|
||||
fi
|
||||
|
||||
if test "x${CXX}" = "xxlc++_r"; then
|
||||
AC_DEFINE(HAVE_CLANG, 1, [Uses the IBM XL C++ compiler])
|
||||
AC_DEFINE(HAVE_IBM_XLC, 1, [Uses the IBM XL C++ compiler])
|
||||
|
||||
CFLAGS=${CFLAGS:-"-O -maix64 -Wx,-qinfo=all" }
|
||||
CXXFLAGS=${CXXFLAGS:-"-O -maix64 -Wx,-qinfo=all"}
|
||||
else
|
||||
AC_DEFINE(HAVE_CLANG, 0, [Uses the IBM XL C++ compiler])
|
||||
AC_DEFINE(HAVE_IBM_XLC, 0, [Uses the IBM XL C++ compiler])
|
||||
fi
|
||||
|
||||
|
||||
dnl *** TODO these compilers need work on default args ****
|
||||
|
||||
if test "x${CXX}" = "xgxlc++"; then
|
||||
AC_DEFINE(HAVE_IBM_GXLC, 1, [Uses the gxlc++ compiler])
|
||||
else
|
||||
AC_DEFINE(HAVE_IBM_GXLC, 0, [Uses the gxlc++ compiler])
|
||||
fi
|
||||
|
||||
if test "x${CXX}" = "xsunCC"; then
|
||||
AC_DEFINE(HAVE_ORACLE_SUNCC, 1, [Uses the sunCC compiler])
|
||||
else
|
||||
|
@ -96,12 +101,12 @@ dnl Configuration options
|
|||
dnl #####################
|
||||
|
||||
# This is primarily to support old compilers that don’t understand -Wextra
|
||||
AC_ARG_ENABLE(extrawarnings, [ —-disable-extrawarnings do not compile with -Wextra warnings enabled])
|
||||
if test "x$enable_extrawarnings" != "xno"
|
||||
then
|
||||
CFLAGS="${CFLAGS} -Wextra -Wno-unused-parameter"
|
||||
CXXFLAGS="${CXXFLAGS} -Wextra -Wno-unused-parameter"
|
||||
fi
|
||||
#AC_ARG_ENABLE(extrawarnings, [ —-disable-extrawarnings do not compile with -Wextra warnings enabled])
|
||||
#if test "x$enable_extrawarnings" != "xno"
|
||||
#then
|
||||
# CFLAGS="${CFLAGS} -Wextra -Wno-unused-parameter"
|
||||
# CXXFLAGS="${CXXFLAGS} -Wextra -Wno-unused-parameter"
|
||||
#fi
|
||||
|
||||
AC_ARG_ENABLE(static, [ --enable-static compile static binaries])
|
||||
if test "x$enable_static" = xyes
|
||||
|
@ -153,6 +158,9 @@ AC_ARG_WITH(stlport-dir,
|
|||
CFLAGS="${CFLAGS} ${stlport_paths}"
|
||||
CXXFLAGS="${CXXFLAGS} ${stlport_paths}"
|
||||
LDFLAGS="${LDFLAGS} ${stlport_lib} -lstlport_gcc"
|
||||
# Append lib dir to LD_LIBRARY_PATH (or set LD_LIBRARY_PATH if unset)
|
||||
# This is mostly for the benefit of configure-time test programs.
|
||||
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+:LD_LIBRARY_PATH}${stlport_lib}
|
||||
fi
|
||||
]
|
||||
)
|
||||
|
|
|
@ -195,7 +195,6 @@ CC = @CC@
|
|||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CORE_CRYPT_O = @CORE_CRYPT_O@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
|
|
|
@ -167,7 +167,6 @@ CC = @CC@
|
|||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CORE_CRYPT_O = @CORE_CRYPT_O@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
|
|
|
@ -167,7 +167,6 @@ CC = @CC@
|
|||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CORE_CRYPT_O = @CORE_CRYPT_O@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
|
|
|
@ -167,7 +167,6 @@ CC = @CC@
|
|||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CORE_CRYPT_O = @CORE_CRYPT_O@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
|
|
|
@ -193,7 +193,6 @@ CC = @CC@
|
|||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CORE_CRYPT_O = @CORE_CRYPT_O@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
|
|
|
@ -224,7 +224,6 @@ CC = @CC@
|
|||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CORE_CRYPT_O = @CORE_CRYPT_O@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
|
|
|
@ -284,6 +284,15 @@ bool cFile::IsOpen(void) const
|
|||
return (mpData->mpCurrStream != NULL);
|
||||
}
|
||||
|
||||
// Autoconf docs say HAVE_FSEEKO applies to both fseeko & ftello
|
||||
#if HAVE_FSEEKO
|
||||
#define tss_fseek fseeko
|
||||
#define tss_ftell ftello
|
||||
#else
|
||||
#define tss_fseek fseek
|
||||
#define tss_ftell ftell
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// Seek -- Positions the read/write offset in mpCurrStream. Returns the
|
||||
// current offset upon completion. Returns 0 if no stream is defined.
|
||||
|
@ -323,7 +332,9 @@ cFile::File_t cFile::Seek(File_t offset, SeekFrom From) const //throw(eFile)
|
|||
fprintf(stderr, "%d\n", blowupCount);
|
||||
#endif
|
||||
|
||||
if (fseeko(mpData->mpCurrStream, offset, apiFrom) != 0)
|
||||
|
||||
|
||||
if (tss_fseek(mpData->mpCurrStream, offset, apiFrom) != 0)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
cDebug d("cFile::Seek");
|
||||
|
@ -332,7 +343,7 @@ cFile::File_t cFile::Seek(File_t offset, SeekFrom From) const //throw(eFile)
|
|||
throw eFileSeek();
|
||||
}
|
||||
|
||||
return ftello(mpData->mpCurrStream);
|
||||
return tss_ftell(mpData->mpCurrStream);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -214,7 +214,6 @@ CC = @CC@
|
|||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CORE_CRYPT_O = @CORE_CRYPT_O@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
|
|
|
@ -211,7 +211,6 @@ CC = @CC@
|
|||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CORE_CRYPT_O = @CORE_CRYPT_O@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
|
|
|
@ -219,7 +219,6 @@ CC = @CC@
|
|||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CORE_CRYPT_O = @CORE_CRYPT_O@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
|
|
|
@ -214,7 +214,6 @@ CC = @CC@
|
|||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CORE_CRYPT_O = @CORE_CRYPT_O@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
|
|
|
@ -206,7 +206,6 @@ CC = @CC@
|
|||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CORE_CRYPT_O = @CORE_CRYPT_O@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
|
|
|
@ -210,7 +210,6 @@ CC = @CC@
|
|||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CORE_CRYPT_O = @CORE_CRYPT_O@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
|
|
|
@ -217,7 +217,6 @@ CC = @CC@
|
|||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CORE_CRYPT_O = @CORE_CRYPT_O@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
|
|
|
@ -206,7 +206,6 @@ CC = @CC@
|
|||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CORE_CRYPT_O = @CORE_CRYPT_O@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
|
|
|
@ -61,6 +61,12 @@
|
|||
#include "twcrypto/crypto.h"
|
||||
#include "core/displayencoder.h"
|
||||
|
||||
#if HAVE_SWAB && (__cplusplus <= 1)
|
||||
#ifndef __USE_XOPEN
|
||||
#define _USE_XOPEN 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
//Provide a swab() impl. from glibc, for platforms that don't have one
|
||||
|
|
|
@ -212,7 +212,6 @@ CC = @CC@
|
|||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CORE_CRYPT_O = @CORE_CRYPT_O@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
|
|
|
@ -213,7 +213,6 @@ CC = @CC@
|
|||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CORE_CRYPT_O = @CORE_CRYPT_O@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
|
|
|
@ -206,7 +206,6 @@ CC = @CC@
|
|||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CORE_CRYPT_O = @CORE_CRYPT_O@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
|
|
|
@ -246,7 +246,6 @@ CC = @CC@
|
|||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CORE_CRYPT_O = @CORE_CRYPT_O@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
#include "twtest/test.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <locale.h>
|
||||
|
||||
bool localeIsUtf8()
|
||||
{
|
||||
|
@ -82,10 +83,13 @@ void TestCharUtilBasic()
|
|||
CheckChars("foo");
|
||||
CheckChars("fo\x23 54");
|
||||
|
||||
// Test case requires support for Unicode escape sequences
|
||||
#if __cplusplus >= 201103L
|
||||
if (localeIsUtf8())
|
||||
CheckChars("\U0001F408", 4); //Cat emoji, if UTF-8
|
||||
else
|
||||
CheckChars("\U0001F408", 1); // just a bag of bytes otherwise
|
||||
#endif
|
||||
}
|
||||
|
||||
void RegisterSuite_CharUtil()
|
||||
|
|
|
@ -211,7 +211,6 @@ CC = @CC@
|
|||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CORE_CRYPT_O = @CORE_CRYPT_O@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
|
|
Loading…
Reference in New Issue