Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

first wave of diffs to compile on OpenBSD #68

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+92 −69
Split
View
@@ -3099,6 +3099,15 @@ $as_echo "#define IS_NETBSD 1" >>confdefs.h
export CFLAGS="-fPIC -fno-strict-aliasing -D_GNU_SOURCE -D_NETBSD_SOURCE"
pcp_platform_paths='/usr/pkg/bin'
pcp_ps_all_flags=auxww
+elif test $target_os = openbsd
+then
+ target_os=openbsd
+
+$as_echo "#define IS_OPENBSD 1" >>confdefs.h
+
+ export CFLAGS="-fPIC -fno-strict-aliasing -D_GNU_SOURCE"
+ pcp_platform_paths='/usr/local/bin'
+ pcp_ps_all_flags=auxww
else
echo
echo "FATAL ERROR: need platform-specific customization for \"$target_os\""
@@ -16294,5 +16303,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
-
-
View
@@ -2,17 +2,17 @@ dnl
dnl Copyright (c) 2012-2015 Red Hat.
dnl Copyright (c) 2008 Aconex. All Rights Reserved.
dnl Copyright (c) 2000-2004,2008 Silicon Graphics, Inc. All Rights Reserved.
-dnl
+dnl
dnl This program is free software; you can redistribute it and/or modify it
dnl under the terms of the GNU General Public License as published by the
dnl Free Software Foundation; either version 2 of the License, or (at your
dnl option) any later version.
-dnl
+dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dnl for more details.
-dnl
+dnl
dnl unpacking check - this file must exist
AC_INIT(src/include/pcp/pmapi.h)
@@ -214,7 +214,7 @@ else
build_os=`echo $build_os | sed '[s/^\([^-][^-]*\)-.*$/\1/]'`
fi
-echo Building on $build for $target
+echo Building on $build for $target
echo "Build: os=$build_os cpu=$build_cpu"
echo "Target: os=$target_os cpu=$target_cpu"
@@ -310,6 +310,12 @@ then
export CFLAGS="-fPIC -fno-strict-aliasing -D_GNU_SOURCE -D_NETBSD_SOURCE"
pcp_platform_paths='/usr/pkg/bin'
pcp_ps_all_flags=auxww
+elif test $target_os = openbsd
+then
+ AC_DEFINE(IS_OPENBSD, [1], [Platform is OpenBSD])
+ export CFLAGS="-fPIC -fno-strict-aliasing -D_GNU_SOURCE"
+ pcp_platform_paths='/usr/local/bin'
+ pcp_ps_all_flags=auxww
else
echo
echo "FATAL ERROR: need platform-specific customization for \"$target_os\""
@@ -995,7 +1001,7 @@ enable_qt=false
qt_release=release
AS_IF([test "x$do_qt" != "xno"], [
enable_qt=true
-
+
if test -z "$QMAKE"
then
AC_PATH_PROGS(QMAKE, [qmake-qt5 qmake-qt4 qmake],, [$QTDIR/bin:/usr/bin:/usr/lib64/qt5/bin:/usr/lib/qt5/bin:/usr/lib64/qt4/bin:/usr/lib/qt4/bin])
@@ -1045,7 +1051,7 @@ dnl note: all makefiles in this package use the gmake syntax
if test -z "$MAKE"
then
AC_PATH_PROG(MAKE, gmake)
- if test -z "$MAKE"
+ if test -z "$MAKE"
then
# look elsewhere ...
AC_MSG_CHECKING([for GNU make elsewhere])
@@ -1074,7 +1080,7 @@ then
fi
fi
AC_MSG_RESULT($MAKE)
- fi
+ fi
fi
make=$MAKE
AC_SUBST(make)
@@ -1197,7 +1203,7 @@ then
AC_MSG_WARN([PackageMaker not found, mac packages will not be made])
fi
else
- AC_MSG_RESULT([ no])
+ AC_MSG_RESULT([ no])
fi
else
package_maker="$PACKAGE_MAKER"
@@ -1440,27 +1446,27 @@ AC_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/mount.h)
dnl Check if we have <sys/endian.h> ... standard way
AC_MSG_CHECKING([for sys/endian.h ])
AC_TRY_COMPILE(
-[
- #include <sys/endian.h>
+[
+ #include <sys/endian.h>
],
[
], AC_DEFINE(HAVE_SYS_ENDIAN_H, [1], [sys/endian.h]) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
dnl Check if we have <machine/endian.h> ... MacOSX way
AC_MSG_CHECKING([for machine/endian.h ])
AC_TRY_COMPILE(
-[
- #include <machine/endian.h>
+[
+ #include <machine/endian.h>
],
[
], AC_DEFINE(HAVE_MACHINE_ENDIAN_H, [1], [machine/endian.h]) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
dnl Check if we have <sys/endian.h> ... IRIX strangeness
AC_MSG_CHECKING([for sys/endian.h (IRIX variant) ])
AC_TRY_COMPILE(
-[
+[
#include <standards.h>
- #include <sys/endian.h>
+ #include <sys/endian.h>
],
[
], AC_DEFINE(HAVE_SYS_ENDIAN_H, [1], [IRIX sys/endian.h]) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
@@ -1759,9 +1765,9 @@ fi
dnl check if we have a type for the pointer's size integer (__psint_t)
AC_MSG_CHECKING([for __psint_t ])
AC_TRY_COMPILE(
-[
+[
#include <sys/types.h>
- #include <stdlib.h>
+ #include <stdlib.h>
#include <stddef.h>
], [ __psint_t psint; ],
AC_DEFINE(HAVE___PSINT_T, [1], [__psint_t type]) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
@@ -2205,7 +2211,7 @@ then
AC_MSG_CHECKING([where pthread_create() is defined])
for cand in "" pthreads pthread ; do
savedLIBS=$LIBS
- if test -n "$cand"
+ if test -n "$cand"
then
LIBS=`echo $LIBS -l$cand`
fi
@@ -2567,7 +2573,7 @@ AC_TRY_LINK([#include <sys/wait.h>],
], AC_DEFINE(HAVE_WAIT_INCLUDES_SIGNAL, [1], [indirect signal.h]))
dnl check for name and type of time fields in struct stat
-dnl IRIX example timespec_t st_mtim;
+dnl IRIX example timespec_t st_mtim;
dnl Linux example struct timespec st_mtim;
dnl Darwin example struct timespec st_mtimespec;
dnl Solaris example timestruc_t st_mtim;
@@ -2882,7 +2888,7 @@ AC_ARG_WITH(demosdir,[AC_HELP_STRING([--with-demosdir],[run directory [DATADIR/p
[pcp_demos_dir=$pcp_share_dir/demos])
AC_SUBST(pcp_demos_dir)
-if test -z "$XCONFIRM"
+if test -z "$XCONFIRM"
then
AC_PATH_PROG(ac_xconfirm_prog, xconfirm, $pcp_bin_dir/pmconfirm)
else
@@ -3066,7 +3072,7 @@ AC_TRY_COMPILE([
], [ struct timespec foo; ],
AC_DEFINE(HAVE_STRUCT_TIMESPEC, [1], [timespec type]) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
-dnl check if we have IRIX style altzone
+dnl check if we have IRIX style altzone
AC_MSG_CHECKING([for altzone in time.h])
AC_TRY_COMPILE([
#include <time.h>
@@ -3135,7 +3141,7 @@ AC_SUBST(HAVE_ZLIB, [$have_zlib])
dnl Check if we have AI_ADDRCONFIG
AC_MSG_CHECKING([for AI_ADDRCONFIG])
AC_TRY_COMPILE(
-[
+[
#include <netdb.h>
int test = AI_ADDRCONFIG;
],
@@ -38,7 +38,7 @@ extern "C" {
#undef HAVE_ST_MTIME_WITH_E
/* if your compiler supports LL sufix on 64 bit int constants */
-#undef HAVE_CONST_LONGLONG
+#undef HAVE_CONST_LONGLONG
/*
* HAVE_UNDERBAR_ENVIRON if extern char **_environ is defined
@@ -325,11 +325,11 @@ extern "C" {
#undef HAVE_PORT_PERFORMANCE_QUERY_VIA
#undef HAVE_PMA_QUERY_VIA
-#ifndef ULONGLONG_MAX
+#ifndef ULONGLONG_MAX
#define ULONGLONG_MAX (__uint64_t)18446744073709551615ULL
#endif
-#ifndef LONGLONG_MAX
+#ifndef LONGLONG_MAX
#define LONGLONG_MAX (__int64_t)9223372036854775807LL
#endif
@@ -342,7 +342,7 @@ extern "C" {
/* Check if __psint_t is set to something meaningful */
#undef HAVE___PSINT_T
-#ifndef HAVE___PSINT_T
+#ifndef HAVE___PSINT_T
#ifdef HAVE_32BIT_PTR
typedef int __psint_t;
#elif defined HAVE_64BIT_PTR
@@ -539,6 +539,9 @@ typedef void (*SIG_PF) (int);
/* Determine if we are on a NetBSD box */
#undef IS_NETBSD
+/* Determine if we are on a NetBSD box */
+#undef IS_OPENBSD
+
/* Determine if we are on a Mac OS X box */
#undef IS_DARWIN
#ifdef IS_DARWIN
View
@@ -1,18 +1,18 @@
/*
* Copyright (c) 2013-2015 Red Hat.
- *
+ *
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
- *
+ *
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*/
-#include <sys/stat.h>
+#include <sys/stat.h>
#include "pmapi.h"
#include "impl.h"
@@ -22,6 +22,11 @@
#include <ucred.h>
#endif
+/* OpenBSD doesn't have EPROTO */
+#ifndef EPROTO
+#define EPROTO EINTR
+#endif
+
#define STRINGIFY(s) #s
#define TO_STRING(s) STRINGIFY(s)
View
@@ -1,17 +1,16 @@
/*
* Copyright (c) 1995 Silicon Graphics, Inc. All Rights Reserved.
* Copyright (c) 2015 Red Hat, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
- *
+ *
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
- *
* Thread-safe notes
*
* To avoid buffer trampling, on success __pmFindPDUBuf() now returns
@@ -24,6 +23,9 @@
#include "compiler.h"
#include <assert.h>
#include <search.h>
+#ifdef __OpenBSD__
+#include <sys/stdint.h>
+#endif
typedef struct bufctl
{
Oops, something went wrong.