]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Initial revision
authorThomas Tanner <tanner@gmx.de>
Tue, 24 Nov 1998 20:32:39 +0000 (20:32 +0000)
committerThomas Tanner <tanner@gmx.de>
Tue, 24 Nov 1998 20:32:39 +0000 (20:32 +0000)
13 files changed:
depdemo/Makefile.am [new file with mode: 0644]
depdemo/README [new file with mode: 0644]
depdemo/configure.in [new file with mode: 0644]
depdemo/l1.c [new file with mode: 0644]
depdemo/l1.h [new file with mode: 0644]
depdemo/l2.c [new file with mode: 0644]
depdemo/l2.h [new file with mode: 0644]
depdemo/l3.c [new file with mode: 0644]
depdemo/l3.h [new file with mode: 0644]
depdemo/l4.c [new file with mode: 0644]
depdemo/l4.h [new file with mode: 0644]
depdemo/main.c [new file with mode: 0644]
depdemo/sysdep.h [new file with mode: 0644]

diff --git a/depdemo/Makefile.am b/depdemo/Makefile.am
new file mode 100644 (file)
index 0000000..74dc040
--- /dev/null
@@ -0,0 +1,30 @@
+# A brief demonstration of using Automake with Libtool. -*-Makefile-*-
+#
+# NOTE: Don't forget that in the libtool distribution, files in this
+# directory are distributed by the demo_distfiles variable in the top
+# level Makefile.
+AUTOMAKE_OPTIONS = foreign
+
+EXTRA_DIST = acinclude.m4
+
+lib_LTLIBRARIES = libl1.la libl2.la libl3.la libl4.la
+libl1_la_SOURCES = l1.c l1.h sysdep.h
+libl2_la_SOURCES = l2.c l2.h sysdep.h
+libl2_la_LIBADD = libl1.la
+libl3_la_SOURCES = l3.c l3.h sysdep.h
+libl3_la_LIBADD = libl1.la libl2.la
+libl4_la_SOURCES = l4.c l4.h sysdep.h
+libl4_la_LIBADD = libl3.la -lm
+
+bin_PROGRAMS = depdemo depdemo.static
+
+depdemo_SOURCES = main.c
+depdemo_LDADD = libl1.la libl2.la libl4.la \
+               libl3.la # remove this!
+depdemo_DEPENDENCIES = libl1.la libl2.la libl4.la
+
+depdemo_static_SOURCES = main.c
+depdemo_static_LDADD = libl1.la libl2.la libl4.la \
+               libl3.la # remove this!
+depdemo_static_DEPENDENCIES = libl1.la libl2.la libl4.la
+depdemo_static_LDFLAGS = -static
diff --git a/depdemo/README b/depdemo/README
new file mode 100644 (file)
index 0000000..f122fab
--- /dev/null
@@ -0,0 +1,11 @@
+This is depdemo, an example package that uses GNU libtool with an
+Automake-generated environment to build many interdependent libraries
+and a test program.
+
+There are four libraries: l1, l2, l3 and l4.
+l1 depends on nothing.
+l2 depends on l1.
+l3 depends on l1 and l2.
+l4 depends on l3 and libm.
+
+The test program uses l1, l2 and l4.
\ No newline at end of file
diff --git a/depdemo/configure.in b/depdemo/configure.in
new file mode 100644 (file)
index 0000000..3cb9591
--- /dev/null
@@ -0,0 +1,12 @@
+dnl Initialize the hell package.
+AC_INIT(main.c)
+AM_INIT_AUTOMAKE(depdemo,1.0)
+
+AC_PROG_CC
+AC_EXEEXT
+AM_PROG_LIBTOOL
+
+AC_CHECK_HEADERS(string.h)
+
+dnl Output the makefile
+AC_OUTPUT(Makefile)
diff --git a/depdemo/l1.c b/depdemo/l1.c
new file mode 100644 (file)
index 0000000..cb2fd4c
--- /dev/null
@@ -0,0 +1,34 @@
+/* l1.c -- trivial test library
+   Copyright (C) 1998 Thomas Tanner <tanner@gmx.de>
+   This file is part of GNU Libtool.
+
+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. */
+
+#include "l1.h"
+#include <stdio.h>
+
+int    var_l1;
+
+int
+func_l1(int ident)
+{
+  int i;
+  
+  for (i = 0; i < ident; i++)
+    putchar(' ');
+  printf("l1\n");
+  return 0; 
+}
diff --git a/depdemo/l1.h b/depdemo/l1.h
new file mode 100644 (file)
index 0000000..a9499f6
--- /dev/null
@@ -0,0 +1,31 @@
+/* l1.h -- interface to a trivial library
+   Copyright (C) 1998 Thomas Tanner <tanner@gmx.de>
+   This file is part of GNU Libtool.
+
+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. */
+
+/* Only include this header file once. */
+#ifndef _L1_H_
+#define _L1_H_ 1
+
+#include "sysdep.h"
+
+__BEGIN_DECLS
+extern int var_l1;
+int    func_l1 __P((int));
+__END_DECLS
+
+#endif /* !_L1_H_ */
diff --git a/depdemo/l2.c b/depdemo/l2.c
new file mode 100644 (file)
index 0000000..f9f9032
--- /dev/null
@@ -0,0 +1,37 @@
+/* l2.c -- trivial test library
+   Copyright (C) 1998 Thomas Tanner <tanner@gmx.de>
+   This file is part of GNU Libtool.
+
+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. */
+
+#include "l2.h"
+
+#include "l1.h"
+#include <stdio.h>
+
+int    var_l2;
+
+int
+func_l2(int ident)
+{
+  int i;
+  
+  for (i = 0; i < ident; i++)
+    putchar(' ');
+  printf("l2\n");
+  func_l1(ident+1);
+  return 0; 
+}
diff --git a/depdemo/l2.h b/depdemo/l2.h
new file mode 100644 (file)
index 0000000..3c08143
--- /dev/null
@@ -0,0 +1,31 @@
+/* l2.h -- interface to a trivial library
+   Copyright (C) 1998 Thomas Tanner <tanner@gmx.de>
+   This file is part of GNU Libtool.
+
+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. */
+
+/* Only include this header file once. */
+#ifndef _L2_H_
+#define _L2_H_ 1
+
+#include "sysdep.h"
+
+__BEGIN_DECLS
+extern int var_l2;
+int    func_l2 __P((int));
+__END_DECLS
+
+#endif /* !_L2_H_ */
diff --git a/depdemo/l3.c b/depdemo/l3.c
new file mode 100644 (file)
index 0000000..b33a8e5
--- /dev/null
@@ -0,0 +1,39 @@
+/* l3.c -- trivial test library
+   Copyright (C) 1998 Thomas Tanner <tanner@gmx.de>
+   This file is part of GNU Libtool.
+
+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. */
+
+#include "l3.h"
+
+#include "l1.h"
+#include "l2.h"
+#include <stdio.h>
+
+int    var_l3;
+
+int
+func_l3(int ident)
+{
+  int i;
+  
+  for (i = 0; i < ident; i++)
+    putchar(' ');
+  printf("l3\n");
+  func_l1(ident+1);
+  func_l2(ident+1);
+  return 0; 
+}
diff --git a/depdemo/l3.h b/depdemo/l3.h
new file mode 100644 (file)
index 0000000..e8659f4
--- /dev/null
@@ -0,0 +1,31 @@
+/* l3.h -- interface to a trivial library
+   Copyright (C) 1998 Thomas Tanner <tanner@gmx.de>
+   This file is part of GNU Libtool.
+
+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. */
+
+/* Only include this header file once. */
+#ifndef _L3_H_
+#define _L3_H_ 1
+
+#include "sysdep.h"
+
+__BEGIN_DECLS
+extern int var_l3;
+int    func_l3 __P((int));
+__END_DECLS
+
+#endif /* !_L3_H_ */
diff --git a/depdemo/l4.c b/depdemo/l4.c
new file mode 100644 (file)
index 0000000..b8a675f
--- /dev/null
@@ -0,0 +1,41 @@
+/* l4.c -- trivial test library
+   Copyright (C) 1998 Thomas Tanner <tanner@gmx.de>
+   This file is part of GNU Libtool.
+
+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. */
+
+#include "l4.h"
+
+#include "l3.h"
+#include <stdio.h>
+#include <math.h>
+
+int    var_l4;
+
+int
+func_l4(int ident)
+{
+  int i;
+  
+  for (i = 0; i < ident; i++)
+    putchar(' ');
+  printf("l4\n");
+  func_l3(ident+1);
+  for (i = 0; i <= ident; i++)
+    putchar(' ');
+  printf("libm [sin(1.5) = %f]\n", sin(1.5));
+  return 0; 
+}
diff --git a/depdemo/l4.h b/depdemo/l4.h
new file mode 100644 (file)
index 0000000..20a5ff6
--- /dev/null
@@ -0,0 +1,31 @@
+/* l4.h -- interface to a trivial library
+   Copyright (C) 1998 Thomas Tanner <tanner@gmx.de>
+   This file is part of GNU Libtool.
+
+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. */
+
+/* Only include this header file once. */
+#ifndef _L4_H_
+#define _L4_H_ 1
+
+#include "sysdep.h"
+
+__BEGIN_DECLS
+extern int var_l4;
+int    func_l4 __P((int));
+__END_DECLS
+
+#endif /* !_L4_H_ */
diff --git a/depdemo/main.c b/depdemo/main.c
new file mode 100644 (file)
index 0000000..65683d1
--- /dev/null
@@ -0,0 +1,34 @@
+/* main.c -- inter-library dependency test program
+   Copyright (C) 1996 Free Software Foundation, Inc.
+   This file is part of GNU Libtool.
+
+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. */
+
+#include "l1.h"
+#include "l2.h"
+#include "l4.h"
+#include <stdio.h>
+#include <string.h>
+
+int
+main (int argc, char **argv)
+{
+  printf("dependencies:\n");
+  func_l1(0);
+  func_l2(0);
+  func_l4(0);
+  return 0;
+}
diff --git a/depdemo/sysdep.h b/depdemo/sysdep.h
new file mode 100644 (file)
index 0000000..797669d
--- /dev/null
@@ -0,0 +1,47 @@
+/* foo.h -- interface to the libfoo* libraries
+   Copyright (C) 1998 Thomas Tanner <tanner@gmx.de>
+   This file is part of GNU Libtool.
+
+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. */
+
+/* Only include this header file once. */
+#ifndef _SYSDEP_H_
+#define _SYSDEP_H_ 1
+
+/* __BEGIN_DECLS should be used at the beginning of your declarations,
+   so that C++ compilers don't mangle their names.  Use __END_DECLS at
+   the end of C declarations. */
+#undef __BEGIN_DECLS
+#undef __END_DECLS
+#ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+#else
+# define __BEGIN_DECLS /* empty */
+# define __END_DECLS /* empty */
+#endif
+
+/* __P is a macro used to wrap function prototypes, so that compilers
+   that don't understand ANSI C prototypes still work, and ANSI C
+   compilers can issue warnings about type mismatches. */
+#undef __P
+#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus)
+# define __P(protos) protos
+#else
+# define __P(protos) ()
+#endif
+
+#endif /* !_SYSDEP_H_ */