From 438df772b91e6ecfee2dc18ca792dc9f9a24b33c Mon Sep 17 00:00:00 2001 From: Torello Querci Date: Tue, 12 Jan 2010 13:01:31 +0000 Subject: Update to the build files. Thanks to nmencia. --- diff --git a/.gitignore b/.gitignore index 2888a38..ce0302f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ Makefile Makefile.in Makefile.include +INSTALL install-sh aclocal.m4 missing diff --git a/COPYING b/COPYING index 025873f..d511905 100644 --- a/COPYING +++ b/COPYING @@ -1,8 +1,8 @@ GNU GENERAL PUBLIC LICENSE Version 2, June 1991 - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to +the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not @@ -255,33 +255,29 @@ make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, -THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT -PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED -IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, -EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY -AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL -NECESSARY SERVICING, REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR -AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY -OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM -AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING -ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM -(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY -OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS -BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs @@ -295,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - Copyright (C) 19yy + Copyright (C) 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 @@ -307,17 +303,16 @@ the "copyright" line and a pointer to where the full notice is found. 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 - + 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., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. @@ -340,5 +335,5 @@ necessary. Here is a sample; alter the names: This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General +library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. diff --git a/Makefile.am b/Makefile.am index 54229ee..30bc0af 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,19 @@ -SUBDIRS = src +SUBDIRS = src +bin_SCRIPTS = fsgateway +EXTRA_DIST = fsgateway.in + +REWRITE = \ + sed -e "s|\@prefix\@|$(prefix)|g" \ + -e "s|\@pkglibdir\@|$(pkglibdir)|g" \ + -e "s|\@bindir\@|$(bindir)|g" \ + -e "s|\@MONO\@|$(MONO)|g" + +$(bin_SCRIPTS): $(srcdir)/fsgateway.in Makefile + $(REWRITE) $(srcdir)/fsgateway.in > $@.tmp + mv $@.tmp $@ + +CLEANFILES = \ + fsgateway MAINTAINERCLEANFILES = \ INSTALL \ diff --git a/autogen.sh b/autogen.sh index b597da6..2e0a644 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,7 +1,7 @@ #! /bin/sh PROJECT=fsgateway -FILE= +FILE=src/FsGateway.cs CONFIGURE=configure.ac : ${AUTOCONF=autoconf} @@ -51,10 +51,10 @@ if test "$DIE" -eq 1; then exit 1 fi -#test $TEST_TYPE $FILE || { -# echo "You must run this script in the top-level $PROJECT directory" -# exit 1 -#} +test $TEST_TYPE $FILE || { + echo "You must run this script in the top-level $PROJECT directory" + exit 1 +} if test -z "$*"; then echo "I am going to run ./configure with no arguments - if you wish " @@ -81,3 +81,4 @@ $AUTOCONF echo Running $srcdir/configure $conf_flags "$@" ... $srcdir/configure --enable-maintainer-mode $conf_flags "$@" \ + diff --git a/configure.ac b/configure.ac index 00cc0e5..6e433fd 100644 --- a/configure.ac +++ b/configure.ac @@ -1,38 +1,44 @@ AC_INIT(src/FsGateway.cs) - -AC_PREREQ([2.13]) - -VERSION=0.0.3 - -AM_INIT_AUTOMAKE(fsgateway, $VERSION) - +AC_CANONICAL_SYSTEM +AM_INIT_AUTOMAKE(fsgateway, 0.0.3) AM_MAINTAINER_MODE AC_PROG_INSTALL +dnl pkg-config AC_PATH_PROG(PKG_CONFIG, pkg-config, no) if test "x$PKG_CONFIG" = "xno"; then - AC_MSG_ERROR([You need to install pkg-config]) + AC_MSG_ERROR([You need to install pkg-config]) fi -AC_SUBST(PKH_CONFIG) -MONO_REQ_VERSION=2.0.1 -PKG_CHECK_MODULES(MONO, mono >= $MONO_REQ_VERSION) +dnl C# compiler +AC_PATH_PROGS(CSC, [csc mono-csc], no) +AC_PATH_PROGS(MCS, [mcs gmcs], no) +AC_PATH_PROG(MONO, mono, no) -MONO_FUSE_REQ_VERSION=0.4 -PKG_CHECK_MODULES([MONO_FUSE], [mono-fuse] >= $MONO_FUSE_REQ_VERSION) +CS="C#" +if test "x$CSC" = "xno" -a "x$MCS" = "xno" ; then + dnl AC_MSG_ERROR([You need to install a C# compiler]) + AC_MSG_ERROR([No $CS compiler found]) +fi -AC_PATH_PROG(GMCS, gmcs, no) -if test "x$GMCS" = "xno"; then - AC_MSG_ERROR([You need to install gmcs]) +if test "x$MCS" = "xno" ; then + MCS=$CSC fi -AC_SUBST(GMCS) -AC_PATH_PROG(GACUTIL, gacutil, no) -if test "x$GACUTIL" = "xno"; then - AC_MSG_ERROR([You need to install gacutil]) +if test "x$MONO" = "xno"; then + AC_MSG_ERROR([No mono runtime found]) +else + PKG_CHECK_MODULES(MONO, mono >= 2.0.1) fi -AC_SUBST(GACUTIL) + +AC_SUBST(MCS) + +dnl mono-fuse +PKG_CHECK_MODULES(MONO_FUSE, mono-fuse >= 0.4) + +dnl mysql-connector-net +PKG_CHECK_MODULES(MYSQL_CONNECTOR_NET, mysql-connector-net) dnl find assembly paths for unstable installed assemblies that will be dnl copied into monoskel installation directory for local usage with the app @@ -40,9 +46,15 @@ UNSTABLE_INSTALL_ASSEMBLIES="mono-fuse" INSTALLED_ASSEMBLIES="`$PKG_CONFIG --variable=Libraries $UNSTABLE_INSTALL_ASSEMBLIES`" AC_SUBST(INSTALLED_ASSEMBLIES) -AC_CONFIG_FILES([ +AC_OUTPUT([ src/Makefile Makefile ]) -AC_OUTPUT +dnl Configuration summary +echo "" +echo "Configuration summary" +echo "" +echo " * Installation prefix = $prefix" +echo " * $CS compiler: $MCS" +echo "" diff --git a/fsgateway.in b/fsgateway.in new file mode 100644 index 0000000..78661bb --- /dev/null +++ b/fsgateway.in @@ -0,0 +1,4 @@ +#!/bin/sh + +LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}@pkglibdir@" \ +exec @MONO@ @pkglibdir@/fsgateway.exe $MONO_EXTRA_ARGS "$@" diff --git a/src/Makefile.am b/src/Makefile.am index 893db14..dd6bd59 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,32 +1,10 @@ +fsgatewaydir=$(pkglibdir) +fsgateway_SCRIPTS = fsgateway.exe +EXTRA_DIST = $(fsgateway_sources) +CLEANFILES = fsgateway.exe fsgateway.exe.mdb +MAINTAINERCLEANFILES = Makefile.in -ASSEMBLY_COMPILER_COMMAND = gmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug "-define:DEBUG" - "-main:FsGateway.FsGateway" - -ASSEMBLY_DIR = ../bin -ASSEMBLY = $(ASSEMBLY_DIR)/fsgateway.exe -ASSEMBLY_MDB = $(ASSEMBLY).mdb -COMPILE_TARGET = exe -PROJECT_REFERENCES = -BUILD_DIR = ../bin - -BINARIES = \ - $(FSGATEWAY) - -LIBFLAGS = \ - -r:System \ - -r:System.Data \ - -r:Npgsql \ - -r:Mono.Posix \ - -r:System.Xml \ - -pkg:mysql-connector-net \ - -pkg:mono-fuse - - -all: $(BINARIES) - -FILES = \ - AssemblyInfo.cs \ +fsgateway_sources = AssemblyInfo.cs \ DirAsTag.cs \ Field.cs \ FsDbManager.cs \ @@ -47,28 +25,19 @@ FILES = \ FsSqlServer.cs \ FsPostgresql.cs -DATA_FILES = - -RESOURCES = - -EXTRAS = \ - fsgateway.in - - -CLEANFILES = $(PROGRAMFILES) $(BINARIES) - -FSGATEWAY = $(ASSEMBLY) - -MAIN = FsGateway.FsGateway +fsgateway_libs = \ + -r:System \ + -r:System.Data \ + -r:Npgsql \ + -r:Mono.Posix \ + -r:System.Xml \ + $(MYSQL_CONNECTOR_NET_LIBS) \ + $(MONO_FUSE_LIBS) -$(eval $(call emit-deploy-wrapper,FSGATEWAY,fsgateway,x)) +fsgateway_flags = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug "-define:DEBUG" "-main:FsGateway.FsGateway" -$(ASSEMBLY) $(ASSEMBLY_MDB): $(PROJECT_REFERENCES) $(FILES) - mkdir -p $(dir $(ASSEMBLY)) - $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) -main:$(MAIN) $(LIBFLAGS) $(FILES) - for ASM in $(INSTALLED_ASSEMBLIES); do \ - $(INSTALL) -c -m 0755 $$ASM $(ASSEMBLY_DIR); \ - done; +fsgateway.exe: $(fsgateway_sources) + $(MCS) $(fsgateway_flags) $(fsgateway_libs) -out:$@ $(fsgateway_sources) # Install Unstable Mono Libraries (see configure.ac) @@ -82,3 +51,4 @@ uninstall-hook: for ASM in $(INSTALLED_ASSEMBLIES); do \ rm -f $(DESTDIR)$(pkglibdir)/`basename $$ASM`; \ done; + -- cgit v0.9.1