Commit 84bbb1ad authored by Paul Eggert's avatar Paul Eggert
Browse files

Use gnulib's getopt-gnu module.

parent e2900ac7
2011-01-09 Paul Eggert <eggert@cs.ucla.edu>
Use gnulib's getopt-gnu module.
* Makefile.in (GNULIB_MODULES): Add getopt-gnu.
(AUTOCONF_INPUTS): Remove getopt.m4; aclocal.m4 is a good-enough
representative of the dependencies.
* configure.in: Do not configure getopt, as gnulib does that now.
* make-dist: Do not worry about lib-src/getopt.h, as gnulib handles
getopt now, in lib.
Regenerate.
* arg-nonnull.h, c++defs.h, lib/mktime-internal.h, lib/mktime.c:
* lib/stddef.in.h, lib/time.h, lib/time.in.h, lib/time_r.c:
......
......@@ -330,7 +330,7 @@ $(gnulib_srcdir):
# Update modules from gnulib, for maintainers, who should have it in
# $(gnulib_srcdir) (relative to $(srcdir) and should have build tools
# as per $(gnulib_srcdir)/DEPENDENCIES.
GNULIB_MODULES = ftoastr mktime
GNULIB_MODULES = ftoastr getopt-gnu mktime
GNULIB_TOOL_FLAGS = \
--import --no-changelog --no-vc-files --makefile-name=gnulib.mk
sync-from-gnulib: $(gnulib_srcdir)
......@@ -401,7 +401,7 @@ Makefile: config.status $(srcdir)/src/config.in \
config.status: ${srcdir}/configure ${srcdir}/lisp/version.el
./config.status --recheck
AUTOCONF_INPUTS = @MAINT@ $(srcdir)/configure.in $(srcdir)/m4/getopt.m4 $(srcdir)/aclocal.m4
AUTOCONF_INPUTS = @MAINT@ $(srcdir)/configure.in $(srcdir)/aclocal.m4
$(srcdir)/configure: $(AUTOCONF_INPUTS)
cd ${srcdir} && autoconf
......
......@@ -2657,15 +2657,6 @@ AC_FUNC_GETLOADAVG
AC_FUNC_FSEEKO
# Configure getopt.
m4_include([m4/getopt.m4])
gl_GETOPT_IFELSE([
gl_GETOPT_SUBSTITUTE_HEADER
gl_PREREQ_GETOPT
GETOPTOBJS='getopt.o getopt1.o'
])
AC_SUBST(GETOPTOBJS)
AC_FUNC_GETPGRP
# Configure gnulib.
......
......@@ -279,7 +279,7 @@ uninstall:
fi
mostlyclean:
-rm -f core *.o getopt.h getopt.h-t
-rm -f core *.o
clean: mostlyclean
-rm -f ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
......@@ -311,20 +311,6 @@ test-distrib${EXEEXT}: ${srcdir}/test-distrib.c
$(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
./test-distrib ${srcdir}/testfile
## We need the following in order to create a <getopt.h> when the system
## does not have one that works with the given compiler.
GETOPT_H = @GETOPT_H@
getopt.h: getopt_.h
cp $(srcdir)/getopt_.h $@-t
mv $@-t $@
GETOPTOBJS = @GETOPTOBJS@
GETOPTDEPS = $(GETOPTOBJS) $(GETOPT_H)
getopt.o: ${srcdir}/getopt.c $(GETOPT_H) ${srcdir}/gettext.h
${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
getopt1.o: ${srcdir}/getopt1.c $(GETOPT_H)
${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
../lib/libgnu.a: ../src/config.h
cd ../lib && $(MAKE) libgnu.a
......@@ -335,20 +321,20 @@ regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h ../src/config.h
${CC} -c ${CPP_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \
${srcdir}/../src/regex.c
etags${EXEEXT}: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
etags${EXEEXT}: ${srcdir}/etags.c $(REGEXPDEPS) ../src/config.h
$(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \
-DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) \
-DVERSION="\"${version}\"" ${srcdir}/etags.c \
$(REGEXPOBJ) $(LOADLIBES) -o etags
ebrowse${EXEEXT}: ${srcdir}/ebrowse.c $(GETOPTDEPS) ../src/config.h
ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ../src/config.h
$(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \
${srcdir}/ebrowse.c $(GETOPTOBJS) $(LOADLIBES) -o ebrowse
${srcdir}/ebrowse.c $(LOADLIBES) -o ebrowse
## We depend on etags to assure that parallel makes do not write two
## etags.o files on top of each other.
ctags${EXEEXT}: etags${EXEEXT}
$(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \
-DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) \
-DVERSION="\"${version}\"" ${srcdir}/etags.c \
$(REGEXPOBJ) $(LOADLIBES) -o ctags
profile${EXEEXT}: ${srcdir}/profile.c ../src/config.h
......@@ -358,11 +344,11 @@ make-docfile${EXEEXT}: ${srcdir}/make-docfile.c ../src/config.h
$(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) \
-o make-docfile
movemail${EXEEXT}: movemail.o pop.o $(GETOPTDEPS)
movemail${EXEEXT}: movemail.o pop.o
$(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o \
$(GETOPTOBJS) $(LOADLIBES) $(LIBS_MOVE) -o movemail
$(LOADLIBES) $(LIBS_MOVE) -o movemail
movemail.o: ${srcdir}/movemail.c ../src/config.h $(GETOPT_H)
movemail.o: ${srcdir}/movemail.c ../src/config.h
$(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c
pop.o: ${srcdir}/pop.c ../src/config.h
......@@ -371,19 +357,19 @@ pop.o: ${srcdir}/pop.c ../src/config.h
fakemail${EXEEXT}: ${srcdir}/fakemail.c ../src/config.h
$(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
emacsclient${EXEEXT}: ${srcdir}/emacsclient.c ../src/config.h $(GETOPTDEPS)
$(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(GETOPTOBJS) \
emacsclient${EXEEXT}: ${srcdir}/emacsclient.c ../src/config.h
$(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \
-DVERSION="\"${version}\"" \
$(LOADLIBES) -o emacsclient
hexl${EXEEXT}: ${srcdir}/hexl.c ../src/config.h
$(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
update-game-score${EXEEXT}: update-game-score.o $(GETOPTDEPS)
$(CC) ${LINK_CFLAGS} update-game-score.o $(GETOPTOBJS) \
update-game-score${EXEEXT}: update-game-score.o
$(CC) ${LINK_CFLAGS} update-game-score.o \
$(LOADLIBES) -o update-game-score
update-game-score.o: ${srcdir}/update-game-score.c ../src/config.h $(GETOPT_H)
update-game-score.o: ${srcdir}/update-game-score.c ../src/config.h
$(CC) -c ${CPP_CFLAGS} ${srcdir}/update-game-score.c \
-DHAVE_SHARED_GAME_DIR="\"$(gamedir)\""
......
......@@ -384,9 +384,7 @@ echo "Making links to \`lib-src'"
ln [a-zA-Z]*.[ch] ../${tempdir}/lib-src
ln ChangeLog Makefile.in README testfile vcdiff ../${tempdir}/lib-src
ln grep-changelog rcs2log rcs-checkin ../${tempdir}/lib-src
ln makefile.w32-in ../${tempdir}/lib-src
cd ../${tempdir}/lib-src
rm -f getopt.h)
ln makefile.w32-in ../${tempdir}/lib-src)
echo "Making links to \`m4'"
(cd m4
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment