Skip to content

Commit c0fe9c2

Browse files
committed
Merge pull request #24 from physicalist/master
Require configure prefix to be set
2 parents f76929a + af6b988 commit c0fe9c2

File tree

6 files changed

+64
-34
lines changed

6 files changed

+64
-34
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ compiler:
66

77
install:
88
- cd src
9-
- ./configure
9+
- ./configure --prefix=`pwd`
1010
- make nxgenesis
1111
- cp startup/travis_simrc $HOME/.simrc
1212

src/Makefile.BASE

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ RNG_CFLAGS ?= -O3 -D$(MACHINE) # -DLittleEndian has no effect
1010
ifeq ($(ARCH), powerpc)
1111
RNG_CFLAGS += -DBIGENDIAN
1212
CFLAGS += -DBIGENDIAN
13-
LIBS += $(XPRELIBS) # X11 backwards compatibility on 10.3.9
13+
ifeq ($(MACHINE), Darwin)
14+
LIBS += -lSM -lICE # X11 backwards compatibility on 10.3.9
15+
endif
1416
endif
1517
ifeq ($(ARCH), ppc64)
1618
RNG_CFLAGS += -DBIGENDIAN

src/Makefile.dist

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# The General Neural Simulation System
55
# Version 2.4
66
#
7+
VERSION = 2.4
8+
#
79
# SYNOPSIS: This is the top-level Makefile for GENESIS.
810
# YOU MUST EDIT THIS FILE BEFORE RUNNING "make".
911
# Please follow the procedure given below.
@@ -65,9 +67,15 @@
6567
# ----------------------------------------------------------------------
6668

6769
# The following variable determines where GENESIS is placed by the
68-
# "make install" command. Substituting the full path here is preferable
69-
# to using `pwd`.
70-
INSTALLDIR = `pwd`/..
70+
# "make install" command. It can be changed by the user by calling
71+
# INSTALLDIR=<path> make install
72+
# Supplying PREFIX=<path> make install will install genesis to the
73+
# directory "<path>/genesis-2.4"
74+
ifdef $(PREFIX)
75+
INSTALLDIR = $(PREFIX)/genesis-$(VERSION)
76+
else
77+
INSTALLDIR ?= `pwd`/..
78+
endif
7179

7280
# If /tmp is not big enough to contain compile-produced object files,
7381
# choose a different location here.
@@ -1557,7 +1565,7 @@ nxinstall: makedirs
15571565
mininstall: makedirs
15581566
@make -f $(MF) MF="$(MF)" INSTALLDIR="$(INSTALLDIR)" INSTALLBIN="$(INSTALLBIN)" SPRNG_LIB="$(SPRNG_LIB)" MINSUBDIR="$(MINSUBDIR)" RANLIB="$(RANLIB)" mininstall
15591567

1560-
VERSNAME="genesis-2.4"
1568+
VERSNAME="genesis-$(VERSION)"
15611569
bindist: genesis nxgenesis
15621570
make INSTALLDIR="`pwd`/../distributions/$(VERSNAME)/genesis" install
15631571
cp nxgenesis "../distributions/$(VERSNAME)/genesis"

src/Makefile.in

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ CC=@CC@
1616
CPP=@CPP@ -P
1717
LD=ld
1818

19-
CFLAGS+=-D__NO_MATH_INLINES
19+
CFLAGS += -O2 -D__NO_MATH_INLINES
2020

2121
RANLIB=@RANLIB@
2222
AR=ar
@@ -31,11 +31,11 @@ ifneq (@X_LIB@,)
3131
endif
3232

3333
# X11's ICE, SM libraries break netcdf on OSX
34-
# (needed for backward compatibility?)
34+
# (uncomment if needed for backward compatibility)
3535
XPRELIBS=@X_PRE_LIBS@
36-
ifneq ($(MACHINE), Darwin)
37-
LIBS += $(XPRELIBS)
38-
endif
36+
#ifneq ($(MACHINE), Darwin)
37+
# LIBS += $(XPRELIBS)
38+
#endif
3939

4040

4141
# TODO:
@@ -51,7 +51,7 @@ TERMOPT=-DTERMIO -DDONT_USE_SIGIO
5151

5252
# The following variable determines where GENESIS is placed by the
5353
# "make install" command
54-
INSTALLDIR ?= @prefix@/genesis
54+
INSTALLDIR ?= @prefix@/genesis-@PACKAGE_VERSION@
5555

5656
# If /tmp is not big enough to contain compile-produced object files,
5757
# choose a different location here.

src/configure

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.69 for genesis version-2.4g.
3+
# Generated by GNU Autoconf 2.69 for genesis 2.4.
4+
#
5+
# Report bugs to <genesis@genesis-sim.org>.
46
#
57
#
68
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -264,10 +266,11 @@ fi
264266
$as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
265267
$as_echo "$0: be upgraded to zsh 4.3.4 or later."
266268
else
267-
$as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
268-
$0: including any error possibly output before this
269-
$0: message. Then install a modern shell, or manually run
270-
$0: the script under such a shell if you do have one."
269+
$as_echo "$0: Please tell bug-autoconf@gnu.org and
270+
$0: genesis@genesis-sim.org about your system, including
271+
$0: any error possibly output before this message. Then
272+
$0: install a modern shell, or manually run the script
273+
$0: under such a shell if you do have one."
271274
fi
272275
exit 1
273276
fi
@@ -577,9 +580,9 @@ MAKEFLAGS=
577580
# Identity of this package.
578581
PACKAGE_NAME='genesis'
579582
PACKAGE_TARNAME='genesis'
580-
PACKAGE_VERSION='version-2.4g'
581-
PACKAGE_STRING='genesis version-2.4g'
582-
PACKAGE_BUGREPORT=''
583+
PACKAGE_VERSION='2.4'
584+
PACKAGE_STRING='genesis 2.4'
585+
PACKAGE_BUGREPORT='genesis@genesis-sim.org'
583586
PACKAGE_URL=''
584587

585588
# Factoring default headers for most tests.
@@ -1239,7 +1242,7 @@ if test "$ac_init_help" = "long"; then
12391242
# Omit some internal or obsolete options to make the list less imposing.
12401243
# This message is too long to be a string in the A/UX 3.1 sh.
12411244
cat <<_ACEOF
1242-
\`configure' configures genesis version-2.4g to adapt to many kinds of systems.
1245+
\`configure' configures genesis 2.4 to adapt to many kinds of systems.
12431246
12441247
Usage: $0 [OPTION]... [VAR=VALUE]...
12451248
@@ -1304,7 +1307,7 @@ fi
13041307

13051308
if test -n "$ac_init_help"; then
13061309
case $ac_init_help in
1307-
short | recursive ) echo "Configuration of genesis version-2.4g:";;
1310+
short | recursive ) echo "Configuration of genesis 2.4:";;
13081311
esac
13091312
cat <<\_ACEOF
13101313
@@ -1333,7 +1336,7 @@ Some influential environment variables:
13331336
Use these variables to override the choices made by `configure' or to help
13341337
it to find libraries and programs with nonstandard names/locations.
13351338
1336-
Report bugs to the package provider.
1339+
Report bugs to <genesis@genesis-sim.org>.
13371340
_ACEOF
13381341
ac_status=$?
13391342
fi
@@ -1396,7 +1399,7 @@ fi
13961399
test -n "$ac_init_help" && exit $ac_status
13971400
if $ac_init_version; then
13981401
cat <<\_ACEOF
1399-
genesis configure version-2.4g
1402+
genesis configure 2.4
14001403
generated by GNU Autoconf 2.69
14011404
14021405
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1857,7 +1860,7 @@ cat >config.log <<_ACEOF
18571860
This file contains any messages produced by compilers while
18581861
running configure, to aid debugging if configure makes a mistake.
18591862
1860-
It was created by genesis $as_me version-2.4g, which was
1863+
It was created by genesis $as_me 2.4, which was
18611864
generated by GNU Autoconf 2.69. Invocation command line was
18621865
18631866
$ $0 $@
@@ -2206,6 +2209,15 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
22062209

22072210

22082211

2212+
# If the user did not supply --prefix, we fail loudly
2213+
# (taken from NEST's configure.ac)
2214+
if test $prefix = NONE; then
2215+
echo "Please supply a valid installation prefix!"
2216+
echo "Example: ./configure --prefix=\$HOME/opt"
2217+
exit 1
2218+
fi
2219+
2220+
# check for correct compiler & libraries
22092221
ac_ext=c
22102222
ac_cpp='$CPP $CPPFLAGS'
22112223
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3995,7 +4007,6 @@ fi
39954007
as_fn_error $? "bison|byacc|yacc not found. Please install _bison_ in order to compile Genesis." "$LINENO" 5
39964008
fi
39974009
fi
3998-
39994010
for ac_prog in flex lex
40004011
do
40014012
# Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -5052,7 +5063,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
50525063
# report actual input values of CONFIG_FILES etc. instead of their
50535064
# values after options handling.
50545065
ac_log="
5055-
This file was extended by genesis $as_me version-2.4g, which was
5066+
This file was extended by genesis $as_me 2.4, which was
50565067
generated by GNU Autoconf 2.69. Invocation command line was
50575068
50585069
CONFIG_FILES = $CONFIG_FILES
@@ -5099,13 +5110,13 @@ Usage: $0 [OPTION]... [TAG]...
50995110
Configuration files:
51005111
$config_files
51015112
5102-
Report bugs to the package provider."
5113+
Report bugs to <genesis@genesis-sim.org>."
51035114
51045115
_ACEOF
51055116
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
51065117
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
51075118
ac_cs_version="\\
5108-
genesis config.status version-2.4g
5119+
genesis config.status 2.4
51095120
configured by $0, generated by GNU Autoconf 2.69,
51105121
with options \\"\$ac_cs_config\\"
51115122

src/configure.ac

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1-
AC_INIT(genesis, version-2.4g)
1+
AC_PREREQ(2.52)
2+
AC_INIT([genesis], [2.4], [genesis@genesis-sim.org])
23

4+
# If the user did not supply --prefix, we fail loudly
5+
# (taken from NEST's configure.ac)
6+
if test $prefix = NONE; then
7+
echo "Please supply a valid installation prefix!"
8+
echo "Example: ./configure --prefix=\$HOME/opt"
9+
exit 1
10+
fi
11+
12+
# check for correct compiler & libraries
313
AC_PROG_CC
414
AC_PROG_CPP
5-
AC_PATH_X
15+
AC_PATH_X
616
AC_PATH_XTRA
717
AC_PROG_RANLIB
818
AC_PROG_YACC
@@ -12,7 +22,6 @@ if test x"$YACC" = "xyacc"; then
1222
AC_MSG_ERROR([[bison|byacc|yacc not found. Please install _bison_ in order to compile Genesis.]])
1323
fi
1424
fi
15-
1625
AC_PROG_LEX
1726
if test x"$LEX" == x":" ; then
1827
AC_MSG_ERROR([flex|lex not found. Please install _flex_ in order to compile Genesis.])
@@ -26,8 +35,8 @@ AC_SUBST(X_LIB, $x_libraries)
2635
AC_SUBST(LEX, $LEX)
2736
AC_SUBST(LEXLIB, $LEXLIB)
2837

29-
AC_CHECK_SIZEOF([long int])
30-
AS_IF([test "$ac_cv_sizeof_long_int" -eq 8],
38+
AC_CHECK_SIZEOF([long int])
39+
AS_IF([test "$ac_cv_sizeof_long_int" -eq 8],
3140
[AC_DEFINE([LONGWORDS])])
3241

3342
AC_OUTPUT(Makefile)

0 commit comments

Comments
 (0)