Skip to content

Commit

Permalink
autoconf, makefile, build cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
chu11 committed Apr 19, 2005
1 parent 4cc6e95 commit dc7e7c4
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 108 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2005-04-19 Albert Chu <[email protected]>

* Autoconf, Makefile, Built cleanup.

2005-01-25 Albert Chu <[email protected]>

* src/nodeattr/nodeattr.c (_gend_error_exit): Output info on
Expand Down
14 changes: 14 additions & 0 deletions autogen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
##
# $Id: autogen.sh,v 1.1 2005-04-19 23:47:27 achu Exp $
##

PATH=/bin:/usr/bin:/usr/local/bin

set -x
aclocal -I config || exit 1
libtoolize --copy || exit 1
autoheader || exit 1
automake --add-missing --copy --gnu || exit 1
autoconf --warnings=all || exit 1
exit 0
16 changes: 0 additions & 16 deletions bootstrap

This file was deleted.

21 changes: 21 additions & 0 deletions config/ac_genders_file.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
##*****************************************************************************
## $Id: ac_genders_file.m4,v 1.1 2005-04-19 23:47:27 achu Exp $
##*****************************************************************************

AC_DEFUN([AC_GENDERS_FILE],
[
AC_MSG_CHECKING([for genders default file path])
AC_ARG_WITH([genders-file],
AC_HELP_STRING([--with-genders-file=PATH],
[define default genders file]),
[ case "$withval" in
no) GENDERS_DEFAULT_FILE="\"/etc/genders\"" ;;
yes) GENDERS_DEFAULT_FILE="\"/etc/genders\"" ;;
*) GENDERS_DEFAULT_FILE="\"$withval\""
esac
]
)
AC_MSG_RESULT([${GENDERS_DEFAULT_FILE="\"/etc/genders\""}])
AC_SUBST(GENDERS_DEFAULT_FILE)
])
32 changes: 32 additions & 0 deletions config/ac_perl_install_destdir.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
##*****************************************************************************
## $Id: ac_perl_install_destdir.m4,v 1.1 2005-04-19 23:47:27 achu Exp $
##*****************************************************************************

# - Used almost exclusively so perl install works with rpm builds
AC_DEFUN([AC_PERL_INSTALL_DESTDIR],
[
AC_MSG_CHECKING(for --with-perl-install-destdir )
AC_ARG_WITH(perl-install-destdir,
AC_HELP_STRING([--with-perl-install-destdir=path],
[define perl modules install prefix]),
[ case "$withval" in
yes)
withperllinstalldestdir=yes
;;
no)
;;
*)
withperllinstalldestdir=yes
PERL_INSTALL_DESTDIR="$withval"
;;
esac ]
)
AC_MSG_RESULT(${withperllinstalldestdir=no})
if test -z "$PERL_INSTALL_DESTDIR"; then
PERL_INSTALL_PREFIX='${prefix}'
else
PERL_INSTALL_PREFIX='${PERL_INSTALL_DESTDIR}${prefix}'
fi
AC_SUBST(PERL_INSTALL_DESTDIR)
AC_SUBST(PERL_INSTALL_PREFIX)
])
65 changes: 12 additions & 53 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##*****************************************************************************
## $Id: configure.ac,v 1.31 2005-01-10 16:45:35 achu Exp $
## $Id: configure.ac,v 1.32 2005-04-19 23:47:27 achu Exp $
##*****************************************************************************
## Process this file with autoconf to produce a configure script.
##*****************************************************************************
Expand Down Expand Up @@ -46,54 +46,6 @@ PERLGENDERS_MINOR=01
PERLGENDERS_VERSION=$PERLGENDERS_MAJOR.$PERLGENDERS_MINOR
AC_SUBST([PERLGENDERS_VERSION])

# option for default genders file
AC_MSG_CHECKING(for --with-genders-file )
AC_ARG_WITH(genders-file,
AC_HELP_STRING([--with-genders-file=file], [define default genders file]),
[ case "$withval" in
yes)
withgendersfile=yes
;;
no)
;;
*)
withgendersfile=yes
GENDERS_DEFAULT_FILE="\"$withval\""
;;
esac ]
)
AC_MSG_RESULT(${withgendersfile=no})
if test -z "$GENDERS_DEFAULT_FILE"; then
GENDERS_DEFAULT_FILE="\"/etc/genders\""
fi
AC_SUBST(GENDERS_DEFAULT_FILE)

# Perl Install Destdir
# - Used almost exclusively so perl install works with rpm builds
AC_MSG_CHECKING(for --with-perl-install-destdir )
AC_ARG_WITH(perl-install-destdir,
AC_HELP_STRING([--with-perl-install-destdir=path], [define perl modules install prefix]),
[ case "$withval" in
yes)
withperllinstalldestdir=yes
;;
no)
;;
*)
withperllinstalldestdir=yes
PERL_INSTALL_DESTDIR="$withval"
;;
esac ]
)
AC_MSG_RESULT(${withperllinstalldestdir=no})
if test -z "$PERL_INSTALL_DESTDIR"; then
PERL_INSTALL_PREFIX='${prefix}'
else
PERL_INSTALL_PREFIX='${PERL_INSTALL_DESTDIR}${prefix}'
fi
AC_SUBST(PERL_INSTALL_DESTDIR)
AC_SUBST(PERL_INSTALL_PREFIX)

##
# Checks for programs.
##
Expand All @@ -104,6 +56,7 @@ AM_PROG_LEX
AC_PROG_YACC
AM_CONDITIONAL(WITH_GNU_LD, test "$with_gnu_ld" = "yes")
AC_PATH_PROG(PERL, perl)
AC_DEBUG

##
# Checks for header files.
Expand All @@ -121,6 +74,16 @@ AC_CHECK_HEADERS( \
types.h \
)

#
# Check for default paths
#
AC_GENDERS_FILE

#
# Check for perl install destdir
#
AC_PERL_INSTALL_DESTDIR

##
# Checks for typedefs, structures, and compiler characteristics.
##
Expand All @@ -143,10 +106,6 @@ AC_CHECK_FUNCS( \
getopt_long \
)

# Do this last, you could add compile options which can make
# function checks fail
AC_DEBUG

##
# Epilogue.
##
Expand Down
17 changes: 6 additions & 11 deletions src/Genders/Makefile.PL
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.

WriteMakefile(
'NAME' => 'Genders',
'VERSION_FROM' => 'Genders.pm', # finds $VERSION
'PREREQ_PM' => {}, # e.g., Module::Name => 1.1
($] >= 5.005 ? ## Add these new keywords supported since 5.005
(ABSTRACT_FROM => 'Genders.pm', # retrieve abstract from module
AUTHOR => 'A. U. Thor <[email protected]>') : ()),
'LIBS' => [''], # e.g., '-lm'
'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
# Insert -I. if you add *.h files later:
'INC' => '', # e.g., '-I/usr/include/other'
'VERSION_FROM' => 'Genders.pm',
'PREREQ_PM' => {},
($] >= 5.005 ?
(ABSTRACT_FROM => 'Genders.pm',
AUTHOR => 'Albert Chu <[email protected]>') : ()),
);
8 changes: 5 additions & 3 deletions src/Genders/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##*****************************************************************************
## $Id: Makefile.am,v 1.17 2005-01-10 16:45:35 achu Exp $
## $Id: Makefile.am,v 1.18 2005-04-19 23:47:27 achu Exp $
##*****************************************************************************
## Process this file with automake to produce Makefile.in.
##*****************************************************************************
Expand All @@ -12,8 +12,10 @@
PERL_INSTALL_DESTDIR = @PERL_INSTALL_DESTDIR@
PERL_INSTALL_PREFIX = @PERL_INSTALL_PREFIX@

MAKEMAKERFLAGS = INSTALLDIRS=site SITEPREFIX=$(PERL_INSTALL_PREFIX) \
MAKEFILE=Makefile.xs FIRST_MAKEFILE=Makefile.xs
MAKEMAKERFLAGS = INSTALLDIRS=site \
SITEPREFIX=$(PERL_INSTALL_PREFIX) \
MAKEFILE=Makefile.xs \
FIRST_MAKEFILE=Makefile.xs

all: Makefile.xs
$(MAKE) -f Makefile.xs
Expand Down
17 changes: 5 additions & 12 deletions src/Libgenders/Makefile.PL
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.

WriteMakefile(
'NAME' => 'Libgenders',
'VERSION_FROM' => 'Libgenders.pm', # finds $VERSION
'PREREQ_PM' => {}, # e.g., Module::Name => 1.1
($] >= 5.005 ? ## Add these new keywords supported since 5.005
(ABSTRACT_FROM => 'Libgenders.pm', # retrieve abstract from module
'VERSION_FROM' => 'Libgenders.pm',
'PREREQ_PM' => {},
($] >= 5.005 ?
(ABSTRACT_FROM => 'Libgenders.pm',
AUTHOR => 'Albert Chu <[email protected]>') : ()),
'LIBS' => [''], # e.g., '-lm'
'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
# Insert -I. if you add *.h files later:
'INC' => '', # e.g., '-I/usr/include/other'
# Un-comment this if you add C files to link with later:
'OBJECT' => '$(O_FILES)', # link all the C files too
);
24 changes: 11 additions & 13 deletions src/Libgenders/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##*****************************************************************************
## $Id: Makefile.am,v 1.20 2005-01-10 16:45:35 achu Exp $
## $Id: Makefile.am,v 1.21 2005-04-19 23:47:27 achu Exp $
##*****************************************************************************
## Process this file with automake to produce Makefile.in.
##*****************************************************************************
Expand All @@ -11,23 +11,21 @@
# make time, so this is our work around
PERL_INSTALL_PREFIX = @PERL_INSTALL_PREFIX@

MAKEMAKERFLAGS = INSTALLDIRS=site SITEPREFIX=$(PERL_INSTALL_PREFIX) \
MAKEFILE=Makefile.xs FIRST_MAKEFILE=Makefile.xs
PERL_INC = "-I../../config -I$(srcdir)/../libgenders"

PERL_LIBS = "-L../libgenders/.libs -lgenders"

MAKEMAKERFLAGS = INSTALLDIRS=site \
SITEPREFIX=$(PERL_INSTALL_PREFIX) \
INC=$(PERL_INC) \
LIBS=$(PERL_LIBS) \
MAKEFILE=Makefile.xs \
FIRST_MAKEFILE=Makefile.xs

all: Makefile.xs
$(MAKE) -f Makefile.xs

Makefile.xs: Makefile.PL Libgenders.xs Libgenders.pm
cp $(srcdir)/../libgenders/*.c .
cp $(srcdir)/../libgenders/*.h .
cp $(srcdir)/../libgenders/*.l .
cp $(srcdir)/../libgenders/*.y .
if ! test -a genders_query_parse.c; then \
$(LEX) -ogenders_query_parse.c genders_query_parse.l; \
fi
if ! test -a genders_query.c; then \
$(YACC) -d -ogenders_query.c genders_query.y; \
fi
# Hacks to make distcheck work
if ! test -a Makefile.PL; then \
cp $(srcdir)/Makefile.PL .; \
Expand Down

0 comments on commit dc7e7c4

Please sign in to comment.