home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / Emulatoren / UAE061.LZH / uae-0.6.1 / configure.in < prev    next >
Encoding:
Text File  |  1996-08-28  |  5.7 KB  |  227 lines

  1. dnl Process this file with autoconf to produce a configure script.
  2. dnl Do not use autoconf-2.8 or autoconf-2.9, these versions have a serious
  3. dnl bug.
  4. AC_INIT(amiga/transdisk.c)
  5.  
  6. dnl Checks for programs.
  7. AC_PROG_CC
  8.  
  9. AC_PROG_CPP
  10. AC_PROG_MAKE_SET
  11.  
  12. AC_AIX
  13. AC_ISC_POSIX
  14.  
  15. dnl Checks for libraries.
  16. HAVE_BEBOX=n
  17. dnl Replace `main' with a function in -lMedia_s: (Ian!)
  18. AC_CHECK_LIB(Media_s, main, HAVE_MEDIA_LIB=y, HAVE_MEDIA_LIB=n)
  19. dnl Replace `main' with a function in -lNeXT_s:
  20. AC_CHECK_LIB(NeXT_s, main, HAVE_NEXT_LIB=y, HAVE_NEXT_LIB=n)
  21. AC_CHECK_LIB(amiga, OpenLibrary, HAVE_AMIGA_LIB=y, HAVE_AMIGA_LIB=n)
  22. AC_CHECK_LIB(vga, vga_setmode, HAVE_SVGA_LIB=y, HAVE_SVGA_LIB=n)
  23. AC_CHECK_LIB(AF, AFOpenAudioConn, HAVE_AF_LIB=y, HAVE_AF_LIB=n)
  24.  
  25. AC_PATH_XTRA
  26. AC_CONFIG_HEADER(sysconfig.h)
  27.  
  28. AC_HEADER_DIRENT
  29. AC_HEADER_STDC
  30. AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/types.h utime.h string.h strings.h values.h)
  31. AC_CHECK_HEADERS(sys/vfs.h sys/mount.h sys/param.h sys/statfs.h sys/statvfs.h sys/stat.h sys/types.h linux/joystick.h)
  32.  
  33. if [[ $ac_cv_header_linux_joystick_h = "yes" ]]; then
  34.   AC_MSG_CHECKING(whether linux/joystick.h is broken)
  35.   if grep "#include" /usr/include/linux/joystick.h >/dev/null; then
  36.     AC_MSG_RESULT(yes)
  37.     BROKEN_JOYSTICK_H=1
  38.     grep -v "#include" /usr/include/linux/joystick.h >include/joystick.h
  39.   else
  40.     AC_MSG_RESULT(no)
  41.     BROKEN_JOYSTICK_H=0
  42.   fi
  43. fi
  44.  
  45. AC_CHECK_SIZEOF(char)
  46. AC_CHECK_SIZEOF(short)
  47. AC_CHECK_SIZEOF(int)
  48. AC_CHECK_SIZEOF(long)
  49. AC_CHECK_SIZEOF(long long)
  50.  
  51. dnl Checks for typedefs, structures, and compiler characteristics.
  52. AC_C_CONST
  53. AC_C_INLINE
  54. AC_TYPE_MODE_T
  55. AC_TYPE_OFF_T
  56. AC_TYPE_PID_T
  57. AC_STRUCT_ST_BLOCKS
  58. AC_HEADER_TIME
  59. AC_STRUCT_TM
  60.  
  61. dnl Checks for library functions.
  62. AC_PROG_GCC_TRADITIONAL
  63. AC_FUNC_MEMCMP
  64. AC_TYPE_SIGNAL
  65. AC_FUNC_UTIME_NULL
  66. AC_CHECK_FUNCS(gettimeofday mkdir rmdir select strerror strstr statfs)
  67.  
  68. AC_MSG_CHECKING(how many args statfs takes)
  69. if [[ $ac_cv_func_statfs = "yes" ]]; then
  70.   AC_TRY_COMPILE([
  71. #include "confdefs.h"
  72. #ifdef HAVE_SYS_TYPES_H
  73. #include <sys/types.h>
  74. #endif
  75. #ifdef HAVE_SYS_MOUNT_H
  76. #include <sys/mount.h>
  77. #endif
  78. #ifdef HAVE_SYS_VFS_H
  79. #include <sys/vfs.h>
  80. #endif
  81. #ifdef HAVE_SYS_PARAM_H
  82. #include <sys/param.h>
  83. #endif
  84. #ifdef HAVE_SYS_STATFS_H
  85. #include <sys/statfs.h>
  86. #endif
  87. #ifdef HAVE_SYS_STATVFS_H
  88. #include <sys/statvfs.h>
  89. #endif],[struct statfs statbuf;statfs("/",&statbuf);],
  90. AC_MSG_RESULT(2) 
  91. STATFS_NO_ARGS=2,
  92. AC_MSG_RESULT(4)
  93. STATFS_NO_ARGS=4)
  94. fi
  95.  
  96. AC_MSG_CHECKING(whether to use f_bavail or f_bfree)
  97. if [[ $ac_cv_func_statfs = "yes" ]]; then
  98.   AC_TRY_COMPILE([
  99. #include "confdefs.h"
  100. #ifdef HAVE_SYS_MOUNT_H
  101. #include <sys/mount.h>
  102. #endif
  103. #ifdef HAVE_SYS_VFS_H
  104. #include <sys/vfs.h>
  105. #endif
  106. #ifdef HAVE_SYS_PARAM_H
  107. #include <sys/param.h>
  108. #endif
  109. #ifdef HAVE_SYS_STATFS_H
  110. #include <sys/statfs.h>
  111. #endif
  112. #ifdef HAVE_SYS_STATVFS_H
  113. #include <sys/statvfs.h>
  114. #endif],[struct statfs statbuf;statbuf.f_bavail;],
  115. AC_MSG_RESULT(f_bavail) 
  116. STATBUF_BAVAIL=f_bavail,
  117. AC_MSG_RESULT(f_bfree)
  118. STATBUF_BAVAIL=f_bfree)
  119. fi
  120.  
  121. AC_MSG_CHECKING(which target to use)
  122. if [[ $HAVE_BEBOX = "y" ]]; then
  123.   AC_MSG_RESULT(BeBox)
  124.   TARGET=be
  125.   GFXOBJS="bebox.o nogui.o"
  126.   ac_cv_c_inline=
  127. else
  128.   if [[ $HAVE_AMIGA_LIB = "y" ]]; then
  129.     AC_MSG_RESULT(AmigaOS)
  130.     TARGET=amiga
  131.     GFXOBJS="awin.o"
  132.   else
  133.     if [[ $HAVE_NEXT_LIB = "y" ]]; then
  134.       AC_MSG_RESULT(NeXTStep)
  135.       TARGET=next
  136.       GFXOBJS="NeXTwin.o"
  137.       LIBRARIES="-sectcreate __ICON __header Uae.app/Uae.iconheader -segprot __ICON r r -sectcreate __ICON app Uae.app/Uae.tiff -lMedia_s -lNeXT_s"
  138.     else
  139.       if [[ x$no_x = "xyes" ]]; then
  140.         if [[ $HAVE_SVGA_LIB = "n" ]]; then
  141.           AC_MSG_RESULT(Ummm....)
  142.           echo "Neither X nor SVGAlib found, don't know what target to use." 
  143.        exit 1
  144.         else
  145.           AC_MSG_RESULT(SVGAlib)
  146.           TARGET=svgalib
  147.        GFXOBJS="svga.o nogui.o"
  148.         LIBRARIES=-lvga
  149.         fi
  150.       else
  151.         AC_MSG_RESULT(X Window System)
  152.         TARGET=x11
  153.         LIBRARIES="$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS"
  154.         TCLGUI=yes
  155.         AC_ARG_ENABLE(gui, --disable-gui      Don't use the Tcl/Tk GUI,[TCLGUI=$enableval],[])
  156.         if [[ $TCLGUI = "yes" ]]; then
  157.           AC_CHECK_PROG(TCLGUI,wish4.0,yes,no)
  158.         else
  159.           echo "Disabling the GUI."
  160.         fi
  161.         if [[ $TCLGUI = "yes" ]]; then
  162.           GFXOBJS="xwin.o xui.o"
  163.         else
  164.           GFXOBJS="xwin.o nogui.o"
  165.         fi
  166.       fi
  167.     fi
  168.   fi
  169. fi
  170.  
  171. ASMOBJS=
  172.  
  173. dnl It may be possible to use X86.S on other systems, too, but then again, it
  174. dnl might break. Check for a system that is known to work.
  175. dnl Gustavo says it works on linuxaout, too. We'll try this later.
  176.  
  177. if [[ "$CC" = "gcc" ]]; then
  178.   CFLAGS="-O3 -fomit-frame-pointer -Wall -Wno-unused -Wno-format -W -Wmissing-prototypes -Wstrict-prototypes"
  179.   AC_MSG_CHECKING(whether we are on a Linux/i386 ELF system)
  180.   LINUXELF=n
  181.   if MACHINE=`uname -a 2>/dev/null`; then
  182.     cat >conftest.c << EOF
  183. int main() { return 0; }
  184. EOF
  185.     case $MACHINE in
  186.     Linux*i*86)
  187.       gcc conftest.c -o conftest
  188.       file conftest >conftest.file
  189.       if grep ELF conftest.file >/dev/null; then
  190.         LINUXELF=y
  191.       fi
  192.       ;;
  193.     esac
  194.     rm -f conftest*
  195.   fi
  196.   if [[ $LINUXELF = "n" ]]; then
  197.     AC_MSG_RESULT(no)
  198.   else
  199.     AC_MSG_RESULT(yes)
  200.     ASMOBJS=X86.o
  201.     CFLAGS="$CFLAGS -DX86_ASSEMBLY"
  202.   fi
  203. else
  204.   echo "Couldn't find GCC. UAE may or may not compile and run correctly."
  205. fi
  206.  
  207. if [[ $TARGET = "x11" -o $TARGET = "svgalib" ]]; then
  208.   dnl On a Unix system, zfile is supposed to work. Dunno about others.
  209.   CFLAGS="$CFLAGS -DUSE_ZFILE"
  210. fi
  211.  
  212. if [[ $TARGET = "amiga" ]]; then
  213.   dnl Determine the cpu-type
  214.   CFLAGS="$CFLAGS -DUSE_ZFILE -m`cpu | cut -d' ' -f2`"
  215. fi
  216.  
  217. AC_SUBST(ac_cv_c_inline)
  218. AC_SUBST(STATFS_NO_ARGS)
  219. AC_SUBST(BROKEN_JOYSTICK_H)
  220. AC_SUBST(STATBUF_BAVAIL)
  221. AC_SUBST(LIBRARIES)
  222. AC_SUBST(TARGET)
  223. AC_SUBST(GFXOBJS)
  224. AC_SUBST(ASMOBJS)
  225.  
  226. AC_OUTPUT(Makefile)
  227.