[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemacs-commit] qemacs configure
From: |
Charlie Gordon |
Subject: |
[Qemacs-commit] qemacs configure |
Date: |
Fri, 22 Nov 2013 20:03:11 +0000 |
CVSROOT: /sources/qemacs
Module name: qemacs
Changes by: Charlie Gordon <chqrlie> 13/11/22 20:03:11
Modified files:
. : configure
Log message:
- force bash because of echo -n
- use shadow file for config.mak to prevent clobbering if identical
- added Darwin target support
- stricter tests on command line options
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/configure?cvsroot=qemacs&r1=1.15&r2=1.16
Patches:
Index: configure
===================================================================
RCS file: /sources/qemacs/qemacs/configure,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- configure 17 Apr 2008 15:06:44 -0000 1.15
+++ configure 22 Nov 2013 20:03:11 -0000 1.16
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# qemacs configure script (c) 2002 Fabrice Bellard
#
@@ -16,6 +16,7 @@
TMPO="${TMPDIR1}/qemacs-conf-${RANDOM}-$$-${RANDOM}.o"
TMPS="${TMPDIR1}/qemacs-conf-${RANDOM}-$$-${RANDOM}.S"
TMPH="${TMPDIR1}/qemacs-conf-${RANDOM}-$$-${RANDOM}.h"
+TMPMAK="${TMPDIR1}/qemacs-conf-${RANDOM}-$$-${RANDOM}.mak"
# default parameters
prefix="/usr/local"
@@ -25,6 +26,7 @@
ar="ar"
make="make"
strip="strip"
+strip_args="-s -R .comment -R .note"
cpu=`uname -m`
case "$cpu" in
i386|i486|i586|i686|i86pc|BePC)
@@ -46,6 +48,7 @@
gprof="no"
network="yes"
win32="no"
+darwin="no"
cygwin="no"
lshared="no"
extralibs=""
@@ -102,6 +105,14 @@
CYGWIN*)
cygwin="yes"
;;
+ Darwin)
+ CFLAGS=""
+ initcalls="no"
+ unlockio="no"
+ plugins="no"
+ extralibs="-lm"
+ strip_args="-x -S"
+ ;;
*)
extralibs="-lm"
unlockio="yes"
@@ -136,7 +147,17 @@
fi
fi
+if test -f "/opt/X11/include/X11/Xlib.h" ; then
+ CFLAGS="$CFLAGS -I/opt/X11/include"
+ x11="yes"
+ html="yes"
+ if test -f "/opt/X11/include/X11/extensions/Xv.h" ; then
+ xv="yes"
+ fi
+fi
+
for opt do
+ value="none"
case "$opt" in
--prefix=*)
prefix=`echo $opt | cut -d '=' -f 2`
@@ -154,10 +175,10 @@
make=`echo $opt | cut -d '=' -f 2`
;;
--extra-cflags=*)
- CFLAGS="${opt#--extra-cflags=}"
+ CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
;;
--extra-ldflags=*)
- LDFLAGS="${opt#--extra-ldflags=}"
+ LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
;;
--extra-libs=*)
extralibs=${opt#--extra-libs=}
@@ -165,53 +186,69 @@
--cpu=*)
cpu=`echo $opt | cut -d '=' -f 2`
;;
- --enable-gprof)
- gprof="yes"
+ --with-ffmpegdir=*)
+ ffmpeg_srcdir=${opt#--with-ffmpegdir=} ; ffmpeg="yes"
;;
- --disable-network)
- network="no"
+ --with-ffmpeglibdir=*)
+ ffmpeg_libdir=${opt#--with-ffmpeglibdir=}
+ ;;
+ --disable-*)
+ value="no"
+ ;;
+ --enable-*)
+ value="yes"
+ ;;
+ *)
+ echo "unknown option: $opt"
+ exit 1
+ ;;
+ esac
+ case "$opt" in
+ --disable-gprof | --enable-gprof)
+ gprof="$value"
+ ;;
+ --enable-network | --disable-network)
+ network="$value"
;;
--enable-win32)
win32="yes"
;;
--enable-cygwin)
- cygwin="yes" ;
- ;;
- --enable-shared)
- lshared="yes"
+ cygwin="yes"
;;
- --disable-mpegaudio-hp)
- mpegaudio_hp="no"
+ --enable-shared | --disable-shared)
+ lshared="$value"
;;
- --enable-tiny)
- tiny="yes"
+ --enable-mpegaudio-hp | --disable-mpegaudio-hp)
+ mpegaudio_hp="$value"
;;
- --disable-x11)
- x11="no"
+ --enable-tiny | --disable-tiny)
+ tiny="$value"
;;
- --disable-xv)
- xv="no"
+ --enable-x11 | --disable-x11)
+ x11="$value"
;;
- --disable-xrender)
- xrender="no"
+ --enable-xv | --disable-xv)
+ xv="$value"
;;
- --disable-png)
- png="no"
+ --enable-xrender | --disable-xrender)
+ xrender="$value"
;;
- --disable-html)
- html="no"
+ --enable-png | --disable-png)
+ png="$value"
;;
- --disable-plugins)
- plugins="no"
+ --enable-html | --disable-html)
+ html="$value"
;;
- --disable-ffmpeg)
- ffmpeg="no"
+ --enable-plugins | --disable-plugins)
+ plugins="$value"
;;
- --with-ffmpegdir=*)
- ffmpeg_srcdir=${opt#--with-ffmpegdir=} ; ffmpeg="yes"
+ --enable-ffmpeg | --disable-ffmpeg)
+ ffmpeg="$value"
;;
- --with-ffmpeglibdir=*)
- ffmpeg_libdir=${opt#--with-ffmpeglibdir=}
+ --enable-* | --disable-*)
+ echo "unknown option: $opt"
+ exit 1
;;
esac
done
@@ -390,147 +427,147 @@
echo ""
echo "Creating config.mak and config.h"
-echo "# Automatically generated by configure - do not modify" > config.mak
+echo "# Automatically generated by configure - do not modify" > $TMPMAK
echo "/* Automatically generated by configure - do not modify */" > $TMPH
-echo "prefix=$prefix" >> config.mak
+echo "prefix=$prefix" >> $TMPMAK
echo "#define CONFIG_QE_PREFIX \"$prefix\"" >> $TMPH
-echo "MAKE=$make" >> config.mak
-echo "CC=$cc" >> config.mak
-echo "GCC_MAJOR=$gcc_major" >> config.mak
-echo "HOST_CC=$host_cc" >> config.mak
-echo "AR=$ar" >> config.mak
-echo "STRIP=$strip -s -R .comment -R .note" >> config.mak
-echo "INSTALL=install" >> config.mak
-echo "CFLAGS=$CFLAGS" >> config.mak
-echo "LDFLAGS=$LDFLAGS" >> config.mak
-echo "EXE=$exe" >> config.mak
+echo "MAKE=$make" >> $TMPMAK
+echo "CC=$cc" >> $TMPMAK
+echo "GCC_MAJOR=$gcc_major" >> $TMPMAK
+echo "HOST_CC=$host_cc" >> $TMPMAK
+echo "AR=$ar" >> $TMPMAK
+echo "STRIP=$strip $strip_args" >> $TMPMAK
+echo "INSTALL=install" >> $TMPMAK
+echo "CFLAGS=$CFLAGS" >> $TMPMAK
+echo "LDFLAGS=$LDFLAGS" >> $TMPMAK
+echo "EXE=$exe" >> $TMPMAK
if test "$cpu" = "x86" ; then
- echo "TARGET_ARCH_X86=yes" >> config.mak
+ echo "TARGET_ARCH_X86=yes" >> $TMPMAK
echo "#define ARCH_X86 1" >> $TMPH
elif test "$cpu" = "armv4l" ; then
- echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
+ echo "TARGET_ARCH_ARMV4L=yes" >> $TMPMAK
echo "#define ARCH_ARMV4L 1" >> $TMPH
elif test "$cpu" = "alpha" ; then
- echo "TARGET_ARCH_ALPHA=yes" >> config.mak
+ echo "TARGET_ARCH_ALPHA=yes" >> $TMPMAK
echo "#define ARCH_ALPHA 1" >> $TMPH
elif test "$cpu" = "powerpc" ; then
- echo "TARGET_ARCH_POWERPC=yes" >> config.mak
+ echo "TARGET_ARCH_POWERPC=yes" >> $TMPMAK
echo "#define ARCH_POWERPC 1" >> $TMPH
fi
if test "$bigendian" = "yes" ; then
- echo "WORDS_BIGENDIAN=yes" >> config.mak
+ echo "WORDS_BIGENDIAN=yes" >> $TMPMAK
echo "#define WORDS_BIGENDIAN 1" >> $TMPH
fi
if test "$unlockio" = "yes" ; then
- echo "CONFIG_UNLOCKIO=yes" >> config.mak
+ echo "CONFIG_UNLOCKIO=yes" >> $TMPMAK
echo "#define CONFIG_UNLOCKIO 1" >> $TMPH
fi
if test "$ptsname" = "yes" ; then
- echo "CONFIG_PTSNAME=yes" >> config.mak
+ echo "CONFIG_PTSNAME=yes" >> $TMPMAK
echo "#define CONFIG_PTSNAME 1" >> $TMPH
fi
if test "$gprof" = "yes" ; then
- echo "TARGET_GPROF=yes" >> config.mak
+ echo "TARGET_GPROF=yes" >> $TMPMAK
echo "#define HAVE_GPROF 1" >> $TMPH
fi
if test "$lshared" = "yes" ; then
- echo "BUILD_SHARED=yes" >> config.mak
- echo "PIC=-fPIC" >> config.mak
+ echo "BUILD_SHARED=yes" >> $TMPMAK
+ echo "PIC=-fPIC" >> $TMPMAK
fi
-echo "EXTRALIBS=$extralibs" >> config.mak
-echo -n "VERSION=" >>config.mak
-echo -n `head $source_path/VERSION` >> config.mak
-echo "" >> config.mak
+echo "EXTRALIBS=$extralibs" >> $TMPMAK
+echo -n "VERSION=" >> $TMPMAK
+echo -n `head $source_path/VERSION` >> $TMPMAK
+echo "" >> $TMPMAK
echo -n "#define QE_VERSION \"" >> $TMPH
echo -n `head $source_path/VERSION` >> $TMPH
echo "\"" >> $TMPH
if test "$network" = "yes" ; then
echo "#define CONFIG_NETWORK 1" >> $TMPH
- echo "CONFIG_NETWORK=yes" >> config.mak
+ echo "CONFIG_NETWORK=yes" >> $TMPMAK
fi
if test "$win32" = "yes" ; then
echo "#define CONFIG_WIN32 1" >> $TMPH
- echo "CONFIG_WIN32=yes" >> config.mak
+ echo "CONFIG_WIN32=yes" >> $TMPMAK
fi
if test "$cygwin" = "yes" ; then
echo "#define CONFIG_CYGWIN 1" >> $TMPH
- echo "CONFIG_CYGWIN=yes" >> config.mak
+ echo "CONFIG_CYGWIN=yes" >> $TMPMAK
fi
if test "$x11" = "yes" ; then
echo "#define CONFIG_X11 1" >> $TMPH
- echo "CONFIG_X11=yes" >> config.mak
+ echo "CONFIG_X11=yes" >> $TMPMAK
fi
if test "$xv" = "yes" ; then
echo "#define CONFIG_XV 1" >> $TMPH
- echo "CONFIG_XV=yes" >> config.mak
+ echo "CONFIG_XV=yes" >> $TMPMAK
fi
if test "$xrender" = "yes" ; then
echo "#define CONFIG_XRENDER 1" >> $TMPH
- echo "CONFIG_XRENDER=yes" >> config.mak
+ echo "CONFIG_XRENDER=yes" >> $TMPMAK
fi
if test "$tiny" = "yes" ; then
echo "#define CONFIG_TINY 1" >> $TMPH
- echo "CONFIG_TINY=yes" >> config.mak
+ echo "CONFIG_TINY=yes" >> $TMPMAK
fi
if test "$html" = "yes" ; then
echo "#define CONFIG_HTML 1" >> $TMPH
- echo "CONFIG_HTML=yes" >> config.mak
+ echo "CONFIG_HTML=yes" >> $TMPMAK
fi
if test "$plugins" = "yes" ; then
echo "#define CONFIG_DLL 1" >> $TMPH
- echo "CONFIG_DLL=yes" >> config.mak
+ echo "CONFIG_DLL=yes" >> $TMPMAK
fi
if test "$initcalls" = "yes" ; then
echo "#define CONFIG_INIT_CALLS 1" >> $TMPH
- echo "CONFIG_INIT_CALLS=yes" >> config.mak
+ echo "CONFIG_INIT_CALLS=yes" >> $TMPMAK
fi
if test "$png" = "yes" ; then
echo "#define CONFIG_PNG_OUTPUT 1" >> $TMPH
- echo "CONFIG_PNG_OUTPUT=yes" >> config.mak
+ echo "CONFIG_PNG_OUTPUT=yes" >> $TMPMAK
fi
if test "$ffmpeg" = "yes" ; then
echo "#define CONFIG_FFMPEG 1" >> $TMPH
- echo "CONFIG_FFMPEG=yes" >> config.mak
- echo "FFMPEG_SRCDIR=$ffmpeg_srcdir" >> config.mak
- echo "FFMPEG_LIBDIR=$ffmpeg_libdir" >> config.mak
+ echo "CONFIG_FFMPEG=yes" >> $TMPMAK
+ echo "FFMPEG_SRCDIR=$ffmpeg_srcdir" >> $TMPMAK
+ echo "FFMPEG_LIBDIR=$ffmpeg_libdir" >> $TMPMAK
fi
if test "$kmaps" = "yes" ; then
echo "#define CONFIG_ALL_KMAPS 1" >> $TMPH
- echo "CONFIG_ALL_KMAPS=yes" >> config.mak
+ echo "CONFIG_ALL_KMAPS=yes" >> $TMPMAK
fi
if test "$mmap" = "yes" ; then
echo "#define CONFIG_MMAP 1" >> $TMPH
- echo "CONFIG_MMAP=yes" >> config.mak
+ echo "CONFIG_MMAP=yes" >> $TMPMAK
fi
if test "$modes" = "yes" ; then
echo "#define CONFIG_ALL_MODES 1" >> $TMPH
- echo "CONFIG_ALL_MODES=yes" >> config.mak
+ echo "CONFIG_ALL_MODES=yes" >> $TMPMAK
fi
if test "$bidir" = "yes" ; then
echo "#define CONFIG_UNICODE_JOIN 1" >> $TMPH
- echo "CONFIG_UNICODE_JOIN=yes" >> config.mak
+ echo "CONFIG_UNICODE_JOIN=yes" >> $TMPMAK
fi
if test "$doc" = "yes" ; then
echo "#define CONFIG_DOC 1" >> $TMPH
- echo "CONFIG_DOC=yes" >> config.mak
+ echo "CONFIG_DOC=yes" >> $TMPMAK
fi
# build tree in object directory if source path is different from current one
@@ -544,7 +581,14 @@
ln -sf $source_path/$f $f
done
fi
-echo "SRC_PATH=$source_path" >> config.mak
+echo "SRC_PATH=$source_path" >> $TMPMAK
+
+diff $TMPMAK config.mak >/dev/null 2>&1
+if test $? -ne 0 ; then
+ mv -f $TMPMAK config.mak
+else
+ echo "config.mak is unchanged"
+fi
diff $TMPH config.h >/dev/null 2>&1
if test $? -ne 0 ; then
@@ -553,4 +597,4 @@
echo "config.h is unchanged"
fi
-rm -f $TMPC $TMPO $TMPS $TMPH $TMPE
+rm -f $TMPC $TMPO $TMPS $TMPH $TMPE $TMPMAK
- [Qemacs-commit] qemacs configure,
Charlie Gordon <=