Search
lxdream.org :: lxdream :: r660:d1b2695347c6
lxdream 0.9.1
released Jun 29
Download Now
changeset660:d1b2695347c6
parent659:6b1dff1575b3
child661:99d9494955a9
authornkeynes
dateWed Apr 16 23:47:32 2008 +0000 (11 years ago)
Add check for objective-c compiler (for mac) and set the language if found
configure
configure.in
1.1 --- a/configure Wed Apr 16 22:54:40 2008 +0000
1.2 +++ b/configure Wed Apr 16 23:47:32 2008 +0000
1.3 @@ -725,8 +725,8 @@
1.4 host_cpu
1.5 host_vendor
1.6 host_os
1.7 -GUI_CARBON_TRUE
1.8 -GUI_CARBON_FALSE
1.9 +GUI_COCOA_TRUE
1.10 +GUI_COCOA_FALSE
1.11 PKG_CONFIG
1.12 LIBPNG_CFLAGS
1.13 LIBPNG_LIBS
1.14 @@ -5873,6 +5873,9 @@
1.15
1.16
1.17
1.18 +
1.19 +lxdream_save_cppflags="$CPPFLAGS"
1.20 +CPPFLAGS="$CPPFLAGS -x objective-c"
1.21 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
1.22
1.23
1.24 @@ -5945,7 +5948,42 @@
1.25 done
1.26
1.27
1.28 -if test "${ac_cv_header_Cocoa_Cocoa_h+set}" = set; then
1.29 +cat >conftest.$ac_ext <<_ACEOF
1.30 +/* confdefs.h. */
1.31 +_ACEOF
1.32 +cat confdefs.h >>conftest.$ac_ext
1.33 +cat >>conftest.$ac_ext <<_ACEOF
1.34 +/* end confdefs.h. */
1.35 +@interface Foo @end
1.36 +int
1.37 +main ()
1.38 +{
1.39 +
1.40 + ;
1.41 + return 0;
1.42 +}
1.43 +_ACEOF
1.44 +rm -f conftest.$ac_objext
1.45 +if { (ac_try="$ac_compile"
1.46 +case "(($ac_try" in
1.47 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1.48 + *) ac_try_echo=$ac_try;;
1.49 +esac
1.50 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
1.51 +$as_echo "$ac_try_echo") >&5
1.52 + (eval "$ac_compile") 2>conftest.er1
1.53 + ac_status=$?
1.54 + grep -v '^ *+' conftest.er1 >conftest.err
1.55 + rm -f conftest.er1
1.56 + cat conftest.err >&5
1.57 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
1.58 + (exit $ac_status); } && {
1.59 + test -z "$ac_c_werror_flag" ||
1.60 + test ! -s conftest.err
1.61 + } && test -s conftest.$ac_objext; then
1.62 +
1.63 +
1.64 + if test "${ac_cv_header_Cocoa_Cocoa_h+set}" = set; then
1.65 { $as_echo "$as_me:$LINENO: checking for Cocoa/Cocoa.h" >&5
1.66 $as_echo_n "checking for Cocoa/Cocoa.h... " >&6; }
1.67 if test "${ac_cv_header_Cocoa_Cocoa_h+set}" = set; then
1.68 @@ -6074,10 +6112,10 @@
1.69 fi
1.70 if test $ac_cv_header_Cocoa_Cocoa_h = yes; then
1.71
1.72 - HAVE_COCOA='yes'
1.73 - APPLE_BUILD='yes'
1.74 - LIBS="$LIBS -framework AppKit"
1.75 - LIBS="$LIBS -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -framework OpenGL"
1.76 + HAVE_COCOA='yes'
1.77 + APPLE_BUILD='yes'
1.78 + LIBS="$LIBS -framework AppKit"
1.79 + LIBS="$LIBS -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -framework OpenGL"
1.80
1.81 cat >>confdefs.h <<\_ACEOF
1.82 #define HAVE_COCOA 1
1.83 @@ -6094,12 +6132,22 @@
1.84
1.85
1.86
1.87 +else
1.88 + $as_echo "$as_me: failed program was:" >&5
1.89 +sed 's/^/| /' conftest.$ac_ext >&5
1.90 +
1.91 + CPPFLAGS="$lxdream_save_cppflags"
1.92 +fi
1.93 +
1.94 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1.95 +
1.96 +
1.97 if test "$HAVE_COCOA" = 'yes'; then
1.98 - GUI_CARBON_TRUE=
1.99 - GUI_CARBON_FALSE='#'
1.100 -else
1.101 - GUI_CARBON_TRUE='#'
1.102 - GUI_CARBON_FALSE=
1.103 + GUI_COCOA_TRUE=
1.104 + GUI_COCOA_FALSE='#'
1.105 +else
1.106 + GUI_COCOA_TRUE='#'
1.107 + GUI_COCOA_FALSE=
1.108 fi
1.109
1.110
1.111 @@ -10314,10 +10362,10 @@
1.112 Usually this means the macro was only invoked conditionally." >&2;}
1.113 { (exit 1); exit 1; }; }
1.114 fi
1.115 -if test -z "${GUI_CARBON_TRUE}" && test -z "${GUI_CARBON_FALSE}"; then
1.116 - { { $as_echo "$as_me:$LINENO: error: conditional \"GUI_CARBON\" was never defined.
1.117 -Usually this means the macro was only invoked conditionally." >&5
1.118 -$as_echo "$as_me: error: conditional \"GUI_CARBON\" was never defined.
1.119 +if test -z "${GUI_COCOA_TRUE}" && test -z "${GUI_COCOA_FALSE}"; then
1.120 + { { $as_echo "$as_me:$LINENO: error: conditional \"GUI_COCOA\" was never defined.
1.121 +Usually this means the macro was only invoked conditionally." >&5
1.122 +$as_echo "$as_me: error: conditional \"GUI_COCOA\" was never defined.
1.123 Usually this means the macro was only invoked conditionally." >&2;}
1.124 { (exit 1); exit 1; }; }
1.125 fi
2.1 --- a/configure.in Wed Apr 16 22:54:40 2008 +0000
2.2 +++ b/configure.in Wed Apr 16 23:47:32 2008 +0000
2.3 @@ -27,18 +27,26 @@
2.4 [], [with_osmesa=no])
2.5
2.6
2.7 +dnl ------------ Check if we're building on Darwn --------------
2.8 +
2.9 +dnl For starters, do we have a working objective-c compiler?
2.10 +lxdream_save_cppflags="$CPPFLAGS"
2.11 +CPPFLAGS="$CPPFLAGS -x objective-c"
2.12 +AC_TRY_COMPILE([@interface Foo @end],, [
2.13 +
2.14 + AC_CHECK_HEADER([Cocoa/Cocoa.h], [
2.15 + HAVE_COCOA='yes'
2.16 + APPLE_BUILD='yes'
2.17 + LIBS="$LIBS -framework AppKit"
2.18 + LIBS="$LIBS -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -framework OpenGL"
2.19 + AC_DEFINE(HAVE_COCOA,[1],[Have Cocoa framework])
2.20 + AC_DEFINE(APPLE_BUILD,[1],[Building on an apple platform. Things are different...])
2.21 + ])
2.22 +
2.23 +], [CPPFLAGS="$lxdream_save_cppflags"] )
2.24 +AM_CONDITIONAL(GUI_COCOA, [test "$HAVE_COCOA" = 'yes'])
2.25 +
2.26 dnl ----------- Check for mandatory dependencies --------------
2.27 -dnl Building on MAC?
2.28 -AC_CHECK_HEADER([Cocoa/Cocoa.h], [
2.29 - HAVE_COCOA='yes'
2.30 - APPLE_BUILD='yes'
2.31 - LIBS="$LIBS -framework AppKit"
2.32 - LIBS="$LIBS -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -framework OpenGL"
2.33 - AC_DEFINE(HAVE_COCOA,[1],[Have Cocoa framework])
2.34 - AC_DEFINE(APPLE_BUILD,[1],[Building on an apple platform. Things are different...])
2.35 -])
2.36 -AM_CONDITIONAL(GUI_CARBON, [test "$HAVE_COCOA" = 'yes'])
2.37 -
2.38 dnl Check for libpng (required)
2.39 PKG_CHECK_MODULES(LIBPNG, [libpng] )
2.40
.