The qDecoder Project

[svn] / trunk / configure.ac

Parent Directory Parent Directory Revision Log Revision Log


Revision 580 - Download Blame
Wed Apr 28 04:29:40 2010 UTC (3 weeks, 4 days ago) by wolkykim
File size: 6355 byte(s)
o adjust to compile with -g flag
    1 ## Copyright 2000-2010 The qDecoder Project. All rights reserved.
    2 ##
    3 ## Redistribution and use in source and binary forms, with or without
    4 ## modification, are permitted provided that the following conditions
    5 ## are met:
    6 ##
    7 ## 1. Redistributions of source code must retain the above copyright
    8 ##    notice, this list of conditions and the following disclaimer.
    9 ## 2. Redistributions in binary form must reproduce the above copyright
   10 ##    notice, this list of conditions and the following disclaimer in the
   11 ##    documentation and/or other materials provided with the distribution.
   12 ##
   13 ## THIS SOFTWARE IS PROVIDED BY THE QDECODER PROJECT ``AS IS'' AND ANY
   14 ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   15 ## WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   16 ## DISCLAIMED. IN NO EVENT SHALL THE QDECODER PROJECT BE LIABLE FOR ANY
   17 ## DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   18 ## (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   19 ## LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   20 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   21 ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   22 ## THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   23 ##
   24 ## $Id$
   25 
   26 AC_COPYRIGHT([
   27 =============================================================================
   28 Copyright 2000-2010 The qDecoder Project. All rights reserved.
   29 
   30 Redistribution and use in source and binary forms, with or without
   31 modification, are permitted provided that the following conditions
   32 are met:
   33 
   34 1. Redistributions of source code must retain the above copyright
   35    notice, this list of conditions and the following disclaimer.
   36 2. Redistributions in binary form must reproduce the above copyright
   37    notice, this list of conditions and the following disclaimer in the
   38    documentation and/or other materials provided with the distribution.
   39 
   40 THIS SOFTWARE IS PROVIDED BY THE QDECODER PROJECT ``AS IS'' AND ANY
   41 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   42 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   43 DISCLAIMED. IN NO EVENT SHALL THE QDECODER PROJECT BE LIABLE FOR ANY
   44 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   45 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   46 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   47 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   48 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   49 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   50 =============================================================================
   51 ])
   52 
   53 ## Internal functions
   54 AC_DEFUN([Q_ARG_ENABLE], [
   55 	AC_ARG_ENABLE([$1],[AS_HELP_STRING([--enable-$1], [$2])],,[enableval=no])
   56 	if test "$enableval" = yes; then
   57 		AC_MSG_NOTICE(['$1' feature is enabled])
   58 		CPPFLAGS="$CPPFLAGS $3"
   59 	fi
   60 ])
   61 
   62 AC_DEFUN([Q_ARG_DISABLE], [
   63 	AC_ARG_ENABLE([$1],[AS_HELP_STRING([--disable-$1], [$2])],,[enableval=yes])
   64 	if test "$enableval" = no; then
   65 		AC_MSG_NOTICE(['$1' feature is disabled])
   66 		CPPFLAGS="$CPPFLAGS $3"
   67 	fi
   68 ])
   69 
   70 ## Initialize
   71 AC_INIT([qDecoder], [10 RELEASE], [/])
   72 AC_CONFIG_SRCDIR([config.h.in])
   73 AC_CONFIG_HEADER([config.h])
   74 AC_CONFIG_FILES([Makefile src/Makefile examples/Makefile])
   75 
   76 ## Set path
   77 PATH="$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
   78 CPPFLAGS="$CPPFLAGS -I/usr/include -I/usr/local/include -I./ -D_GNU_SOURCE"
   79 LDFLAGS="$LDFLAGS -L/usr/lib -L/usr/local/lib"
   80 
   81 ## Set autoconf setting
   82 #AC_CANONICAL_TARGET
   83 AC_PREFIX_DEFAULT([/usr/local])
   84 #AC_PRESERVE_HELP_ORDER
   85 
   86 ## Checks for programs.
   87 AC_PROG_CC
   88 if test $ac_compiler_gnu = yes; then
   89 	CFLAGS="-Wall -fPIC"
   90 #else
   91 #	AC_MSG_FAILURE([GCC is required to compile qDecoder.])
   92 fi
   93 
   94 AC_PROG_INSTALL
   95 AC_PROG_LN_S
   96 AC_PROG_MAKE_SET
   97 AC_PROG_RANLIB
   98 
   99 AC_PATH_PROG(AR, ar)
  100 AC_PATH_PROG(CHMOD, chmod)
  101 AC_PATH_PROG(LD, ld)
  102 AC_PATH_PROG(RM, rm)
  103 
  104 ## Checks for header files.
  105 AC_HEADER_STDC
  106 AC_HEADER_STDBOOL
  107 AC_HEADER_DIRENT
  108 #AC_CHECK_HEADER([sys/sendfile.h])
  109 
  110 ## Checks for typedefs, structures, and compiler characteristics.
  111 AC_TYPE_SIZE_T
  112 AC_TYPE_OFF_T
  113 
  114 ## Checks for libraries.
  115 
  116 ## Checks for library functions.
  117 #AC_CHECK_FUNCS([socket sendfile])
  118 
  119 Q_ARG_ENABLE([debug], [enable debugging output], [-DBUILD_DEBUG])
  120 if test "$enableval" = yes; then
  121 	CFLAGS="$CFLAGS -g -O2"
  122 else
  123 	CFLAGS="$CFLAGS -g -O2"
  124 fi
  125 
  126 Q_ARG_ENABLE([threadsafe], [enable thread-safe feature], [-DENABLE_THREADSAFE])
  127 if test "$enableval" = yes; then
  128 	AC_CHECK_LIB([pthread], [main], [], AC_MSG_ERROR([Can't find pthread library.]))
  129 fi
  130 
  131 Q_ARG_ENABLE([lfs], [enable large file supports], [-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64])
  132 #Q_ARG_ENABLE([sendfile], [use sendfile() if possible], [-DENABLE_SENDFILE])
  133 
  134 AC_ARG_ENABLE([fastcgi],[AS_HELP_STRING([--enable-fastcgi=/FASTCGI_INCLUDE_DIR_PATH/], [enable FastCGI supports])],[enableval=yes],[enableval=no])
  135 if test "$enableval" = yes; then
  136 	AC_CHECK_FILE([$enable_fastcgi/fcgi_stdio.h],[enableval=yes],[enableval=no])
  137 	if test "$enableval" = yes; then
  138 		AC_MSG_NOTICE(['fastcgi' feature is enabled])
  139 		CPPFLAGS="$CPPFLAGS -DENABLE_FASTCGI -I$enable_fastcgi"
  140 	else
  141 		AC_MSG_FAILURE([can't find 'fcgi_stdio.h' header file in '$enable_fastcgi' directory. can't enable fastcgi support.])
  142 	fi
  143 fi
  144 
  145 AC_ARG_ENABLE([mysql],[AS_HELP_STRING([--enable-mysql=/MYSQL_INCLUDE_DIR_PATH/], [enable MySQL database supports])],[enableval=yes],[enableval=no])
  146 if test "$enableval" = yes; then
  147 	AC_CHECK_FILE([$enable_mysql/mysql.h],[enableval=yes],[enableval=no])
  148 	if test "$enableval" = yes; then
  149 		AC_MSG_NOTICE(['mysql' feature is enabled])
  150 		CPPFLAGS="$CPPFLAGS -DENABLE_MYSQL -I$enable_mysql"
  151 	else
  152 		AC_MSG_FAILURE([can't find 'mysql.h' header file in '$enable_mysql' directory. can't enable mysql support.])
  153 	fi
  154 fi
  155 
  156 Q_ARG_DISABLE([cgi], [disable CGI APIs], [-DDISABLE_CGI])
  157 Q_ARG_DISABLE([socket], [disable socket APIs], [-DDISABLE_SOCKET])
  158 Q_ARG_DISABLE([ipc], [disable IPC APIs], [-DDISABLE_IPC])
  159 Q_ARG_DISABLE([datastructure], [disable data-structure APIs], [-DDISABLE_DATASTRUCTURE])
  160 
  161 AC_MSG_NOTICE([CFLAGS $CFLAGS])
  162 AC_MSG_NOTICE([CPPFLAGS $CPPFLAGS])
  163 #AC_MSG_NOTICE([LIBS $LIBS])
  164 
  165 ## Create Makefile
  166 AC_OUTPUT

Home | About | Examples | Changes | Download | SVN Repository | Install | Reference