From: <mik...@us...> - 2003-12-29 16:39:04
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web In directory sc8-pr-cvs1:/tmp/cvs-serv24526 Modified Files: configure Log Message: 29/12/2003 Mikael Barbeaux * configure - compatible with Linux format Index: configure =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/configure,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- configure 29 Dec 2003 16:33:44 -0000 1.2 +++ configure 29 Dec 2003 16:39:01 -0000 1.3 @@ -1,323 +1,323 @@ -#!/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 - elif 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 "$THREAD_EXCP_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 \\\/'` -THREAD_EXCP_OBJ=`find . -name '*.cpp' | grep /ThreadException.cpp | sed -e 's/.cpp/.o \\\/'` -OTHER_OBJS=`find . -name '*.cpp' | sed '/\/Exception.cpp/d' | sed '/\/ThreadException.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 +#!/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 + elif 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 "$THREAD_EXCP_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 \\\/'` +THREAD_EXCP_OBJ=`find . -name '*.cpp' | grep /ThreadException.cpp | sed -e 's/.cpp/.o \\\/'` +OTHER_OBJS=`find . -name '*.cpp' | sed '/\/Exception.cpp/d' | sed '/\/ThreadException.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 |