about summary refs log tree commit diff
path: root/pkgs/test/incrementalBuild/hello-additionalFile.patch
blob: 31fbe034909eb8fda9f0f8fdb624589dc0e5f5d5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
diff --git a/Makefile.in b/Makefile.in
index 0805eda..77b000c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -227,7 +227,7 @@ am_lib_libhello_a_OBJECTS = lib/c-ctype.$(OBJEXT) \
 	lib/quotearg.$(OBJEXT) lib/strnlen1.$(OBJEXT) \
 	lib/unistd.$(OBJEXT) lib/wctype-h.$(OBJEXT) \
 	lib/xmalloc.$(OBJEXT) lib/xalloc-die.$(OBJEXT) \
-	lib/xstrndup.$(OBJEXT)
+	lib/xstrndup.$(OBJEXT) src/additionalFile.$(OBJEXT)
 lib_libhello_a_OBJECTS = $(am_lib_libhello_a_OBJECTS)
 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(infodir)" \
 	"$(DESTDIR)$(man1dir)"
@@ -1380,7 +1380,7 @@ lib_libhello_a_SOURCES = lib/c-ctype.h lib/c-ctype.c lib/c-strcase.h \
 	lib/gettext.h lib/localcharset.h lib/localcharset.c \
 	lib/progname.h lib/progname.c lib/quotearg.c lib/strnlen1.h \
 	lib/strnlen1.c lib/unistd.c lib/wctype-h.c lib/xmalloc.c \
-	lib/xalloc-die.c lib/xstrndup.h lib/xstrndup.c
+	lib/xalloc-die.c lib/xstrndup.h lib/xstrndup.c src/additionalFile.c
 lib_libhello_a_LIBADD = $(gl_LIBOBJS)
 lib_libhello_a_DEPENDENCIES = $(gl_LIBOBJS)
 EXTRA_lib_libhello_a_SOURCES = lib/stripslash.c lib/error.c \
diff --git a/src/additionalFile.c b/src/additionalFile.c
new file mode 100644
index 0000000..34d683d
--- /dev/null
+++ b/src/additionalFile.c
@@ -0,0 +1,6 @@
+#include "config.h"
+#include "system.h"
+
+int somefunc() {
+    return 0;
+}
diff --git a/src/hello.c b/src/hello.c
index 453962f..df67de2 100644
--- a/src/hello.c
+++ b/src/hello.c
@@ -57,7 +57,11 @@ main (int argc, char *argv[])
 #endif
 
   /* Having initialized gettext, get the default message. */
-  greeting_msg = _("Hello, world!");
+  if (somefunc() == 0) {
+    greeting_msg = _("Hello, world!");
+  } else {
+    greeting_msg = _("Hello, incremental world!");
+  }
 
   /* Even exiting has subtleties.  On exit, if any writes failed, change
      the exit status.  The /dev/full device on GNU/Linux can be used for
diff --git a/src/system.h b/src/system.h
index d1acac2..935b955 100644
--- a/src/system.h
+++ b/src/system.h
@@ -42,4 +42,6 @@
 /* Check for errors on write.  */
 # include "closeout.h"
 
+int somefunc();
+
 #endif /* HELLO_SYSTEM_H */