~ubuntu-branches/ubuntu/feisty/basilisk2/feisty

« back to all changes in this revision

Viewing changes to src/Unix/configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2006-06-01 01:11:16 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060601011116-xjhegbgyfsxag5fl
Tags: 0.9.20060529-1
* New upstream CVS snapshot.
* Update local cdbs snippet copyright-check.mk:
  + Broaden scan to also look for "(c)" by default.
  + Make egrep options configurable.
  + Ignore auto-tools files.
* Bump up standards-version to 3.7.2 (no changes needed).
* Let dh_strip do the stripping (not the make install target).

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
dnl cores for the configure tests since some are intended to dump core.
15
15
ulimit -c 0
16
16
 
 
17
AC_ARG_ENABLE(standalone-gui,[  --enable-standalone-gui enable a standalone GUI prefs editor [default=no]], [WANT_STANDALONE_GUI=$enableval], [WANT_STANDALONE_GUI=no])
 
18
 
17
19
dnl Video options.
18
20
AC_ARG_ENABLE(xf86-dga,      [  --enable-xf86-dga       use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes])
19
21
AC_ARG_ENABLE(xf86-vidmode,  [  --enable-xf86-vidmode   use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes])
136
138
AC_CHECK_LIB(posix4, sem_init)
137
139
AC_CHECK_LIB(rt, timer_create)
138
140
AC_CHECK_LIB(rt, shm_open)
 
141
AC_CHECK_LIB(m, cos)
139
142
 
140
143
dnl Do we need SDL?
141
144
WANT_SDL=no
250
253
case "x$WANT_GTK" in
251
254
xgtk2*)
252
255
  AM_PATH_GTK_2_0(1.3.15, [
253
 
    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
254
 
    CFLAGS="$CFLAGS $GTK_CFLAGS"
255
 
    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
256
 
    LIBS="$LIBS $GTK_LIBS"
257
 
    UISRCS=prefs_editor_gtk.cpp
 
256
    GUI_CFLAGS="$GTK_CFLAGS"
 
257
    GUI_LIBS="$GTK_LIBS"
258
258
    WANT_GTK=gtk2
259
259
  ], [
260
260
    case "x${WANT_GTK}x" in
272
272
esac
273
273
if [[ "x$WANT_GTK" = "xgtk" ]]; then
274
274
  AM_PATH_GTK(1.2.0, [
275
 
    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
276
 
    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
277
 
    LIBS="$LIBS $GTK_LIBS"
278
 
    UISRCS=prefs_editor_gtk.cpp
 
275
    GUI_CFLAGS="$GTK_CFLAGS"
 
276
    GUI_LIBS="$GTK_LIBS"
279
277
    dnl somehow, <gnome-i18n.h> would redefine gettext() to nothing if
280
278
    dnl ENABLE_NLS is not set, thusly conflicting with C++ <string> which
281
279
    dnl includes <libintl.h>
282
280
    AM_GNU_GETTEXT
283
281
    B2_PATH_GNOMEUI([
284
282
      AC_DEFINE(HAVE_GNOMEUI, 1, [Define if libgnomeui is available.])
285
 
      CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS"
286
 
      LIBS="$LIBS $GNOMEUI_LIBS"
 
283
      GUI_CFLAGS="$GUI_CFLAGS $GNOMEUI_CFLAGS"
 
284
      GUI_LIBS="$GUI_LIBS $GNOMEUI_LIBS"
287
285
    ], [])
288
286
  ], [
289
287
    AC_MSG_WARN([Could not find GTK+, disabling user interface.])
290
288
    WANT_GTK=no
291
289
  ])
292
290
fi
 
291
if [[ "x$WANT_GTK" != "xno" -a "x$WANT_STANDALONE_GUI" = "xno" ]]; then
 
292
  AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
 
293
  UISRCS=prefs_editor_gtk.cpp
 
294
fi
 
295
AC_SUBST(GUI_CFLAGS)
 
296
AC_SUBST(GUI_LIBS)
 
297
 
 
298
dnl Build external GUI if requested.
 
299
if [[ "$WANT_STANDALONE_GUI" != "yes" ]]; then
 
300
  WANT_STANDALONE_GUI=no
 
301
fi
 
302
if [[ "$WANT_GTK" = "no" ]]; then
 
303
  WANT_STANDALONE_GUI=no
 
304
fi
 
305
AC_SUBST(STANDALONE_GUI, [$WANT_STANDALONE_GUI])
293
306
 
294
307
dnl We use ESD if possible.
295
308
if [[ "x$WANT_ESD" = "xyes" ]]; then
421
434
dnl (end of code from openssh-3.2.2p1 configure.ac)
422
435
 
423
436
 
 
437
dnl Check for systems where POSIX-style non-blocking I/O (O_NONBLOCK)
 
438
dnl doesn't work or is unimplemented. On these systems (mostly older
 
439
dnl ones), use the old BSD-style FIONBIO approach instead. [tcl.m4]
 
440
AC_CACHE_CHECK([FIONBIO vs. O_NONBLOCK for non-blocking I/O],
 
441
  ac_cv_nonblocking_io, [
 
442
  case "$host" in
 
443
  *-*-osf*)
 
444
    ac_cv_nonblocking_io=FIONBIO
 
445
    ;;
 
446
  *-*-sunos4*)
 
447
    ac_cv_nonblocking_io=FIONBIO
 
448
    ;;
 
449
  *-*-ultrix*)
 
450
    ac_cv_nonblocking_io=FIONBIO
 
451
    ;;
 
452
  *)
 
453
    ac_cv_nonblocking_io=O_NONBLOCK
 
454
    ;;
 
455
  esac
 
456
])
 
457
if [[ "$ac_cv_nonblocking_io" = "FIONBIO" ]]; then
 
458
  AC_DEFINE(USE_FIONBIO, 1, [Define if BSD-style non-blocking I/O is to be used])
 
459
fi
 
460
 
 
461
dnl Check whether compiler supports byte bit-fields
 
462
AC_CACHE_CHECK([whether compiler supports byte bit-fields],
 
463
  ac_cv_have_byte_bitfields, [
 
464
  AC_LANG_SAVE
 
465
  AC_LANG_CPLUSPLUS
 
466
  AC_TRY_RUN([
 
467
    struct A {
 
468
      unsigned char b1:4;
 
469
      unsigned char b2:4;
 
470
      unsigned char c;
 
471
      unsigned short s;
 
472
      unsigned char a[4];
 
473
    };
 
474
 
 
475
    int main(void) {
 
476
      A a;
 
477
      return ! (sizeof(A) == 8 && &a.c == ((unsigned char *)&a + 1));
 
478
    }],
 
479
    [ac_cv_have_byte_bitfields=yes],
 
480
    [ac_cv_have_byte_bitfields=no],
 
481
    dnl When cross-compiling, assume only GCC supports this
 
482
    [if [[ "$GCC" = "yes" ]]; then
 
483
      ac_cv_have_byte_bitfields="guessing yes"
 
484
    else
 
485
      ac_cv_have_byte_bitfields="guessing no"
 
486
    fi]
 
487
    )
 
488
  AC_LANG_RESTORE
 
489
])
 
490
 
424
491
dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
425
492
AC_DEFUN([AC_CHECK_FRAMEWORK], [
426
493
  AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
429
496
    saved_LIBS="$LIBS"
430
497
    LIBS="$LIBS -framework $1"
431
498
    AC_TRY_LINK(
432
 
      [$2], [int main(void) { return 0; }], 
 
499
      [$2], [],
433
500
      [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
434
501
    )
435
502
  ])
440
507
])
441
508
 
442
509
dnl Check for some MacOS X frameworks
 
510
AC_CHECK_FRAMEWORK(AppKit, [])
443
511
AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
444
512
AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
445
513
AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>])
490
558
  DEFINES="$DEFINES -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS"
491
559
  ;;
492
560
irix*)
493
 
  ETHERSRC=ether_unix.cpp
494
561
  AUDIOSRC=Irix/audio_irix.cpp
495
562
  EXTRASYSSRCS=Irix/unaligned.c
496
 
  dnl IRIX headers work fine, but somehow don't define or use "STDC_HEADERS"
497
 
  DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200 -DSTDC_HEADERS"
498
563
  LIBS="$LIBS -laudio"
499
564
  WANT_ESD=no
500
565
 
504
569
  CFLAGS=`echo "$CFLAGS -IPA" | sed -e "s/-g//g"`
505
570
  AC_MSG_CHECKING(if "-IPA" works)
506
571
  dnl Do a test compile of an empty function
507
 
  AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
 
572
  AC_TRY_COMPILE([#if defined __GNUC__
 
573
                  # error GCC does not support IPA yet
 
574
                  #endif],, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
508
575
  CFLAGS="$ocflags"
509
576
  ;;
510
577
darwin*)
523
590
esac
524
591
 
525
592
dnl Is the slirp library supported?
526
 
if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then
 
593
case "$ac_cv_have_byte_bitfields" in
 
594
yes|"guessing yes")
 
595
  CAN_SLIRP=yes
 
596
  ETHERSRC=ether_unix.cpp
 
597
  ;;
 
598
esac
 
599
if [[ -n "$CAN_SLIRP" ]]; then
527
600
  AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
528
601
  SLIRP_SRCS="\
529
602
    ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
1036
1109
dnl A dummy program that returns always true
1037
1110
AC_PATH_PROG([BLESS], "true")
1038
1111
 
 
1112
dnl Check for linker script support
 
1113
case $target_os:$target_cpu in
 
1114
linux*:i?86)    LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
 
1115
linux*:x86_64)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";;
 
1116
linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";;
 
1117
netbsd*:i?86)   LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
 
1118
freebsd*:i?86)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";;
 
1119
darwin*:*)      LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";;
 
1120
esac
 
1121
if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then
 
1122
  AC_CACHE_CHECK([whether linker script is usable],
 
1123
    ac_cv_linker_script_works, [
 
1124
    AC_LANG_SAVE
 
1125
    AC_LANG_CPLUSPLUS
 
1126
    saved_LDFLAGS="$LDFLAGS"
 
1127
    LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS"
 
1128
    AC_TRY_RUN(
 
1129
      [int main() {if ((char *)&main < (char *)0x70000000) return 1;}],
 
1130
      [ac_cv_linker_script_works=yes],
 
1131
      [ac_cv_linker_script_works=no],
 
1132
      dnl When cross-compiling, assume it works
 
1133
      [ac_cv_linker_script_works="guessing yes"]
 
1134
    )
 
1135
    AC_LANG_RESTORE
 
1136
    if [[ "$ac_cv_linker_script_works" = "no" ]]; then
 
1137
      LDFLAGS="$saved_LDFLAGS"
 
1138
      LINKER_SCRIPT_FLAGS=""
 
1139
    fi
 
1140
  ])
 
1141
fi
 
1142
AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works",
 
1143
  [Define if there is a linker script to relocate the executable above 0x70000000.])
 
1144
 
1039
1145
dnl Determine the addressing mode to use
1040
1146
if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then
1041
1147
  ADDRESSING_MODE="real"
1194
1300
  CFLAGS="$SAVED_CFLAGS"
1195
1301
fi
1196
1302
 
1197
 
dnl Add -mdynamic-no-pic for MacOS X
1198
 
if [[ "x$HAVE_GCC30" = "xyes" ]]; then
 
1303
dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X)
 
1304
if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1199
1305
  SAVED_CFLAGS="$CFLAGS"
1200
1306
  CFLAGS="$CFLAGS -mdynamic-no-pic"
1201
1307
  AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],