configure.in
来自「OTP是开放电信平台的简称」· IN 代码 · 共 190 行
IN
190 行
define([AC_CACHE_LOAD], )dnldefine([AC_CACHE_SAVE], )dnldnl Process this file with autoconf to produce a configure script.AC_INIT(c_src/odbcserver.c)if test -z "$ERL_TOP" || test ! -d $ERL_TOP ; then AC_CONFIG_AUX_DIRS(autoconf)else erl_top=${ERL_TOP} AC_CONFIG_AUX_DIRS($erl_top/erts/autoconf)fiif test "X$host" != "Xfree_source" -a "X$host" != "Xwin32"; then AC_CANONICAL_HOSTelse host_os=win32fidnl Checks for programs.AC_PROG_CCdnl ---------------------------------------------------------------------dnl Special windows stuff regarding CFLAGS and details in the environment...dnl ---------------------------------------------------------------------AC_MSG_CHECKING(for mixed cygwin and native VC++ environment)if test "X$CC" = "Xcc.sh" -a "X$host" = "Xwin32"; then if test -x /usr/bin/cygpath; then CFLAGS="-O2" AC_MSG_RESULT([yes]) MIXED_CYGWIN_VC=yes else AC_MSG_RESULT([undeterminable]) AC_MSG_ERROR(Seems to be mixed windows but not with cygwin, cannot handle this!) fielse AC_MSG_RESULT([no]) MIXED_CYGWIN_VC=nofiAC_SUBST(MIXED_CYGWIN_VC)AC_PROG_MAKE_SETAC_CHECK_PROGS(DED_LD, [ld.sh ld], '$(CC)')AC_SUBST(DED_LD)# ODBC /bin/rm -f $ERL_TOP/lib/odbc/SKIPhave_pthread_lib=noAC_SUBST(TARGET_FLAGS) case $host_os in win32|cygwin) TARGET_FLAGS="-DWIN32" AC_CHECK_LIB(ws2_32, main) if test ! -d "$with_odbc"; then ODBC_LIB="" ODBC_INCLUDE="" else ODBC_LIB=-L"$with_odbc/lib" ODBC_INCLUDE="-I$with_odbc/include" fi ;; *) TARGET_FLAGS="-DUNIX" AC_CHECK_LIB(pthread, pthread_create, [AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have the pthread library (-lpthread).]) LIBS="$LIBS -lpthread" have_pthread_lib=yes]) if test ! -d "$with_odbc"; then AC_MSG_CHECKING([for odbc in standard locations]) for dir in /usr/local/odbc /usr/local /usr/odbc \ /usr /opt/local/pgm/odbc /usr/local/pgm/odbc do if test -f "$dir/include/sql.h"; then is_odbc_std_location=yes ODBC_LIB=-L"$dir/lib" ODBC_INCLUDE="-I$dir/include" break fi done if test "x$is_odbc_std_location" != "xyes"; then AC_MSG_RESULT(no) AC_MSG_WARN([No odbc library found skipping odbc]) echo "No odbc library found" > $ERL_TOP/lib/odbc/SKIP else AC_MSG_RESULT($ODBC_LIB) fi else ODBC_LIB=-L"$with_odbc/lib" ODBC_INCLUDE="-I$with_odbc/include" fi ;;esacAC_CHECK_LIB(odbc, SQLAllocHandle, [ODBC_LIB="$ODBC_LIB -lodbc"], [], [$ODBC_LIB]) AC_SUBST(ODBC_LIB)AC_SUBST(ODBC_INCLUDE)AC_CHECK_LIB(odbc32, main) # Sockets#--------------------------------------------------------------------# Check for the existence of the -lsocket and -lnsl libraries.# The order here is important, so that they end up in the right# order in the command line generated by make. Here are some# special considerations:# 1. Use "connect" and "accept" to check for -lsocket, and# "gethostbyname" to check for -lnsl.# 2. Use each function name only once: can't redo a check because# autoconf caches the results of the last check and won't redo it.# 3. Use -lnsl and -lsocket only if they supply procedures that# aren't already present in the normal libraries. This is because# IRIX 5.2 has libraries, but they aren't needed and they're# bogus: they goof up name resolution if used.# 4. On some SVR4 systems, can't use -lsocket without -lnsl too.# To get around this problem, check for both libraries together# if -lsocket doesn't work by itself.#--------------------------------------------------------------------erl_checkBoth=0AC_CHECK_FUNC(connect, erl_checkSocket=0, erl_checkSocket=1)if test "$erl_checkSocket" = 1; then AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket", erl_checkBoth=1)fiif test "$erl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" AC_CHECK_FUNC(accept, odbc_erl_checkNsl=0, [LIBS=$tk_oldLibs])fiAC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))dnl Checks for header files.AC_HEADER_STDCcase $have_pthread_lib-$host_os in yes-linux*) dnl NPTL test stolen from $ERL_TOP/erts/aclocal.m4 AC_MSG_CHECKING(for Native POSIX Thread Library) case `getconf GNU_LIBPTHREAD_VERSION 2>/dev/null` in nptl*) nptl=yes;; NPTL*) nptl=yes;; *) nptl=no;; esac AC_MSG_RESULT($nptl) if test $nptl = yes; then need_nptl_incldir=no AC_CHECK_HEADER(nptl/pthread.h, need_nptl_incldir=yes) if test $need_nptl_incldir = yes; then # Ahh... nptl_path="$C_INCLUDE_PATH:$CPATH:/usr/local/include:/usr/include" nptl_ws_path= save_ifs="$IFS"; IFS=":" for dir in $nptl_path; do if test "x$dir" != "x"; then nptl_ws_path="$nptl_ws_path $dir" fi done IFS=$save_ifs nptl_incldir= for dir in $nptl_ws_path; do AC_CHECK_HEADER($dir/nptl/pthread.h, nptl_incldir=$dir/nptl) if test "x$nptl_incldir" != "x"; then CFLAGS="$CFLAGS -isystem $nptl_incldir" dnl CPPFLAGS is for configure internal use CPPFLAGS="$CPPFLAGS -isystem $nptl_incldir" break fi done if test "x$nptl_incldir" = "x"; then AC_MSG_ERROR(Failed to locate nptl system include directory) fi fi fi ;; *) ;;esacAC_CHECK_HEADERS([fcntl.h netdb.h stdlib.h string.h sys/socket.h])dnl Checks for typedefs, structures, and compiler characteristics.AC_C_CONSTAC_TYPE_SIZE_Tdnl Checks for library functions.AC_CHECK_FUNCS([memset socket])AC_OUTPUT(c_src/$host/Makefile:c_src/Makefile.in)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?