Skip to content
This repository has been archived by the owner on Nov 11, 2018. It is now read-only.

Homebrew build #130

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build/*
gnulib
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,22 @@ configure_file(${CMAKE_SOURCE_DIR}/data/finalterm.1.in ${CMAKE_BINARY_DIR}/data/
install(FILES ${CMAKE_BINARY_DIR}/data/finalterm.1 DESTINATION share/man/man1)

add_executable(finalterm ${VALA_C})

if (APPLE)
include(ExternalProject)
ExternalProject_Add(
gnulib
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gnulib
UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/gnulib/autogen.sh
CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/gnulib/configure --prefix=${CMAKE_BINARY_DIR}
PREFIX ${CMAKE_BINARY_DIR}
BUILD_COMMAND ${MAKE}
BUILD_IN_SOURCE 1
)
include_directories(BEFORE SYSTEM ${CMAKE_BINARY_DIR}/include)
add_dependencies(finalterm gnulib)
endif (APPLE)

target_link_libraries(finalterm m util)

install(TARGETS finalterm RUNTIME DESTINATION bin)
Expand Down
7 changes: 7 additions & 0 deletions gnulib/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SUBDIRS = lib

ACLOCAL_AMFLAGS = -I m4

EXTRA_DIST = m4/gnulib-cache.m4

include_HEADERS = lib/pty.h
5 changes: 5 additions & 0 deletions gnulib/autogen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#! /bin/sh

touch NEWS README AUTHORS ChangeLog

autoreconf -i --force
34 changes: 34 additions & 0 deletions gnulib/configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([gnulib], [HEAD])

AM_INIT_AUTOMAKE

AC_PROG_CC

gl_EARLY

AC_CONFIG_MACRO_DIR([m4])

LT_INIT
gl_INIT

AC_CONFIG_FILES([
Makefile
lib/Makefile
])

AC_OUTPUT

# Checks for programs.

# Checks for libraries.

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.

142 changes: 142 additions & 0 deletions gnulib/lib/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
# Copyright (C) 2002-2012 Free Software Foundation, Inc.
#
# This file 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 3 of the License, or
# (at your option) any later version.
#
# This file 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 file. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License,
# this file may be distributed as part of a program that
# contains a configuration script generated by Autoconf, under
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --no-conditional-dependencies --no-libtool --macro-prefix=gl pty

AUTOMAKE_OPTIONS = 1.5 gnits

SUBDIRS =
noinst_HEADERS =
noinst_LIBRARIES =
noinst_LTLIBRARIES =
EXTRA_DIST =
BUILT_SOURCES =
SUFFIXES =
MOSTLYCLEANFILES = core *.stackdump
MOSTLYCLEANDIRS =
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =

AM_CPPFLAGS =
AM_CFLAGS =

noinst_LIBRARIES += libgnu.a

libgnu_a_SOURCES =
libgnu_a_LIBADD = $(gl_LIBOBJS)
libgnu_a_DEPENDENCIES = $(gl_LIBOBJS)
EXTRA_libgnu_a_SOURCES =

## begin gnulib module pty

BUILT_SOURCES += pty.h

# We need the following in order to create <pty.h> when the system
# doesn't have one that works with the given compiler.
pty.h: pty.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''HAVE_PTY_H''@|$(HAVE_PTY_H)|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_PTY_H''@|$(NEXT_PTY_H)|g' \
-e 's/@''GNULIB_FORKPTY''@/$(GNULIB_FORKPTY)/g' \
-e 's/@''GNULIB_OPENPTY''@/$(GNULIB_OPENPTY)/g' \
-e 's|@''HAVE_UTIL_H''@|$(HAVE_UTIL_H)|g' \
-e 's|@''HAVE_LIBUTIL_H''@|$(HAVE_LIBUTIL_H)|g' \
-e 's|@''HAVE_FORKPTY''@|$(HAVE_FORKPTY)|g' \
-e 's|@''HAVE_OPENPTY''@|$(HAVE_OPENPTY)|g' \
-e 's|@''REPLACE_FORKPTY''@|$(REPLACE_FORKPTY)|g' \
-e 's|@''REPLACE_OPENPTY''@|$(REPLACE_OPENPTY)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/pty.in.h; \
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += pty.h pty.h-t

EXTRA_DIST += pty.in.h

## end gnulib module pty

## begin gnulib module snippet/c++defs

# The BUILT_SOURCES created by this Makefile snippet are not used via #include
# statements but through direct file reference. Therefore this snippet must be
# present in all Makefile.am that need it. This is ensured by the applicability
# 'all' defined above.

BUILT_SOURCES += c++defs.h
# The c++defs.h that gets inserted into generated .h files is the same as
# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
c++defs.h: $(top_srcdir)/./snippet/c++defs.h
$(AM_V_GEN)rm -f $@-t $@ && \
sed -n -e '/_GL_CXXDEFS/,$$p' \
< $(top_srcdir)/./snippet/c++defs.h \
> $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += c++defs.h c++defs.h-t

CXXDEFS_H=c++defs.h

EXTRA_DIST += $(top_srcdir)/./snippet/c++defs.h

## end gnulib module snippet/c++defs

## begin gnulib module snippet/warn-on-use

BUILT_SOURCES += warn-on-use.h
# The warn-on-use.h that gets inserted into generated .h files is the same as
# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
# off.
warn-on-use.h: $(top_srcdir)/./snippet/warn-on-use.h
$(AM_V_GEN)rm -f $@-t $@ && \
sed -n -e '/^.ifndef/,$$p' \
< $(top_srcdir)/./snippet/warn-on-use.h \
> $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t

WARN_ON_USE_H=warn-on-use.h

EXTRA_DIST += $(top_srcdir)/./snippet/warn-on-use.h

## end gnulib module snippet/warn-on-use

## begin gnulib module dummy

libgnu_a_SOURCES += dummy.c

## end gnulib module dummy


mostlyclean-local: mostlyclean-generic
@for dir in '' $(MOSTLYCLEANDIRS); do \
if test -n "$$dir" && test -d $$dir; then \
echo "rmdir $$dir"; rmdir $$dir; \
fi; \
done; \
:
42 changes: 42 additions & 0 deletions gnulib/lib/dummy.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* A dummy file, to prevent empty libraries from breaking builds.
Copyright (C) 2004, 2007, 2009-2012 Free Software Foundation, Inc.

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 3 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, see <http://www.gnu.org/licenses/>. */

/* Some systems, reportedly OpenBSD and Mac OS X, refuse to create
libraries without any object files. You might get an error like:

> ar cru .libs/libgl.a
> ar: no archive members specified

Compiling this file, and adding its object file to the library, will
prevent the library from being empty. */

/* Some systems, such as Solaris with cc 5.0, refuse to work with libraries
that don't export any symbol. You might get an error like:

> cc ... libgnu.a
> ild: (bad file) garbled symbol table in archive ../gllib/libgnu.a

Compiling this file, and adding its object file to the library, will
prevent the library from exporting no symbols. */

#ifdef __sun
/* This declaration ensures that the library will export at least 1 symbol. */
int gl_dummy_symbol;
#else
/* This declaration is solely to ensure that after preprocessing
this file is never empty. */
typedef int dummy;
#endif
131 changes: 131 additions & 0 deletions gnulib/lib/pty.in.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
/* Substitute for and wrapper around <pty.h>.
Copyright (C) 2010-2012 Free Software Foundation, Inc.

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 3, 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, see <http://www.gnu.org/licenses/>. */

#ifndef _@GUARD_PREFIX@_PTY_H

#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
@PRAGMA_COLUMNS@

/* The include_next requires a split double-inclusion guard. */
#if @HAVE_PTY_H@
# @INCLUDE_NEXT@ @NEXT_PTY_H@
#endif

#ifndef _@GUARD_PREFIX@_PTY_H
#define _@GUARD_PREFIX@_PTY_H

/* Some platforms declare this in a different header than glibc. */
#if @HAVE_UTIL_H@
# include <util.h>
#endif
#if @HAVE_LIBUTIL_H@
/* <sys/types.h> is a prerequisite of <libutil.h> on FreeBSD 8.0. */
# include <sys/types.h>
# include <libutil.h>
#endif

/* Get 'struct termios' and 'struct winsize'. */
#include <termios.h>
#if defined _AIX
# include <sys/ioctl.h>
#endif
/* Mingw lacks 'struct termios' and 'struct winsize', but a forward
declaration of an opaque type is sufficient to allow compilation of
a stub openpty(). */
struct termios;
struct winsize;

/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */

/* The definition of _GL_WARN_ON_USE is copied here. */


/* Declare overridden functions. */

#if @GNULIB_FORKPTY@
/* Create pseudo tty master slave pair and set terminal attributes
according to TERMP and WINP. Fork a child process attached to the
slave end. Return a handle for the master end in *AMASTER, and
return the name of the slave end in NAME. */
# if @REPLACE_FORKPTY@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef forkpty
# define forkpty rpl_forkpty
# endif
_GL_FUNCDECL_RPL (forkpty, int,
(int *amaster, char *name,
struct termios const *termp, struct winsize const *winp));
_GL_CXXALIAS_RPL (forkpty, int,
(int *amaster, char *name,
struct termios const *termp, struct winsize const *winp));
# else
# if !@HAVE_FORKPTY@
_GL_FUNCDECL_SYS (forkpty, int,
(int *amaster, char *name,
struct termios const *termp, struct winsize const *winp));
# endif
_GL_CXXALIAS_SYS (forkpty, int,
(int *amaster, char *name,
struct termios const *termp, struct winsize const *winp));
# endif
_GL_CXXALIASWARN (forkpty);
#elif defined GNULIB_POSIXCHECK
# undef forkpty
# if HAVE_RAW_DECL_FORKPTY
_GL_WARN_ON_USE (forkpty, "forkpty is not declared consistently - "
"use gnulib module forkpty for portability");
# endif
#endif

#if @GNULIB_OPENPTY@
/* Create pseudo tty master slave pair and set terminal attributes
according to TERMP and WINP. Return handles for both ends in
*AMASTER and *ASLAVE, and return the name of the slave end in NAME. */
# if @REPLACE_OPENPTY@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef openpty
# define openpty rpl_openpty
# endif
_GL_FUNCDECL_RPL (openpty, int,
(int *amaster, int *aslave, char *name,
struct termios const *termp, struct winsize const *winp));
_GL_CXXALIAS_RPL (openpty, int,
(int *amaster, int *aslave, char *name,
struct termios const *termp, struct winsize const *winp));
# else
# if !@HAVE_OPENPTY@
_GL_FUNCDECL_SYS (openpty, int,
(int *amaster, int *aslave, char *name,
struct termios const *termp, struct winsize const *winp));
# endif
_GL_CXXALIAS_SYS (openpty, int,
(int *amaster, int *aslave, char *name,
struct termios const *termp, struct winsize const *winp));
# endif
_GL_CXXALIASWARN (openpty);
#elif defined GNULIB_POSIXCHECK
# undef openpty
# if HAVE_RAW_DECL_OPENPTY
_GL_WARN_ON_USE (openpty, "openpty is not declared consistently - "
"use gnulib module openpty for portability");
# endif
#endif


#endif /* _@GUARD_PREFIX@_PTY_H */
#endif /* _@GUARD_PREFIX@_PTY_H */
Loading