Ignore:
Timestamp:
Sep 10, 2006 4:33:48 PM (18 years ago)
Author:
bennylp
Message:

Fixed autoconf in mingw

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/aconfigure.ac

    r698 r699  
    1818 
    1919AC_CHECK_LIB(pthread,pthread_create) 
     20AC_CHECK_LIB(wsock32,puts) 
     21AC_CHECK_LIB(ws2_32,puts) 
     22AC_CHECK_LIB(ole32,puts) 
     23AC_CHECK_LIB(winmm,puts) 
     24AC_CHECK_LIB(socket,puts) 
     25AC_CHECK_LIB(rt,puts) 
     26AC_CHECK_LIB(nsl,puts) 
    2027 
    2128AC_MSG_RESULT([Setting PJ_M_NAME to $target_cpu]) 
    2229AC_DEFINE_UNQUOTED(PJ_M_NAME,["$target_cpu"]) 
    2330 
    24 dnl # Endianness detection 
     31dnl 
     32dnl Endianness detection 
     33dnl 
    2534AC_C_BIGENDIAN 
     35 
     36dnl 
     37dnl Legacy macros 
     38dnl 
     39case $target in 
     40    *mingw* | *cygw* | *win32* | *w32* ) 
     41        AC_DEFINE(PJ_WIN32,1) 
     42        AC_DEFINE(PJ_WIN32_WINNT,0x0400) 
     43        AC_DEFINE(WIN32_LEAN_AND_MEAN) 
     44        ;; 
     45    *darwin*) 
     46        AC_DEFINE(PJ_DARWINOS,1) 
     47        ;; 
     48    *linux*) 
     49        AC_DEFINE(PJ_LINUX,1) 
     50        ;; 
     51    *rtems*) 
     52        AC_DEFINE(PJ_RTEMS,1) 
     53        ;; 
     54    *sunos* | *solaris* ) 
     55        AC_DEFINE(PJ_SUNOS,1) 
     56        ;; 
     57    *) 
     58        ;; 
     59esac 
     60 
     61 
     62 
    2663 
    2764dnl # --disable-floating-point option 
     
    4380AC_CHECK_HEADER(assert.h,[AC_DEFINE(PJ_HAS_ASSERT_H,1)]) 
    4481AC_CHECK_HEADER(ctype.h,[AC_DEFINE(PJ_HAS_CTYPE_H,1)]) 
    45 AC_CHECK_HEADER(errno.h,[AC_DEFINE(PJ_HAS_ERRNO_H,1)]) 
     82 
     83case $target in 
     84    *mingw* | *cygw* | *win32* | *w32* ) 
     85        AC_DEFINE(PJ_HAS_ERRNO_H,0) 
     86        ;; 
     87    *) 
     88        AC_CHECK_HEADER(errno.h,[AC_DEFINE(PJ_HAS_ERRNO_H,1)]) 
     89        ;; 
     90esac 
     91 
    4692AC_CHECK_HEADER(linux/socket.h,[AC_DEFINE(PJ_HAS_LINUX_SOCKET_H,1)]) 
    4793AC_CHECK_HEADER(malloc.h,[AC_DEFINE(PJ_HAS_MALLOC_H,1)]) 
     
    113159dnl # Determine if SO_ERROR is available 
    114160AC_MSG_CHECKING([if SO_ERROR is available]) 
    115 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 
    116                                      #include <sys/socket.h> 
    117                                      #include <netinet/in.h> 
    118                                      #include <arpa/inet.h>]], 
    119                                   [int i=SO_ERROR;])], 
    120                   [AC_DEFINE(PJ_HAS_SO_ERROR,1) 
    121                    AC_MSG_RESULT(yes)], 
    122                   AC_MSG_RESULT(no)) 
     161case $target in 
     162    *mingw* | *cygw* | *win32* | *w32* ) 
     163        AC_DEFINE(PJ_HAS_SO_ERROR,1) 
     164        AC_MSG_RESULT(yes) 
     165        ;; 
     166    *) 
     167        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 
     168                                             #include <sys/socket.h> 
     169                                             #include <netinet/in.h> 
     170                                             #include <arpa/inet.h>]], 
     171                                          [int i=SO_ERROR;])], 
     172                          [AC_DEFINE(PJ_HAS_SO_ERROR,1) 
     173                           AC_MSG_RESULT(yes)], 
     174                          AC_MSG_RESULT(no)) 
     175        ;; 
     176esac 
     177 
    123178 
    124179dnl # Determine if RW-mutex is available 
     
    131186                   AC_MSG_RESULT(no)]) 
    132187 
     188AC_SUBST(ac_os_objs) 
     189case $target in 
     190  *mingw* | *cygw* | *win32* | *w32* ) 
     191        ac_os_objs="os_core_win32.o os_error_win32.o os_time_win32.o os_timestamp_win32.o guid_win32.o ioqueue_select.o" 
     192        ;; 
     193  *) 
     194        ac_os_objs="os_core_unix.o os_error_unix.o os_time_unix.o os_timestamp_posix.o guid_simple.o ioqueue_select.o" 
     195        ;; 
     196esac 
     197 
    133198 
    134199dnl ########################################## 
     
    315380dnl # socket recv() can not return immediate data. 
    316381case $target in 
     382  *mingw* | *cygw* | *win32* | *w32* ) 
     383        AC_DEFINE(PJ_BLOCKING_ERROR_VAL,WSAEWOULDBLOCK) 
     384        ;; 
    317385  *) AC_DEFINE(PJ_BLOCKING_ERROR_VAL,EAGAIN) 
    318386     AC_MSG_RESULT([** Setting non-blocking recv() retval to EAGAIN (please check)]) 
     
    323391dnl # socket connect() can not get connected immediately. 
    324392case $target in 
     393  *mingw* | *cygw* | *win32* | *w32* ) 
     394        AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,WSAEWOULDBLOCK) 
     395        ;; 
    325396  *) AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,EINPROGRESS) 
    326397     AC_MSG_RESULT([** Setting non-blocking connect() retval to EINPROGRESS (please check)]) 
Note: See TracChangeset for help on using the changeset viewer.