aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-05-21 19:30:39 +0200
committerMattias Andrée <maandree@operamail.com>2014-05-21 19:30:39 +0200
commit11ceca8af127bb96daf3d8cb60ed73e41652863e (patch)
treeb1998e082889ae428149e97dd66e07732f661810
parentm + create .c files for the adjustment methods (diff)
downloadlibgamma-11ceca8af127bb96daf3d8cb60ed73e41652863e.tar.gz
libgamma-11ceca8af127bb96daf3d8cb60ed73e41652863e.tar.bz2
libgamma-11ceca8af127bb96daf3d8cb60ed73e41652863e.tar.xz
add ./configure
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--.gitignore1
-rw-r--r--Makefile6
-rwxr-xr-xconfigure149
3 files changed, 155 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 4f7dd78..bf0de41 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,4 +12,5 @@ obj/
*.gch
*.out
*.o
+/config.mk
diff --git a/Makefile b/Makefile
index f1d2536..5e435ad 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,10 @@
# without any warranty.
+# Include configurations from `./configure`.
+include config.mk
+
+
# The package path prefix, if you want to install to another root, set DESTDIR to that root.
PREFIX ?= /usr
# The library path excluding prefix.
@@ -58,7 +62,7 @@ endif
C_FLAGS = $(OPTIMISE) $(WARN) -std=$(STD) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) \
-ftree-vrp -fstrict-aliasing -fipa-pure-const -fstack-usage \
-fstrict-overflow -funsafe-loop-optimizations -fno-builtin \
- $(DEBUG_FLAGS)
+ $(DEBUG_FLAGS) $(DEFINITIONS)
# Object files for the library.
diff --git a/configure b/configure
new file mode 100755
index 0000000..86e85b6
--- /dev/null
+++ b/configure
@@ -0,0 +1,149 @@
+#!/bin/sh
+
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved. This file is offered as-is,
+# without any warranty.
+
+
+have_debug='No, enable with --debug'
+have_dummy='No, enable with --enable-dummy'
+have_randr='No, enable with --enable-randr'
+have_vidmode='No, enable with --enable-vidmode'
+have_drm='No, enable with --enable-drm'
+have_w32gdi='No, enable with --enable-w32gdi[=fake]'
+have_quartz='No, enable with --enable-quartz[=fake]'
+
+enable_debug=0
+enable_dummy=0
+enable_randr=0
+enable_vidmode=0
+enable_drm=0
+enable_w32gdi=0
+enable_quartz=0
+fake_w32gdi=0
+fake_quartz=0
+
+
+for arg in "$@"; do
+ case "${arg}" in
+ (--linux=developer|--developer) enable_debug=1
+ enable_dummy=1
+ enable_vidmode=1
+ enable_randr=1
+ enable_drm=1
+ fake_w32gdi=1
+ fake_quartz=1
+ ;;
+ (--linux) enable_vidmode=1
+ enable_randr=1
+ enable_drm=1
+ ;;
+ (--*bsd=developer) enable_debug=1
+ enable_dummy=1
+ enable_vidmode=1
+ enable_randr=1
+ fake_w32gdi=1
+ fake_quartz=1
+ ;;
+ (--*bsd) enable_vidmode=1
+ enable_randr=1
+ ;;
+ (--windows=developer) enable_debug=1
+ enable_dummy=1
+ enable_w32gdi=1
+ ;;
+ (--windows) enable_w32gdi=1
+ ;;
+ (--mac-os-x=developer) enable_debug=1
+ enable_dummy=1
+ enable_quartz=1
+ ;;
+ (--mac-os-x) enable_quartz=1
+ ;;
+ (--debug) enable_debug=1 ;;
+ (--enable-dummy) enable_dummy=1 ;;
+ (--enable-randr) enable_randr=1 ;;
+ (--enable-vidmode) enable_vidmode=1 ;;
+ (--enable-drm) enable_drm=1 ;;
+ (--enable-w32gdi) enable_w32gdi=1 ;;
+ (--enable-quartz) enable_quartz=1 ;;
+ (--enable-w32gdi=fake) fake_w32gdi=1 ;;
+ (--enable-quartz=fake) fake_quartz=1 ;;
+ (*)
+ echo "$0: unrecognised option: ${arg}" >&2
+ exit 1
+ ;;
+ esac
+done
+
+
+exec 3> "$(dirname "$0")/config.mk"
+echo 'DEFINITIONS =' >&3
+
+if [ ${fake_w32gdi} = 1 ]; then
+ enable_w32gdi=1
+fi
+if [ ${fake_quartz} = 1 ]; then
+ enable_quartz=1
+fi
+if [ ${enable_debug} = 1 ]; then
+ echo "DEBUG = y" >&3
+ have_debug='Yes'
+fi
+if [ ${enable_dummy} = 1 ]; then
+ echo 'DEFINITIONS += -DHAVE_GAMMA_METHOD_DUMMY' >&3
+ have_dummy='Yes'
+fi
+if [ ${enable_randr} = 1 ]; then
+ echo 'DEFINITIONS += -DHAVE_GAMMA_METHOD_RANDR' >&3
+ have_randr='Yes'
+fi
+if [ ${enable_vidmode} = 1 ]; then
+ echo 'DEFINITIONS += -DHAVE_GAMMA_METHOD_VIDMODE' >&3
+ have_vidmode='Yes'
+fi
+if [ ${enable_drm} = 1 ]; then
+ echo 'DEFINITIONS += -DHAVE_GAMMA_METHOD_LINUX_DRM' >&3
+ have_drm='Yes'
+fi
+if [ ${enable_w32gdi} = 1 ]; then
+ echo 'DEFINITIONS += -DHAVE_GAMMA_METHOD_W32_GDI' >&3
+ have_w32gdi='Yes'
+fi
+if [ ${enable_quartz} = 1 ]; then
+ echo 'DEFINITIONS += -DHAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS' >&3
+ have_quartz='Yes'
+fi
+if [ ${fake_w32gdi} = 1 ]; then
+ echo 'DEFINITIONS += -FAKE_GAMMA_METHOD_W32_GDI' >&3
+ if [ ${enable_randr} = 1 ]; then
+ have_w32gdi='Yes, fake via the RandR protocol for X'
+ else
+ have_w32gdi='Yes, fake via dummy method, `/dev/null`-style'
+ fi
+fi
+if [ ${fake_quartz} = 1 ]; then
+ echo 'DEFINITIONS += -FAKE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS' >&3
+ if [ ${enable_randr} = 1 ]; then
+ have_quartz='Yes, fake via the RandR protocol for X'
+ else
+ have_quartz='Yes, fake via dummy method, `/dev/null`-style'
+ fi
+fi
+
+exec 3<&-
+
+
+echo 'libgamma have not been configured.'
+echo
+echo " Debug mode: ${have_debug}"
+echo " Dummy method: ${have_dummy}"
+echo " X.org via RandR: ${have_randr}"
+echo " X.org via VidMode: ${have_vidmode}"
+echo " Linux DRM: ${have_drm}"
+echo " Windows GDI: ${have_w32gdi}"
+echo " Quartz via CoreGraphics: ${have_quartz}"
+echo
+echo 'Compile with `make`.'
+