[c47c9a]: configure.ac  Maximize  Restore  History

Download this file

199 lines (165 with data), 5.8 kB

dnl Process this file with autoconf to produce configure.
dnl
dnl Copyright Edscott Wilson Garcia.
dnl
dnl This file is part of libtubo.  The full libtubo copyright notice, including
dnl terms governing use, modification, and redistribution, is contained in
dnl the files COPYING and Copyright.html.  COPYING can be found at the root
dnl of the source code distribution tree; Copyright.html can be found at the
dnl root level of an installed copy of the electronic DBH document set and
dnl is linked from the top-level documents page.  
dnl
dnl ----------------------------------------------------------------------
AC_COPYRIGHT([Copyright (c) 2002-2015
        Edscott Wilson García. All rights reserved.])
AC_INIT([libtubo0], [5.0.16], [https://sourceforge.net/p/xffm/bugs/milestone/libtubo/])
AC_SUBST(TUBO_VERSION) TUBO_VERSION=5.0.16
# libtool versioning (quick reminder)
# libtool version related macros
# 1. (current) new headers, do current++, revision->0
# 2. (DBH_SO_REVISION) bug fixes, optimizations,  do revision++
# 3. (age) age: how many backwards compatible "currents" is this current compatible with.
#         increment with current, set to zero if function calls have changed or
#         removed.
AC_SUBST(TUBO_LT_VERSION) TUBO_LT_VERSION="1:0:1"
# DBH_SO_VERSION = current - age
# new headers, do current++, revision->0
m4_define([x_current], [1])
# bug fixes, do revision++
m4_define([x_revision], [0])
# age: how many backwards compatible "currents" is this current compatible with.
m4_define([x_age], [1])

RFM_LINUX_OR_BSD
RFM_DEBUG
RFM_TRACE


# RPM stuff 
m4_define([library], [libtubo])
AC_SUBST(LIBRARY) LIBRARY=library
AC_SUBST(SO_VERSION) SO_VERSION=x_current
AC_SUBST(SO_REVISION) SO_REVISION=x_revision
m4_define([x_so_version], [m4_eval(x_current - x_age)])
m4_define([x_so_file], [library().so.x_so_version()])
m4_define([rpm_so_file], [%{_libdir}/x_so_file()])
AC_SUBST(SO_LINK) SO_LINK=rpm_so_file

AC_SUBST(CENTOS_OPTION)CENTOS_OPTION=
AC_SUBST(RPM_COMMENT)
AC_SUBST(RPM_LICENSE)
AC_SUBST(RPM_GROUP) 
AC_SUBST(RPM_FDUPES_REQUIRES)
AC_SUBST(FDUPES_ACT)
# install stuff
AC_SUBST(PKG_CONFIG_FILE) 
AC_SUBST(RPM_PKG_CONFIG)
if test "$SUSE_RPM" = "no"; then
    RPM_COMMENT="# RPM spec file for RedHat CentOS created by configure script."
    RPM_LICENSE="GPLv3"
    RPM_GROUP="Development tools"
    RPM_FDUPES_REQUIRES=
    FDUPES_ACT
    PKG_CONFIG_FILE="%{_datadir}/pkgconfig/tubo.pc"
    CENTOS_OPTION="--with-centos=yes"
    RPM_PKG_CONFIG="pkgconfig"
else 
    RPM_COMMENT="# RPM spec file for SUSE OpenSUSE created by configure script."
    RPM_LICENSE="GPL-3.0"
    RPM_GROUP="Development/Libraries/C and C++"
    RPM_FDUPES_REQUIRES="BuildRequires: fdupes"
    PKG_CONFIG_FILE="%{_libdir}/pkgconfig/tubo.pc"
    RPM_PKG_CONFIG="pkg-config"
fi


if test $prefix = NONE; then
   echo "prefix = $ac_default_prefix"
else
   echo "prefix = $prefix"
   ac_default_prefix=$prefix
fi  


AC_CONFIG_MACRO_DIR([m4])
LT_INIT([win32-dll])

AM_INIT_AUTOMAKE(1.11 foreign silent-rules)
AM_SILENT_RULES([yes])


AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE

dnl Basic Checks
dnl check for UNIX variants
AC_ISC_POSIX

dnl check for basic programs
AC_PROG_CC
AM_PROG_CC_STDC
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_PROG_MAKE_SET

GTK_DOC_CHECK([1.18],[--flavour no-tmpl])


dnl check for standard header files
AC_HEADER_MAJOR
AC_HEADER_STDC

AC_ARG_WITH(examples, [  --with-examples         build example programs (required for test) (default=no)])
AM_CONDITIONAL([WANT_EXAMPLES], [test "$with_examples" = yes])
if test "$with_examples" != "yes"; then
    with_examples=no
fi

if test "$with_examples" = "yes"; then
    AM_PATH_GLIB_2_0([2.18.0],[ac_cv_glib_ok=yes],[ac_cv_glib_ok=no])
 if test "$ac_cv_glib_ok" = "no"; then
    AC_MSG_ERROR("Examples require glib.")
 fi
fi
AC_SUBST(WITH_EXAMPLES) WITH_EXAMPLES=$with_examples
AM_CONDITIONAL(WANT_GLIB, [test "$ac_cv_glib_ok" = yes])

AC_CHECK_FUNCS([waitid])
AC_CHECK_FUNCS([waitpid])
AC_CHECK_FUNCS([_pipe])
AC_CHECK_FUNCS([_cwait])
AC_CHECK_FUNCS([fork])
AC_CHECK_FUNCS([mmap])
AC_CHECK_FUNCS([munmap])
AC_CHECK_FUNCS([usleep])
AC_CHECK_FUNCS([nanosleep])
AC_CHECK_FUNCS([kill])
dnl Check for signal handling
AC_CHECK_FUNCS([signal])
AC_CHECK_FUNCS([sigaction])
AC_CHECK_LIB([rt],[shm_open])
if test "$ac_cv_lib_rt_shm_open" == yes ; then
	AC_SUBST(RT_LIB) RT_LIB="-lrt"
fi


AC_ARG_WITH(semaphores, [  --with-semaphores            compile and install local semaphore code for windows (default=yes)])
# default is set to local _semaphores.c until sem patch is included
# in Mingw-w64 (if ever)
AM_CONDITIONAL(WANT_SEMAPHORES, [test "$with_semaphores" != "no"])
if test  "$with_semaphores" != "no" ; then
	AC_DEFINE_UNQUOTED([WITH__SEMAPHORE], [1], [Use internal semaphore wrappers]) 
fi	

AC_CHECK_HEADERS([sys/types.h sys/wait.h sys/mman.h])
AC_CHECK_HEADERS([unistd.h stdarg.h signal.h errno.h stdlib.h stdio.h string.h fcntl.h semaphore.h pthread.h])
AC_CHECK_HEADERS([windows.h process.h conio.h tchar.h])
AM_CONDITIONAL(WINDOZE, [test "$ac_cv_header_windows_h" = "yes"])
if test "$ac_cv_header_windows_h" = "yes" ; then
  AC_CHECK_FUNCS([GetProcessId],[],[AC_MSG_ERROR("GetProcessId() not found. Try compiling with Mingw-w64 >= 3.0 instead.")])
fi

dnl Check for system characteristics
AC_SYS_LARGEFILE

AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(int)

dnl Check for C compiler characteristics
AC_C_BIGENDIAN
AC_C_CONST
AC_C_INLINE
AC_C_LONG_DOUBLE
AC_C_VOLATILE




AC_OUTPUT([
Makefile
tubo.settings
src/Makefile
doc/Makefile
man/Makefile
tubo.pc
libtubo0.spec
debian/changelog
])

#doc/version.xml
#doc/Makefile


echo "CFLAGS -> $CFLAGS"
#AC_MSG_RESULT(configure step complete: now do a "make" followed by a make "install")

dnl show the configure settings
cat tubo.settings