Skip to content

Commit

Permalink
Clean build system
Browse files Browse the repository at this point in the history
* .gitignore: updated
* Makefile.am (EXTRA_DIST): new
  (distclean-local, clean-GNUmakefile): new
* NEWS: updated
* configure.ac: bump version
  (guilemoduledir): changed to guilesitedir
  (guileextensiondir): new
* m4/guile.m4: whitespace
* src/Makefile.am: use guilesitedir and guileextensiondir
  • Loading branch information
spk121 committed Feb 13, 2013
1 parent dbe3924 commit 9a414c9
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,6 +1,6 @@
.sc*
*~
#*#
#*
.#*
/GNUmakefile
/maint.mk
Expand Down
18 changes: 17 additions & 1 deletion Makefile.am
@@ -1,11 +1,27 @@
## Process this file with automake to produce Makefile.in

SUBDIRS = \
src\
src \
m4 \
doc \
test \
build-aux

ACLOCAL_AMFLAGS = -I m4 --install

# Gnulib
distclean-local: clean-GNUmakefile
clean-GNUmakefile:
test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile

EXTRA_DIST = \
AUTHORS \
INSTALL \
NEWS \
README \
COPYING \
ChangeLog \
m4/gnulib-cache.m4 \
doc/fdl-1.3.texi \
build-aux/texinfo.tex \
cfg.mk
5 changes: 5 additions & 0 deletions NEWS
@@ -0,0 +1,5 @@
For Release 0.2 - TBD

For Release 0.1

- Initial release
94 changes: 69 additions & 25 deletions configure.ac
@@ -1,14 +1,34 @@
# Process this file with autoconf to produce a configure script
# Process this file with autoconf to produce a configure script

# Copyright 20011, 2013 Michael L Gran

# This file is part of guile-curl.

# guile-curl 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.

# guile-curl 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 guile-curl. If not, see <http://www.gnu.org/licenses/>.

##################
# Package info
AC_PREREQ([2.66])
AC_INIT([guile-curl],[0.1],[spk121@yahoo.com])
AC_PREREQ([2.61])
AC_INIT([guile-curl],[0.2],[spk121@yahoo.com])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([gnu std-options -Wall])
gl_EARLY
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
gl_INIT

##################
# Set some version constants
Expand All @@ -33,9 +53,9 @@ case $host in
*-*-cygwin)
[enable_etex_fix=yes] ;;
*-*-linux*)
[enable_etex_fix=no] ;;
[enable_etex_fix=no] ;;
*)
[enable_etex_fix=no] ;;
[enable_etex_fix=no] ;;
esac

AM_CONDITIONAL([ETEX_FIX], [test "$enable_etex_fix" = yes])
Expand All @@ -44,40 +64,55 @@ AM_CONDITIONAL([ETEX_FIX], [test "$enable_etex_fix" = yes])
# Check for libraries

# Guile gets added to LIBS here
AC_CHECK_LIB([curl],
AC_CHECK_LIB([curl],
[curl_global_init], ,
[AC_MSG_ERROR([The curl library was not found])])

AC_ARG_WITH([guilemoduledir],
AC_ARG_WITH([guilesitedir],
[use the specified installation path for Guile modules],
[case "x$withval" in
xyes|xno) guilemoduledir="";;
*) guilemoduledir="$withval";;
xyes|xno) guilesitedir="";;
*) guilesitedir="$withval";;
esac],
[guilemoduledir=""])
[guilesiteir=""])

GUILE_PROGS
GUILE_FLAGS
GUILE_SITE_DIR
GUILE_FLAGS

pkgdatadir="$datadir/$PACKAGE_NAME"
if test "x$guilemoduledir" = "x"; then
guilemoduledir="$pkgdatadir"
if test "x$guilesitedir" = "x"; then
guilesitedir="$pkgdatadir"
fi
AC_SUBST([guilesitedir])

AC_ARG_WITH([guileextensiondir],
[use the specified installation path for Guile binary shared libraries],
[case "x$withval" in
xyes|xno) guileextensiondir="";;
*) guileextensiondir="$withval";;
esac],
[guileextensiondir=""])

if test "x$guileextensiondir" = "x"; then
guileextensiondir="$libdir"
fi
AC_SUBST([guilemoduledir])
AC_SUBST([guileextensiondir])

GUILE_EXTENSION_DIR=`pkg-config guile-2.0 --variable=extensiondir`
if test "x$GUILE_EXTENSION_DIR" = "x"; then
GUILE_EXTENSION_DIR=`guile-config info libdir`
fi
AC_SUBST([GUILE_EXTENSION_DIR])

dnl AC_CHECK_LIB([guile-2.0],
dnl [scm_boot_guile], ,
dnl [AC_MSG_ERROR([The guile library was not found])])

##################
# Check for header files

AC_CHECK_HEADERS([curl/curl.h], ,
AC_CHECK_HEADERS([curl/curl.h], ,
[AC_MSG_ERROR([<curl.h> was not found])])
dnl AC_CHECK_HEADERS([libguile.h], ,
dnl AC_CHECK_HEADERS([libguile.h], ,
dnl [AC_MSG_ERROR([<libguile.h> was not found])])


Expand All @@ -96,21 +131,30 @@ AC_PROG_CC_C99

##################
# Output
AC_CONFIG_FILES([Makefile
src/Makefile
doc/Makefile
test/Makefile
m4/Makefile
AC_CONFIG_FILES([Makefile
src/Makefile
doc/Makefile
test/Makefile
m4/Makefile
build-aux/Makefile])

AC_OUTPUT

if test "$guilemoduledir" != "$GUILE_SITE"; then
if test "$guilesitedir" != "$GUILE_SITE"; then
# Guile has a different prefix than this module
AC_MSG_WARN([]
[The Guile modules will be installed in '${guilemoduledir}'.]
[The Guile modules will be installed in '${guilesitedir}'.]
[You should probably re-run `configure' with]
[`--with-guilemoduledir=$GUILE_SITE']
[`--with-guilesitedir=$GUILE_SITE']
[Otherwise, you will have to adjust the `GUILE_LOAD_PATH' environment]
[variable.])
fi

if test "x$GUILE_EXTENSION_DIR" != "x"; then
if test "$guileextensiondir" != "$GUILE_EXTENSION_DIR"; then
AC_MSG_WARN([]
[The Guile extensions will be installed in ${guileextensiondir}.]
[You should consider re-running `configure' with]
[`--with-guileextensiondir=$GUILE_EXTENSION_DIR'])
fi
fi
4 changes: 2 additions & 2 deletions m4/guile.m4
Expand Up @@ -6,12 +6,12 @@
## modify it under the terms of the GNU Lesser General Public License
## as published by the Free Software Foundation; either version 3 of
## the License, or (at your option) any later version.
##
##
## This library 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
## Lesser General Public License for more details.
##
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
Expand Down
12 changes: 8 additions & 4 deletions src/Makefile.am
@@ -1,11 +1,16 @@
## Process this file with automake to produce Makefile.in

COMPILE_FLAGS = -Wall -Wextra
### MAIN TARGETS ###

lib_LTLIBRARIES = \
guileextension_LTLIBRARIES = \
libguile-curl.la

libguile_curl_la_CPPFLAGS = $(COMPILE_FLAGS) $(GUILE_CFLAGS)
dist_guilesite_DATA = \
curl.scm

####################

libguile_curl_la_CPPFLAGS = $(GUILE_CFLAGS) -pthread

libguile_curl_la_LDFLAGS = \
-no-undefined \
Expand All @@ -18,7 +23,6 @@ libguile_curl_la_SOURCES = \
func.c func.h \
main.c

guilemodule_DATA = curl.scm
ETAGS_ARGS = curl.scm

EXTRA_DIST = \
Expand Down

0 comments on commit 9a414c9

Please sign in to comment.