Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add autoconf and automake files #119

Merged
merged 6 commits into from
Aug 25, 2018
Merged

add autoconf and automake files #119

merged 6 commits into from
Aug 25, 2018

Conversation

andy5995
Copy link
Contributor

@andy5995 andy5995 commented Aug 23, 2018

This prepares bric for adding support for GNU gettext (#109), a way for the program to get translated.

You can get an idea here from the gettext docs that these files are required to set up support for translation.

EDIT: https://www.gnu.org/software/gettext/manual/html_node/Adjusting-Files.html#Adjusting-Files

This PR will add a configure script, which allows for setting various options before running make, including where bric would be installed to.

$ ./configure --help
`configure' configures bric git to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print `checking ...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for `--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or `..']

Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR            user executables [EPREFIX/bin]
  --sbindir=DIR           system admin executables [EPREFIX/sbin]
  --libexecdir=DIR        program executables [EPREFIX/libexec]
  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
  --libdir=DIR            object code libraries [EPREFIX/lib]
  --includedir=DIR        C header files [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
  --infodir=DIR           info documentation [DATAROOTDIR/info]
  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
  --mandir=DIR            man documentation [DATAROOTDIR/man]
  --docdir=DIR            documentation root [DATAROOTDIR/doc/bric]
  --htmldir=DIR           html documentation [DOCDIR]
  --dvidir=DIR            dvi documentation [DOCDIR]
  --pdfdir=DIR            pdf documentation [DOCDIR]
  --psdir=DIR             ps documentation [DOCDIR]

Program names:
  --program-prefix=PREFIX            prepend PREFIX to installed program names
  --program-suffix=SUFFIX            append SUFFIX to installed program names
  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names

Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-silent-rules   less verbose build output (undo: "make V=1")
  --disable-silent-rules  verbose build output (undo: "make V=0")
  --enable-dependency-tracking
                          do not reject slow dependency extractors
  --disable-dependency-tracking
                          speeds up one-time build

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

Report bugs to <noone@localhost>.
bric home page: <'https://github.com/shnupta/bric'>.

I've removed the existing Makefiles; they are created when configure is run

* This adds more files to .gitignore. These are created when ./configure
and make is run, and are removed when `make clean` or ` make distclean`
is run.
@andy5995
Copy link
Contributor Author

You can get an idea here from the gettext docs that these files are required to set up support for translation.

Here's that link I forgot to include: https://www.gnu.org/software/gettext/manual/html_node/Adjusting-Files.html#Adjusting-Files

VERSION will defined as a macro, and output to config.h when
`./configure` is run. You'll want to #include config.h in bric.c, and
you'll be able to use the macros that you desire later. Here's what my
bric config.h looks like after running configure:

```
andy@oceanus:~/src/bric/src$ cat config.h
/* src/config.h.  Generated from config.in by configure.  */
/* config.in.  Generated from configure.ac by autoheader.  */

/* Name of package */

/* Define to the address where bug reports for this package should be
sent. */

/* Define to the full name of this package. */

/* Define to the full name and version of this package. */

/* Define to the one symbol short name of this package. */

/* Define to the home page for this package. */

/* Define to the version of this package. */

/* Version number of package */
```
@andy5995
Copy link
Contributor Author

Oh this didn't render right when I added it to the commit message. Here's the correct output.

andy@oceanus:~/src/bric/src$ cat config.h 
/* src/config.h.  Generated from config.in by configure.  */
/* config.in.  Generated from configure.ac by autoheader.  */

/* Name of package */
#define PACKAGE "bric"

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "noone@localhost"

/* Define to the full name of this package. */
#define PACKAGE_NAME "bric"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "bric 0.0.3-dev"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "bric"

/* Define to the home page for this package. */
#define PACKAGE_URL "https://github.com/shnupta/bric"

/* Define to the version of this package. */
#define PACKAGE_VERSION "0.0.3-dev"

/* Version number of package */
#define VERSION "0.0.3-dev"

@andy5995
Copy link
Contributor Author

with commit b1403c6 , now you can actually see the build and install output: https://travis-ci.org/andy5995/bric/builds/420228519

Just click on one of the 4 jobs. And as you can see, the first one failed because of "undefined reference" problem. I'm not having that problem when building locally, and I'm using gcc 6.3.0

Let's wait until that's fixed to merge this. I'll give it some thought but if you have any ideas on how to fix that, let me know.

@andy5995
Copy link
Contributor Author

Ok, fixed by 79dadc7 and here's the output: https://travis-ci.org/andy5995/bric/builds/420234607

@shnupta
Copy link
Owner

shnupta commented Aug 25, 2018

Hi Andy,

This is an awesome PR - makes bric feel a lot more professional.

I'm currently away for the weekend but I've just pulled my laptop out and built it and seems to work really well.

I'll try explore the rest of the new configure script and the other file changes (aswell as reading those links) tonight but so far it looks really good.

Also, thanks for integrating Travis! I haven't actually used it before so thanks for setting that up and showing me how it's done haha!

@andy5995
Copy link
Contributor Author

You're welcome, Casey. Enjoy your weekend.

Does bric have a development chat room on IRC or Slack or something like that?

@shnupta
Copy link
Owner

shnupta commented Aug 25, 2018

No I haven't really thought about setting one up actually. I'll do that now! Would probably be very useful if more people get involved.

Edit:
Here we go: https://join.slack.com/t/bric-editor/shared_invite/enQtNDIyNjg5NzY2MTQ1LTk4OTE4ZjdiMGFmMDlhNWM2ZWJkMmM0MGQxMjNhODJlOWY1MjQzMmQ5MDEzOGM3YjM0YTJiZTc3MWY5MGNmZjI

@shnupta shnupta merged commit 3928e60 into shnupta:development Aug 25, 2018
@andy5995
Copy link
Contributor Author

Cool. :)

You'll want to make a note of this. Not a serious problem but users shouldn't see this. Only maintainers should have to worry about having "autoheader" installed. I'm trying to figure it out... I saw it wasn't a problem on travis.

theimpossibleastronaut/rmw@90200c2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants