Browse Source

Remove some config items that are just wrong with cross compilation

pull/1124/head
Hamish Coleman 1 year ago
parent
commit
1b83e0e0e9
  1. 2
      config.mak.in
  2. 18
      configure.ac
  3. 1
      scripts/hack_fakeautoconf.sh
  4. 6
      src/n2n.c
  5. 11
      win32/winconfig.h

2
config.mak.in

@ -1,4 +1,4 @@
N2N_VERSION=@N2N_VERSION@ PACKAGE_VERSION=@PACKAGE_VERSION@
CC=@CC@ CC=@CC@
AR=@AR@ AR=@AR@
WINDRES=@WINDRES@ WINDRES=@WINDRES@

18
configure.ac

@ -2,8 +2,6 @@ odnl> Do not add anything above
AC_INIT([edge], m4_esyscmd([scripts/version.sh | tr -d '\n'])) AC_INIT([edge], m4_esyscmd([scripts/version.sh | tr -d '\n']))
dnl> Do not add anything above dnl> Do not add anything above
N2N_VERSION=${PACKAGE_VERSION}
AC_DEFINE([PACKAGE_BUILDDATE], "[m4_esyscmd([scripts/version.sh date | tr -d '\n'])]", [Last change date]) AC_DEFINE([PACKAGE_BUILDDATE], "[m4_esyscmd([scripts/version.sh date | tr -d '\n'])]", [Last change date])
if test "${CC+set}" != set; then if test "${CC+set}" != set; then
@ -134,28 +132,12 @@ AS_IF([test "x$enable_pthread" != xno],
) )
MACHINE=`uname -m`
SYSTEM=`uname -s`
if test $SYSTEM = "Linux"; then
if test -f /etc/debian_version; then
DEBIAN_VERSION=`cat /etc/debian_version`
OSNAME="Debian $DEBIAN_VERSION"
else
OSNAME=`./config.guess`
fi
else
dnl> wget -O config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
OSNAME=`./config.guess`
fi
AC_DEFINE_UNQUOTED(PACKAGE_OSNAME, "${OSNAME}", [OS name])
AC_SUBST(CC) AC_SUBST(CC)
AC_SUBST(AR) AC_SUBST(AR)
AC_SUBST(WINDRES) AC_SUBST(WINDRES)
AC_SUBST(CFLAGS) AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS) AC_SUBST(LDFLAGS)
AC_SUBST(N2N_VERSION)
AC_SUBST(N2N_LIBS_EXTRA) AC_SUBST(N2N_LIBS_EXTRA)
AC_SUBST(TOOLS_ADDITIONAL) AC_SUBST(TOOLS_ADDITIONAL)
AC_CONFIG_HEADERS(include/config.h) AC_CONFIG_HEADERS(include/config.h)

1
scripts/hack_fakeautoconf.sh

@ -17,6 +17,5 @@ EOF
cat <<EOF >include/config.h cat <<EOF >include/config.h
#define PACKAGE_VERSION "FIXME" #define PACKAGE_VERSION "FIXME"
#define PACKAGE_OSNAME "FIXME"
#define PACKAGE_BUILDDATE "$(date)" #define PACKAGE_BUILDDATE "$(date)"
EOF EOF

6
src/n2n.c

@ -24,7 +24,7 @@
#include <string.h> // for memcmp, memcpy, memset, strlen, strerror #include <string.h> // for memcmp, memcpy, memset, strlen, strerror
#include <sys/time.h> // for gettimeofday, timeval #include <sys/time.h> // for gettimeofday, timeval
#include <time.h> // for time, localtime, strftime #include <time.h> // for time, localtime, strftime
#include "config.h" // for PACKAGE_BUILDDATE, PACKAGE_OSNAME, PACKA... #include "config.h" // for PACKAGE_BUILDDATE, PACKA...
#include "n2n.h" #include "n2n.h"
#include "random_numbers.h" // for n2n_rand #include "random_numbers.h" // for n2n_rand
#include "sn_selection.h" // for sn_selection_criterion_default #include "sn_selection.h" // for sn_selection_criterion_default
@ -608,10 +608,10 @@ void hexdump (const uint8_t *buf, size_t len) {
void print_n2n_version () { void print_n2n_version () {
printf("Welcome to n2n v.%s for %s\n" printf("Welcome to n2n v.%s\n"
"Built on %s\n" "Built on %s\n"
"Copyright 2007-2022 - ntop.org and contributors\n\n", "Copyright 2007-2022 - ntop.org and contributors\n\n",
PACKAGE_VERSION, PACKAGE_OSNAME, PACKAGE_BUILDDATE); PACKAGE_VERSION, PACKAGE_BUILDDATE);
} }
/* *********************************************** */ /* *********************************************** */

11
win32/winconfig.h

@ -1,11 +0,0 @@
/* winconfig.h. Win32 replacement for file generated from config.h.in by configure. */
/* OS name */
#ifndef PACKAGE_OSNAME
#define PACKAGE_OSNAME "windows"
#endif
/* Define to the version of this package. */
#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION N2N_VERSION
#endif
Loading…
Cancel
Save