📄 configure.in
字号:
# Manual detection for <withval>/include/<packagename> # and <withval>/include. if test -f $withval/include/mysql/mysql.h; then MYSQL_INCDIR=$withval/include/mysql elif test -f $withval/include/mysql.h; then MYSQL_INCDIR=$withval/include fi # Manual detection for <withval>/lib/<packagename> # and <withval>/lib. if test -f $withval/lib/mysql/libmysqlclient.a -o -f $withval/lib/mysql/libmysqlclient.so; then MYSQL_LIBDIR=$withval/lib/mysql elif test -f $withval/lib/libmysqlclient.a -o -f $withval/lib/libmysqlclient.so; then MYSQL_LIBDIR=$withval/lib fifi## Did we find anything?if test "${MYSQL}" = "no"; then AC_MSG_RESULT(skipped)else if test -z "$MYSQL_LIBDIR" ; then AC_MSG_RESULT(no) echo Invalid MySQL directory - unable to find libmysqlclient.a or libmysqlclient.so. elif test -z "$MYSQL_INCDIR" ; then AC_MSG_RESULT(no) echo Invalid MySQL directory - unable to find mysql.h. else TEMP_LIBS="$TEMP_LIBS -L$MYSQL_LIBDIR -lmysqlclient" #Add -lz for some mysql installs.... TEMP_LIBS="$TEMP_LIBS -lz" TEMP_CFLAGS="$TEMP_CFLAGS -DHAVE_MYSQL -I$MYSQL_INCDIR" AC_MSG_RESULT(yes) MYSQL_SUPPORT="yes" fifidnl Start Check for PostgresqlAC_DEFUN(PGSQL_INC_CHK,[if test -r $i$1/libpq-fe.h; then PGSQL_DIR=$i; PGSQL_INCDIR=$i$1])PGSQL="yes"AC_MSG_CHECKING(for PostgreSQL)AC_ARG_WITH(pgsql,[ --with-pgsql[=DIR] Include PostgreSQL support. DIR is the PostgreSQL base install directory. If not specified configure will search in /usr, /usr/local and /usr/local/pgsql. ],PGSQL="$withval"dnl if not given argument, assume standard)if test "${PGSQL}" = "no"; then AC_MSG_RESULT(skipped)fiif test "${PGSQL}" = "yes"; then for i in /usr /usr/local /usr/local/pgsql $PHP_PGSQL; do PGSQL_INC_CHK(/include) el[]PGSQL_INC_CHK(/include/pgsql) el[]PGSQL_INC_CHK(/include/postgresql) fi done if test -z "$PGSQL_DIR"; then AC_MSG_RESULT(Cannot find libpq-fe.h. Please specify the installation path of PostgreSQL) else PGSQL_INCLUDE="-I$PGSQL_INCDIR" PGSQL_LIBDIR=$PGSQL_DIR/lib AC_MSG_RESULT(yes) test -d $PGSQL_DIR/lib/pgsql && PGSQL_LIBDIR=$PGSQL_DIR/lib/pgsql LDFLAGS="$TEMP_LDFLAGS -L$PGSQL_LIBDIR" AC_CHECK_LIB(pq, PQcmdTuples,AC_DEFINE(HAVE_PQCMDTUPLES,1,[ ])) AC_CHECK_LIB(pq, PQoidValue,AC_DEFINE(HAVE_PQOIDVALUE,1,[ ])) AC_CHECK_LIB(pq, PQclientEncoding,AC_DEFINE(HAVE_PQCLIENTENCODING,1,[ ])) AC_CHECK_LIB(pq, pg_encoding_to_char,AC_DEFINE(HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT,1,[ ])) LDFLAGS="" AC_DEFINE(HAVE_PGSQL,1,[ ]) TEMP_LIBS="$TEMP_LIBS -L$PGSQL_LIBDIR -lpq" TEMP_CFLAGS="$TEMP_CFLAGS -DHAVE_PGSQL $PGSQL_INCLUDE" PostgreSQL_SUPPORT="yes" fifidnl End Postgresqldnl Checks for header files.AC_HEADER_STDCAC_CHECK_HEADERS(stdio.h unistd.h fcntl.h time.h signal.h sys/ioctl.h sys/mman.h linux/videodev.h sys/param.h)dnl Check sizes of integer typesAC_CHECK_SIZEOF(short int)if test "$ac_cv_sizeof_short_int" = "4"; then TEMP_CFLAGS="${TEMP_CFLAGS} -DTYPE_32BIT=\"short int\""else AC_CHECK_SIZEOF(int) if test "$ac_cv_sizeof_int" = "4"; then TEMP_CFLAGS="${TEMP_CFLAGS} -DTYPE_32BIT=\"int\"" else AC_CHECK_SIZEOF(long int) if test "$ac_cv_sizeof_long_int" = "4"; then TEMP_CFLAGS="${TEMP_CFLAGS} -DTYPE_32BIT=\"long int\"" fi fifiOPTIMIZECPU="yes"AC_ARG_WITH(optimizecpu,[ --without-optimizecpu Exclude autodetecting platform and cpu type. This will disable the compilation of gcc optimizing code by platform and cpu. ],OPTIMIZECPU="$withval")DEVELOPER_FLAGS="no"AC_ARG_WITH(developer-flags,[ --with-developer-flags Causes practically all of the possible gcc warning flags to be set. This may produce a large amount of warnings.],DEVELOPER_FLAGS="$withval")dnl Checks for typedefs, structures, and compiler characteristics.AC_C_CONSTif test "${FreeBSD}" != ""; then OPTIMIZECPU=""fiif test "${OPTIMIZECPU}" = "yes"; thendnl Try to autodetect cpu typeCPU_NAME="unknown"CPU_TYPE="unknown"if test -e "/proc/cpuinfo" ; then intel[[30]]="-march=i386" intel[[32]]="-march=i386" intel[[34]]="-march=i386" intel[[40]]="-march=i486" intel[[41]]="-march=i486" intel[[42]]="-march=i486" intel[[43]]="-march=i486" intel[[44]]="-march=i486" intel[[45]]="-march=i486" intel[[47]]="-march=i486" intel[[48]]="-march=i486" intel[[51]]="-march=pentium" intel[[52]]="-march=pentium" intel[[54]]="-march=pentium-mmx" intel[[61]]="-march=pentiumpro" intel[[63]]="-march=pentium2" intel[[65]]="-march=pentium2" intel[[66]]="-march=pentium2" intel[[67]]="-march=pentium3" intel[[68]]="-march=pentium3" intel[[610]]="-march=pentium3" intel[[611]]="-march=pentium3" intel[[150]]="-march=pentium4" intel[[151]]="-march=pentium4" intel[[152]]="-march=pentium4" amd[[50]]="-march=i586" amd[[51]]="-march=i586" amd[[52]]="-march=i586" amd[[53]]="-march=i586" amd[[56]]="-march=k6" amd[[57]]="-march=k6" amd[[58]]="-march=k6-2" amd[[59]]="-march=k6-3" amd[[61]]="-march=athlon" amd[[62]]="-march=athlon" amd[[63]]="-march=athlon" amd[[64]]="-march=athlon" amd[[66]]="-march=athlon" amd[[67]]="-march=athlon" amd[[68]]="-march=athlon" amd[[155]]="-march=athlon64" CPU_TYPE="known" CPU_FAMILY=`cat /proc/cpuinfo | grep "cpu family" | head -n1` CPU_MODEL=`cat /proc/cpuinfo | grep model[[^\ ]] | head -n1` CPU_NAME=`cat /proc/cpuinfo | grep "model name" | head -n1` CPU_FLAGS=`cat /proc/cpuinfo | grep "flags" | head -n1` CPU_VENDOR=`cat /proc/cpuinfo | grep "vendor_id" | head -n1` CPU_FAMILY=${CPU_FAMILY#*: } CPU_MODEL=${CPU_MODEL#*: } CPU_NAME=${CPU_NAME#*: } CPU_FLAGS=${CPU_FLAGS#*: } CPU_VENDOR=${CPU_VENDOR#*: } if test "x${CPU_VENDOR}" = "xGenuineIntel" ; then CPU_OPTIONS=${intel[[$CPU_FAMILY$CPU_MODEL]]} fi if test "x${CPU_VENDOR}" = "xAuthenticAMD" ; then CPU_OPTIONS=${amd[[$CPU_FAMILY$CPU_MODEL]]} fi if test "x${CPU_OPTIONS}" = "x" ; then CPU_TYPE="unknown" fi CPU_EXT="" for i in $CPU_FLAGS ; do case $i in fpu) CPU_FPU="-mfpmath=387" ;; mmx) CPU_EXT="$CPU_EXT -mmmx" ;; sse) CPU_FPU="-mfpmath=sse -msse" ;; sse2) CPU_FPU="-mfpmath=sse -msse2" ;; 3dnow) CPU_EXT="$CPU_EXT -m3dnow" ;; esac done CPU_OPTIONS="$CPU_OPTIONS $CPU_FPU $CPU_EXT"fiif test "x${CPU_TYPE}" = "xunknown"; then CPU_TYPE=`( uname -p ) 2>&1` case $CPU_TYPE in i386) CPU_OPTIONS="-march=i386" ;; i486) CPU_OPTIONS="-march=i486" ;; Pentium2) CPU_OPTIONS="-march=pentium2" ;; Pentiumpro) CPU_OPTIONS="-march=pentiumpro" ;; Pentium*) CPU_OPTIONS="-march=pentium" ;; k6) CPU_OPTIONS="-march=k6" ;; k6-2) CPU_OPTIONS="-march=k6-2" ;; k6-3) CPU_OPTIONS="-march=k6-3" ;; "VIA C3 Ezra") CPU_OPTIONS="-march=c3" CPU_TYPE="known" ;; *) CPU_OPTIONS="" CPU_TYPE="unknown" ;; esac if test "x${CPU_TYPE}" = "xunknown"; then CPU_TYPE=`( uname -m ) 2>&1` case $CPU_TYPE in i386) CPU_OPTIONS="-march=i386" ;; i486) CPU_OPTIONS="-march=i486" ;; i586) CPU_OPTIONS="-march=i586" ;; i686) CPU_OPTIONS="-march=i686" ;; Pentium2) CPU_OPTIONS="-march=pentium2" ;; Pentiumpro) CPU_OPTIONS="-march=pentiumpro" ;; k6) CPU_OPTIONS="-march=k6" ;; k6-2) CPU_OPTIONS="-march=k6-2" ;; k6-3) CPU_OPTIONS="-march=k6-3" ;; *) CPU_OPTIONS="" ;; esac fifiecho "Detected CPU: $CPU_NAME"dnl Now we check if the compiler supports the detected cpuCOMPILER=$CCfor I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do test "$I" && breakdoneTMPC="$I/cpu_test-$RANDOM-$$.c"TMPO="$I/cpu_test-$RANDOM-$$.o"cat > $TMPC << EOFint main(void) { return 0; }EOF( $COMPILER $CPU_OPTIONS -o $TMPO $TMPC ) 2>&1TMP="$?"rm -f $TMPOrm -f $TMPCif test "x${TMP}" = "x1" ; then CPU_OPTIONS="" echo "No CPU optimizations will be added"else echo "CPU optimization: $CPU_OPTIONS"fielse CPU_OPTIONS=""fiAC_MSG_CHECKING(for bswap instruction)AC_LINK_IFELSE([ AC_LANG_PROGRAM([ ], [unsigned int __x=0; register unsigned int __v; __asm("bswap %0" : "=r" (__v) : "0" (__x));]) ], [ TEMP_CFLAGS="${TEMP_CFLAGS} -DHAVE_BSWAP" AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) ])if test "${DEVELOPER_FLAGS}" = "yes"; then TEMP_CFLAGS="${TEMP_CFLAGS} -W -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wno-long-long"fiCFLAGS="${TEMP_CFLAGS} $UNAME_DEFS $CPU_OPTIONS"LIBS="${TEMP_LIBS}"LDFLAGS="${TEMP_LDFLAGS}"dnldnl Add the right exec path for rc scriptsdnlif test $prefix = "NONE";then BIN_PATH="$ac_default_prefix" if test $exec_prefix = "NONE"; then BIN_PATH="$BIN_PATH/bin" else BIN_PATH="$BIN_PATH/$bindir" fielse if test $exec_prefix = "NONE";then BIN_PATH="$prefix/bin" else BIN_PATH="$prefix/$bindir" fifiAC_SUBST(BIN_PATH)AC_OUTPUT(motion.init-FreeBSD.shmotion.init-Debianmotion.init-RHmotion.specMakefile)echo ""echo " ************************"echo " * Configure status *"echo " ************************"echo ""if test "${Darwin}" != ""; then echo "OS : Darwin"elif test "${FreeBSD}" != ""; then echo "OS : *BSD" else echo "OS : Linux"fiif test "${PTHREAD_SUPPORT}" = "yes"; then echo "pthread Support: Yes"else echo "pthread Support: No" echo "**********************************************" echo "** Fatal Error YOU MUST HAVE pthread Support *" echo "**********************************************" fiif test "${JPEG_SUPPORT_MMX}" = "yes"; then echo "jpeg-mmx Support: Yes"elif test "${JPEG_SUPPORT}" = "yes"; then echo "jpeg Support: Yes"else echo "jpeg Support: No" echo "**********************************************" echo "** Fatal Error YOU MUST HAVE jpeg Support ***" echo "**********************************************"fiif test "${FreeBSD}" != ""; then if test "${BKTR}" = "yes"; then echo "BKTR included: Yes" else echo "BKTR included: No" fielse if test "${V4L}" = "yes"; then echo "V4L included: Yes" else echo "V4L included: No" fifiif test "${FFMPEG_OK}" = "found"; then echo "FFmpeg Support: Yes"else echo "FFmpeg Support: No"fiif test "${MYSQL_SUPPORT}" = "yes"; then echo "MYSQL Support: Yes"else echo "MYSQL Support: No"fiif test "${PostgreSQL_SUPPORT}" = "yes"; then echo "PostgreSQL Support: Yes"else echo "PostgreSQL Support: No"fiecho ""echo "CFLAGS: $CFLAGS"echo "LIBS: $LIBS"echo "LDFLAGS: $LDFLAGS"echoecho "Install prefix: $prefix"echo
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -