Added initial implementation of autoconf script (aconfigure)

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@625 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Benny Prijono 2006-07-24 02:07:11 +00:00
parent 7db431e40c
commit a9b372ae96
8 changed files with 11124 additions and 4 deletions

7778
aconfigure Executable file

File diff suppressed because it is too large Load Diff

148
aconfigure.ac Normal file
View File

@ -0,0 +1,148 @@
AC_INIT(pjproject,0.5.7)
AC_CANONICAL_TARGET
AC_CONFIG_HEADER(pjlib/include/pj/compat/os_auto.h)
AC_PROG_CC
AC_LANG_C
AC_CHECK_HEADER(arpa/inet.h,[AC_DEFINE(PJ_HAS_ARPA_INET_H,1)])
AC_CHECK_HEADER(assert.h,[AC_DEFINE(PJ_HAS_ASSERT_H,1)])
AC_CHECK_HEADER(ctype.h,[AC_DEFINE(PJ_HAS_CTYPE_H,1)])
AC_CHECK_HEADER(errno.h,[AC_DEFINE(PJ_HAS_ERRNO_H,1)])
AC_CHECK_HEADER(linux/socket.h,[AC_DEFINE(PJ_HAS_LINUX_SOCKET_H,1)])
AC_CHECK_HEADER(malloc.h,[AC_DEFINE(PJ_HAS_MALLOC_H,1)])
AC_CHECK_HEADER(netdb.h,[AC_DEFINE(PJ_HAS_NETDB_H,1)])
AC_CHECK_HEADER(netinet/in.h,[AC_DEFINE(PJ_HAS_NETINET_IN_H,1)])
AC_CHECK_HEADER(setjmp.h,[AC_DEFINE(PJ_HAS_SETJMP_H,1)])
AC_CHECK_HEADER(stdarg.h,[AC_DEFINE(PJ_HAS_STDARG_H,1)])
AC_CHECK_HEADER(stddef.h,[AC_DEFINE(PJ_HAS_STDDEF_H,1)])
AC_CHECK_HEADER(stdio.h,[AC_DEFINE(PJ_HAS_STDIO_H,1)])
AC_CHECK_HEADER(stdlib.h,[AC_DEFINE(PJ_HAS_STDLIB_H,1)])
AC_CHECK_HEADER(string.h,[AC_DEFINE(PJ_HAS_STRING_H,1)])
AC_CHECK_HEADER(sys/ioctl.h,[AC_DEFINE(PJ_HAS_SYS_IOCTL_H,1)])
AC_CHECK_HEADER(sys/select.h,[AC_DEFINE(PJ_HAS_SYS_SELECT_H,1)])
AC_CHECK_HEADER(sys/socket.h,[AC_DEFINE(PJ_HAS_SYS_SOCKET_H,1)])
AC_CHECK_HEADER(sys/time.h,[AC_DEFINE(PJ_HAS_SYS_TIME_H,1)])
AC_CHECK_HEADER(sys/timeb.h,[AC_DEFINE(PJ_HAS_SYS_TIMEB_H,1)])
AC_CHECK_HEADER(sys/types.h,[AC_DEFINE(PJ_HAS_SYS_TYPES_H,1)])
AC_CHECK_HEADER(time.h,[AC_DEFINE(PJ_HAS_TIME_H,1)])
AC_CHECK_HEADER(unistd.h,[AC_DEFINE(PJ_HAS_UNISTD_H,1)])
AC_CHECK_HEADER(mswsock.h,[AC_DEFINE(PJ_HAS_MSWSOCK_H,1)])
AC_CHECK_HEADER(winsock.h,[AC_DEFINE(PJ_HAS_WINSOCK_H,1)])
AC_CHECK_HEADER(winsock2.h,[AC_DEFINE(PJ_HAS_WINSOCK2_H,1)])
AC_CHECK_HEADER(alsa/version.h)
# Determine if inet_aton() is available
AC_MSG_CHECKING([if inet_aton is available])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>]],
[inet_aton(0, 0);])],
[AC_DEFINE(PJ_SOCK_HAS_INET_ATON,1)
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
# Determine if sockaddr_in has sin_len member
AC_MSG_CHECKING([if sockaddr_in has sin_len member])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>]],
[struct sockaddr_in a; a.sin_len=0;])],
[AC_DEFINE(PJ_SOCKADDR_HAS_LEN,1)
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
# Determine if SO_ERROR is available
AC_MSG_CHECKING([if SO_ERROR is available])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>]],
[int i=SO_ERROR;])],
[AC_DEFINE(PJ_HAS_SO_ERROR,1)
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
# Determine if RW-mutex is available
AC_MSG_CHECKING([if pthread_rwlock_t is available])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
[pthread_rwlock_t *x;])],
[AC_DEFINE(PJ_EMULATE_RWMUTEX,0)
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
# Determine if select() requires nfds to be filled up with
# correct value (max_fd+1). If zero, nfds will be filled up with
# PJ_FD_SETSIZE
case $target in
*rtems*) AC_DEFINE(PJ_SELECT_NEEDS_NFDS,1)
AC_MSG_CHECKING([if select() needs correct nfds])
AC_MSG_RESULT(yes)
;;
*) AC_DEFINE(PJ_SELECT_NEEDS_NFDS,0)
AC_MSG_RESULT([no (default)])
AC_MSG_RESULT([** Decided that select() doesn't need correct nfds (please check)])
;;
esac
# Determine if pj_thread_create() should enforce thread stack size when
# creating thread. Default is zero, to allow OS to allocate appropriate
# thread's stack size.
AC_MSG_CHECKING([if pj_thread_create() should enforce stack size])
case $target in
*rtems*) AC_DEFINE(PJ_THREAD_SET_STACK_SIZE,1)
AC_MSG_RESULT(yes)
;;
*) AC_DEFINE(PJ_THREAD_SET_STACK_SIZE,0)
AC_MSG_RESULT([no (default)])
;;
esac
# Determine if pj_thread_create() should allocate thread's stack from
# the pool. Default is zero, to let OS allocate thread's stack.
AC_MSG_CHECKING([if pj_thread_create() should allocate stack])
case $target in
*rtems*) AC_DEFINE(PJ_THREAD_ALLOCATE_STACK,1)
AC_MSG_RESULT(yes)
;;
*) AC_DEFINE(PJ_THREAD_ALLOCATE_STACK,0)
AC_MSG_RESULT([no (default)])
;;
esac
# This value specifies the value set in errno by the OS when a non-blocking
# socket recv() can not return immediate data.
case $target in
*) AC_DEFINE(PJ_BLOCKING_ERROR_VAL,EAGAIN)
AC_MSG_RESULT([** Setting non-blocking recv() retval to EAGAIN (please check)])
;;
esac
# This value specifies the value set in errno by the OS when a non-blocking
# socket connect() can not get connected immediately.
case $target in
*) AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,EINPROGRESS)
AC_MSG_RESULT([** Setting non-blocking connect() retval to EINPROGRESS (please check)])
;;
esac
AC_MSG_RESULT([Setting PJ_OS_NAME to $target])
AC_DEFINE_UNQUOTED(PJ_OS_NAME,["$target"])
AC_MSG_RESULT([Setting PJ_HAS_ERRNO_VAR to 1])
AC_DEFINE(PJ_HAS_ERRNO_VAR,1)
AC_MSG_RESULT([Setting PJ_HAS_HIGH_RES_TIMER to 1])
AC_DEFINE(PJ_HAS_HIGH_RES_TIMER,1)
AC_MSG_RESULT([Setting PJ_HAS_MALLOC to 1])
AC_DEFINE(PJ_HAS_MALLOC,1)
AC_MSG_RESULT([Setting PJ_NATIVE_STRING_IS_UNICODE to 0])
AC_DEFINE(PJ_NATIVE_STRING_IS_UNICODE,0)
AC_MSG_RESULT([Setting PJ_ATOMIC_VALUE_TYPE to long])
AC_DEFINE(PJ_ATOMIC_VALUE_TYPE,long)
AC_OUTPUT()

1317
config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

1500
config.sub vendored Executable file

File diff suppressed because it is too large Load Diff

251
install-sh Executable file
View File

@ -0,0 +1,251 @@
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
:
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
chmodcmd=""
else
instcmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f "$src" ] || [ -d "$src" ]
then
:
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
:
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
:
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
:
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
:
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0

View File

@ -0,0 +1,126 @@
/* $Id$ */
/*
* Copyright (C)2003-2006 Benny Prijono <benny@prijono.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __PJ_COMPAT_OS_AUTO_H__
#define __PJ_COMPAT_OS_AUTO_H__
/**
* @file os_auto.h
* @brief Describes operating system specifics (automatically detected by
* autoconf)
*/
/* Canonical OS name */
#undef PJ_OS_NAME
/* Headers availability */
#undef PJ_HAS_ARPA_INET_H
#undef PJ_HAS_ASSERT_H
#undef PJ_HAS_CTYPE_H
#undef PJ_HAS_ERRNO_H
#undef PJ_HAS_LINUX_SOCKET_H
#undef PJ_HAS_MALLOC_H
#undef PJ_HAS_NETDB_H
#undef PJ_HAS_NETINET_IN_H
#undef PJ_HAS_SETJMP_H
#undef PJ_HAS_STDARG_H
#undef PJ_HAS_STDDEF_H
#undef PJ_HAS_STDIO_H
#undef PJ_HAS_STDLIB_H
#undef PJ_HAS_STRING_H
#undef PJ_HAS_SYS_IOCTL_H
#undef PJ_HAS_SYS_SELECT_H
#undef PJ_HAS_SYS_SOCKET_H
#undef PJ_HAS_SYS_TIME_H
#undef PJ_HAS_SYS_TIMEB_H
#undef PJ_HAS_SYS_TYPES_H
#undef PJ_HAS_TIME_H
#undef PJ_HAS_UNISTD_H
#undef PJ_HAS_MSWSOCK_H
#undef PJ_HAS_WINSOCK_H
#undef PJ_HAS_WINSOCK2_H
#undef PJ_SOCK_HAS_INET_ATON
/* Set 1 if native sockaddr_in has sin_len member.
* Default: 0
*/
#undef PJ_SOCKADDR_HAS_LEN
/**
* If this macro is set, it tells select I/O Queue that select() needs to
* be given correct value of nfds (i.e. largest fd + 1). This requires
* select ioqueue to re-scan the descriptors on each registration and
* unregistration.
* If this macro is not set, then ioqueue will always give FD_SETSIZE for
* nfds argument when calling select().
*
* Default: 0
*/
#undef PJ_SELECT_NEEDS_NFDS
/* Is errno a good way to retrieve OS errors?
*/
#undef PJ_HAS_ERRNO_VAR
/* When this macro is set, getsockopt(SOL_SOCKET, SO_ERROR) will return
* the status of non-blocking connect() operation.
*/
#undef PJ_HAS_SO_ERROR
/* This value specifies the value set in errno by the OS when a non-blocking
* socket recv() can not return immediate daata.
*/
#undef PJ_BLOCKING_ERROR_VAL
/* This value specifies the value set in errno by the OS when a non-blocking
* socket connect() can not get connected immediately.
*/
#undef PJ_BLOCKING_CONNECT_ERROR_VAL
/* Default threading is enabled, unless it's overridden. */
#ifndef PJ_HAS_THREADS
# define PJ_HAS_THREADS (1)
#endif
#undef PJ_HAS_HIGH_RES_TIMER
#undef PJ_HAS_MALLOC
#ifndef PJ_OS_HAS_CHECK_STACK
# define PJ_OS_HAS_CHECK_STACK 0
#endif
#undef PJ_NATIVE_STRING_IS_UNICODE
#undef PJ_ATOMIC_VALUE_TYPE
/* If 1, use Read/Write mutex emulation for platforms that don't support it */
#undef PJ_EMULATE_RWMUTEX
/* If 1, pj_thread_create() should enforce the stack size when creating
* threads.
* Default: 0 (let OS decide the thread's stack size).
*/
#undef PJ_THREAD_SET_STACK_SIZE
/* If 1, pj_thread_create() should allocate stack from the pool supplied.
* Default: 0 (let OS allocate memory for thread's stack).
*/
#undef PJ_THREAD_ALLOCATE_STACK
#endif /* __PJ_COMPAT_OS_AUTO_H__ */

View File

@ -1,5 +1,5 @@
#!/bin/sh
svn add $1
svn add $*
./svn_pset $1
./svn_pset $*

View File

@ -1,4 +1,4 @@
#!/bin/sh
svn pset svn:keywords id $1
svn pset svn:eol-style native $1
svn pset svn:keywords id $*
svn pset svn:eol-style native $*