Add possibility to include private sources into build
authorVictor Kirhenshtein <victor@netxms.org>
Tue, 17 Jun 2008 11:33:16 +0000 (11:33 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Tue, 17 Jun 2008 11:33:16 +0000 (11:33 +0000)
.gitattributes
configure.ac
reconf
tools/Makefile.am
tools/patch_config.status.pl [new file with mode: 0755]

index 638cfda..5088eb0 100644 (file)
@@ -382,6 +382,7 @@ src/server/tools/nxsnmpget/nxsnmpget.dsw -text
 src/server/tools/nxsnmpset/nxsnmpset.dsw -text
 src/server/tools/nxsnmpwalk/nxsnmpwalk.dsw -text
 src/server/tools/nxupload/nxupload.dsw -text
+tools/patch_config.status.pl -text
 www/data/documentation/body.shtml -text
 www/data/documentation/confexample/image001.png -text
 www/data/documentation/confexample/image002.png -text
index a44154a..6cc8fc2 100644 (file)
@@ -111,6 +111,12 @@ AC_ARG_WITH(mdebug,
        CPPFLAGS="$CPPFLAGS -DNETXMS_MEMORY_DEBUG"
 ])
 
+AC_ARG_WITH(private,
+[AS_HELP_STRING(--with-private,include private sources into build)],
+[
+       COMPONENTS="$COMPONENTS private"
+])
+
 AC_ARG_WITH(sqlite,
 [AS_HELP_STRING(--with-sqlite,build SQLite database driver)],
 [ if test "x$withval" != "xno" ; then
@@ -406,6 +412,11 @@ if test $? = 0; then
        DB_DRIVERS="$DB_DRIVERS oracle"
 fi
 
+check_substr "$COMPONENTS" "private"
+if test $? = 0; then
+       MODULES="$MODULES private"
+fi
+
 
 #--------------------------------------------------------------------
 # Check for programs
@@ -1539,6 +1550,11 @@ AC_CONFIG_FILES([
        tools/Makefile
 ])
 
+if test -d src/private; then
+       PRIVATE=`cat src/private/configure.files`
+       AC_CONFIG_FILES([$PRIVATE])
+fi
+
 AC_OUTPUT
 
 echo "Updating libtool"
@@ -1549,6 +1565,11 @@ if test "x$CC" = "xgcc" && test "x$PLATFORM" = "xHP-UX"; then
        sed "s,hardcode_libdir_flag_spec_ld=,#hardcode_libdir_flag_spec_ld=,g" < ./libtool > libtool.new && mv libtool.new libtool && chmod +x ./libtool
 fi
 
+# Patch config.status
+if test -d src/private; then
+       PRIVATE=`cat src/private/configure.files`
+       $PERL tools/patch_config.status.pl $PRIVATE < config.status > config.status.temp && mv config.status.temp config.status && chmod +x ./config.status
+fi
 
 #--------------------------------------------------------------------
 # Print summary
diff --git a/reconf b/reconf
index 9418cbd..da4cc0c 100644 (file)
--- a/reconf
+++ b/reconf
@@ -34,5 +34,14 @@ echo "- autoheader." &&
 $AUTOHEADER &&
 echo "- automake." &&
 $AUTOMAKE -a &&
-chmod 755 configure &&
+chmod 755 configure
+
+if test -d src/private; then
+       FILES=`cat src/private/configure.files`
+       for file in $FILES; do
+               echo "Processing $file"
+               $AUTOMAKE $file
+       done
+fi
+
 exit $?
index 7f80715..1b4dc1a 100644 (file)
@@ -14,6 +14,7 @@ EXTRA_DIST = \
        create_ssa_list.sh \
        mc.pl \
        nwmkimp.pl \
+       patch_config.status.pl \
        sharIt \
        stub.sh \
        update_xrc.pl
diff --git a/tools/patch_config.status.pl b/tools/patch_config.status.pl
new file mode 100755 (executable)
index 0000000..6450a98
--- /dev/null
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+
+while(<STDIN>)
+{
+   chomp;
+   $line = $_;
+
+       if ($line =~ /\"\$PRIVATE\"\) CONFIG_FILES/)
+       {
+               for($i = 0; $i <= $#ARGV; $i++)
+               {
+                       print "\t\"" . $ARGV[$i]. "\") CONFIG_FILES=\"\$CONFIG_FILES " . $ARGV[$i] . "\" ;;\n";
+               }
+               $line = "";
+       }
+
+   if ($line ne "")
+   {
+      print "$line\n";
+   }
+}