Ver código fonte

Major configure.in/ac cleanup


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1849 fd59a12c-fef9-0310-b244-a6a79926bd2f
Fabio M. Di Nitto 17 anos atrás
pai
commit
e8d5ae2510
4 arquivos alterados com 323 adições e 553 exclusões
  1. 321 0
      configure.ac
  2. 0 549
      configure.in
  3. 1 2
      exec/Makefile.am
  4. 1 2
      lib/Makefile.am

+ 321 - 0
configure.ac

@@ -0,0 +1,321 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+# bootstrap / init
+AC_PREREQ([2.61])
+
+AC_INIT([corosync], [0.95], [openais@lists.osdl.org], [corosync-0.95.tar.gz])
+AM_INIT_AUTOMAKE
+
+AC_CONFIG_SRCDIR([lib/coroipc.c])
+AC_CONFIG_HEADER([include/corosync/config.h include/corosync/cs_config.h])
+
+AC_CANONICAL_HOST
+
+AC_LANG([C])
+
+# Checks for programs.
+
+# check stolen from gnulib/m4/gnu-make.m4
+if ! ${MAKE-make} --version /cannot/make/this >/dev/null 2>&1; then
+	AC_MSG_ERROR([you don't seem to have GNU make; it is required])
+fi
+
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+AC_PROG_RANLIB
+AC_CHECK_PROGS([GROFF], [groff])
+
+# Checks for libraries.
+AC_CHECK_LIB([dl], [dlopen])
+AC_CHECK_LIB([pthread], [pthread_create])
+# from OS != linux
+AC_CHECK_LIB([c], [getpeereid])
+AC_CHECK_LIB([socket], [socket])
+AC_CHECK_LIB([nsl], [t_open])
+AC_CHECK_LIB([rt], [sched_getscheduler])
+
+# Checks for header files.
+AC_FUNC_ALLOCA
+AC_HEADER_DIRENT
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h sys/types.h getopt.h])
+# from OS != linux
+AC_CHECK_HEADERS([sys/sockio.h malloc.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_TYPE_UID_T
+AC_C_INLINE
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+AC_TYPE_INT8_T
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
+AC_HEADER_TIME
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_UINT64_T
+AC_TYPE_UINT8_T
+AC_C_VOLATILE
+
+# Checks for library functions.
+AC_FUNC_CLOSEDIR_VOID
+AC_FUNC_ERROR_AT_LINE
+AC_REPLACE_FNMATCH
+AC_FUNC_FORK
+AC_PROG_GCC_TRADITIONAL
+AC_FUNC_MALLOC
+AC_FUNC_MEMCMP
+AC_FUNC_REALLOC
+AC_FUNC_SELECT_ARGTYPES
+AC_TYPE_SIGNAL
+AC_FUNC_STRFTIME
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS([alarm alphasort atexit bzero dup2 endgrent endpwent fcntl getcwd getpeerucred gettimeofday inet_ntoa memmove memset mkdir scandir select socket strcasecmp strchr strdup strerror strrchr strspn strstr])
+
+# add man and init dirs?
+AC_CONFIG_FILES([Makefile
+                 exec/Makefile
+                 include/Makefile
+                 lcr/Makefile
+                 lib/Makefile
+                 pkgconfig/Makefile
+                 services/Makefile
+                 test/Makefile
+                 tools/Makefile])
+
+### Local business
+
+# ===============================================
+# Helpers
+# ===============================================
+
+## helper for CC stuff
+cc_supports_flag() {
+	local CFLAGS="$@"
+	AC_MSG_CHECKING([whether $CC supports "$@"])
+	AC_COMPILE_IFELSE([int main(){return 0;}] ,[RC=0; AC_MSG_RESULT([yes])],[RC=1; AC_MSG_RESULT([no])])
+	return $RC
+}
+
+## local defines
+PKG_FEATURES=""
+
+LINT_FLAGS="-weak -unrecog +posixlib +ignoresigns -fcnuse -badflag -D__gnuc_va_list=va_list -D__attribute\(x\)="
+
+# libraries SONAME
+SOMAJOR=3
+SOMINOR=0
+SOMICRO=0
+SONAME=${SOMAJOR}.${SOMINOR}.${SOMICRO}
+
+# local options
+AC_ARG_ENABLE([ansi],
+	[ --enable-ansi           : force GCC to compile to ANSI/ANSI standard for older compilers. ],
+	[ default="no" ])
+
+AC_ARG_ENABLE([fatal-warnings],
+	[ --enable-fatal-warnings : very pedantic and fatal warnings for gcc. ],
+	[ default="no" ])
+
+AC_ARG_ENABLE([debug],
+	[ --enable-debug          : enable debug build. ],
+	[ default="no" ])
+
+AC_ARG_ENABLE([coverage],
+	[ --enable-coverage       : coverage analysis of the codebase. ],
+	[ default="no" ])
+
+AC_ARG_WITH([lcrso-dir],
+	[ --with-lcrso-dir=DIR    : corosync lcrso files. ],
+	[ LCRSODIR="$withval" ],
+	[ LCRSODIR="$libexecdir/lcrso" ])
+
+# OS detection
+# THIS SECTION MUST DIE!
+
+case "$host_os" in
+	*linux*)
+		AC_DEFINE_UNQUOTED([COROSYNC_LINUX], [1], [Compiling for Linux platform])
+		OS_CFLAGS=""
+		OS_CPPFLAGS=""
+		OS_LDFLAGS=""
+		OS_DYFLAGS="-rdynamic"
+		DARWIN_OPTS=""
+	;;
+	darwin*)
+		AC_DEFINE_UNQUOTED([COROSYNC_DARWIN], [1], [Compiling for Darwin platform])
+		OS_CFLAGS=""
+		OS_CPPFLAGS=""
+		OS_LDFLAGS=""
+		OS_DYFLAGS=""
+		DARWIN_OPTS="-dynamiclib -bind_at_load -current_version $(SONAME) -compatibility_version $(SONAME)"
+	;;
+	*bsd*)
+		AC_DEFINE_UNQUOTED([COROSYNC_BSD], [1], [Compiling for BSD platform])
+		OS_CFLAGS="-I/usr/local/include"
+		OS_CPPFLAGS=""
+		OS_LDFLAGS="-L/usr/local/lib"
+		OS_DYFLAGS="-export-dynamic"
+		DARWIN_OPTS=""
+	;;
+	*solaris*)
+		AC_DEFINE_UNQUOTED([COROSYNC_SOLARIS], [1], [Compiling for Solaris platform])
+		AC_DEFINE_UNQUOTED([TS_CLASS], [1], [Prevent being scheduled RR])
+		OS_CFLAGS=""
+		OS_CPPFLAGS="-D_REENTRANT"
+		OS_LDFLAGS="-Wl,-rpath-link=/usr/lib"
+		OS_DYFLAGS="-Wl,--export-dynamic"
+		DARWIN_OPTS=""
+	;;
+	*)
+		AC_MSG_ERROR([Unsupported OS? this is why this section should die an horrible death])
+	;;
+esac
+
+# *FLAGS handling goes here
+
+ENV_CFLAGS="$CFLAGS"
+ENV_CPPFLAGS="$CPPFLAGS"
+ENV_LDFLAGS="$LDFLAGS"
+
+# debug build stuff
+if test "x${enable_debug}" = xyes; then
+	AC_DEFINE_UNQUOTED([DEBUG], [1], [Compiling Debugging code])
+	OPT_CFLAGS="-O0"
+	PKG_FEATURES="$PKG_FEATURES debug"
+else
+	OPT_CFLAGS="-O3"
+fi
+
+# gdb flags
+if test "$GCC" == yes; then
+	GDB_FLAGS="-ggdb3"
+else
+	GDB_FLAGS="-g"
+fi
+
+# extra warnings
+EXTRA_WARNINGS=""
+
+WARNLIST="
+	all
+	missing-prototypes
+	missing-declarations
+	strict-prototypes
+	declaration-after-statement
+	pointer-arith
+	write-strings
+	cast-qual
+	cast-align
+	bad-function-cast
+	missing-format-attribute
+	format=2
+	format-security
+	format-nonliteral
+	no-long-long
+	unsigned-char
+	gnu89-inline
+	no-strict-aliasing
+	"
+
+for j in $WARNLIST; do
+	if cc_supports_flag -W$j; then
+		EXTRA_WARNINGS="$EXTRA_WARNINGS -W$j";
+	fi
+done
+
+if test "x${enable_coverage}" = xyes && \
+		cc_supports_flag -ftest-coverage && \
+		cc_supports_flag -fprofile-arcs ; then
+	AC_MSG_NOTICE([Enabling Coverage (enable -O0 by default)])
+	OPT_CFLAGS="-O0"
+	COVERAGE_CFLAGS="-ftest-coverage -fprofile-arcs"
+	COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
+	PKG_FEATURES="$PKG_FEATURES coverage"
+else
+	COVERAGE_CFLAGS=""
+	COVERAGE_LDFLAGS=""
+fi
+
+if test "x${enable_ansi}" = xyes && \
+		cc_supports_flag -std=iso9899:199409 ; then
+	AC_MSG_NOTICE([Enabling ANSI Compatibility])
+	ANSI_CPPFLAGS="-ansi -D_GNU_SOURCE -DANSI_ONLY"
+	PKG_FEATURES="$PKG_FEATURES ansi"
+else
+	ANSI_CPPFLAGS=""
+fi
+
+if test "x${enable_fatal_warnings}" = xyes && \
+		cc_supports_flag -Werror ; then
+	AC_MSG_NOTICE([Enabling Fatal Warnings (-Werror)])
+	WERROR_CFLAGS="-Werror"
+	PKG_FEATURES="$PKG_FEATURES fatal-warnings"
+else
+	WERROR_CFLAGS=""
+fi
+
+# final build of *FLAGS
+CFLAGS="$ENV_CFLAGS $OPT_CFLAGS $GDB_FLAGS $OS_CFLAGS $COVERAGE_CFLAGS $EXTRA_WARNINGS $WERROR_CFLAGS"
+CPPFLAGS="$ENV_CPPFLAGS $ANSI_CPPFLAGS $OS_CPPFLAGS"
+LDFLAGS="$ENV_LDFLAGS $COVERAGE_LDFLAGS $OS_LDFLAGS"
+
+# substitute what we need:
+AC_DEFINE_UNQUOTED([LCRSODIR], ["$LCRSODIR"], [Location of lcrso plugins])
+AC_SUBST([LCRSODIR])
+
+AC_SUBST([SOMAJOR])
+AC_SUBST([SOMINOR])
+AC_SUBST([SOMICRO])
+AC_SUBST([SONAME])
+
+AC_SUBST([OS_DYFLAGS])
+
+AM_CONDITIONAL(BUILD_DARWIN, test -n "${DARWIN_OPTS}")
+AC_SUBST([DARWIN_OPTS])
+
+AM_CONDITIONAL(BUILD_HTML_DOCS, test -n "${GROFF}")
+
+AC_SUBST([LINT_FLAGS])
+
+AC_OUTPUT
+
+AC_MSG_RESULT([])
+AC_MSG_RESULT([$PACKAGE configuration:])
+AC_MSG_RESULT([  Version                  = ${VERSION}])
+AC_MSG_RESULT([  Prefix                   = ${prefix}])
+AC_MSG_RESULT([  Executables              = ${sbindir}])
+AC_MSG_RESULT([  Man pages                = ${mandir}])
+AC_MSG_RESULT([  Libraries                = ${libdir}])
+AC_MSG_RESULT([  Header files             = ${includedir}])
+AC_MSG_RESULT([  Arch-independent files   = ${datadir}])
+AC_MSG_RESULT([  State information        = ${localstatedir}])
+AC_MSG_RESULT([  System configuration     = ${sysconfdir}])
+AC_MSG_RESULT([  LCRSO                    = ${LCRSODIR}])
+AC_MSG_RESULT([  Features                 =${PKG_FEATURES}])
+AC_MSG_RESULT([])
+AC_MSG_RESULT([$PACKAGE build info:])
+AC_MSG_RESULT([  Library SONAME           = ${SONAME}])
+AC_MSG_RESULT([  Default optimization     = ${OPT_CFLAGS}])
+AC_MSG_RESULT([  Default debug options    = ${GDB_CFLAGS}])
+AC_MSG_RESULT([  Extra compiler warnings  = ${EXTRA_WARNING}])
+AC_MSG_RESULT([  Env. defined CFLAG       = ${ENV_CFLAGS}])
+AC_MSG_RESULT([  Env. defined CPPFLAGS    = ${ENV_CPPFLAGS}])
+AC_MSG_RESULT([  Env. defined LDFLAGS     = ${ENV_LDFLAGS}])
+AC_MSG_RESULT([  OS   defined CFLAGS      = ${OS_CFLAGS}])
+AC_MSG_RESULT([  OS   defined CPPFLAGS    = ${OS_CPPFLAGS}])
+AC_MSG_RESULT([  OS   defined LDFLAGS     = ${OS_LDFLAGS}])
+AC_MSG_RESULT([  OS   defined DYFLAGS     = ${OS_DYFLAGS}])
+AC_MSG_RESULT([  ANSI defined CPPFLAGS    = ${ANSI_CPPFLAGS}])
+AC_MSG_RESULT([  Coverage     CFLAGS      = ${COVERAGE_CFLAGS}])
+AC_MSG_RESULT([  Coverage     LDFLAGS     = ${COVERAGE_LDFLAGS}])
+AC_MSG_RESULT([  Fatal War.   CFLAGS      = ${WERROR_CFLAGS}])
+AC_MSG_RESULT([  Final        CFLAGS      = ${CFLAGS}])
+AC_MSG_RESULT([  Final        CPPFLAGS    = ${CPPFLAGS}])
+AC_MSG_RESULT([  Final        LDFLAGS     = ${LDFLAGS}])

+ 0 - 549
configure.in

@@ -1,549 +0,0 @@
-dnl
-dnl autoconf for Corosync
-dnl
-dnl License: GNU General Public License (GPL)
-
-dnl ===============================================
-dnl Bootstrap 
-dnl ===============================================
-
-dnl Initialiase, with sanity check of a unique file in the hierarchy
-AC_INIT(configure.in)
-AC_PREREQ(2.53)
-
-AC_CONFIG_AUX_DIR(.)
-AC_CANONICAL_HOST
-AC_MSG_NOTICE(Host: $host)
-AC_MSG_NOTICE(Host OS: $host_os)
-AC_MSG_NOTICE(Host CPU: $host_cpu)
-AC_MSG_NOTICE(Host Vendor: $host_vendor)
-
-dnl Where #defines go (e.g. `AC_CHECK_HEADERS' below)
-dnl
-dnl Internal header: include/corosync/config.h
-dnl   - Contains ALL defines
-dnl   - include/config.h.in is generated automatically by autoheader
-dnl   - NOT to be included in any header files except lha_internal.h
-dnl     (which is also not to be included in any other header files)
-dnl
-dnl External header: include/corosync/cs_config.h
-dnl   - Contains a subset of defines checked here
-dnl   - Manually edit include/corosync/cs_config.h.in to have configure include
-dnl     new defines
-dnl   - Should not include HAVE_* defines
-dnl   - Safe to include anywhere
-AM_CONFIG_HEADER(include/corosync/config.h include/corosync/cs_config.h)
-ALL_LINGUAS="en fr"
-
-AC_ARG_WITH(version,
-    [  --with-version=name     Override package version (if you're a packager needing to pretend) ],
-    [ CS_VERSION="$withval" ],
-    [ CS_VERSION="" ],
-)
-
-DTD_VERSION=1.0
-
-if test -z "$CS_VERSION" ; then
-   CS_VERSION="1.0.0"
-fi
-
-PKG_NAME=corosync
-PKG_FEATURES=""
-AM_INIT_AUTOMAKE($PKG_NAME, $CS_VERSION)
-AC_DEFINE_UNQUOTED(CS_VERSION, "$CS_VERSION", Current corosync version)
-AC_SUBST(PKG_NAME)
-
-dnl Project wise library soname handling
-SOMAJOR=3
-SOMINOR=0
-SOMICRO=0
-SONAME=${SOMAJOR}.${SOMINOR}.${SOMICRO}
-AC_SUBST(SOMAJOR)
-AC_SUBST(SOMINOR)
-AC_SUBST(SOMICRO)
-AC_SUBST(SONAME)
-
-LDD=ldd
-dnl Which C compiler?
-dnl Defaults to GNU C compiler if available.
-dnl Always tries to set the compiler to ANSI C via options (AM)
-dnl Can force other with environment variable "CC".
-AC_PROG_CC
-AC_PROG_CC_STDC
-AC_PROG_CC_C_O
-AC_PROG_RANLIB
-
-dnl ===============================================
-dnl Helpers 
-dnl ===============================================
-cc_supports_flag() {
-	  AC_MSG_CHECKING(whether $CC supports "$@")
-	  Cfile=/tmp/foo${$}
-	  touch ${Cfile}.c
-	  $CC -c "$@" ${Cfile}.c -o ${Cfile}.o >/dev/null 2>&1
-          rc=$?
-	  rm -f ${Cfile}.c ${Cfile}.o
-          case $rc in
-            0) AC_MSG_RESULT(yes);;
-            *) AC_MSG_RESULT(no);;
-          esac
-          return $rc
-}
-
-extract_header_define() {
-	  AC_MSG_CHECKING(for $2 in $1)
-	  Cfile=/tmp/extract_define.$2.${$}
-	  printf "#include <stdio.h>\n" > ${Cfile}.c
-	  printf "#include <%s>\n" $1 >> ${Cfile}.c
-	  printf "int main(int argc, char **argv) { printf(\"%%s\", %s); return 0; }\n" $2 >> ${Cfile}.c
-	  $CC $CFLAGS ${Cfile}.c -o ${Cfile}
-	  value=`${Cfile}`
-	  AC_MSG_RESULT($value)
-	  printf $value
-	  rm -f ${Cfile}.c ${Cfile}
-	}
-
-check_for_type() {
-  type="$1"
-  headers=""
-  shift
-  for arg
-  do
-    headers="${headers}${arg}
-"
-  done
-  program="if ((${type} *) 0)  return 0;
-    if (sizeof(${type}))  return 0; 
-    return 0;"
-  have="HAVE_`echo "$type" | tr ' ' '_' | dd conv=ucase 2>/dev/null`"
-  varhave="heartbeat_cv_$have"
-
-  AC_CACHE_CHECK([for type $type ],$varhave,[
-    AC_TRY_COMPILE([$headers], [$program], eval $varhave=yes, eval $varhave=no
-    , eval $varhave=cross)
-  ])
-  if test x"`eval echo '${'$varhave'}'`" = xyes; then
-    return 0
-  fi
-  return 1
-}
-
-check_for_type_member() {
-  type="$1"
-  member="$2"
-  headers=""
-  shift
-  shift
-  for arg
-  do
-    headers="${headers}${arg}
-"
-  done
-  program="${type} foo;
-    if ((${type} *) 0)  return 0;
-    if (sizeof(${type}))  return 0;
-    if (sizeof(foo))  return 0;
-    (void*)foo.${member};
-    return 0;"
-  have="HAVE_`echo "$type" | tr ' ' '_' | dd conv=ucase 2>/dev/null`"
-  varhave="heartbeat_cv_$have"
-
-  AC_CACHE_CHECK([for type $type ],$varhave,[
-    AC_TRY_COMPILE([$headers], [$program], eval $varhave=yes, eval $varhave=no
-    , eval $varhave=cross)
-  ])
-  if test x"`eval echo '${'$varhave'}'`" = xyes; then
-    return 0
-  fi
-  return 1
-}
-
-dnl ===============================================
-dnl Configure Options
-dnl ===============================================
-
-AC_ARG_ENABLE([ansi],
-[  --enable-ansi force GCC to compile to ANSI/ANSI standard for older compilers.
-     [default=no]])
-
-AC_ARG_ENABLE([fatal-warnings],
-[  --enable-fatal-warnings very pedantic and fatal warnings for gcc
-     [default=no]])
-
-AC_ARG_WITH(lcrso-dir, 
-    [  --with-lcrso-dir=DIR   Corosync lcrso files. ],
-    [ LCRSODIR="$withval" ])
-
-AC_ARG_ENABLE(coverage, 
-    [  --enable-coverage   Coverage analysis of the codebase. ],
-    [ default="no" ])
-
-AC_ARG_ENABLE(debug, 
-    [  --enable-debug   Enable debug build. ],
-    [ default="no" ])
-
-dnl ===============================================
-dnl General Processing
-dnl ===============================================
-
-AC_MSG_NOTICE(Sanitizing prefix: ${prefix})
-case $prefix in
-  NONE)	prefix=/usr;;
-esac
-
-AC_MSG_NOTICE(Sanitizing exec_prefix: ${exec_prefix})
-case $exec_prefix in
-  dnl For consistency with Heartbeat, map NONE->$prefix
-  NONE)	  exec_prefix=$prefix;;
-  prefix) exec_prefix=$prefix;;
-esac
-
-AC_MSG_NOTICE(Sanitizing libdir: ${libdir})
-case $libdir in
-  dnl For consistency with Heartbeat, map NONE->$prefix
-  prefix|NONE|*exec_prefix*)
-    AC_MSG_CHECKING(which lib directory to use)
-    for aDir in lib64 lib
-    do
-      trydir="${exec_prefix}/${aDir}"
-      if
-        test -d ${trydir}
-      then
-        libdir=${trydir}
-        break
-      fi
-    done
-    AC_MSG_RESULT($libdir);
-    ;;
-esac
-
-
-dnl Expand autoconf variables so that we dont end up with '${prefix}' 
-dnl in #defines and python scripts
-dnl NOTE: Autoconf deliberately leaves them unexpanded to allow
-dnl    make exec_prefix=/foo install
-dnl No longer being able to do this seems like no great loss to me...
-
-eval prefix="`eval echo ${prefix}`"
-eval exec_prefix="`eval echo ${exec_prefix}`"
-eval bindir="`eval echo ${bindir}`"
-eval sbindir="`eval echo ${sbindir}`"
-eval libexecdir="`eval echo ${libexecdir}`"
-eval datadir="`eval echo ${datadir}`"
-eval sysconfdir="`eval echo ${sysconfdir}`"
-eval sharedstatedir="`eval echo ${sharedstatedir}`"
-eval localstatedir="`eval echo ${localstatedir}`"
-eval libdir="`eval echo ${libdir}`"
-eval includedir="`eval echo ${includedir}`"
-eval oldincludedir="`eval echo ${oldincludedir}`"
-eval infodir="`eval echo ${infodir}`"
-eval mandir="`eval echo ${mandir}`"
-eval docdir="`eval echo ${docdir}`"
-
-for j in prefix exec_prefix bindir sbindir libexecdir datadir sysconfdir \
-    sharedstatedir localstatedir libdir includedir oldincludedir infodir \
-    mandir docdir
-do 
-  dirname=`eval echo '${'${j}'}'`
-  if
-    test ! -d "$dirname"
-  then
-    AC_MSG_WARN([$j directory ($dirname) does not exist!])
-  fi
-done
-
-dnl debug build stuff
-if test "x${enable_debug}" = xyes; then
-	echo Enabled Debug Build
-	PKG_FEATURES="$PKG_FEATURES debug"
-	CFLAGS="$CFLAGS -O0"
-	AC_DEFINE_UNQUOTED(DEBUG, 1, Compiling Debugging code)
-else
-	echo Enabled Standard Build
-	CFLAGS="$CFLAGS -O3"
-fi
-
-dnl This OS-based decision-making is poor autotools practice;
-dnl feature-based mechanisms are strongly preferred.
-dnl
-dnl So keep this section to a bare minimum; regard as a "necessary evil". 
-
-ON_DARWIN=0
-DYFLAGS=
-case "$host_os" in
-*bsd*)
-		AC_DEFINE_UNQUOTED(COROSYNC_BSD, 1, Compiling for BSD platform)
-		CFLAGS="$CFLAGS -I/usr/local/include"
-		LD_FLAGS="$LD_FLAGS -L/usr/local/lib"
-		DYFLAGS="$DYFLAGS -export-dynamic"
-		;;
-*solaris*)
-		AC_DEFINE_UNQUOTED(COROSYNC_SOLARIS, 1, Compiling for Solaris platform)
-		AC_DEFINE_UNQUOTED(TS_CLASS, 1, Prevent being scheduled RR)
-		CFLAGS="$CFLAGS -D_REENTRANT"
-		LDFLAGS="$LDFLAGS -Wl,--export-dynamic -Wl,-rpath-link=/usr/lib"
-		;;
-*linux*)
-		AC_DEFINE_UNQUOTED(COROSYNC_LINUX, 1, Compiling for Linux platform)
-		DYFLAGS="$DYFLAGS -rdynamic"
- 		;;
-darwin*)
-		ON_DARWIN=1
-		AC_DEFINE_UNQUOTED(COROSYNC_DARWIN, 1, Compiling for Darwin platform)
-		;;
-esac
-AC_SUBST(DYFLAGS)
-
-AC_MSG_CHECKING(which format is needed to print uint64_t)
-case "$host_cpu" in
-  s390x)U64T="%lu";;
-  *64*) U64T="%lu";;
-  *)    U64T="%llu";;
-esac
-AC_MSG_RESULT($U64T)
-AC_DEFINE_UNQUOTED(U64T, "$U64T", Correct printf format for logging uint64_t)
-
-dnl Variables needed for substitution
-
-case x$LCRSODIR in
-     x) LCRSODIR=$libexecdir/lcrso;;
-esac
-AC_DEFINE_UNQUOTED(LCRSODIR, "$LCRSODIR", Location of Corosync lcrso plugins)
-AC_SUBST(LCRSODIR)
-
-
-dnl *************************************************************************
-PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin"
-export PATH
-
-dnl ===============================================
-dnl Program Paths - Most of these need to go away
-dnl ===============================================
-
-
-AC_CHECK_PROGS(MAKE, gmake make)
-AC_PATH_PROGS(PKGCONFIG, pkg-config)
-
-if test x"${MAKE}" = x""; then
-   AC_MSG_ERROR(You need (g)make installed in order to build ${PKG_NAME})
-fi
-
-AC_SUBST(MAKE)
-AC_SUBST(CC)
-
-dnl ===============================================
-dnl Libraries
-dnl ===============================================
-
-AC_CHECK_LIB(dl, dlopen)
-AC_CHECK_LIB(nsl, t_open)
-AC_CHECK_LIB(socket, socket)
-AC_CHECK_LIB(c, getpeereid)
-AC_CHECK_LIB(rt, sched_getscheduler)
-AC_CHECK_LIB(pthread, pthread_create)
-
-dnl if test x"${PKGCONFIG}" = x""; then
-dnl    AC_MSG_ERROR(You need pkgconfig installed in order to build ${PKG_NAME})
-dnl fi
-dnl
-dnl if test $PKGCONFIG --exists $GPKGNAME; then
-dnl 	CFLAGS="$CFLAGS `$GLIBCONFIG --cflags`"
-dnl 	LIBS="$LIBS `$GLIBCONFIG --libs`"
-dnl fi
-
-dnl ===============================================
-dnl Functions
-dnl ===============================================
-AC_CHECK_FUNCS(alphasort)
-AC_CHECK_FUNCS(scandir)
-AC_CHECK_FUNCS(getpeerucred)
-
-dnl ===============================================
-dnl Headers
-dnl ===============================================
-
-AC_HEADER_STDC
-
-AC_CHECK_HEADERS(sys/sockio.h)
-AC_CHECK_HEADERS(sys/types.h)
-AC_CHECK_HEADERS(sys/socket.h)
-AC_CHECK_HEADERS(malloc.h)
-AC_CHECK_HEADERS(getopt.h)
-
-dnl ===============================================
-dnl Typedefs
-dnl ===============================================
-
-dnl Check syslog.h for 'facilitynames' table
-dnl
-AC_CACHE_CHECK([for facilitynames in syslog.h],ac_cv_HAVE_SYSLOG_FACILITYNAMES,[
-AC_TRY_COMPILE([
-#define SYSLOG_NAMES
-#include <stdlib.h>
-#include <syslog.h>
-],
-[ void *fnames; fnames = facilitynames; ],
-ac_cv_HAVE_SYSLOG_FACILITYNAMES=yes,ac_cv_HAVE_SYSLOG_FACILITYNAMES=no,ac_cv_HAVE_SYSLOG_FACILITYNAMES=cross)])
-if test x"$ac_cv_HAVE_SYSLOG_FACILITYNAMES" = x"yes"; then
-    AC_DEFINE(HAVE_SYSLOG_FACILITYNAMES,1,[ ])
-fi
-
-dnl ===============================================
-dnl Compiler Characteristics
-dnl ===============================================
-
-dnl if not known on this system, #define size_t unsigned
-AC_TYPE_SIZE_T
-AC_CHECK_SIZEOF(char)
-AC_CHECK_SIZEOF(short)
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(long long)
-AC_C_STRINGIZE
-
-CC_WARNINGS=""
-
-dnl AC_CHECK_FUNCS(fcntl)
-
-dnl
-dnl Make sure that CFLAGS is not exported. If the user did
-dnl not have CFLAGS in their environment then this should have
-dnl no effect. However if CFLAGS was exported from the user's
-dnl environment, then the new CFLAGS will also be exported
-dnl to sub processes. 
-dnl
-
-if export | fgrep " CFLAGS=" > /dev/null; then
-	export -n CFLAGS || true # We don't want to bomb out if this fails
-fi
-
-
-if test "$GCC" == yes; then
-        CFLAGS="$CFLAGS -ggdb3"
-
-	EXTRA_WARNINGS=""
-	# We had to eliminate -Wnested-externs because of libtool changes
-        WARNLIST="all missing-prototypes 
-		missing-declarations 
-		strict-prototypes 
-		declaration-after-statement
-		pointer-arith 
-		write-strings
-		cast-qual cast-align 
-		bad-function-cast 
-		missing-format-attribute
-		format=2
-		format-security
-		format-nonliteral
-		no-long-long
-    		unsigned-char
-		gnu89-inline
-		no-strict-aliasing"
-
-	for j in $WARNLIST
-	do
-	  if
-	    cc_supports_flag -W$j
-	  then
-	    EXTRA_WARNINGS="$EXTRA_WARNINGS -W$j"
-	  fi
-	done
-
-dnl Add any system specific options here.
-
-	case "$host_os" in
-  	*linux*|*bsd*)
-		if test "${enable_fatal_warnings}" = "unknown"; then
-        		enable_fatal_warnings=yes
-        	fi
-          	;;
-  	*solaris*)
-          	;;
-	esac
-
-	if test "x${enable_coverage}" = xyes && cc_supports_flag -ftest-coverage && cc_supports_flag -fprofile-arcs ; then
-	   echo "Enabling Coverage"
-	   CFLAGS="$CFLAGS -O0 -g -ftest-coverage -fprofile-arcs"
-	   LDFLAGS="$LDFLAGS -g -ftest-coverage -fprofile-arcs"
-	   PKG_FEATURES="$PKG_FEATURES coverage"
-	fi
-
-	if test "x${enable_ansi}" = xyes && cc_supports_flag -std=iso9899:199409 ; then
-	  echo "Enabling ANSI Compatibility"
-	  ANSI="-ansi -D_GNU_SOURCE -DANSI_ONLY"
-	  PKG_FEATURES="$PKG_FEATURES ansi"
-	fi
-
-	if test "x${enable_fatal_warnings}" = xyes && cc_supports_flag -Werror ; then
-          echo "Enabling Fatal Warnings (-Werror)"
-    	  FATAL_WARNINGS="-Werror"
-	  PKG_FEATURES="$PKG_FEATURES fatal-warnings"
-        fi
-        
-	CC_WARNINGS="$EXTRA_WARNINGS $FATAL_WARNINGS $ANSI" 
-	NON_FATAL_CC_WARNINGS="$EXTRA_WARNINGS"
-
-fi
-dnl AC_SUBST(CC_WARNINGS)
-
-NON_FATAL_CFLAGS="$CFLAGS $NON_FATAL_CC_WARNINGS"
-AC_SUBST(NON_FATAL_CFLAGS)
-
-dnl
-dnl We reset CFLAGS to include our warnings *after* all function
-dnl checking goes on, so that our warning flags don't keep the
-dnl AC_*FUNCS() calls above from working.  In particular, -Werror will
-dnl *always* cause us troubles if we set it before here.
-dnl
-dnl
-CFLAGS="$CFLAGS $CC_WARNINGS"
-AC_SUBST(CFLAGS)
-
-dnl This is useful for use in Makefiles that need to remove one specific flag
-CFLAGS_COPY="$CFLAGS"
-AC_SUBST(CFLAGS_COPY)
-
-AM_CONDITIONAL(BUILD_DARWIN, test $ON_DARWIN = 1)
-
-LINT_FLAGS="-weak -unrecog +posixlib +ignoresigns -fcnuse -badflag -D__gnuc_va_list=va_list -D__attribute\(x\)="
-AC_SUBST(LINT_FLAGS)
-
-dnl ************************************************************************
-AC_SUBST(LOCALE)
-
-
-dnl The Makefiles and shell scripts we output
-AC_CONFIG_FILES(Makefile				        \
-include/Makefile						\
-lib/Makefile							\
-lcr/Makefile							\
-exec/Makefile							\
-test/Makefile							\
-tools/Makefile							\
-services/Makefile						\
-pkgconfig/Makefile						\
-		)
-
-dnl Now process the entire list of files added by previous 
-dnl  calls to AC_CONFIG_FILES()
-AC_OUTPUT()
-
-dnl *****************
-dnl Configure summary
-dnl *****************
-
-AC_MSG_RESULT([])
-AC_MSG_RESULT([$PACKAGE configuration:])
-AC_MSG_RESULT([  Version                  = ${VERSION}])
-AC_MSG_RESULT([  Prefix                   = ${prefix}])
-AC_MSG_RESULT([  Executables              = ${sbindir}])
-AC_MSG_RESULT([  Man pages                = ${mandir}])
-AC_MSG_RESULT([  Libraries                = ${libdir}])
-AC_MSG_RESULT([  Header files             = ${includedir}])
-AC_MSG_RESULT([  Arch-independent files   = ${datadir}])
-AC_MSG_RESULT([  State information        = ${localstatedir}])
-AC_MSG_RESULT([  System configuration     = ${sysconfdir}])
-AC_MSG_RESULT([  Features                 =${PKG_FEATURES}])
-AC_MSG_RESULT([  CC_WARNINGS              =${CC_WARNINGS}])
-AC_MSG_RESULT([  Mangled CFLAGS           = ${CFLAGS}])
-AC_MSG_RESULT([  Libraries                = ${LIBS}])

+ 1 - 2
exec/Makefile.am

@@ -33,7 +33,6 @@ MAINTAINERCLEANFILES    = Makefile.in
 
 
 AM_CFLAGS	= -fPIC
 AM_CFLAGS	= -fPIC
 INCLUDES       	= -I$(top_builddir)/include  -I$(top_srcdir)/include
 INCLUDES       	= -I$(top_builddir)/include  -I$(top_srcdir)/include
-DARWIN_OPTS	= -dynamiclib -bind_at_load -current_version $(SONAME) -compatibility_version $(SONAME)
 
 
 LCR_SRC		= objdb.c vsf_ykd.c coroparse.c quorum.c vsf_quorum.c
 LCR_SRC		= objdb.c vsf_ykd.c coroparse.c quorum.c vsf_quorum.c
 TOTEM_SRC	= coropoll.c totemip.c totemnet.c totemrrp.c totemsrp.c totemmrp.c totempg.c crypto.c wthread.c
 TOTEM_SRC	= coropoll.c totemip.c totemnet.c totemrrp.c totemsrp.c totemmrp.c totempg.c crypto.c wthread.c
@@ -52,7 +51,7 @@ corosync_SOURCES = main.c mempool.c util.c sync.c apidef.c service.c ipc.c \
 		timer.c totemconfig.c mainconfig.c quorum.c ../lcr/lcr_ifact.c
 		timer.c totemconfig.c mainconfig.c quorum.c ../lcr/lcr_ifact.c
 corosync_LDADD	  = -ltotem_pg -llogsys
 corosync_LDADD	  = -ltotem_pg -llogsys
 corosync_DEPENDENCIES = libtotem_pg.so.$(SONAME) liblogsys.so.$(SONAME)
 corosync_DEPENDENCIES = libtotem_pg.so.$(SONAME) liblogsys.so.$(SONAME)
-corosync_LDFLAGS = $(DYFLAGS) -L./
+corosync_LDFLAGS = $(OS_DYFLAGS) -L./
 
 
 TOTEM_OBJS	= $(TOTEM_SRC:%.c=%.o)
 TOTEM_OBJS	= $(TOTEM_SRC:%.c=%.o)
 LOGSYS_OBJS	= $(LOGSYS_SRC:%.c=%.o)
 LOGSYS_OBJS	= $(LOGSYS_SRC:%.c=%.o)

+ 1 - 2
lib/Makefile.am

@@ -34,7 +34,6 @@ MAINTAINERCLEANFILES    = Makefile.in
 
 
 AM_CFLAGS		= -fPIC
 AM_CFLAGS		= -fPIC
 INCLUDES       		= -I$(top_builddir)/include  -I$(top_srcdir)/include
 INCLUDES       		= -I$(top_builddir)/include  -I$(top_srcdir)/include
-DARWIN_OPTS		= -dynamiclib -bind_at_load -current_version $(SONAME) -compatibility_version $(SONAME)
 
 
 lib_LIBRARIES	= libcpg.a libconfdb.a libevs.a libcfg.a libquorum.a libvotequorum.a libpload.a libcoroipc.a
 lib_LIBRARIES	= libcpg.a libconfdb.a libevs.a libcfg.a libquorum.a libvotequorum.a libpload.a libcoroipc.a
 SHARED_LIBS		= $(lib_LIBRARIES:%.a=%.so.$(SONAME))
 SHARED_LIBS		= $(lib_LIBRARIES:%.a=%.so.$(SONAME))
@@ -70,7 +69,7 @@ libcoroipc.so.$(SONAME): coroipc.o
 	ln -sf libcoroipc.so.$(SONAME) libcoroipc.so.$(SOMAJOR)
 	ln -sf libcoroipc.so.$(SONAME) libcoroipc.so.$(SOMAJOR)
 
 
 libconfdb.so.$(SONAME): coroipc.o confdb.o sa-confdb.o 
 libconfdb.so.$(SONAME): coroipc.o confdb.o sa-confdb.o 
-	$(CC) $(LDFLAGS) $(DYFLAGS) -shared -Wl,-soname,libconfdb.so.$(SOMAJOR),-version-script=$(srcdir)/libconfdb.versions coroipc.o confdb.o sa-confdb.o ../lcr/lcr_ifact.o -o $@ -ldl
+	$(CC) $(LDFLAGS) $(OS_DYFLAGS) -shared -Wl,-soname,libconfdb.so.$(SOMAJOR),-version-script=$(srcdir)/libconfdb.versions coroipc.o confdb.o sa-confdb.o ../lcr/lcr_ifact.o -o $@ -ldl
 	ln -sf libconfdb.so.$(SONAME) libconfdb.so
 	ln -sf libconfdb.so.$(SONAME) libconfdb.so
 	ln -sf libconfdb.so.$(SONAME) libconfdb.so.$(SOMAJOR)
 	ln -sf libconfdb.so.$(SONAME) libconfdb.so.$(SOMAJOR)