Update of /cvsroot/sharedaemon/sharedaemon-ui-web
In directory sc8-pr-cvs1:/tmp/cvs-serv17459
Modified Files:
ChangeLog INSTALL
Added Files:
configure
Removed Files:
Makefile.win Makefile.lin Makefile.bsd Makefile.osx
Log Message:
29/12/2003 Mikael Barbeaux
* Wrote a configure script that auto generates a Makefile
for the current plateform.
--- NEW FILE: configure ---
#!/bin/sh
# Configure script for ShareDaemon Web Interface
#
# This file is part of webInterface.
# Copyright (C) 2003 Mikael Barbeaux <mik...@us...>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
####
# Check configuration
####
check_config() {
echo ""
check_command g++
COMP_EXE=$COMM
check_command make
MAKE_EXE=$COMM
check_command ar
AR_EXE=$COMM
check_command rm
RM_EXE=$COMM
check_command strip
STRIP_EXE=$COMM
check_command uname
UNAME_EXE=$COMM
check_lib stdc++ libstdc++.a
OS_TEST=`uname -s | cut -c1-5`
if test $OS_TEST = "MINGW"
then
check_lib winsock libws2_32.a
fi
}
####
# Check for a command
####
check_command() {
COMM=`which $1`
if test -z ${COMM}
then
echo "Checking for $1 not found"
help_comp;
else
echo "Checking for $1 ${COMM}"
fi
}
####
# Check for library
####
check_lib() {
LIBNAME=$1
LIB=`$COMP_EXE -print-file-name=$2`
if test $LIB = $LIBNAME
then
echo "Checking for $LIBNAME not found"
help_comp;
else
echo "Checking for $LIBNAME found"
fi
}
####
# Build Makefile
####
build_Makefile() {
$RM_EXE -f Makefile
echo "# Sharedaemon Web Interface" > Makefile
echo "# Auto generated Makefile" >> Makefile
echo "# Author : Mikael Barbeaux" >> Makefile
echo "" >> Makefile
echo "# Path to compiler binary" >> Makefile
echo "CC = $COMP_EXE" >> Makefile
echo "" >> Makefile
echo "# Path to make binary" >> Makefile
echo "MAKE = $MAKE_EXE" >> Makefile
echo "" >> Makefile
echo "# Path to ar binary" >> Makefile
echo "AR = $AR_EXE" >> Makefile
echo "" >> Makefile
echo "# Path to rm binary" >> Makefile
echo "RM = $RM_EXE" >> Makefile
echo "" >> Makefile
echo "# Path to strip binary" >> Makefile
echo "STRIP = $STRIP_EXE" >> Makefile
echo "" >> Makefile
echo "# Name of output binary" >> Makefile
OS_TEST=`uname -n`
if test $OS_TEST = "WINDOWS"
then
echo "BIN = ui-web.exe" >> Makefile
else
echo "BIN = ui-web" >> Makefile
fi
echo "" >> Makefile
echo "# Common objects" >> Makefile
echo "OBJECTS = $OTHER_OBJS" >> Makefile
echo "" >> Makefile
echo "# Thread lib objects" >> Makefile
echo "THREADS_OBJECTS = $THREADS_OBJS" >> Makefile
echo "$EXC_OBJ" >> Makefile
echo "" >> Makefile
echo "# Libraries" >> Makefile
OS_TEST=`uname -s | cut -c1-5`
if test $OS_TEST = "MINGW"
then
echo "LIBS = -L. -lws2_32 -lsd_threads" >> Makefile
else
echo "LIBS = -L. -lpthread -lsd_threads" >> Makefile
fi
echo "" >> Makefile
echo "# Flags" >> Makefile
if test $OS_TEST = "MINGW"
then
echo "CCFLAGS = -D_WIN32_" >> Makefile
else
echo "CCFLAGS =" >> Makefile
fi
echo ""
echo "all : clean \$(BIN) strip" >> Makefile
echo "" >> Makefile
echo "\$(BIN) : libthread \$(OBJECTS)" >> Makefile
echo " @echo \"\"" >> Makefile
echo " @echo -e \"Creating \$(BIN) binary : \\\\c\"" >> Makefile
echo " @if \$(CC) -o \$(BIN) \$(OBJECTS) \$(LIBS) 2> .error; then \\" >> Makefile
echo " if test -s .error; then \\" >> Makefile
echo " echo -e \"Created with warnings :\"; \\" >> Makefile
echo " cat .error; \\" >> Makefile
echo " \$(RM) -f .error; \\" >> Makefile
echo " else \\" >> Makefile
echo " echo -e \"ok\"; \\" >> Makefile
echo " fi; \\" >> Makefile
echo " else \\" >> Makefile
echo " echo -e \"Creation failed : \"; \\" >> Makefile
echo " cat .error ; \\" >> Makefile
echo " \$(RM) -f .error; \\" >> Makefile
echo " false; \\" >> Makefile
echo " fi;" >> Makefile
echo "" >> Makefile
echo "libthread : \$(THREADS_OBJECTS)" >> Makefile
echo " @echo \"\"" >> Makefile
echo " @echo -e \"Creating libsd_threads.a library : \\\\c\"" >> Makefile
echo " @if \$(AR) -r libsd_threads.a \$(THREADS_OBJECTS) 2> .error; then \\" >> Makefile
echo " if test -s .error; then \\" >> Makefile
echo " echo -e \"Created with warnings :\"; \\" >> Makefile
echo " cat .error; \\" >> Makefile
echo " \$(RM) -f .error; \\" >> Makefile
echo " else \\" >> Makefile
echo " echo -e \"ok\"; \\" >> Makefile
echo " fi; \\" >> Makefile
echo " else \\" >> Makefile
echo " echo -e \"Creation failed : \"; \\" >> Makefile
echo " cat .error ; \\" >> Makefile
echo " \$(RM) -f .error; \\" >> Makefile
echo " false; \\" >> Makefile
echo " fi;" >> Makefile
echo " @echo \"\"" >> Makefile
echo "" >> Makefile
echo "%.o : %.cpp" >> Makefile
echo " @echo -e \"Compiling \$< : \\\\c\"" >> Makefile
echo " @if \$(CC) \$(CCFLAGS) -o \$@ -c \$< 2>.error; then \\" >> Makefile
echo " if test -s .error; then \\" >> Makefile
echo " echo -e \"Created with warnings :\"; \\" >> Makefile
echo " cat .error; \\" >> Makefile
echo " \$(RM) -f .error; \\" >> Makefile
echo " else \\" >> Makefile
echo " echo -e \"ok\"; \\" >> Makefile
echo " fi; \\" >> Makefile
echo " else \\" >> Makefile
echo " echo -e \"Creation failed : \"; \\" >> Makefile
echo " cat .error ; \\" >> Makefile
echo " \$(RM) -f .error; \\" >> Makefile
echo " false; \\" >> Makefile
echo " fi;" >> Makefile
echo "" >> Makefile
echo "strip:" >> Makefile
echo " @echo \"Stripping...\"" >> Makefile
echo " @if \$(STRIP) \$(BIN) 2> .error; then \\" >> Makefile
echo " \$(RM) -f .error; \\" >> Makefile
echo " fi" >> Makefile
echo "" >> Makefile
echo ".PHONY : clean" >> Makefile
echo "" >> Makefile
echo "clean :" >> Makefile
echo " @echo -e \"Cleaning up : \\\\c\"; " >> Makefile
echo " @if \$(RM) -f \$(BIN) libsd_threads.a \$(OBJECTS) \$(THREADS_OBJECTS) 2> .error; then \\" >> Makefile
echo " echo -e \"ok\"; \\" >> Makefile
echo " \$(RM) -f .error; \\" >> Makefile
echo " fi; \\" >> Makefile
echo " echo \"\"">> Makefile
echo "" >> Makefile
echo "" >> Makefile
echo "" >> Makefile
}
####
# Other OS help
####
other_os() {
echo "Your current plateform is : Unknown"
echo "This script cannot compile the program."
echo "Contact me for more informations :"
echo "mik...@us..."
echo ""
echo "Exiting."
}
####
# Displays help
####
help() {
echo "Available options for configure :"
echo " --help"
echo " displays this help"
echo " --optimize"
echo " enable optimization flags"
echo " --debug"
echo " enable debugging"
}
####
# Displays compilation help
####
help_comp() {
echo "compilation help"
exit;
}
####
# Objects
####
THREADS_OBJS=`find . -name '*.cpp' | grep thread | sed -e 's/.cpp/.o \\\/'`
EXC_OBJ=`find . -name '*.cpp' | grep /Exception.cpp | sed -e 's/.cpp/.o \\\/'`
OTHER_OBJS=`find . -name '*.cpp' | sed '/\/Exception.cpp/d' | sed '/\/thread/d' | sed -e 's/.cpp/.o \\\/'`
####
# Main script
####
echo "ShareDaemon Web Interface - configure script"
echo "Written by MikaelB"
CONF_OPTIONS=$1
if test -n "$CONF_OPTIONS" -a "$CONF_OPTIONS" = "--help"
then
help;
else
check_config;
fi
OS=`uname -n`
SYSTEM=`uname -s`
echo ""
echo "Check system : $OS - $SYSTEM"
echo "Building Makefile..."
build_Makefile;
echo ""
echo "Configure script successfully ended."
echo "Now, type \"make\" for compiling the software."
# End
Index: ChangeLog
===================================================================
RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/ChangeLog,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- ChangeLog 28 Dec 2003 13:07:01 -0000 1.16
+++ ChangeLog 29 Dec 2003 16:05:37 -0000 1.17
@@ -23,6 +23,11 @@
-----------------------------------------------------------
+29/12/2003 Mikael Barbeaux
+ * Wrote a configure script that auto generates a Makefile
+ for the current plateform.
+
+
Version : 0.1.3pre1
-------------
Index: INSTALL
===================================================================
RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/INSTALL,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- INSTALL 24 Dec 2003 14:10:32 -0000 1.2
+++ INSTALL 29 Dec 2003 16:05:37 -0000 1.3
@@ -5,25 +5,20 @@
This version is an early alpha. Compilation has been tester under Win32 ( MinGW
and Cygwin ) and Linux, but should also work on FreeBSD and MacOS X ( Cocoa ).
-Use the specific plateform Makefiles from compiling the sources, eg :
- Makefile.lin : Makefile for Linux / Unix plateforms and win32 Cygwin
- Makefile.win : Makefile for win32 MinGW
- Makefile.bsd : Makefile for FreeBSD
- Makefile.osx : Makefile for MacOS X (Cocoa).
-
+
1) Compiling from sources
Download the lastest sources package ( or retrieve sources from
CVS ). Then, go into the directory where your downloaded ( and
- unzipped ) the sources and type, depending your plateform :
+ unzipped ) the sources and type the following :
- $> make -f Makefile.lin # if you are on Linux
- $> make -f Makefile.win # if you are on win32 MinGW
+ $> ./configure
+ $> make
Then, to start the program, simply type, depending your plateform :
- $> ./ui-web # if you are on Linux
+ $> ./ui-web # if you are on Linux, FreeBSD or Cocoa
$> ui-web.exe # if you are on Windows
@@ -36,14 +31,18 @@
If you are under Linux / FreeBSD / MacOS X, you need to have the GCC
compiler ( lastest version if possible ) with the C++ standard library
installed ( typically they are packaged together ).
+
If you are under Windows, you have the choice between using Cygwin
( a Linux shell emulator ) or MinGW. I recommand that you use MinGW,
because Cygwin binaries are often built with dependencies, whereas
MinGW binaries aren't. Moreother, MinGW are much more stable than
Cygwin ones.
+ If you choose to use MinGW, take care to download and install lastest
+ versions of MinGW, mSYS and mSYS Development ToolKit before compiling
+ the sources.
GCC : http://gcc.gnu.org/
- MinGW : http://www.mingw.org
+ MinGW, mSYS & mSYS DTK : http://www.mingw.org
Cygwin : http://www.cygwin.com
--- Makefile.win DELETED ---
--- Makefile.lin DELETED ---
--- Makefile.bsd DELETED ---
--- Makefile.osx DELETED ---
|