Search
lxdream.org :: lxdream/configure.in :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename configure.in
changeset 1024:c67f2d61ab97
prev1015:ad448bedc48a
next1029:7138bbb9537c
author nkeynes
date Sat Jun 13 00:50:48 2009 +0000 (12 years ago)
permissions -rw-r--r--
last change Build drivers with library dependencies as shared objects (ie plugins)
file annotate diff log raw
1.1 --- a/configure.in Tue Jun 02 23:16:26 2009 +0000
1.2 +++ b/configure.in Sat Jun 13 00:50:48 2009 +0000
1.3 @@ -34,6 +34,9 @@
1.4 AC_ARG_ENABLE( optimized,
1.5 AS_HELP_STRING( [--disable-optimized], [Disable compile-time optimizations (Enabled by default)]),
1.6 [true], [enable_optimized=yes] )
1.7 +AC_ARG_ENABLE( shared,
1.8 + AS_HELP_STRING( [--enable-shared], [Build drivers as shared libraries (Enabled if available)]),
1.9 + [if test "$enableval" == "yes"; then enable_shared=yes; else enable_shared=no; fi], [enable_shared=cond] )
1.10 AC_ARG_ENABLE( profiled,
1.11 AS_HELP_STRING( [--enable-profiled], [Enable profiling build]),
1.12 [if test "$enableval" == "yes"; then
1.13 @@ -76,7 +79,7 @@
1.14 APPLE_BUILD='yes'
1.15 LIBS="$LIBS -framework AppKit"
1.16 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.17 - CPPFLAGS="$CPPFLAGS -DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_4 -mdynamic-no-pic"
1.18 + LXDREAMCPPFLAGS="-DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_4 -mdynamic-no-pic"
1.19 LDFLAGS="$LDFLAGS -Wl,-headerpad_max_install_names"
1.20 AC_DEFINE(HAVE_COCOA,[1],[Have Cocoa framework])
1.21 AC_DEFINE(APPLE_BUILD,[1],[Building on an apple platform. Things are different...])
1.22 @@ -131,6 +134,47 @@
1.23 OBJCFLAGS="$OBJCFLAGS -Wall -Werror -Wno-unused"
1.24 fi
1.25
1.26 +if test "x$enable_shared" != "xno"; then
1.27 + AC_DEFINE(ENABLE_SHARED, [1], [Enable shared-library plugins])
1.28 + if test "x$APPLE_BUILD" = "xyes"; then
1.29 + SOEXT="dylib"
1.30 + PLUGINLDFLAGS="-dynamiclib -undefined dynamic_lookup"
1.31 + else
1.32 + SOEXT="so"
1.33 + PLUGINLDFLAGS="-shared"
1.34 + fi
1.35 + PLUGINCFLAGS="-fPIC"
1.36 +
1.37 +dnl Check for dlfcn.h and dlopen() (in libdl or libc)
1.38 + AC_CHECK_HEADER( [dlfcn.h], [
1.39 + AC_SEARCH_LIBS( [dlopen], [dl], [have_dlopen=yes]) ])
1.40 + if test "x$have_dlopen" != "xyes"; then
1.41 + if test "x$enable_shared" == "xyes"; then
1.42 + AC_MSG_ERROR( "--enable-shared not supported on your system - can't find a working dlopen" )
1.43 + else
1.44 + AC_MSG_WARN("Statically linking all plugins")
1.45 + fi
1.46 + fi
1.47 +
1.48 +dnl Check if linker accepts -rdynamic
1.49 + AC_MSG_CHECKING([if linker accepts -rdynamic])
1.50 + old_LDFLAGS="$LDFLAGS"
1.51 + LDFLAGS="$LDFLAGS -rdynamic"
1.52 + AC_LINK_IFELSE( [int main(){}], [
1.53 + LXDREAMLDFLAGS="-rdynamic"
1.54 + AC_MSG_RESULT([yes])
1.55 + ], [
1.56 + LXDREAMLDFLAGS=""
1.57 + AC_MSG_RESULT([no]) ])
1.58 + LDFLAGS="$old_LDFLAGS"
1.59 +
1.60 + AC_SUBST(SOEXT)
1.61 + AC_SUBST(PLUGINCFLAGS)
1.62 + AC_SUBST(PLUGINLDFLAGS)
1.63 + AC_SUBST(LXDREAMLDFLAGS)
1.64 +fi
1.65 +AM_CONDITIONAL(BUILD_SHARED, [test "x$have_dlopen" = "xyes"])
1.66 +
1.67 AC_CHECK_FASTCALL([
1.68 AC_DEFINE(HAVE_FASTCALL, [1], [Use fast register-passing calling conventions])
1.69 ])
1.70 @@ -138,6 +182,7 @@
1.71 AC_DEFINE(HAVE_FRAME_ADDRESS, [1], [Define if we have a working builtin frame_address])
1.72 ], [ AC_MSG_WARN([Memory exceptions will be slow]) ])
1.73
1.74 +AC_SUBST(LXDREAMCPPFLAGS)
1.75 AC_SEARCH_LIBS(listen, [socket])
1.76 AC_SEARCH_LIBS(inet_ntoa,[nsl])
1.77
1.78 @@ -315,7 +360,8 @@
1.79
1.80 AC_CHECK_HEADER([linux/joystick.h], [
1.81 HAVE_LINUX_JOYSTICK_H=yes
1.82 - AC_DEFINE([HAVE_LINUX_JOYSTICK], 1, [Have linux joystick support]) ],
1.83 + AC_DEFINE([HAVE_LINUX_JOYSTICK], 1, [Have linux joystick support])
1.84 + INPUT_DRIVERS="$INPUT_DRIVERS joy_linux" ],
1.85 [ echo "Linux Joystick support not found, building without it."] )
1.86 AM_CONDITIONAL(JOY_LINUX, [test "$HAVE_LINUX_JOYSTICK_H" = "yes"])
1.87
1.88 @@ -323,7 +369,9 @@
1.89 if test "x$with_lirc" != "xno"; then
1.90 AC_CHECK_HEADER([lirc/lirc_client.h], [
1.91 HAVE_LIRC_CLIENT_H=yes
1.92 - AC_DEFINE([HAVE_LIRC],1,[Have LIRC support]) ],
1.93 + AC_DEFINE([HAVE_LIRC],1,[Have LIRC support])
1.94 + INPUT_DRIVERS="$INPUT_DRIVERS lirc"
1.95 + ],
1.96 [ echo "LIRC support not found, building without it." ] )
1.97 fi
1.98 AM_CONDITIONAL(INPUT_LIRC, [test "$HAVE_LIRC_CLIENT_H" = "yes"])
1.99 @@ -405,14 +453,15 @@
1.100 echo " Audio drivers: $AUDIO_DRIVERS"
1.101 fi
1.102
1.103 +if test "x$INPUT_DRIVERS" = "x"; then
1.104 + echo " Input drivers: none (no supported output devices found)"
1.105 +else
1.106 + echo " Input drivers: $INPUT_DRIVERS"
1.107 +fi
1.108 +
1.109 if test "x$CDROM_DRIVER" = "x"; then
1.110 echo " CD-ROM driver: none (no supported cd-rom devices found)"
1.111 else
1.112 echo " CD-ROM driver: $CDROM_DRIVER"
1.113 fi
1.114
1.115 -if test "x$HAVE_LIRC_CLIENT_H" = "x"; then
1.116 - echo " LIRC support: no"
1.117 -else
1.118 - echo " LIRC support: yes"
1.119 -fi
.