summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@gnu.org>2009-10-06 11:44:11 +0200
committerThomas Schwinge <tschwinge@gnu.org>2009-10-06 12:52:06 +0200
commit7993b3db57070ec6b37bdac13f9edf9362861f16 (patch)
tree9966f152ed07e2c4d7e5c0a2060bd1f275947e08
parentdea12e2529ecdcab3a382fc71e7430326b74d6a6 (diff)
Build system.
* configure.ac: New file. * package.m4: Likewise. * Makefile.am: Likewise. * build: Remove file. * nsmux.c (netfs_server_name, netfs_server_version): Set from the Autoconf variables. * options.c (argp_program_version): Likewise. (argp_program_bug_address): New.
-rw-r--r--Makefile.am58
-rwxr-xr-xbuild1
-rw-r--r--configure.ac45
-rw-r--r--nsmux.c4
-rw-r--r--options.c3
-rw-r--r--package.m43
6 files changed, 110 insertions, 4 deletions
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 000000000..76e4fa040
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,58 @@
+# Copyright (C) 2009 Free Software Foundation, Inc.
+#
+# This file is part of nsmux.
+#
+# 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, 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.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+AM_CPPFLAGS =
+AM_CFLAGS =
+
+bin_PROGRAMS =
+
+
+AM_CPPFLAGS += \
+ -include config.h
+
+AM_CFLAGS += \
+ -Wall
+
+
+bin_PROGRAMS += \
+ nsmux
+
+
+nsmux_SOURCES = \
+ nsmux.c \
+ node.c \
+ lnode.c \
+ ncache.c \
+ options.c \
+ lib.c \
+ magic.c \
+ trans.c
+
+nsmux_CPPFLAGS = \
+ -DDEBUG \
+ $(AM_CPPFLAGS)
+
+nsmux_LDADD = \
+ -lnetfs \
+ -lfshelp \
+ -liohelp \
+ -lthreads \
+ -lports \
+ -lihash \
+ -lshouldbeinlibc
diff --git a/build b/build
deleted file mode 100755
index bfe91357a..000000000
--- a/build
+++ /dev/null
@@ -1 +0,0 @@
-gcc -DDEBUG -Wall -g -lnetfs -lfshelp -liohelp -lthreads -lports -lihash -lshouldbeinlibc -o nsmux nsmux.c node.c lnode.c ncache.c options.c lib.c magic.c trans.c 2>&1 | tee errors
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 000000000..fdf17c864
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,45 @@
+# Copyright (C) 2009 Free Software Foundation, Inc.
+#
+# This file is part of nsmux.
+#
+# 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, 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.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+m4_include([package.m4])
+AC_INIT(
+ [AC_PACKAGE_NAME],
+ [AC_PACKAGE_VERSION],
+ [AC_PACKAGE_BUGREPORT])
+
+AC_CONFIG_SRCDIR([nsmux.c])
+
+AC_CONFIG_AUX_DIR([build-aux])
+
+AM_INIT_AUTOMAKE(
+ [foreign] dnl For now.
+ [-Wall]
+ [no-define]
+ [subdir-objects])
+
+
+AC_PROG_CC
+AC_PROG_CC_C_O
+
+
+AC_CONFIG_HEADERS([config.h])
+
+AC_CONFIG_FILES([Makefile])
+
+AC_OUTPUT
diff --git a/nsmux.c b/nsmux.c
index 112dd5f31..2424a2e91 100644
--- a/nsmux.c
+++ b/nsmux.c
@@ -45,10 +45,10 @@
/*---------------------------------------------------------------------------*/
/*--------Global Variables---------------------------------------------------*/
/*The name of the server*/
-char *netfs_server_name = "nsmux";
+char *netfs_server_name = PACKAGE_NAME;
/*---------------------------------------------------------------------------*/
/*The version of the server*/
-char *netfs_server_version = "0.0";
+char *netfs_server_version = PACKAGE_VERSION;
/*---------------------------------------------------------------------------*/
/*The maximal length of a chain of symbolic links*/
int netfs_maxsymlinks = 12;
diff --git a/options.c b/options.c
index dbff5e21a..f96810436 100644
--- a/options.c
+++ b/options.c
@@ -107,7 +107,8 @@ static const struct argp_child argp_children_startup[] = {
/*---------------------------------------------------------------------------*/
/*The version of the server for argp*/
-const char *argp_program_version = "0.0";
+const char *argp_program_version = PACKAGE_VERSION;
+const char *argp_program_bug_address = PACKAGE_BUGREPORT;
/*---------------------------------------------------------------------------*/
/*The arpg parser for runtime arguments*/
struct argp argp_runtime = { 0, 0, 0, 0, argp_children_runtime };
diff --git a/package.m4 b/package.m4
new file mode 100644
index 000000000..903b41343
--- /dev/null
+++ b/package.m4
@@ -0,0 +1,3 @@
+m4_define([AC_PACKAGE_NAME],[nsmux])
+m4_define([AC_PACKAGE_VERSION],[0])
+m4_define([AC_PACKAGE_BUGREPORT],[bug-hurd@gnu.org])