"Fossies" - the Fresh Open Source Software Archive

Member "automake-1.16.3/t/vala-libs-vpath.sh" (19 Nov 2020, 2261 Bytes) of package /linux/misc/automake-1.16.3.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #! /bin/sh
    2 # Copyright (C) 2012-2020 Free Software Foundation, Inc.
    3 #
    4 # This program is free software; you can redistribute it and/or modify
    5 # it under the terms of the GNU General Public License as published by
    6 # the Free Software Foundation; either version 2, or (at your option)
    7 # any later version.
    8 #
    9 # This program is distributed in the hope that it will be useful,
   10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
   11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12 # GNU General Public License for more details.
   13 #
   14 # You should have received a copy of the GNU General Public License
   15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
   16 
   17 # Building libraries (libtool and static) from Vala sources.
   18 # And use of vapi files to call C code from Vala.
   19 
   20 required="valac cc pkg-config libtoolize GNUmake"
   21 am_create_testdir=empty
   22 . test-init.sh
   23 
   24 cat >> configure.ac << 'END'
   25 AC_INIT([valalibs],[0.1])
   26 
   27 AC_CONFIG_MACRO_DIR([m4])
   28 
   29 AM_INIT_AUTOMAKE
   30 AM_PROG_AR
   31 LT_INIT
   32 
   33 AC_PROG_CC
   34 
   35 AM_PROG_VALAC([0.7.3])
   36 PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.4])
   37 
   38 AC_CONFIG_FILES([Makefile src/Makefile])
   39 AC_OUTPUT
   40 END
   41 
   42 
   43 cat > Makefile.am << 'END'
   44 SUBDIRS=src
   45 END
   46 
   47 mkdir src
   48 
   49 cat > src/Makefile.am << 'END'
   50 AUTOMAKE_OPTIONS = subdir-objects
   51 lib_LTLIBRARIES = libservice.la
   52 libservice_la_SOURCES = service.vala cservice.c cservice.h
   53 libservice_la_CPPFLAGS = -DOKOKIMDEFINED=1
   54 libservice_la_VALAFLAGS = --vapidir=$(srcdir) --pkg cservice --library service
   55 AM_CFLAGS = $(GOBJECT_CFLAGS)
   56 END
   57 
   58 libtoolize
   59 $ACLOCAL
   60 $AUTOCONF
   61 $AUTOMAKE -a
   62 
   63 cat > src/cservice.c << 'END'
   64 #include "cservice.h"
   65 int c_service_mu_call (void)
   66 {
   67   return OKOKIMDEFINED;
   68 }
   69 END
   70 
   71 cat > src/cservice.h << 'END'
   72 int c_service_mu (void);
   73 END
   74 
   75 cat > src/cservice.vapi <<'END'
   76 namespace CService {
   77   public class Mu {
   78     [CCode (cheader_filename = "cservice.h", cname = "c_service_mu_call")]
   79     public int call ();
   80   }
   81 }
   82 END
   83 
   84 cat > src/service.vala << 'END'
   85 namespace CService {
   86 public class Generator : Object {
   87     public Generator () {
   88         stdout.printf ("construct generator");
   89     }
   90     public void init () {
   91         stdout.printf ("init generator");
   92     }
   93 }
   94 }
   95 END
   96 
   97 mkdir build
   98 cd build
   99 ../configure
  100 
  101 $MAKE
  102 pwd
  103 test -f src/libservice_la_vala.stamp
  104 test -f src/libservice.la
  105 
  106 :